diff --git a/firmware/console/binary/output_channels.txt b/firmware/console/binary/output_channels.txt index a89f030282..e6db63e8ab 100644 --- a/firmware/console/binary/output_channels.txt +++ b/firmware/console/binary/output_channels.txt @@ -34,38 +34,39 @@ bit isTps2Error; bit isIdleClosedLoop; bit isIdleCoasting; -uint16_t autoscale RPMValue;;"RPM",1, 0, 0, 0, 0 -uint16_t rpmAcceleration;;"RPM/s",1, 0, 0, 0, 0 +uint16_t autoscale RPMValue;@@GAUGE_NAME_RPM@@;"RPM",1, 0, 0, 0, 0 - uint16_t autoscale speedToRpmRatio;;"value",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0 - uint8_t autoscale vehicleSpeedKph;;"kph",1, 0, 0, 0, 0 - uint8_t autoscale internalMcuTemperature;;"deg C",1, 0, 0, 0, 0 +uint16_t rpmAcceleration;dRPM;"RPM/s",1, 0, 0, 0, 0 - uint16_t autoscale coolant;;"deg C",{1/@@PACK_MULT_TEMPERATURE@@}, 0, 0, 0, 0 - uint16_t autoscale intake;;"deg C",{1/@@PACK_MULT_TEMPERATURE@@}, 0, 0, 0, 0 + uint16_t autoscale speedToRpmRatio;s2rpm;"value",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0 + uint8_t autoscale vehicleSpeedKph;@@GAUGE_NAME_VVS@@;"kph",1, 0, 0, 0, 0 + uint8_t autoscale internalMcuTemperature;@@GAUGE_NAME_CPU_TEMP@@;"deg C",1, 0, 0, 0, 0 + + uint16_t autoscale coolant;@@GAUGE_NAME_CLT@@;"deg C",{1/@@PACK_MULT_TEMPERATURE@@}, 0, 0, 0, 0 + uint16_t autoscale intake;@@GAUGE_NAME_IAT@@;"deg C",{1/@@PACK_MULT_TEMPERATURE@@}, 0, 0, 0, 0 uint16_t autoscale auxTemp1;;"deg C",{1/@@PACK_MULT_TEMPERATURE@@}, 0, 0, 0, 0 uint16_t autoscale auxTemp2;;"deg C",{1/@@PACK_MULT_TEMPERATURE@@}, 0, 0, 0, 0 - uint16_t autoscale TPSValue;;"%",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0 - uint16_t autoscale throttlePedalPosition;;"%",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0 + uint16_t autoscale TPSValue;@@GAUGE_NAME_TPS@@;"%",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0 + uint16_t autoscale throttlePedalPosition;@@GAUGE_NAME_THROTTLE_PEDAL@@;"%",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0 uint16_t tpsADC;;"ADC", 1, 0, 0, 0, 0 - uint16_t autoscale MAFValue;;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 0, 0 + uint16_t autoscale MAFValue;@@GAUGE_NAME_MAF@@;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 0, 0 - uint16_t autoscale massAirFlowValue;;"Kg/h",{1/@@PACK_MULT_MASS_FLOW@@}, 0, 0, 0, 0 - uint16_t autoscale MAPValue;;"kPa",{1/@@PACK_MULT_PRESSURE@@}, 0, 0, 0, 0 + uint16_t autoscale massAirFlowValue;@@GAUGE_NAME_AIR_FLOW@@;"Kg/h",{1/@@PACK_MULT_MASS_FLOW@@}, 0, 0, 0, 0 + uint16_t autoscale MAPValue;@@GAUGE_NAME_MAP@@;"kPa",{1/@@PACK_MULT_PRESSURE@@}, 0, 0, 0, 0 uint16_t autoscale baroPressure;;"kPa",{1/@@PACK_MULT_PRESSURE@@}, 0, 0, 0, 0 - uint16_t autoscale lambdaValue;;"",{1/@@PACK_MULT_LAMBDA@@}, 0, 0, 0, 0 + uint16_t autoscale lambdaValue;@@GAUGE_NAME_LAMBDA@@;"",{1/@@PACK_MULT_LAMBDA@@}, 0, 0, 0, 0 uint8_t autoscale knockRetard;;"deg",{1/10}, 0, 0, 0, 0 uint8_t unused37;;"",1, 0, 0, 0, 0 - uint16_t autoscale VBatt;;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 0, 0 + uint16_t autoscale VBatt;@@GAUGE_NAME_VBAT@@;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 0, 0 - uint16_t autoscale oilPressure;;"kPa",{1/@@PACK_MULT_PRESSURE@@}, 0, 0, 0, 0 - uint16_t autoscale vvtPositionB1I;;"deg",{1/@@PACK_MULT_ANGLE@@}, 0, 0, 0, 0 + uint16_t autoscale oilPressure;@@GAUGE_NAME_OIL_PRESSURE@@;"kPa",{1/@@PACK_MULT_PRESSURE@@}, 0, 0, 0, 0 + uint16_t autoscale vvtPositionB1I;@@GAUGE_NAME_VVT_B1I@@;"deg",{1/@@PACK_MULT_ANGLE@@}, 0, 0, 0, 0 uint16_t autoscale chargeAirMass;;"g",{1/1000}, 0, 0, 0, 0 uint16_t autoscale crankingFuelMs;airmass in mg, 0-65 grams;"ms",{1/@@PACK_MULT_FUEL_MASS@@}, 0, 0, 0, 0 @@ -121,9 +122,9 @@ uint16_t rpmAcceleration;;"RPM/s",1, 0, 0, 0, 0 float autoscale knockLevel;;"Volts", 1, 0, 0, 0, 0 ! integration magic: TS requires exact 'seconds' name - uint32_t autoscale seconds;;"sec", 1, 0, 0, 0, 0 + uint32_t autoscale seconds;@@GAUGE_NAME_UPTIME@@;"sec", 1, 0, 0, 0, 0 uint32_t autoscale engineMode;;"em", 1, 0, 0, 0, 0 - uint32_t autoscale firmwareVersion;;"version_f", 1, 0, 0, 0, 0 + uint32_t autoscale firmwareVersion;@@GAUGE_NAME_VERSION@@;"version_f", 1, 0, 0, 0, 0 ! todo: this not needed in light of TS_SIGNATURE but rusEFI console still uses it. Need to migrate ! rusEFI console from TS_FILE_VERSION to TS_SIGNATURE :( diff --git a/firmware/console/binary/ts_outputs_generated.h b/firmware/console/binary/ts_outputs_generated.h index 113d32cb41..8e820f7010 100644 --- a/firmware/console/binary/ts_outputs_generated.h +++ b/firmware/console/binary/ts_outputs_generated.h @@ -1,4 +1,4 @@ -// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) console/binary/output_channels.txt Sat Nov 27 19:22:57 EST 2021 +// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) console/binary/output_channels.txt Sun Nov 28 14:09:25 EST 2021 // by class com.rusefi.output.CHeaderConsumer // begin #pragma once @@ -102,36 +102,43 @@ struct ts_outputs_s { offset 0 bit 31 */ bool isIdleCoasting : 1 {}; /** + * @@GAUGE_NAME_RPM@@ RPM * offset 4 */ scaled_channel RPMValue = (uint16_t)0; /** + * dRPM RPM/s * offset 6 */ uint16_t rpmAcceleration = (uint16_t)0; /** + * s2rpm value * offset 8 */ scaled_channel speedToRpmRatio = (uint16_t)0; /** + * @@GAUGE_NAME_VVS@@ kph * offset 10 */ scaled_channel vehicleSpeedKph = (uint8_t)0; /** + * @@GAUGE_NAME_CPU_TEMP@@ deg C * offset 11 */ scaled_channel internalMcuTemperature = (uint8_t)0; /** + * @@GAUGE_NAME_CLT@@ deg C * offset 12 */ scaled_channel coolant = (uint16_t)0; /** + * @@GAUGE_NAME_IAT@@ deg C * offset 14 */ @@ -147,11 +154,13 @@ struct ts_outputs_s { */ scaled_channel auxTemp2 = (uint16_t)0; /** + * @@GAUGE_NAME_TPS@@ % * offset 20 */ scaled_channel TPSValue = (uint16_t)0; /** + * @@GAUGE_NAME_THROTTLE_PEDAL@@ % * offset 22 */ @@ -162,16 +171,19 @@ struct ts_outputs_s { */ uint16_t tpsADC = (uint16_t)0; /** + * @@GAUGE_NAME_MAF@@ V * offset 26 */ scaled_channel MAFValue = (uint16_t)0; /** + * @@GAUGE_NAME_AIR_FLOW@@ Kg/h * offset 28 */ scaled_channel massAirFlowValue = (uint16_t)0; /** + * @@GAUGE_NAME_MAP@@ kPa * offset 30 */ @@ -182,6 +194,7 @@ struct ts_outputs_s { */ scaled_channel baroPressure = (uint16_t)0; /** + * @@GAUGE_NAME_LAMBDA@@ * offset 34 */ scaled_channel lambdaValue = (uint16_t)0; @@ -195,16 +208,19 @@ struct ts_outputs_s { */ uint8_t unused37 = (uint8_t)0; /** + * @@GAUGE_NAME_VBAT@@ V * offset 38 */ scaled_channel VBatt = (uint16_t)0; /** + * @@GAUGE_NAME_OIL_PRESSURE@@ kPa * offset 40 */ scaled_channel oilPressure = (uint16_t)0; /** + * @@GAUGE_NAME_VVT_B1I@@ deg * offset 42 */ @@ -383,6 +399,7 @@ struct ts_outputs_s { */ scaled_channel knockLevel = (float)0; /** + * @@GAUGE_NAME_UPTIME@@ sec * offset 112 */ @@ -393,6 +410,7 @@ struct ts_outputs_s { */ scaled_channel engineMode = (uint32_t)0; /** + * @@GAUGE_NAME_VERSION@@ version_f * offset 120 */ @@ -723,4 +741,4 @@ struct ts_outputs_s { }; // end -// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) console/binary/output_channels.txt Sat Nov 27 19:22:57 EST 2021 +// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) console/binary/output_channels.txt Sun Nov 28 14:09:25 EST 2021 diff --git a/firmware/gen_output_channels.sh b/firmware/gen_output_channels.sh index bd9f12a58b..68c0385008 100755 --- a/firmware/gen_output_channels.sh +++ b/firmware/gen_output_channels.sh @@ -9,7 +9,7 @@ java -DSystemOut.name=logs/gen_output_channels \ -cache_zip_file tunerstudio/generated/cache.zip \ -prepend integration/rusefi_config.txt \ -definition console/binary/output_channels.txt \ - -ts_outputs_section console/binary/output_channels.ini \ + -ts_outputs_section console/binary/ \ -cache . \ -with_c_defines false \ -c_destination console/binary/ts_outputs_generated.h \ No newline at end of file diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 30ad649282..0b39ed256d 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1277,31 +1277,41 @@ gaugeCategory = DynoView ; Channel Label Type Format entry = time, @@GAUGE_NAME_TIME@@, float, "%.3f" entry = seconds, @@GAUGE_NAME_UPTIME@@, float, "%.3f" - entry = RPMValue, @@GAUGE_NAME_RPM@@, int, "%d" - entry = firmwareVersion, @@GAUGE_NAME_VERSION@@, int, "%d" - entry = coolant, @@GAUGE_NAME_CLT@@, float, "%.2f" - entry = intake, @@GAUGE_NAME_IAT@@, float, "%.2f" - entry = oilPressure, @@GAUGE_NAME_OIL_PRESSURE@@,float, "%.1f" - entry = TPSValue, @@GAUGE_NAME_TPS@@, float, "%.2f" + +entry = RPMValue, "RPM", int, "%d" +entry = rpmAcceleration, "dRPM", int, "%d" +entry = speedToRpmRatio, "s2rpm", float, "%.3f" +entry = vehicleSpeedKph, "Vehicle Speed", int, "%d" +entry = internalMcuTemperature, "CPU Temperature", int, "%d" +entry = coolant, "CLT", float, "%.3f" +entry = intake, "IAT", float, "%.3f" +entry = auxTemp1, "auxTemp1", float, "%.3f" +entry = auxTemp2, "auxTemp2", float, "%.3f" +entry = TPSValue, "TPS", float, "%.3f" +entry = throttlePedalPosition, "Throttle pedal position", float, "%.3f" +entry = tpsADC, "tpsADC", int, "%d" +entry = MAFValue, "MAF", float, "%.3f" +entry = massAirFlowValue, "massAirFlowValue", float, "%.3f" +entry = MAPValue, "MAP", float, "%.3f" +entry = baroPressure, "baroPressure", float, "%.3f" +entry = lambdaValue, "Lambda", float, "%.3f" +entry = knockRetard, "knockRetard", float, "%.3f" +entry = VBatt, "VBatt", float, "%.3f" +entry = oilPressure, "Oil Pressure", float, "%.3f" +entry = vvtPositionB1I, "VVT: bank 1 intake", float, "%.3f" entry = TPS2Value, @@GAUGE_NAME_TPS2@@, float, "%.2f" - entry = MAFValue, @@GAUGE_NAME_MAF@@, float, "%.2f" - entry = MAPValue, @@GAUGE_NAME_MAP@@, float, "%.1f" entry = AFRValue, @@GAUGE_NAME_AFR@@, float, "%.2f" entry = AFRValue2, @@GAUGE_NAME_AFR2@@, float, "%.2f" - entry = lambdaValue, @@GAUGE_NAME_LAMBDA@@, float, "%.2f" entry = lambdaValue2, @@GAUGE_NAME_LAMBDA2@@, float, "%.2f" - entry = VBatt, @@GAUGE_NAME_VBAT@@, float, "%.2f" entry = fuelingLoad, @@GAUGE_NAME_FUEL_LOAD@@, float, "%.1f" entry = ignitionLoad, @@GAUGE_NAME_IGNITION_LOAD@@, float, "%.1f" entry = ignitionAdvance, @@GAUGE_NAME_TIMING_ADVANCE@@, float, "%.2f" entry = knockLevel, @@GAUGE_NAME_KNOCK_LEVEL@@, float, "%.2f" - entry = vehicleSpeedKph, @@GAUGE_NAME_VVS@@, float, "%.2f" + entry = firmwareVersion, @@GAUGE_NAME_VERSION@@, int, "%d" entry = turboSpeed, @@GAUGE_NAME_TURBO_SPEED@@ int, "%d" entry = speedToRpmRatio, "s2rpm", float, "%.3f" - entry = rpmAcceleration, "dRPM", int, "%d" entry = massAirFlowValue,@@GAUGE_NAME_AIR_FLOW@@, float, "%.3f" entry = chargeAirMass, @@GAUGE_NAME_AIR_MASS@@, float, "%.3f" - entry = throttlePedalPosition, @@GAUGE_NAME_THROTTLE_PEDAL@@, float, "%.3f" entry = wastegatePositionSensor, @@GAUGE_NAME_WG_POSITION@@, float, "%.3f" entry = totalTriggerErrorCounter, @@GAUGE_NAME_TRG_ERR@@,int, "%d" entry = idleAirValvePosition, @@GAUGE_NAME_IAC@@, float, "%.3f" @@ -1350,7 +1360,6 @@ gaugeCategory = DynoView entry = sparkDwellValue, @@GAUGE_COIL_DWELL_TIME@@, float,"%.3f" - entry = vvtPositionB1I, @@GAUGE_NAME_VVT_B1I@@, float, "%.1f" entry = vvtPositionB1E, @@GAUGE_NAME_VVT_B1E@@, float, "%.1f" entry = vvtPositionB2I, @@GAUGE_NAME_VVT_B2I@@, float, "%.1f" entry = vvtPositionB2E, @@GAUGE_NAME_VVT_B2E@@, float, "%.1f" @@ -1389,8 +1398,7 @@ gaugeCategory = DynoView entry = recentErrorCode6, "error 6",int,"%d", { !enableLogErrorList } entry = recentErrorCode7, "error 7",int,"%d", { !enableLogErrorList } entry = recentErrorCode8, "error 8",int,"%d", { !enableLogErrorList } - entry = internalMcuTemperature, @@GAUGE_NAME_CPU_TEMP@@,float,"%.2f" - + entry = tCharge, "tCharge",float,"%.3f" entry = clutchUpState, @@INDICATOR_NAME_CLUTCH_UP@@,int,"%d" diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index 7e40aca3fd..5c20883a5e 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/DataLogConsumer.java b/java_tools/configuration_definition/src/main/java/com/rusefi/output/DataLogConsumer.java index 846646d1a0..cfee656007 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/output/DataLogConsumer.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/output/DataLogConsumer.java @@ -55,6 +55,8 @@ public class DataLogConsumer implements ConfigurationConsumer { } private String handle(ConfigField configField) { + if (configField.getName().contains("unused")) + return ""; if (configField.isBit()) { return ""; } @@ -75,7 +77,10 @@ public class DataLogConsumer implements ConfigurationConsumer { } String comment = state.variableRegistry.applyVariables(configField.getComment()); - if (comment.isEmpty() || comment.charAt(0) != '"') + if (comment.isEmpty()) + comment = configField.getName(); + + if (comment.charAt(0) != '"') comment = quote(comment); return "entry = " + configField.getName() + ", " + comment + ", " + typeString + "\n"; diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/test/OutputsTest.java b/java_tools/configuration_definition/src/main/java/com/rusefi/test/OutputsTest.java index e611b4a98b..17cee94411 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/test/OutputsTest.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/test/OutputsTest.java @@ -69,9 +69,10 @@ public class OutputsTest { String test = "struct total\n" + "float afr_type;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" + "uint16_t autoscale speedToRpmRatio;s2rpm;\"value\",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0\n" + - "uint8_t afr_typet;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" + + "uint8_t afr_typet;;\"ms\", 1, 0, 0, 3000, 0\n" + "uint8_t autoscale vehicleSpeedKph;;\"kph\",1, 0, 0, 0, 0\n" + "bit isForcedInduction;Does the vehicle have a turbo or supercharger?\n" + + "\tuint8_t unused37;;\"\",1, 0, 0, 0, 0\n" + "bit enableFan1WithAc;+Turn on this fan when AC is on.\n" + "end_struct\n"; ReaderState state = new ReaderState(); @@ -82,8 +83,8 @@ public class OutputsTest { state.readBufferedReader(reader, Collections.singletonList(dataLogConsumer)); assertEquals("entry = afr_type, \"PID dTime\", float, \"%.3f\"\n" + "entry = speedToRpmRatio, \"s2rpm\", float, \"%.3f\"\n" + - "entry = afr_typet, \"PID dTime\", int, \"%d\"\n" + - "entry = vehicleSpeedKph, \"\", int, \"%d\"\n", new String(dataLogConsumer.getTsWriter().toCharArray())); + "entry = afr_typet, \"afr_typet\", int, \"%d\"\n" + + "entry = vehicleSpeedKph, \"vehicleSpeedKph\", int, \"%d\"\n", new String(dataLogConsumer.getTsWriter().toCharArray())); } }