From af87bf7e1ed6e14c8e615db93714195dd108cf4a Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 12 Mar 2019 21:48:28 -0400 Subject: [PATCH] fuel gauges unification --- firmware/console/status_loop.cpp | 6 +- firmware/controllers/algo/rusefi_generated.h | 7 +- firmware/integration/rusefi_config.txt | 7 +- firmware/tunerstudio/rusefi.ini | 10 +-- firmware/tunerstudio/rusefi.input | 14 ++-- .../models/src/com/rusefi/config/Fields.java | 9 ++- .../models/src/com/rusefi/core/Sensor.java | 64 +++++++++---------- .../src/com/rusefi/core/SensorCategory.java | 2 + .../src/com/rusefi/core/SensorCentral.java | 13 ++-- .../ui/src/com/rusefi/SensorLogger.java | 6 +- .../ui/src/com/rusefi/ui/FormulasPane.java | 8 +-- .../ui/src/com/rusefi/ui/GaugesPanel.java | 18 +++--- 12 files changed, 84 insertions(+), 80 deletions(-) diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 158b5dca5b..b47dd6f472 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -270,7 +270,7 @@ static void printSensors(Logging *log, bool fileFormat) { reportSensorF(log, fileFormat, GAUGE_NAME_TCHARGE, "K", engine->engineState.tChargeK, 2); // log column #8 if (hasMapSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) { - reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_VR, "%", engine->engineState.currentVE * PERCENT_MULT, 2); + reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_VE, "%", engine->engineState.currentVE * PERCENT_MULT, 2); } reportSensorF(log, fileFormat, GAUGE_NAME_VVT, "deg", engine->triggerCentral.vvtPosition, 1); @@ -289,8 +289,8 @@ static void printSensors(Logging *log, bool fileFormat) { reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_RUNNING, "ms", ENGINE(engineState.runningFuel), 2); reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_PID_CORR, "ms", ENGINE(engineState.fuelPidCorrection), 2); - reportSensorF(log, fileFormat, "f: wall amt", "v", ENGINE(wallFuel).getWallFuel(0), 2); - reportSensorF(log, fileFormat, "f: wall crr", "v", ENGINE(wallFuelCorrection), 2); + reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_WALL_AMOUNT, "v", ENGINE(wallFuel).getWallFuel(0), 2); + reportSensorF(log, fileFormat, GAUGE_NAME_FUEL_WALL_CORRECTION, "v", ENGINE(wallFuelCorrection), 2); reportSensorI(log, fileFormat, GAUGE_NAME_VERSION, "#", getRusEfiVersion()); diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index 4e27b0d2e6..d2dc12e738 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -1822,11 +1822,14 @@ #define GAUGE_NAME_FUEL_EL_EXTRA "fuel: engine load acceleration extra fuel" #define GAUGE_NAME_FUEL_CLT_CORR "fuel: CLT correction" #define GAUGE_NAME_FUEL_IAT_CORR "fuel: IAT correction" -#define GAUGE_NAME_FUEL_VR "fuel: VE" +#define GAUGE_NAME_FUEL_VE "fuel: VE" +#define GAUGE_NAME_FUEL_CRANKING "fuel: cranking" #define GAUGE_NAME_FUEL_RUNNING "fuel: running" #define GAUGE_NAME_FUEL_LAST_INJECTION "fuel: last injection" #define GAUGE_NAME_FUEL_BASE "fuel: base" -#define GAUGE_NAME_FUEL_PID_CORR "fuel: correction" +#define GAUGE_NAME_FUEL_PID_CORR "fuel: short correction" +#define GAUGE_NAME_FUEL_WALL_AMOUNT "fuel: wall amount" +#define GAUGE_NAME_FUEL_WALL_CORRECTION "fuel: wall corr ms" #define GAUGE_NAME_FUEL_INJ_DUTY "fuel: injector duty cycle" #define GAUGE_NAME_TCHARGE "fuel: SD tCharge" #define GAUGE_NAME_TARGET_AFR "fuel: target AFR" diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 34989e42db..25681c8eb1 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -1102,11 +1102,14 @@ end_struct #define GAUGE_NAME_FUEL_EL_EXTRA "fuel: engine load acceleration extra fuel" #define GAUGE_NAME_FUEL_CLT_CORR "fuel: CLT correction" #define GAUGE_NAME_FUEL_IAT_CORR "fuel: IAT correction" -#define GAUGE_NAME_FUEL_VR "fuel: VE" +#define GAUGE_NAME_FUEL_VE "fuel: VE" +#define GAUGE_NAME_FUEL_CRANKING "fuel: cranking" #define GAUGE_NAME_FUEL_RUNNING "fuel: running" #define GAUGE_NAME_FUEL_LAST_INJECTION "fuel: last injection" #define GAUGE_NAME_FUEL_BASE "fuel: base" -#define GAUGE_NAME_FUEL_PID_CORR "fuel: correction" +#define GAUGE_NAME_FUEL_PID_CORR "fuel: short correction" +#define GAUGE_NAME_FUEL_WALL_AMOUNT "fuel: wall amount" +#define GAUGE_NAME_FUEL_WALL_CORRECTION "fuel: wall corr ms" #define GAUGE_NAME_FUEL_INJ_DUTY "fuel: injector duty cycle" #define GAUGE_NAME_TCHARGE "fuel: SD tCharge" diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 6d6ffaf368..67d4ed1ac0 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -63,7 +63,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Mar 12 20:32:30 EDT 2019 +; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Mar 12 21:36:19 EDT 2019 pageSize = 20000 page = 1 @@ -1057,7 +1057,7 @@ fileVersion = { 20171101 } baroPressure = scalar, F32, 36, "pres", 1, 0.0; MAPValue = scalar, F32, 40, "MAP", 1, 0.0; ; total fuel squirt duration (in MS) per engine cycle according to current CLT - crankingFuel = scalar, F32, 44, "ms", 1, 0.0; + crankingFuelMs = scalar, F32, 44, "ms", 1, 0.0; baseFuel = scalar, F32, 48, "ms", 1, 0 tCharge = scalar, F32, 52, "T", 1, 0.0; ignitionAdvance = scalar, F32, 56, "deg", 1, 0.0; @@ -1704,7 +1704,7 @@ gaugeCategory = Accel Data gaugeCategory = Fuel Data - crankingFuelGauge = crankingFuel, "fuel: crank Width", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 + crankingFuelGauge = crankingFuelMs, "fuel: cranking", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 iatCorrectionGauge = iatCorrection, "fuel: IAT correction", "mult", 0, 3, 0, 0, 3, 3, 2, 2 cltCorrectionGauge = cltCorrection, "fuel: CLT correction", "mult", 0, 3, 0, 0, 3, 3, 2, 2 injectorDutyCycleGauge=injectorDutyCycle, "fuel: injector duty cycle","%", 0, 120, 10, 10, 100, 100, 1, 1 @@ -1713,7 +1713,7 @@ gaugeCategory = Fuel Data injectorLagMsGauge = injectorLagMs, "fuel: injector lag", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 fuelRunningGauge = fuelRunning, "fuel: running", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 baseFuelGauge = baseFuel, "fuel: base", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 - fuelPidCorrectionGauge = fuelPidCorrection, "fuel: correction", "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1 + fuelPidCorrectionGauge = fuelPidCorrection, "fuel: short correction", "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1 [WueAnalyze] @@ -1823,7 +1823,7 @@ gaugeCategory = Fuel Data entry = fuelRunning, "fuel: running", float, "%.3f" entry = actualLastInjection, "fuel: last injection", float, "%.3f" entry = baseFuel, "fuel: base", float, "%.2f" - entry = fuelPidCorrection,"fuel: pid", float, "%.2f" + entry = fuelPidCorrection,"fuel: short correction", float, "%.2f" entry = veValue, "fuel: VE", float, "%.3f" entry = injectorDutyCycle,"fuel: injector duty cycle",float,"%.3f" entry = coilDutyCycle, "dwell: coil duty cycle", float,"%.3f" diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index bf08922145..147a65cab3 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -169,7 +169,7 @@ fileVersion = { 20171101 } baroPressure = scalar, F32, 36, "pres", 1, 0.0; MAPValue = scalar, F32, 40, "MAP", 1, 0.0; ; total fuel squirt duration (in MS) per engine cycle according to current CLT - crankingFuel = scalar, F32, 44, "ms", 1, 0.0; + crankingFuelMs = scalar, F32, 44, "ms", 1, 0.0; baseFuel = scalar, F32, 48, "ms", 1, 0 tCharge = scalar, F32, 52, "T", 1, 0.0; ignitionAdvance = scalar, F32, 56, "deg", 1, 0.0; @@ -816,7 +816,7 @@ gaugeCategory = Accel Data gaugeCategory = Fuel Data - crankingFuelGauge = crankingFuel, "fuel: crank Width", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 + crankingFuelGauge = crankingFuelMs, @@GAUGE_NAME_FUEL_CRANKING@@, "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 iatCorrectionGauge = iatCorrection, @@GAUGE_NAME_FUEL_IAT_CORR@@, "mult", 0, 3, 0, 0, 3, 3, 2, 2 cltCorrectionGauge = cltCorrection, @@GAUGE_NAME_FUEL_CLT_CORR@@, "mult", 0, 3, 0, 0, 3, 3, 2, 2 injectorDutyCycleGauge=injectorDutyCycle, @@GAUGE_NAME_FUEL_INJ_DUTY@@,"%", 0, 120, 10, 10, 100, 100, 1, 1 @@ -934,9 +934,9 @@ gaugeCategory = Fuel Data entry = injectorLagMs, @@GAUGE_NAME_INJECTOR_LAG@@, float, "%.3f" entry = fuelRunning, @@GAUGE_NAME_FUEL_RUNNING@@, float, "%.3f" entry = actualLastInjection, @@GAUGE_NAME_FUEL_LAST_INJECTION@@, float, "%.3f" - entry = baseFuel, "fuel: base", float, "%.2f" - entry = fuelPidCorrection,"fuel: pid", float, "%.2f" - entry = veValue, @@GAUGE_NAME_FUEL_VR@@, float, "%.3f" + entry = baseFuel, @@GAUGE_NAME_FUEL_BASE@@, float, "%.2f" + entry = fuelPidCorrection,@@GAUGE_NAME_FUEL_PID_CORR@@, float, "%.2f" + entry = veValue, @@GAUGE_NAME_FUEL_VE@@, float, "%.3f" entry = injectorDutyCycle,@@GAUGE_NAME_FUEL_INJ_DUTY@@,float,"%.3f" entry = coilDutyCycle, @@GAUGE_NAME_DWELL_DUTY@@, float,"%.3f" entry = currentTargetAfr,@@GAUGE_NAME_TARGET_AFR@@, float,"%.3f" @@ -958,8 +958,8 @@ gaugeCategory = Fuel Data entry = deltaTps, "fuel: TPS change",float, "%.3f" entry = tpsAccelFuel, @@GAUGE_NAME_FUEL_TPS_EXTRA@@, float, "%.3f" - entry = wallFuelCorrection,"fuel: wall corr ms", float, "%.3f" - entry = wallFuelAmount, "fuel: wall amount", float, "%.3f" + entry = wallFuelCorrection,@@GAUGE_NAME_FUEL_WALL_CORRECTION@@, float, "%.3f" + entry = wallFuelAmount, @@GAUGE_NAME_FUEL_WALL_AMOUNT@@, float, "%.3f" entry = baroCorrection, "baroCorrection",float,"%.3f" entry = iatCorrection, @@GAUGE_NAME_FUEL_IAT_CORR@@, float, "%.3f" diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index e168e534d0..d195620864 100644 --- a/java_console/models/src/com/rusefi/config/Fields.java +++ b/java_console/models/src/com/rusefi/config/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config; -// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Mar 12 13:29:56 EDT 2019 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Mar 12 21:36:19 EDT 2019 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int BLOCKING_FACTOR = 400; @@ -1161,11 +1161,14 @@ public class Fields { public static final String GAUGE_NAME_FUEL_EL_EXTRA = "fuel: engine load acceleration extra fuel"; public static final String GAUGE_NAME_FUEL_CLT_CORR = "fuel: CLT correction"; public static final String GAUGE_NAME_FUEL_IAT_CORR = "fuel: IAT correction"; - public static final String GAUGE_NAME_FUEL_VR = "fuel: VE"; + public static final String GAUGE_NAME_FUEL_VE = "fuel: VE"; + public static final String GAUGE_NAME_FUEL_CRANKING = "fuel: cranking"; public static final String GAUGE_NAME_FUEL_RUNNING = "fuel: running"; public static final String GAUGE_NAME_FUEL_LAST_INJECTION = "fuel: last injection"; public static final String GAUGE_NAME_FUEL_BASE = "fuel: base"; - public static final String GAUGE_NAME_FUEL_PID_CORR = "fuel: correction"; + public static final String GAUGE_NAME_FUEL_PID_CORR = "fuel: short correction"; + public static final String GAUGE_NAME_FUEL_WALL_AMOUNT = "fuel: wall amount"; + public static final String GAUGE_NAME_FUEL_WALL_CORRECTION = "fuel: wall corr ms"; public static final String GAUGE_NAME_FUEL_INJ_DUTY = "fuel: injector duty cycle"; public static final String GAUGE_NAME_TCHARGE = "fuel: SD tCharge"; public static final String GAUGE_NAME_TARGET_AFR = "fuel: target AFR"; diff --git a/java_console/models/src/com/rusefi/core/Sensor.java b/java_console/models/src/com/rusefi/core/Sensor.java index f047219b4a..824aaa40ad 100644 --- a/java_console/models/src/com/rusefi/core/Sensor.java +++ b/java_console/models/src/com/rusefi/core/Sensor.java @@ -79,8 +79,6 @@ public enum Sensor { IDLE_SWITCH("idle switch", SensorCategory.OTHERS), - DEFAULT_FUEL("map fuel", SensorCategory.FUEL, "ms", 0, 40), - CHARTSIZE("CHARTSIZE", SensorCategory.OTHERS), CHART_STATUS("CHART_STATUS", SensorCategory.OTHERS), ADC_STATUS("ADC_STATUS", SensorCategory.OTHERS), @@ -92,51 +90,46 @@ public enum Sensor { INJECTOR_3_DWELL("inj #3", SensorCategory.SNIFFING), INJECTOR_4_DWELL("inj #4", SensorCategory.SNIFFING), - FUEL("Fuel", SensorCategory.FUEL, "ms", 0, 30), - FUEL_IAT("F IAT", SensorCategory.FUEL, "", 0, 10), - FUEL_CLT("F CLT", SensorCategory.FUEL, "", 0, 10), - FUEL_LAG("F Lag", SensorCategory.FUEL, "", 0, 30), - IAT(SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 8, BackgroundColor.WHITE, -40, 150, "C"), TPS(SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 12, BackgroundColor.MUD, 0, 100, "%"), // throttle position sensor - CRANKING_BASE(SensorCategory.FUEL, FieldType.FLOAT, 44, BackgroundColor.MUD, 0, 30, "ms"), - FUEL_BASE(Fields.GAUGE_NAME_FUEL_BASE, SensorCategory.FUEL, FieldType.FLOAT, 48, BackgroundColor.MUD, 0, 30, "ms"), - T_CHARGE(SensorCategory.FUEL, FieldType.FLOAT, 52, BackgroundColor.MUD, 30, 140), + crankingFuel(GAUGE_NAME_FUEL_CRANKING, SensorCategory.FUEL, FieldType.FLOAT, 44, BackgroundColor.MUD, 0, 30, "ms"), + baseFuel(Fields.GAUGE_NAME_FUEL_BASE, SensorCategory.FUEL, FieldType.FLOAT, 48, BackgroundColor.MUD, 0, 30, "ms"), + tCharge(GAUGE_NAME_TCHARGE, SensorCategory.FUEL, FieldType.FLOAT, 52, BackgroundColor.MUD, 30, 140), // todo: unify with TIMING ignitionAdvance(SensorCategory.OPERATIONS, FieldType.FLOAT, 56, BackgroundColor.MUD, 30, 140), DWELL(Fields.GAUGE_COIL_DWELL_TIME, SensorCategory.OPERATIONS, FieldType.FLOAT, 60, BackgroundColor.MUD, 1, 10), - actualLastInjection(SensorCategory.FUEL, FieldType.FLOAT, /*offset */ 64, BackgroundColor.MUD, 0, 30, "ms"), - debugFloatField1(GAUGE_NAME_DEBUG_F1, SensorCategory.OPERATIONS, FieldType.FLOAT, 68, BackgroundColor.MUD, 0, 5), + actualLastInjection(GAUGE_NAME_FUEL_LAST_INJECTION, SensorCategory.FUEL, FieldType.FLOAT, /*offset */ 64, BackgroundColor.MUD, 0, 30, "ms"), + debugFloatField1(GAUGE_NAME_DEBUG_F1, SensorCategory.DEBUG, FieldType.FLOAT, 68, BackgroundColor.MUD, 0, 5), VSS(SensorCategory.OPERATIONS, FieldType.FLOAT, 76, BackgroundColor.BLUE), FIRMWARE_VERSION(SensorCategory.OPERATIONS, FieldType.INT, 84, BackgroundColor.BLUE), - CURRENT_VE(SensorCategory.FUEL, FieldType.FLOAT, 112, BackgroundColor.MUD), + veValue(GAUGE_NAME_FUEL_VE, SensorCategory.FUEL, FieldType.FLOAT, 112, BackgroundColor.MUD), deltaTps(SensorCategory.FUEL, FieldType.FLOAT, 116, BackgroundColor.MUD), engineLoadAccelDelta(SensorCategory.FUEL, FieldType.FLOAT, 124, BackgroundColor.MUD), tpsAccelFuel(Fields.GAUGE_NAME_FUEL_TPS_EXTRA, SensorCategory.FUEL, FieldType.FLOAT, 128, BackgroundColor.MUD), PPS("pedal", SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 136, BackgroundColor.MUD), // pedal position sensor - injectorDutyCycle(Fields.GAUGE_NAME_FUEL_INJ_DUTY, SensorCategory.OPERATIONS, FieldType.FLOAT, 140, BackgroundColor.MUD), - wallFuelAmount(SensorCategory.FUEL, FieldType.FLOAT, 160, BackgroundColor.MUD), - iatCorrection(SensorCategory.FUEL, FieldType.FLOAT, 164, BackgroundColor.MUD, 0, 5), - wallFuelCorrection(SensorCategory.FUEL, FieldType.FLOAT, 168, BackgroundColor.MUD), + injectorDutyCycle(Fields.GAUGE_NAME_FUEL_INJ_DUTY, SensorCategory.FUEL, FieldType.FLOAT, 140, BackgroundColor.MUD), + wallFuelAmount(GAUGE_NAME_FUEL_WALL_AMOUNT, SensorCategory.FUEL, FieldType.FLOAT, 160, BackgroundColor.MUD), + iatCorrection(GAUGE_NAME_FUEL_IAT_CORR, SensorCategory.FUEL, FieldType.FLOAT, 164, BackgroundColor.MUD, 0, 5), + wallFuelCorrection(GAUGE_NAME_FUEL_WALL_CORRECTION, SensorCategory.FUEL, FieldType.FLOAT, 168, BackgroundColor.MUD), idlePosition(SensorCategory.OPERATIONS, FieldType.FLOAT, 172, BackgroundColor.MUD), TARGET_AFR(SensorCategory.OPERATIONS, FieldType.FLOAT, 176, BackgroundColor.MUD), CHARGE_AIR_MASS(SensorCategory.OPERATIONS, FieldType.FLOAT, 180, BackgroundColor.MUD), - cltCorrection(SensorCategory.OPERATIONS, FieldType.FLOAT, 184, BackgroundColor.MUD, 0, 5), - runningFuel(SensorCategory.FUEL, FieldType.FLOAT, 188, BackgroundColor.MUD, 0, 15, "ms"), - debugIntField1(GAUGE_NAME_DEBUG_I1, SensorCategory.OPERATIONS, FieldType.INT, 192, BackgroundColor.MUD, 0, 5), - injectorLagMs(SensorCategory.FUEL, FieldType.FLOAT, 196, BackgroundColor.MUD, 0, 15, "ms"), + cltCorrection(GAUGE_NAME_FUEL_CLT_CORR, SensorCategory.FUEL, FieldType.FLOAT, 184, BackgroundColor.MUD, 0, 5), + runningFuel(GAUGE_NAME_FUEL_RUNNING, SensorCategory.FUEL, FieldType.FLOAT, 188, BackgroundColor.MUD, 0, 15, "ms"), + debugIntField1(GAUGE_NAME_DEBUG_I1, SensorCategory.DEBUG, FieldType.INT, 192, BackgroundColor.MUD, 0, 5), + injectorLagMs(GAUGE_NAME_INJECTOR_LAG, SensorCategory.FUEL, FieldType.FLOAT, 196, BackgroundColor.MUD, 0, 15, "ms"), - debugFloatField2(GAUGE_NAME_DEBUG_F2, SensorCategory.OPERATIONS, FieldType.FLOAT, 200, BackgroundColor.MUD, 0, 5), - debugFloatField3(GAUGE_NAME_DEBUG_F3, SensorCategory.OPERATIONS, FieldType.FLOAT, 204, BackgroundColor.MUD, 0, 5), - debugFloatField4(GAUGE_NAME_DEBUG_F4, SensorCategory.OPERATIONS, FieldType.FLOAT, 208, BackgroundColor.MUD, 0, 5), - debugFloatField5(GAUGE_NAME_DEBUG_F5, SensorCategory.OPERATIONS, FieldType.FLOAT, 212, BackgroundColor.MUD, 0, 5), - debugIntField2(GAUGE_NAME_DEBUG_I2, SensorCategory.OPERATIONS, FieldType.INT, 216, BackgroundColor.MUD, 0, 5), - debugIntField3(GAUGE_NAME_DEBUG_I3, SensorCategory.OPERATIONS, FieldType.INT, 220, BackgroundColor.MUD, 0, 5), + debugFloatField2(GAUGE_NAME_DEBUG_F2, SensorCategory.DEBUG, FieldType.FLOAT, 200, BackgroundColor.MUD, 0, 5), + debugFloatField3(GAUGE_NAME_DEBUG_F3, SensorCategory.DEBUG, FieldType.FLOAT, 204, BackgroundColor.MUD, 0, 5), + debugFloatField4(GAUGE_NAME_DEBUG_F4, SensorCategory.DEBUG, FieldType.FLOAT, 208, BackgroundColor.MUD, 0, 5), + debugFloatField5(GAUGE_NAME_DEBUG_F5, SensorCategory.DEBUG, FieldType.FLOAT, 212, BackgroundColor.MUD, 0, 5), + debugIntField2(GAUGE_NAME_DEBUG_I2, SensorCategory.DEBUG, FieldType.INT, 216, BackgroundColor.MUD, 0, 5), + debugIntField3(GAUGE_NAME_DEBUG_I3, SensorCategory.DEBUG, FieldType.INT, 220, BackgroundColor.MUD, 0, 5), - errorCodeCounter(SensorCategory.OPERATIONS, FieldType.INT, 236, BackgroundColor.MUD, 0, 5), - lastErrorCode(SensorCategory.OPERATIONS, FieldType.INT, 240, BackgroundColor.MUD, 0, 5), + errorCodeCounter(SensorCategory.STATUS, FieldType.INT, 236, BackgroundColor.MUD, 0, 5), + lastErrorCode(SensorCategory.STATUS, FieldType.INT, 240, BackgroundColor.MUD, 0, 5), RPM(SensorCategory.SENSOR_INPUTS, FieldType.INT, 0, BackgroundColor.RED, 0, 8000), TIME_SECONDS(SensorCategory.OPERATIONS, FieldType.INT, 224, BackgroundColor.MUD, 0, 5), @@ -145,12 +138,13 @@ public enum Sensor { vvtPosition(SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 248, BackgroundColor.MUD, 0, 5), engineMode(SensorCategory.OPERATIONS, FieldType.INT, 252, BackgroundColor.MUD, 0, 5), - debugFloatField6(GAUGE_NAME_DEBUG_F6, SensorCategory.OPERATIONS, FieldType.FLOAT, 256, BackgroundColor.MUD, 0, 5), - debugFloatField7(GAUGE_NAME_DEBUG_F7, SensorCategory.OPERATIONS, FieldType.FLOAT, 260, BackgroundColor.MUD, 0, 5), + debugFloatField6(GAUGE_NAME_DEBUG_F6, SensorCategory.DEBUG, FieldType.FLOAT, 256, BackgroundColor.MUD, 0, 5), + debugFloatField7(GAUGE_NAME_DEBUG_F7, SensorCategory.DEBUG, FieldType.FLOAT, 260, BackgroundColor.MUD, 0, 5), + fuelPidCorrection(SensorCategory.FUEL, FieldType.FLOAT, 268, BackgroundColor.MUD), coilDutyCycle(Fields.GAUGE_NAME_DWELL_DUTY, SensorCategory.OPERATIONS, FieldType.FLOAT, 272, BackgroundColor.MUD), - debugIntField4("debug i4", SensorCategory.OPERATIONS, FieldType.INT16, 292, BackgroundColor.MUD, 0, 5), - debugIntField5("debug i5", SensorCategory.OPERATIONS, FieldType.INT16, 294, BackgroundColor.MUD, 0, 5), + debugIntField4("debug i4", SensorCategory.DEBUG, FieldType.INT16, 292, BackgroundColor.MUD, 0, 5), + debugIntField5("debug i5", SensorCategory.DEBUG, FieldType.INT16, 294, BackgroundColor.MUD, 0, 5), INJ_1_2_DELTA("inj 1-2 delta", SensorCategory.SNIFFING), INJ_3_4_DELTA("inj 3-4 delta", SensorCategory.SNIFFING), @@ -199,18 +193,18 @@ public enum Sensor { /** * Text-based protocol is not very alive - * @param name - * @param category */ @Deprecated Sensor(String name, SensorCategory category) { this(name, category, "", 255); } + @Deprecated Sensor(String name, SensorCategory category, String units, double maxValue) { this(name, category, units, 0, maxValue); } + @Deprecated Sensor(String name, SensorCategory category, String units, double minValue, double maxValue) { this(name, category, units, minValue, maxValue, BackgroundColor.LIGHT_GRAY); } diff --git a/java_console/models/src/com/rusefi/core/SensorCategory.java b/java_console/models/src/com/rusefi/core/SensorCategory.java index 9719a72f74..0a211391e3 100644 --- a/java_console/models/src/com/rusefi/core/SensorCategory.java +++ b/java_console/models/src/com/rusefi/core/SensorCategory.java @@ -5,6 +5,8 @@ public enum SensorCategory { FUEL("Fuel-related"), SNIFFING("Sniffing"), SENSOR_INPUTS("Sensor inputs"), + DEBUG("Debug"), + STATUS("Status"), OTHERS("Others"); private final String name; diff --git a/java_console/models/src/com/rusefi/core/SensorCentral.java b/java_console/models/src/com/rusefi/core/SensorCentral.java index 69424f2414..6a59feb275 100644 --- a/java_console/models/src/com/rusefi/core/SensorCentral.java +++ b/java_console/models/src/com/rusefi/core/SensorCentral.java @@ -125,14 +125,13 @@ public class SensorCentral implements ISensorCentral { addDoubleSensor(Sensor.knockCount, es); addDoubleSensor(Sensor.KnockValue, es); - addDoubleSensor("tch", Sensor.T_CHARGE, es); + addDoubleSensor("tch", Sensor.tCharge, es); addDoubleSensor(Sensor.AFR, es); - addDoubleSensor("d_fuel", Sensor.DEFAULT_FUEL, es); - addDoubleSensor(Sensor.FUEL, es); - addDoubleSensor(Sensor.FUEL_BASE, es); - addDoubleSensor(Sensor.FUEL_LAG, es); - addDoubleSensor(Sensor.FUEL_CLT, es); - addDoubleSensor(Sensor.FUEL_IAT, es); + addDoubleSensor(Sensor.runningFuel, es); + addDoubleSensor(Sensor.baseFuel, es); + addDoubleSensor(Sensor.injectorLagMs, es); + addDoubleSensor(Sensor.cltCorrection, es); + addDoubleSensor(Sensor.iatCorrection, es); addDoubleSensor(Sensor.TABLE_SPARK, es); addDoubleSensor(Sensor.VREF, es); addDoubleSensor(Sensor.VBATT, es); diff --git a/java_console/ui/src/com/rusefi/SensorLogger.java b/java_console/ui/src/com/rusefi/SensorLogger.java index ebb0b7f7a9..5ba09c2cca 100644 --- a/java_console/ui/src/com/rusefi/SensorLogger.java +++ b/java_console/ui/src/com/rusefi/SensorLogger.java @@ -38,14 +38,14 @@ public class SensorLogger { Sensor.idlePosition, Sensor.TARGET_AFR, - Sensor.T_CHARGE, - Sensor.CURRENT_VE, + Sensor.tCharge, + Sensor.veValue, Sensor.ENGINE_LOAD, Sensor.DWELL, Sensor.TIMING, - Sensor.FUEL_BASE, + Sensor.baseFuel, Sensor.actualLastInjection, Sensor.ignitionAdvance, diff --git a/java_console/ui/src/com/rusefi/ui/FormulasPane.java b/java_console/ui/src/com/rusefi/ui/FormulasPane.java index be9e890d52..2e2aae5821 100644 --- a/java_console/ui/src/com/rusefi/ui/FormulasPane.java +++ b/java_console/ui/src/com/rusefi/ui/FormulasPane.java @@ -116,7 +116,7 @@ public class FormulasPane { double rpm = SensorCentral.getInstance().getValue(Sensor.RPM); double maf = SensorCentral.getInstance().getValue(Sensor.MAF); - String baseFuelStr = twoDecimals(Sensor.FUEL_BASE); + String baseFuelStr = twoDecimals(Sensor.baseFuel); String baseFuel = "$Table_Fuel (ms) = lookup (" + "(RPM = " + rpm + ", " + "MAF = " + maf + ") = " + @@ -179,11 +179,11 @@ public class FormulasPane { private String getSpeedDensity(ConfigurationImage ci, String acceleration) { String IAT = oneDecimal(Sensor.IAT); String MAP = oneDecimal(Sensor.MAP); - String T_CHARGE = oneDecimal(Sensor.T_CHARGE); + String T_CHARGE = oneDecimal(Sensor.tCharge); double rpm = SensorCentral.getInstance().getValue(Sensor.RPM); String RPM = "" + (int) rpm; - String VE = twoDecimals(Sensor.CURRENT_VE); + String VE = twoDecimals(Sensor.veValue); String TARGET_AFR = twoDecimals(Sensor.TARGET_AFR); String tpsStr = oneDecimal(Sensor.TPS); String chargeAirMass = String.format("%.3fgm", SensorCentral.getInstance().getValue(Sensor.CHARGE_AIR_MASS)); @@ -205,7 +205,7 @@ public class FormulasPane { chargeAirMass + "$"; - String baseFuelStr = twoDecimals(Sensor.FUEL_BASE); + String baseFuelStr = twoDecimals(Sensor.baseFuel); String baseFuel = "$SD_Fuel (ms) = \\frac{" + "($Airmass = " + chargeAirMass + ")" + "}{" + diff --git a/java_console/ui/src/com/rusefi/ui/GaugesPanel.java b/java_console/ui/src/com/rusefi/ui/GaugesPanel.java index 01f47e43c9..fb0a36ef4b 100644 --- a/java_console/ui/src/com/rusefi/ui/GaugesPanel.java +++ b/java_console/ui/src/com/rusefi/ui/GaugesPanel.java @@ -35,21 +35,20 @@ public class GaugesPanel { Sensor.TPS, Sensor.MAP, Sensor.MAP_RAW, - Sensor.T_CHARGE, + Sensor.tCharge, Sensor.DWELL1, Sensor.DWELL0, Sensor.DUTY0, Sensor.ADVANCE0, - Sensor.FUEL, Sensor.BARO, - Sensor.FUEL_CLT, - Sensor.FUEL_IAT, - Sensor.FUEL_LAG, + Sensor.baseFuel, + Sensor.cltCorrection, + Sensor.iatCorrection, + Sensor.injectorLagMs, + Sensor.lastErrorCode, Sensor.AFR, - Sensor.DEFAULT_FUEL, Sensor.TIMING, Sensor.VREF - }; private static final String GAUGES_ROWS = "gauges_rows"; private static final String GAUGES_COLUMNS = "gauges_cols"; @@ -60,8 +59,9 @@ public class GaugesPanel { public static boolean IS_PAUSED; // dirty but works for not static { - if (DEFAULT_LAYOUT.length != SizeSelectorPanel.WIDTH * SizeSelectorPanel.HEIGHT) - throw new IllegalStateException("Not expected " + DEFAULT_LAYOUT.length); + int expected = SizeSelectorPanel.WIDTH * SizeSelectorPanel.HEIGHT; + if (DEFAULT_LAYOUT.length != expected) + throw new IllegalStateException("Invalid gauges panel size " + DEFAULT_LAYOUT.length + " while " + expected + " expected"); } private final JPanel content = new JPanel(new BorderLayout());