logging of live data structs was: data points #3614

progress!
This commit is contained in:
rusefillc 2022-04-17 13:16:13 -04:00
parent 7e067bb5a1
commit 2624d0ad07
4 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,18 @@
// generated by gen_live_documentation.sh / UsagesReader.java
#define FRAGMENT_OUTPUT_CHANNELS_SIZE 640
#define FRAGMENT_HIGH_PRESSURE_FUEL_PUMP_SIZE 24
#define FRAGMENT_INJECTOR_MODEL_SIZE 12
#define FRAGMENT_LAUNCH_CONTROL_STATE_SIZE 4
#define FRAGMENT_BOOST_CONTROL_SIZE 12
#define FRAGMENT_AC_CONTROL_SIZE 12
#define FRAGMENT_FAN_CONTROL_SIZE 0
#define FRAGMENT_FUEL_PUMP_CONTROL_SIZE 0
#define FRAGMENT_MAIN_RELAY_SIZE 0
#define FRAGMENT_ENGINE_STATE_SIZE 128
#define FRAGMENT_TPS_ACCEL_STATE_SIZE 48
#define FRAGMENT_TRIGGER_CENTRAL_SIZE 28
#define FRAGMENT_TRIGGER_STATE_SIZE 8
#define FRAGMENT_WALL_FUEL_STATE_SIZE 8
#define FRAGMENT_IDLE_STATE_SIZE 32
#define FRAGMENT_IGNITION_STATE_SIZE 16
#define FRAGMENT_ELECTRONIC_THROTTLE_SIZE 12

View File

@ -12,4 +12,5 @@ COMMON_GEN_CONFIG="
-with_c_defines false \
-initialize_to_zero false \
-prepend console/binary/generated/total_live_data_generated.h \
-prepend console/binary/generated/fragments_meta.h \
-definition integration/rusefi_config.txt"

Binary file not shown.

View File

@ -1,10 +1,10 @@
package com.rusefi.ldmp;
import com.devexperts.logging.Logging;
import com.rusefi.ConfigDefinition;
import com.rusefi.ReaderState;
import com.rusefi.output.FragmentDialogConsumer;
import com.rusefi.output.JavaSensorsConsumer;
import com.rusefi.util.SystemOut;
import org.yaml.snakeyaml.Yaml;
import java.io.File;
@ -16,6 +16,8 @@ import java.util.List;
import java.util.Map;
public class UsagesReader {
private final static Logging log = Logging.getLogging(UsagesReader.class);
private final static String header = "// generated by gen_live_documentation.sh / UsagesReader.java\n";
private final StringBuilder enumContent = new StringBuilder(header +
@ -42,6 +44,7 @@ public class UsagesReader {
StringBuilder totalSensors = new StringBuilder();
StringBuilder fancyNewStuff = new StringBuilder();
StringBuilder fragmentsMeta = new StringBuilder(header);
UsagesReader usagesReader = new UsagesReader();
@ -52,6 +55,9 @@ public class UsagesReader {
String javaName = (String) elements.get(0);
String folder = (String) elements.get(1);
int startingPosition = usagesReader.sensorTsPosition;
log.info("Starting " + name + " at " + startingPosition);
boolean withCDefines = false;
String prepend = "";
for (int i = 2; i < elements.size(); i++) {
@ -88,18 +94,25 @@ public class UsagesReader {
fancyNewStuff.append(fragmentDialogConsumer.getContent());
SystemOut.println("TS_TOTAL_OUTPUT_SIZE=" + usagesReader.sensorTsPosition);
int size = usagesReader.sensorTsPosition - startingPosition;
fragmentsMeta.append("#define FRAGMENT_" + name.toUpperCase() + "_SIZE " + size + "\n");
log.info("Done with " + name + " at " + usagesReader.sensorTsPosition);
}
};
usagesReader.handleYaml(data, handler);
usagesReader.writeFiles();
log.info("TS_TOTAL_OUTPUT_SIZE=" + usagesReader.sensorTsPosition);
try (FileWriter fw = new FileWriter("console/binary/generated/total_live_data_generated.h")) {
fw.write(header);
fw.write("#define TS_TOTAL_OUTPUT_SIZE " + usagesReader.sensorTsPosition);
}
try (FileWriter fw = new FileWriter("console/binary/generated/fragments_meta.h")) {
fw.write(fragmentsMeta.toString());
}
try (FileWriter fw = new FileWriter("console/binary/generated/sensors.java")) {
fw.write(totalSensors.toString());