All live data not just outputs to be available in Lua #4866
This commit is contained in:
parent
98626bfa9d
commit
3d791304f1
|
@ -4,5 +4,4 @@ java -DSystemOut.name=logs/gen_output_channels \
|
||||||
-jar ../java_tools/ConfigDefinition.jar \
|
-jar ../java_tools/ConfigDefinition.jar \
|
||||||
-prepend integration/rusefi_config.txt \
|
-prepend integration/rusefi_config.txt \
|
||||||
-definition console/binary/output_channels.txt \
|
-definition console/binary/output_channels.txt \
|
||||||
-output_lookup_file controllers/lua/generated/output_lookup_generated.cpp \
|
|
||||||
-ts_outputs_section console/binary/
|
-ts_outputs_section console/binary/
|
||||||
|
|
Binary file not shown.
|
@ -110,9 +110,6 @@ public class ConfigDefinition {
|
||||||
case "-field_lookup_file":
|
case "-field_lookup_file":
|
||||||
state.destinations.add(new GetConfigValueConsumer(args[i + 1]));
|
state.destinations.add(new GetConfigValueConsumer(args[i + 1]));
|
||||||
break;
|
break;
|
||||||
case "-output_lookup_file":
|
|
||||||
state.destinations.add(new GetOutputValueConsumer(args[i + 1]));
|
|
||||||
break;
|
|
||||||
case "-readfile":
|
case "-readfile":
|
||||||
String keyName = args[i + 1];
|
String keyName = args[i + 1];
|
||||||
// yes, we take three parameters here thus pre-increment!
|
// yes, we take three parameters here thus pre-increment!
|
||||||
|
|
|
@ -88,6 +88,8 @@ public class LiveDataProcessor {
|
||||||
|
|
||||||
SdCardFieldsContent sdCardFieldsConsumer = new SdCardFieldsContent();
|
SdCardFieldsContent sdCardFieldsConsumer = new SdCardFieldsContent();
|
||||||
|
|
||||||
|
GetOutputValueConsumer outputValueConsumer = new GetOutputValueConsumer("controllers/lua/generated/output_lookup_generated.cpp");
|
||||||
|
|
||||||
EntryHandler handler = new EntryHandler() {
|
EntryHandler handler = new EntryHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onEntry(String name, String javaName, String folder, String prepend, boolean withCDefines, String[] outputNames, String constexpr) throws IOException {
|
public void onEntry(String name, String javaName, String folder, String prepend, boolean withCDefines, String[] outputNames, String constexpr) throws IOException {
|
||||||
|
@ -120,6 +122,9 @@ public class LiveDataProcessor {
|
||||||
if (constexpr != null) {
|
if (constexpr != null) {
|
||||||
sdCardFieldsConsumer.home = constexpr;
|
sdCardFieldsConsumer.home = constexpr;
|
||||||
state.addDestination(sdCardFieldsConsumer::handleEndStruct);
|
state.addDestination(sdCardFieldsConsumer::handleEndStruct);
|
||||||
|
|
||||||
|
outputValueConsumer.currentSectionPrefix = constexpr;
|
||||||
|
state.addDestination(outputValueConsumer::handleEndStruct);
|
||||||
}
|
}
|
||||||
|
|
||||||
state.doJob();
|
state.doJob();
|
||||||
|
@ -194,6 +199,8 @@ public class LiveDataProcessor {
|
||||||
SdCardFieldsConsumer.wrapContent(lazyFile, sdCardFieldsConsumer.getBody());
|
SdCardFieldsConsumer.wrapContent(lazyFile, sdCardFieldsConsumer.getBody());
|
||||||
lazyFile.close();
|
lazyFile.close();
|
||||||
|
|
||||||
|
outputValueConsumer.endFile();
|
||||||
|
|
||||||
totalSensors.append(javaSensorsConsumer.getContent());
|
totalSensors.append(javaSensorsConsumer.getContent());
|
||||||
|
|
||||||
return javaSensorsConsumer.sensorTsPosition;
|
return javaSensorsConsumer.sensorTsPosition;
|
||||||
|
|
|
@ -22,6 +22,8 @@ public class GetOutputValueConsumer implements ConfigurationConsumer {
|
||||||
private final List<Pair<String, String>> getterPairs = new ArrayList<>();
|
private final List<Pair<String, String>> getterPairs = new ArrayList<>();
|
||||||
private final String fileName;
|
private final String fileName;
|
||||||
|
|
||||||
|
public String currentSectionPrefix = "engine->outputChannels";
|
||||||
|
|
||||||
public GetOutputValueConsumer(String fileName) {
|
public GetOutputValueConsumer(String fileName) {
|
||||||
this.fileName = fileName;
|
this.fileName = fileName;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +48,7 @@ public class GetOutputValueConsumer implements ConfigurationConsumer {
|
||||||
}
|
}
|
||||||
|
|
||||||
String userName = prefix + cf.getName();
|
String userName = prefix + cf.getName();
|
||||||
String javaName = "engine->outputChannels." + prefix;
|
String javaName = currentSectionPrefix + "." + prefix;
|
||||||
|
|
||||||
getterPairs.add(new Pair<>(userName, javaName + cf.getName()));
|
getterPairs.add(new Pair<>(userName, javaName + cf.getName()));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue