diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index d4ffe4c7eb..2ad799cc43 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/ldmp/LiveDataProcessor.java b/java_tools/configuration_definition/src/main/java/com/rusefi/ldmp/LiveDataProcessor.java index 35c531280f..1113104f9a 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 @@ -3,6 +3,7 @@ package com.rusefi.ldmp; import com.devexperts.logging.Logging; import com.rusefi.EnumToString; import com.rusefi.InvokeReader; +import com.rusefi.ReaderState; import com.rusefi.ReaderStateImpl; import com.rusefi.output.*; import com.rusefi.util.LazyFile; @@ -90,6 +91,8 @@ public class LiveDataProcessor { GetOutputValueConsumer outputValueConsumer = new GetOutputValueConsumer("controllers/lua/generated/output_lookup_generated.cpp"); + GaugeConsumer gaugeConsumer = new GaugeConsumer(tsOutputsDestination + File.separator + "generated/gauges.ini"); + EntryHandler handler = new EntryHandler() { @Override public void onEntry(String name, String javaName, String folder, String prepend, boolean withCDefines, String[] outputNames, String constexpr) throws IOException { @@ -125,6 +128,13 @@ public class LiveDataProcessor { outputValueConsumer.currentSectionPrefix = constexpr; state.addDestination((state1, structure) -> outputValueConsumer.handleEndStruct(state1, structure)); + + state.addDestination(new ConfigurationConsumer() { + @Override + public void handleEndStruct(ReaderState readerState, ConfigStructure structure) throws IOException { + gaugeConsumer.handleEndStruct(readerState, structure); + } + }); } state.doJob(); diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/output/GaugeConsumer.java b/java_tools/configuration_definition/src/main/java/com/rusefi/output/GaugeConsumer.java index 620a18797a..2845beb267 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/output/GaugeConsumer.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/output/GaugeConsumer.java @@ -26,14 +26,16 @@ public class GaugeConsumer implements ConfigurationConsumer { PerFieldWithStructuresIterator iterator = new PerFieldWithStructuresIterator(readerState, structure.getTsFields(), "", (state, configField, prefix) -> handle(configField, prefix)); iterator.loop(); - String content = iterator.getContent(); } + } -// if (fileName != null) { -// FileWriter fw = new FileWriter(fileName); -// fw.write(charArrayWriter.toString()); -// fw.close(); -// } + @Override + public void endFile() throws IOException { + if (fileName != null) { + FileWriter fw = new FileWriter(fileName); + fw.write(getContent()); + fw.close(); + } } private String handle(ConfigField configField, String prefix) {