logging of live data structs was: data points #3614

fixing a couple of brand new bugs
This commit is contained in:
Andrey 2022-04-17 03:10:39 -04:00
parent 0635c19492
commit 698e856803
6 changed files with 9 additions and 7 deletions

Binary file not shown.

View File

@ -106,7 +106,7 @@ public class UsagesReader {
} }
try (FileWriter fw = new FileWriter("console/binary/generated/wip.ini")) { try (FileWriter fw = new FileWriter("console/binary/generated/wip.ini")) {
fw.write(totalSensors.toString()); fw.write(fancyNewStuff.toString());
} }
} }

View File

@ -7,9 +7,9 @@ import java.io.IOException;
import java.util.List; import java.util.List;
public abstract class FieldsStrategy { public abstract class FieldsStrategy {
public void run(ReaderState state, ConfigStructure structure) throws IOException { public void run(ReaderState state, ConfigStructure structure, int sensorTsPosition) throws IOException {
if (state.stack.isEmpty()) { if (state.stack.isEmpty()) {
writeJavaFields(structure.tsFields, "", 0); writeJavaFields(structure.tsFields, "", sensorTsPosition);
} }
} }

View File

@ -52,7 +52,7 @@ public class FragmentDialogConsumer implements ConfigurationConsumer {
return 0; return 0;
} }
}; };
fieldsStrategy.run(readerState, structure); fieldsStrategy.run(readerState, structure, 0);
} }

View File

@ -6,7 +6,6 @@ import com.rusefi.*;
import java.io.CharArrayWriter; import java.io.CharArrayWriter;
import java.io.IOException; import java.io.IOException;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
import java.util.Set; import java.util.Set;
import static com.rusefi.ToolUtil.EOL; import static com.rusefi.ToolUtil.EOL;
@ -107,6 +106,6 @@ public abstract class JavaFieldsConsumer implements ConfigurationConsumer {
return tsPosition; return tsPosition;
} }
}; };
fieldsStrategy.run(state, structure); fieldsStrategy.run(state, structure, 0);
} }
} }

View File

@ -58,10 +58,13 @@ public class JavaSensorsConsumer implements ConfigurationConsumer {
tsPosition += configField.getSize(next); tsPosition += configField.getSize(next);
// this value would be consumed by UsagesReader
sensorTsPosition = tsPosition;
return tsPosition; return tsPosition;
} }
}; };
fieldsStrategy.run(readerState, structure); fieldsStrategy.run(readerState, structure, sensorTsPosition);
} }
public static String quote(String string) { public static String quote(String string) {