diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index cd83e1f53b..cf876e5e10 100644 Binary files a/java_tools/ConfigDefinition.jar and b/java_tools/ConfigDefinition.jar differ diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/output/SdCardFieldsContent.java b/java_tools/configuration_definition/src/main/java/com/rusefi/output/SdCardFieldsContent.java index 6537ce1f5d..150496c1f2 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/output/SdCardFieldsContent.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/output/SdCardFieldsContent.java @@ -1,5 +1,7 @@ package com.rusefi.output; +import com.rusefi.core.SensorCategory; + import com.rusefi.ConfigField; import com.rusefi.ReaderState; @@ -39,6 +41,14 @@ public class SdCardFieldsContent { } private String getLine(ConfigField configField, String prefix, String name) { + String categoryStr = configField.getCategory(); + + if(categoryStr == null) { + categoryStr = ""; + } else { + categoryStr = ", " + categoryStr; + } + return "\t{" + home + "." + name + ", " + DataLogConsumer.getHumanGaugeName(prefix, configField) + @@ -46,9 +56,7 @@ public class SdCardFieldsContent { quote(configField.getUnits()) + ", " + configField.getDigits() + - ", " + - configField.getCategory() + - + categoryStr + "},\n"; } diff --git a/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsGeneratorTest.java b/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsGeneratorTest.java index 290cdf0506..1a774c5ae4 100644 --- a/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsGeneratorTest.java +++ b/java_tools/configuration_definition/src/test/java/com/rusefi/test/SdCardFieldsGeneratorTest.java @@ -24,17 +24,17 @@ public class SdCardFieldsGeneratorTest { String test = "struct_no_prefix output_channels_s\n" + "\tfloat autoscale internalMcuTemperature\n" + - "uint16_t autoscale RPMValue;@@GAUGE_NAME_RPM@@;\"RPM\",1, 0, 0, 8000, 2\n" + + "uint16_t autoscale RPMValue;@@GAUGE_NAME_RPM@@;\"RPM\",1, 0, 0, 8000, 2, \"myCategory\"\n" + "\n" + "uint16_t rpmAcceleration;dRPM;\"RPM/s\",1, 0, 0, 5, 2\n" + "\n" + "\tuint16_t autoscale speedToRpmRatio;@@GAUGE_NAME_GEAR_RATIO@@;\"value\",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0\n" + "end_struct"; - processAndAssert(test, "\t{engine->outputChannels.internalMcuTemperature, \"internalMcuTemperature\", \"\", 0, null},\n" + - "\t{engine->outputChannels.RPMValue, \"hello\", \"RPM\", 2, null},\n" + - "\t{engine->outputChannels.rpmAcceleration, \"dRPM\", \"RPM/s\", 2, null},\n" + - "\t{engine->outputChannels.speedToRpmRatio, \"ra\", \"value\", 0, null},\n" + + processAndAssert(test, "\t{engine->outputChannels.internalMcuTemperature, \"internalMcuTemperature\", \"\", 0},\n" + + "\t{engine->outputChannels.RPMValue, \"hello\", \"RPM\", 2, \"myCategory\"},\n" + + "\t{engine->outputChannels.rpmAcceleration, \"dRPM\", \"RPM/s\", 2},\n" + + "\t{engine->outputChannels.speedToRpmRatio, \"ra\", \"value\", 0},\n" + "", actor); } @@ -43,7 +43,7 @@ public class SdCardFieldsGeneratorTest { processAndAssert("struct_no_prefix output_channels_s\n" + "uint16_t autoscale RPMValue;feee;\"RPM\",1, 0, 0, 8000, 2\n" + "bit sd_logging_internal\n" + - "end_struct", "\t{engine->outputChannels.RPMValue, \"feee\", \"RPM\", 2, null},\n", readerState -> { + "end_struct", "\t{engine->outputChannels.RPMValue, \"feee\", \"RPM\", 2},\n", readerState -> { }); } @@ -52,10 +52,10 @@ public class SdCardFieldsGeneratorTest { public void array() { processAndAssert("struct_no_prefix output_channels_s\n" + "uint16_t[4 iterate] recentErrorCode;;\"error\", 1, 0, 0, 0, 0\n" + - "end_struct", "\t{engine->outputChannels.recentErrorCode[0], \"recentErrorCode 1\", \"error\", 0, null},\n" + - "\t{engine->outputChannels.recentErrorCode[1], \"recentErrorCode 2\", \"error\", 0, null},\n" + - "\t{engine->outputChannels.recentErrorCode[2], \"recentErrorCode 3\", \"error\", 0, null},\n" + - "\t{engine->outputChannels.recentErrorCode[3], \"recentErrorCode 4\", \"error\", 0, null},\n", readerState -> { + "end_struct", "\t{engine->outputChannels.recentErrorCode[0], \"recentErrorCode 1\", \"error\", 0},\n" + + "\t{engine->outputChannels.recentErrorCode[1], \"recentErrorCode 2\", \"error\", 0},\n" + + "\t{engine->outputChannels.recentErrorCode[2], \"recentErrorCode 3\", \"error\", 0},\n" + + "\t{engine->outputChannels.recentErrorCode[3], \"recentErrorCode 4\", \"error\", 0},\n", readerState -> { }); } @@ -68,7 +68,7 @@ public class SdCardFieldsGeneratorTest { " end_struct\n" + "\tpid_status_s alternatorStatus\n" + "end_struct", - "\t{engine->outputChannels.alternatorStatus.pTerm, \"alternatorStatus.pTerm\", \"\", 2, null},\n", + "\t{engine->outputChannels.alternatorStatus.pTerm, \"alternatorStatus.pTerm\", \"\", 2},\n", readerState -> { }); @@ -86,4 +86,4 @@ public class SdCardFieldsGeneratorTest { state.readBufferedReader(input, consumer); assertEquals(expectedOutput, consumer.getBody()); } -} +} \ No newline at end of file