renaming tool

This commit is contained in:
rusefillc 2022-10-28 03:44:39 -04:00
parent 5b3b11253e
commit f47c36c92f
4 changed files with 13 additions and 13 deletions

View File

@ -4,7 +4,7 @@ rm gen_live_documentation.log
java -DSystemOut.name=logs/gen_live_documentation \
-cp ../java_tools/ConfigDefinition.jar \
com.rusefi.ldmp.UsagesReader integration/LiveData.yaml
com.rusefi.ldmp.LiveDataProcessor integration/LiveData.yaml
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
bash gen_output_channels.sh

View File

@ -352,7 +352,7 @@ public class ReaderState {
public void addPrepend(String fileName) {
if (fileName == null || fileName.isEmpty()) {
// see UsagesReader use-case with dynamic prepend usage
// see LiveDataProcessor use-case with dynamic prepend usage
return;
}
prependFiles.add(fileName);

View File

@ -16,10 +16,10 @@ import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
public class UsagesReader {
private final static Logging log = Logging.getLogging(UsagesReader.class);
public class LiveDataProcessor {
private final static Logging log = Logging.getLogging(LiveDataProcessor.class);
private final static String header = "// generated by gen_live_documentation.sh / UsagesReader.java\n";
private final static String header = "// generated by gen_live_documentation.sh / LiveDataProcessor.java\n";
private final StringBuilder enumContent = new StringBuilder(header +
"#pragma once\n" +
@ -34,7 +34,7 @@ public class UsagesReader {
private final StringBuilder fragmentsContent = new StringBuilder(header);
private final String extraPrepend = System.getProperty("UsagesReader.extra_prepend");
private final String extraPrepend = System.getProperty("LiveDataProcessor.extra_prepend");
public static void main(String[] args) throws IOException {
if (args.length != 1) {
@ -45,10 +45,10 @@ public class UsagesReader {
Yaml yaml = new Yaml();
Map<String, Object> data = yaml.load(new FileReader(yamlFileName));
UsagesReader usagesReader = new UsagesReader();
LiveDataProcessor liveDataProcessor = new LiveDataProcessor();
int sensorTsPosition = usagesReader.handleYaml(data, null);
usagesReader.writeFiles();
int sensorTsPosition = liveDataProcessor.handleYaml(data, null);
liveDataProcessor.writeFiles();
log.info("TS_TOTAL_OUTPUT_SIZE=" + sensorTsPosition);
try (FileWriter fw = new FileWriter("console/binary/generated/total_live_data_generated.h")) {
@ -57,15 +57,15 @@ public class UsagesReader {
}
try (FileWriter fw = new FileWriter("console/binary/generated/sensors.java")) {
fw.write(usagesReader.totalSensors.toString());
fw.write(liveDataProcessor.totalSensors.toString());
}
try (FileWriter fw = new FileWriter("console/binary/generated/fancy_content.ini")) {
fw.write(usagesReader.fancyNewStuff.toString());
fw.write(liveDataProcessor.fancyNewStuff.toString());
}
try (FileWriter fw = new FileWriter("console/binary/generated/fancy_menu.ini")) {
fw.write(usagesReader.fancyNewMenu.toString());
fw.write(liveDataProcessor.fancyNewMenu.toString());
}
}

View File

@ -54,7 +54,7 @@ public class JavaSensorsConsumer implements ConfigurationConsumer {
}
tsPosition += configField.getSize(next);
// this value would be consumed by UsagesReader
// this value would be consumed by LiveDataProcessor
// todo: too many variables that's fragile shall we move tsPosition to iterator state?
sensorTsPosition = tsPosition;