logging of live data structs was: data points #3614

sub-structures handling fix
more better liveGraph .ini syntax
This commit is contained in:
rusefillc 2022-04-18 00:31:30 -04:00
parent 282eec37e6
commit 4297173e15
3 changed files with 28 additions and 20 deletions

Binary file not shown.

View File

@ -9,7 +9,6 @@ import java.io.IOException;
import static com.rusefi.output.JavaSensorsConsumer.quote;
public class FragmentDialogConsumer implements ConfigurationConsumer {
private final StringBuilder graphLines = new StringBuilder();
private final StringBuilder graphList = new StringBuilder();
private final StringBuilder indicatorPanel = new StringBuilder();
@ -39,6 +38,15 @@ public class FragmentDialogConsumer implements ConfigurationConsumer {
int writeOneField(FieldIterator iterator, String prefix, int tsPosition) {
ConfigField configField = iterator.cf;
if (configField.getName().startsWith(ConfigStructure.ALIGNMENT_FILL_AT))
return 0;
ConfigStructure cs = configField.getStructureType();
if (cs != null) {
String extraPrefix = cs.withPrefix ? configField.getName() + "_" : "";
return writeFields(cs.tsFields, prefix + extraPrefix, tsPosition);
}
if (configField.getName().startsWith(ConfigStructure.UNUSED_BIT_PREFIX))
return 0;
@ -60,7 +68,7 @@ public class FragmentDialogConsumer implements ConfigurationConsumer {
startNewGraph();
}
graphLines.append("\tgraphLine = " + configField.getName() + "\n");
graphList.append("\t\tgraphLine = " + prefix + configField.getName() + "\n");
linesInCurrentGraph++;
@ -73,11 +81,9 @@ public class FragmentDialogConsumer implements ConfigurationConsumer {
private void startNewGraph() {
currentGraphIndex++;
graphLines.append("liveGraph = " + getGraphControlName() +
graphList.append("\tliveGraph = " + getGraphControlName() +
", " + quote("Graph") + ", South\n");
graphList.append("\tpanel = " + getGraphControlName() + "\n");
}
@NotNull
@ -103,7 +109,6 @@ public class FragmentDialogConsumer implements ConfigurationConsumer {
return indicatorPanel + "\n" +
graphLines + "\n" +
dialogDeclaration +
indicatorPanelUsageLine +
graphList +

View File

@ -16,6 +16,14 @@ public class FragmentDialogConsumerTest {
"\n" +
"" +
"struct_no_prefix output_channels_s\n" +
"struct speed_density_s\n" +
"\n" +
"float Tcharge_coff\n" +
"\n" +
"! speed_density_s\n" +
"end_struct\n" +
"\n" +
"speed_density_s sd;\n" +
"bit sd_present\n" +
"bit sd_present2\n" +
"bit sd_present3\n" +
@ -36,23 +44,18 @@ public class FragmentDialogConsumerTest {
"\tindicator = {sd_present2}, \"No\", \"Yes\"\n" +
"\tindicator = {sd_present3}, \"No\", \"Yes\"\n" +
"\n" +
"liveGraph = ac_state_1_Graph, \"Graph\", South\n" +
"\tgraphLine = RPMValue\n" +
"\tgraphLine = rpmAcceleration\n" +
"\tgraphLine = speedToRpmRatio\n" +
"\tgraphLine = alignmentFill_at_10\n" +
"liveGraph = ac_state_2_Graph, \"Graph\", South\n" +
"\tgraphLine = luaTimingMult\n" +
"\tgraphLine = vehicleSpeedKph\n" +
"\tgraphLine = internalMcuTemperature\n" +
"\tgraphLine = alignmentFill_at_18\n" +
"\n" +
"dialog = ac_stateDialog, \"ac_state\"\n" +
"\tpanel = ac_stateIndicatorPanel\n" +
"\tpanel = ac_state_1_Graph\n" +
"\tpanel = ac_state_2_Graph\n" +
"\tliveGraph = ac_state_1_Graph, \"Graph\", South\n" +
"\t\tgraphLine = sd_Tcharge_coff\n" +
"\t\tgraphLine = RPMValue\n" +
"\t\tgraphLine = rpmAcceleration\n" +
"\t\tgraphLine = speedToRpmRatio\n" +
"\tliveGraph = ac_state_2_Graph, \"Graph\", South\n" +
"\t\tgraphLine = luaTimingMult\n" +
"\t\tgraphLine = vehicleSpeedKph\n" +
"\t\tgraphLine = internalMcuTemperature\n" +
"\n",
fragmentDialogConsumer.getContent());
}
}