logging of live data structs was: data points #3614
alpha version of TS UI
This commit is contained in:
parent
1f7dc3dc0d
commit
31c3c33972
|
@ -6,6 +6,8 @@ COMMON_GEN_CONFIG="
|
|||
-enumInputFile controllers/algo/rusefi_enums.h \
|
||||
-readfile OUTPUTS_SECTION console/binary/generated/output_channels.ini \
|
||||
-readfile DATALOG_SECTION console/binary/generated/data_logs.ini \
|
||||
-readfile LIVE_DATA_MENU_FROM_FILE console/binary/generated/fancy_menu.ini \
|
||||
-readfile LIVE_DATA_PANELS_FROM_FILE console/binary/generated/fancy_content.ini \
|
||||
-ts_destination tunerstudio \
|
||||
-firing_order controllers/algo/firing_order.h \
|
||||
-triggerFolder ../unit_tests \
|
||||
|
|
|
@ -1474,6 +1474,9 @@ menuDialog = main
|
|||
subMenu = idleVeTableTbl, "Idle VE", 0, {useSeparateVeForIdle == 1}
|
||||
subMenu = idleAdvanceCurve, "Ignition advance", 0, {useSeparateAdvanceForIdle == 1}
|
||||
|
||||
menu = "&View"
|
||||
@@LIVE_DATA_MENU_FROM_FILE@@
|
||||
|
||||
menu = "&Advanced"
|
||||
subMenu = ignitionCylExtra, "Cylinder offsets", 0
|
||||
subMenu = gearDetection, "Gear detection", 0
|
||||
|
@ -3138,6 +3141,8 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
|
|||
panel = speedSensorAnalog, { enableCanVss == 0 }
|
||||
panel = speedSensorCan
|
||||
|
||||
@@LIVE_DATA_PANELS_FROM_FILE@@
|
||||
|
||||
dialog = gearDetection, "Gear Detection"
|
||||
field = "Wheel revolutions per kilometer", driveWheelRevPerKm
|
||||
field = "Final drive ratio", finalGearRatio
|
||||
|
|
Binary file not shown.
|
@ -26,9 +26,11 @@ public class UsagesReader {
|
|||
"\n" +
|
||||
"typedef enum {\n");
|
||||
|
||||
private StringBuilder totalSensors = new StringBuilder();
|
||||
private final StringBuilder totalSensors = new StringBuilder();
|
||||
|
||||
private StringBuilder fancyNewStuff = new StringBuilder();
|
||||
private final StringBuilder fancyNewStuff = new StringBuilder();
|
||||
|
||||
private final StringBuilder fancyNewMenu = new StringBuilder();
|
||||
|
||||
private final StringBuilder fragmentsContent = new StringBuilder(
|
||||
header +
|
||||
|
@ -59,9 +61,13 @@ public class UsagesReader {
|
|||
fw.write(usagesReader.totalSensors.toString());
|
||||
}
|
||||
|
||||
try (FileWriter fw = new FileWriter("console/binary/generated/wip.ini")) {
|
||||
try (FileWriter fw = new FileWriter("console/binary/generated/fancy_content.ini")) {
|
||||
fw.write(usagesReader.fancyNewStuff.toString());
|
||||
}
|
||||
|
||||
try (FileWriter fw = new FileWriter("console/binary/generated/fancy_menu.ini")) {
|
||||
fw.write(usagesReader.fancyNewMenu.toString());
|
||||
}
|
||||
}
|
||||
|
||||
interface EntryHandler {
|
||||
|
@ -116,6 +122,8 @@ public class UsagesReader {
|
|||
|
||||
fancyNewStuff.append(fragmentDialogConsumer.getContent());
|
||||
|
||||
fancyNewMenu.append(fragmentDialogConsumer.menuLine());
|
||||
|
||||
log.info("Done with " + name + " at " + javaSensorsConsumer.sensorTsPosition);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -14,6 +14,7 @@ public class FragmentDialogConsumer implements ConfigurationConsumer {
|
|||
private final StringBuilder indicatorPanel = new StringBuilder();
|
||||
private final String fragmentName;
|
||||
private boolean hasIndicators;
|
||||
private int graphLinesCounter;
|
||||
|
||||
public FragmentDialogConsumer(String fragmentName) {
|
||||
this.fragmentName = fragmentName;
|
||||
|
@ -39,7 +40,6 @@ public class FragmentDialogConsumer implements ConfigurationConsumer {
|
|||
return 0;
|
||||
|
||||
if (configField.isBit()) {
|
||||
|
||||
if (!hasIndicators) {
|
||||
hasIndicators = true;
|
||||
indicatorPanel.append("indicatorPanel = " + getPanelName() + ", 2\n");
|
||||
|
@ -48,6 +48,7 @@ public class FragmentDialogConsumer implements ConfigurationConsumer {
|
|||
|
||||
}
|
||||
|
||||
graphLinesCounter++;
|
||||
graphLines.append("\tgraphLine = " + configField.getName() + "\n");
|
||||
|
||||
|
||||
|
@ -63,9 +64,19 @@ public class FragmentDialogConsumer implements ConfigurationConsumer {
|
|||
return fragmentName + "IndicatorPanel";
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
public String menuLine() {
|
||||
if (getContent().isEmpty())
|
||||
return "";
|
||||
return "\t\t\tsubMenu = " + getDialogName() + ", " + quote(fragmentName) + "\n";
|
||||
}
|
||||
|
||||
String dialogDeclaration = "dialog = " + fragmentName + "Dialog, " + quote(fragmentName) + "\n";
|
||||
public String getContent() {
|
||||
if (graphLinesCounter > 40) {
|
||||
// too many lines - really looks like that huge first legacy model, not having fancy stuff for it
|
||||
return "";
|
||||
}
|
||||
|
||||
String dialogDeclaration = "dialog = " + getDialogName() +", " + quote(fragmentName) + "\n";
|
||||
|
||||
String indicatorPanelUsageLine = (indicatorPanel.length() > 0) ? "\tpanel = " + getPanelName() + "\n" : "";
|
||||
|
||||
|
@ -78,10 +89,15 @@ public class FragmentDialogConsumer implements ConfigurationConsumer {
|
|||
graphLines + "\n" +
|
||||
dialogDeclaration +
|
||||
indicatorPanelUsageLine +
|
||||
"\tpanel = " + getGraphControlName() + "\n"
|
||||
"\tpanel = " + getGraphControlName() + "\n\n"
|
||||
;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getDialogName() {
|
||||
return fragmentName + "Dialog";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getGraphControlName() {
|
||||
return fragmentName + "Graph";
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.rusefi.test;
|
|||
|
||||
import com.rusefi.ReaderState;
|
||||
import com.rusefi.output.FragmentDialogConsumer;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -52,7 +51,8 @@ public class FragmentDialogConsumerTest {
|
|||
"\n" +
|
||||
"dialog = ac_stateDialog, \"ac_state\"\n" +
|
||||
"\tpanel = ac_stateIndicatorPanel\n" +
|
||||
"\tpanel = ac_stateGraph\n",
|
||||
"\tpanel = ac_stateGraph\n" +
|
||||
"\n",
|
||||
fragmentDialogConsumer.getContent());
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue