TS gauges section should be auto-generated #4972
This commit is contained in:
parent
f13af3b71c
commit
18224e6901
Binary file not shown.
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue