live data progress
This commit is contained in:
parent
a9b8fef332
commit
ed59d225ca
|
@ -2,51 +2,6 @@
|
|||
|
||||
rm gen_live_documentation.log
|
||||
|
||||
bash gen_live_documentation_one_file.sh high_pressure_fuel_pump HighPressureFuelPump.java controllers/engine_cycle
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh injector_model InjectorModel.java controllers/algo/fuel
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh launch_control_state LaunchControl.java controllers/algo
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh boost_control BoostControl.java controllers/actuators
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh ac_control AcControl.java controllers/actuators
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh fan_control FanControl.java controllers/actuators
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh fuel_pump FuelPump.java controllers/actuators
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh main_relay MainRelay.java controllers/actuators
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh pid_state PidState.java util/math
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh engine_state EngineState.java controllers/algo
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh tps_accel_state TpsAccelState.java controllers/algo
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh trigger_central TriggerCentral.java controllers/trigger
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh trigger_state TriggerState.java controllers/trigger
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh wall_fuel_state WallFuelState.java controllers/algo
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
bash gen_live_documentation_one_file.sh idle_state IdleState.java controllers/actuators
|
||||
[ $? -eq 0 ] || { echo "ERROR generating"; exit 1; }
|
||||
|
||||
java -DSystemOut.name=logs/gen_live_documentation \
|
||||
-cp ../java_tools/ConfigDefinition.jar \
|
||||
com.rusefi.ldmp.UsagesReader integration/LiveData.yaml
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ ! "$1" ] || [ ! "$2" ] || [ ! "$3" ]; then
|
||||
printf "Three parameters expected"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
meta_name=$1
|
||||
# TODO: programmatically produce java output name based on meta file name
|
||||
java_output=$2
|
||||
folder=$3
|
||||
|
||||
meta_file_name=${meta_name}.txt
|
||||
header_file="${meta_name}_generated.h"
|
||||
|
||||
|
||||
java -DSystemOut.name=logs/gen_live_documentation \
|
||||
-jar ../java_tools/ConfigDefinition.jar \
|
||||
-definition $folder/$meta_file_name \
|
||||
-java_destination ../java_console/models/src/main/java/com/rusefi/config/generated/$java_output \
|
||||
-c_destination $folder/${header_file}
|
|
@ -1,11 +1,16 @@
|
|||
Destination: "../java_console"
|
||||
|
||||
Usages:
|
||||
- "controllers/actuators/idle_thread.cpp"
|
||||
- "controllers/trigger/trigger_decoder.cpp"
|
||||
- "controllers/sensors/thermistors.cpp"
|
||||
- "controllers/sensors/tps.cpp"
|
||||
- "controllers/math/speed_density.cpp"
|
||||
- "controllers/algo/fuel_math.cpp"
|
||||
- "controllers/actuators/electronic_throttle.cpp"
|
||||
- "controllers/algo/accel_enrichment.cpp"
|
||||
high_pressure_fuel_pump: [ "HighPressureFuelPump.java", "controllers/engine_cycle" ]
|
||||
injector_model: [ "InjectorModel.java", "controllers/algo/fuel" ]
|
||||
launch_control_state: [ "LaunchControl.java", "controllers/algo" ]
|
||||
boost_control: [ "BoostControl.java", "controllers/actuators" ]
|
||||
ac_control: [ "AcControl.java", "controllers/actuators" ]
|
||||
fan_control: [ "FanControl.java", "controllers/actuators" ]
|
||||
fuel_pump: [ "FuelPump.java", "controllers/actuators" ]
|
||||
main_relay: [ "MainRelay.java", "controllers/actuators" ]
|
||||
pid_state: [ "PidState.java", "util/math" ]
|
||||
engine_state: [ "EngineState.java", "controllers/algo" ]
|
||||
tps_accel_state: [ "TpsAccelState.java", "controllers/algo" ]
|
||||
trigger_central: [ "TriggerCentral.java", "controllers/trigger" ]
|
||||
trigger_state: [ "TriggerState.java", "controllers/trigger" ]
|
||||
wall_fuel_state: [ "WallFuelState.java", "controllers/algo" ]
|
||||
idle_state: [ "IdleState.java", "controllers/actuators" ]
|
||||
|
|
|
@ -36,7 +36,7 @@ public class SystemOut {
|
|||
@Override
|
||||
public void run() {
|
||||
close();
|
||||
System.out.println("SystemOut Hook done!");
|
||||
System.out.println("SystemOut Hook done for " + fileName);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -19,13 +19,13 @@ public class ConfigDefinition {
|
|||
public static final String SIGNATURE_HASH = "SIGNATURE_HASH";
|
||||
|
||||
private static final String ROM_RAIDER_XML_TEMPLATE = "rusefi_template.xml";
|
||||
private static final String KEY_DEFINITION = "-definition";
|
||||
public static final String KEY_DEFINITION = "-definition";
|
||||
private static final String KEY_ROMRAIDER_INPUT = "-romraider";
|
||||
private static final String KEY_TS_DESTINATION = "-ts_destination";
|
||||
private static final String KEY_C_DESTINATION = "-c_destination";
|
||||
public static final String KEY_C_DESTINATION = "-c_destination";
|
||||
private static final String KEY_C_DEFINES = "-c_defines";
|
||||
private static final String KEY_WITH_C_DEFINES = "-with_c_defines";
|
||||
private static final String KEY_JAVA_DESTINATION = "-java_destination";
|
||||
public static final String KEY_JAVA_DESTINATION = "-java_destination";
|
||||
private static final String KEY_ROMRAIDER_DESTINATION = "-romraider_destination";
|
||||
private static final String KEY_FIRING = "-firing_order";
|
||||
private static final String KEY_PREPEND = "-prepend";
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package com.rusefi.ldmp;
|
||||
|
||||
import com.rusefi.ConfigDefinition;
|
||||
import com.rusefi.util.SystemOut;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
@ -17,13 +19,28 @@ public class UsagesReader {
|
|||
String yamlFileName = args[0];
|
||||
Yaml yaml = new Yaml();
|
||||
Map<String, Object> data = yaml.load(new FileReader(yamlFileName));
|
||||
SystemOut.println(data);
|
||||
|
||||
String destination = (String) data.get("Destination");
|
||||
Map<?, ?> liveDocs = (Map) data.get("Usages");
|
||||
for (Map.Entry entry : liveDocs.entrySet()) {
|
||||
String name = (String) entry.getKey();
|
||||
System.out.println(" " + name);
|
||||
System.out.println(" " + entry.getValue());
|
||||
List elements = (List) entry.getValue();
|
||||
|
||||
List<String> usages = (List) data.get("Usages");
|
||||
SystemOut.println("Usages: " + usages);
|
||||
for (String fileName : usages) {
|
||||
String javaName = (String) elements.get(0);
|
||||
String folder = (String) elements.get(1);
|
||||
|
||||
|
||||
ConfigDefinition.main(new String[]{
|
||||
ConfigDefinition.KEY_DEFINITION,
|
||||
folder + File.separator + name + ".txt",
|
||||
|
||||
ConfigDefinition.KEY_JAVA_DESTINATION,
|
||||
"../java_console/models/src/main/java/com/rusefi/config/generated/" + javaName,
|
||||
|
||||
ConfigDefinition.KEY_C_DESTINATION,
|
||||
folder + File.separator + name + "_generated.h"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue