diff --git a/firmware/gen_output_channels.sh b/firmware/gen_output_channels.sh index 61fb040ae9..1a98568e1f 100755 --- a/firmware/gen_output_channels.sh +++ b/firmware/gen_output_channels.sh @@ -4,5 +4,4 @@ java -DSystemOut.name=logs/gen_output_channels \ -jar ../java_tools/ConfigDefinition.jar \ -prepend integration/rusefi_config.txt \ -definition console/binary/output_channels.txt \ - -output_lookup_file controllers/lua/generated/output_lookup_generated.cpp \ -ts_outputs_section console/binary/ diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index ccd6350370..c4fc398b27 100644 Binary files a/java_tools/ConfigDefinition.jar and b/java_tools/ConfigDefinition.jar differ diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java b/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java index fbd92cd5a1..23a929e746 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java @@ -110,9 +110,6 @@ public class ConfigDefinition { case "-field_lookup_file": state.destinations.add(new GetConfigValueConsumer(args[i + 1])); break; - case "-output_lookup_file": - state.destinations.add(new GetOutputValueConsumer(args[i + 1])); - break; case "-readfile": String keyName = args[i + 1]; // yes, we take three parameters here thus pre-increment! diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/ldmp/LiveDataProcessor.java b/java_tools/configuration_definition/src/main/java/com/rusefi/ldmp/LiveDataProcessor.java index d419d64823..cd65755bed 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/ldmp/LiveDataProcessor.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/ldmp/LiveDataProcessor.java @@ -88,6 +88,8 @@ public class LiveDataProcessor { SdCardFieldsContent sdCardFieldsConsumer = new SdCardFieldsContent(); + GetOutputValueConsumer outputValueConsumer = new GetOutputValueConsumer("controllers/lua/generated/output_lookup_generated.cpp"); + EntryHandler handler = new EntryHandler() { @Override 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) { sdCardFieldsConsumer.home = constexpr; state.addDestination(sdCardFieldsConsumer::handleEndStruct); + + outputValueConsumer.currentSectionPrefix = constexpr; + state.addDestination(outputValueConsumer::handleEndStruct); } state.doJob(); @@ -194,6 +199,8 @@ public class LiveDataProcessor { SdCardFieldsConsumer.wrapContent(lazyFile, sdCardFieldsConsumer.getBody()); lazyFile.close(); + outputValueConsumer.endFile(); + totalSensors.append(javaSensorsConsumer.getContent()); return javaSensorsConsumer.sensorTsPosition; diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/output/GetOutputValueConsumer.java b/java_tools/configuration_definition/src/main/java/com/rusefi/output/GetOutputValueConsumer.java index 80800771ef..6b4bfa8ff1 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/output/GetOutputValueConsumer.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/output/GetOutputValueConsumer.java @@ -22,6 +22,8 @@ public class GetOutputValueConsumer implements ConfigurationConsumer { private final List> getterPairs = new ArrayList<>(); private final String fileName; + public String currentSectionPrefix = "engine->outputChannels"; + public GetOutputValueConsumer(String fileName) { this.fileName = fileName; } @@ -46,7 +48,7 @@ public class GetOutputValueConsumer implements ConfigurationConsumer { } String userName = prefix + cf.getName(); - String javaName = "engine->outputChannels." + prefix; + String javaName = currentSectionPrefix + "." + prefix; getterPairs.add(new Pair<>(userName, javaName + cf.getName()));