renaming tool
This commit is contained in:
parent
4917de354e
commit
3c5f8f8f3c
|
@ -1,4 +1,4 @@
|
||||||
// generated by gen_live_documentation.sh / UsagesReader.java
|
// generated by gen_live_documentation.sh / LiveDataProcessor.java
|
||||||
getLiveDataAddr<output_channels_s>(),
|
getLiveDataAddr<output_channels_s>(),
|
||||||
getLiveDataAddr<knock_controller_s>(),
|
getLiveDataAddr<knock_controller_s>(),
|
||||||
getLiveDataAddr<high_pressure_fuel_pump_s>(),
|
getLiveDataAddr<high_pressure_fuel_pump_s>(),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// generated by gen_live_documentation.sh / UsagesReader.java
|
// generated by gen_live_documentation.sh / LiveDataProcessor.java
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
// generated by gen_live_documentation.sh / UsagesReader.java
|
// generated by gen_live_documentation.sh / LiveDataProcessor.java
|
||||||
#define TS_TOTAL_OUTPUT_SIZE 1280
|
#define TS_TOTAL_OUTPUT_SIZE 1280
|
|
@ -4,7 +4,7 @@ rm gen_live_documentation.log
|
||||||
|
|
||||||
java -DSystemOut.name=logs/gen_live_documentation \
|
java -DSystemOut.name=logs/gen_live_documentation \
|
||||||
-cp ../java_tools/ConfigDefinition.jar \
|
-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; }
|
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||||
|
|
||||||
bash gen_output_channels.sh
|
bash gen_output_channels.sh
|
||||||
|
|
|
@ -352,7 +352,7 @@ public class ReaderState {
|
||||||
|
|
||||||
public void addPrepend(String fileName) {
|
public void addPrepend(String fileName) {
|
||||||
if (fileName == null || fileName.isEmpty()) {
|
if (fileName == null || fileName.isEmpty()) {
|
||||||
// see UsagesReader use-case with dynamic prepend usage
|
// see LiveDataProcessor use-case with dynamic prepend usage
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
prependFiles.add(fileName);
|
prependFiles.add(fileName);
|
||||||
|
|
|
@ -16,10 +16,10 @@ import java.util.Collections;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class UsagesReader {
|
public class LiveDataProcessor {
|
||||||
private final static Logging log = Logging.getLogging(UsagesReader.class);
|
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 +
|
private final StringBuilder enumContent = new StringBuilder(header +
|
||||||
"#pragma once\n" +
|
"#pragma once\n" +
|
||||||
|
@ -34,7 +34,7 @@ public class UsagesReader {
|
||||||
|
|
||||||
private final StringBuilder fragmentsContent = new StringBuilder(header);
|
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 {
|
public static void main(String[] args) throws IOException {
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
|
@ -45,10 +45,10 @@ public class UsagesReader {
|
||||||
Yaml yaml = new Yaml();
|
Yaml yaml = new Yaml();
|
||||||
Map<String, Object> data = yaml.load(new FileReader(yamlFileName));
|
Map<String, Object> data = yaml.load(new FileReader(yamlFileName));
|
||||||
|
|
||||||
UsagesReader usagesReader = new UsagesReader();
|
LiveDataProcessor liveDataProcessor = new LiveDataProcessor();
|
||||||
|
|
||||||
int sensorTsPosition = usagesReader.handleYaml(data, null);
|
int sensorTsPosition = liveDataProcessor.handleYaml(data, null);
|
||||||
usagesReader.writeFiles();
|
liveDataProcessor.writeFiles();
|
||||||
|
|
||||||
log.info("TS_TOTAL_OUTPUT_SIZE=" + sensorTsPosition);
|
log.info("TS_TOTAL_OUTPUT_SIZE=" + sensorTsPosition);
|
||||||
try (FileWriter fw = new FileWriter("console/binary/generated/total_live_data_generated.h")) {
|
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")) {
|
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")) {
|
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")) {
|
try (FileWriter fw = new FileWriter("console/binary/generated/fancy_menu.ini")) {
|
||||||
fw.write(usagesReader.fancyNewMenu.toString());
|
fw.write(liveDataProcessor.fancyNewMenu.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class JavaSensorsConsumer implements ConfigurationConsumer {
|
||||||
|
|
||||||
}
|
}
|
||||||
tsPosition += configField.getSize(next);
|
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?
|
// todo: too many variables that's fragile shall we move tsPosition to iterator state?
|
||||||
sensorTsPosition = tsPosition;
|
sensorTsPosition = tsPosition;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue