From a74f74f0c4026032dff05ababc5934e996b3c91b Mon Sep 17 00:00:00 2001 From: rusEfi Date: Wed, 13 Jul 2016 19:03:06 -0400 Subject: [PATCH] auto-sync --- .../binary/tunerstudio_configuration.h | 3 ++- firmware/console/status_loop.cpp | 4 ++++ firmware/controllers/algo/engine.cpp | 1 + firmware/controllers/algo/engine.h | 2 ++ firmware/controllers/error_handling.cpp | 6 +++-- firmware/rusefi.cpp | 2 +- firmware/tunerstudio/rusefi.ini | 3 +++ .../runConfigurations/AverageAnglesUtil.xml | 22 +++++++++++++++++++ .../models/src/com/rusefi/core/Sensor.java | 6 +++++ java_console/ui/src/com/rusefi/Launcher.java | 2 +- .../ui/src/com/rusefi/SensorLogger.java | 9 ++++++++ 11 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 java_console/.idea/runConfigurations/AverageAnglesUtil.xml diff --git a/firmware/console/binary/tunerstudio_configuration.h b/firmware/console/binary/tunerstudio_configuration.h index f1d2b4edad..7a5706d09d 100644 --- a/firmware/console/binary/tunerstudio_configuration.h +++ b/firmware/console/binary/tunerstudio_configuration.h @@ -123,7 +123,8 @@ typedef struct { int timeSeconds; // 224 float engineLoadDelta; // 228 float speedToRpmRatio; // 232 - int unused3[10]; + int warningCounter; // 236 + int unused3[9]; } TunerStudioOutputChannels; #endif /* TUNERSTUDIO_CONFIGURATION_H_ */ diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 2d2d9fea3b..4fdc98ef2b 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -195,6 +195,8 @@ static void printSensors(Logging *log, bool fileFormat) { reportSensorF(log, fileFormat, "sp2rpm", "x", vehicleSpeed / rpm, 2); } + reportSensorI(log, fileFormat, "warn", "count", engine->engineState.warningCounter); + reportSensorF(log, fileFormat, "knck_c", "count", engine->knockCount, 0); reportSensorF(log, fileFormat, "knck_v", "v", engine->knockVolts, 2); @@ -701,6 +703,8 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->isIatError = !isValidIntakeAirTemperature(getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F)); #endif /* EFI_PROD_CODE */ + tsOutputChannels->warningCounter = engine->engineState.warningCounter; + tsOutputChannels->knockNowIndicator = engine->knockCount > 0; tsOutputChannels->knockEverIndicator = engine->knockEver; diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 64b504a2df..2f4fa8d7d2 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -133,6 +133,7 @@ EngineState::EngineState() { dwellAngle = 0; engineNoiseHipLevel = 0; injectorLag = 0; + warningCounter = 0; } void EngineState::updateSlowSensors(DECLARE_ENGINE_PARAMETER_F) { diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 62270b1cf3..e58b5c7ac5 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -122,6 +122,8 @@ public: float iat; float clt; + int warningCounter; + float airMass; float engineNoiseHipLevel; diff --git a/firmware/controllers/error_handling.cpp b/firmware/controllers/error_handling.cpp index 1e9b7cc6f4..6a79050581 100644 --- a/firmware/controllers/error_handling.cpp +++ b/firmware/controllers/error_handling.cpp @@ -10,6 +10,7 @@ #include "io_pins.h" #include "memstreams.h" #include "efilib2.h" +#include "engine.h" #if EFI_HD44780_LCD #include "lcd_HD44780.h" @@ -18,6 +19,8 @@ static time_t timeOfPreviousWarning = -10; static LoggingWithStorage logger("error handling"); +EXTERN_ENGINE; + #define WARNING_PREFIX "WARNING: " extern int warningEnabled; @@ -52,7 +55,6 @@ static char warningBuffer[WARNING_BUFFER_SIZE]; static bool isWarningStreamInitialized = false; static MemoryStream warningStream; -static int warningCounter = 0; /** * OBD_PCM_Processor_Fault is the general error code for now * @@ -67,7 +69,7 @@ int warning(obd_code_e code, const char *fmt, ...) { return true; // we just had another warning, let's not spam timeOfPreviousWarning = now; - warningCounter++; + engine->engineState.warningCounter++; resetLogging(&logger); // todo: is 'reset' really needed here? appendMsgPrefix(&logger); diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index e703b33c2a..2115514af6 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -298,5 +298,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20160707; + return 20160713; } diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 69d428b702..9a48adf7b3 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -841,6 +841,7 @@ fileVersion = { 20160702 } debugIntField3 = scalar, U32, 220, "val", 1, 0.0; engineLoadDelta = scalar,F32, 228, "value", 1, 0 speedToRpmRatio = scalar,F32, 232, "value", 1, 0 + warningCounter = scalar,U32, 236, "count", 1, 0 egoCorrection = { 100 } time = { timeNow } @@ -1130,6 +1131,7 @@ fileVersion = { 20160702 } debugIntField2Gauge = debugIntField2, "debug i2", "%", 0, 100, 0, 0, 100, 100, 0, 0 debugIntField3Gauge = debugIntField3, "debug i3", "%", 0, 100, 0, 0, 100, 100, 0, 0 speedToRpmRatioGauge = speedToRpmRatio, "speed2rpm", "", 0, 100, 0, 0, 100, 100, 4, 4 + warningCounterGauge = warningCounter, "warn", "", 0, 100, 0, 0, 100, 100, 0, 0 [FrontPage] @@ -1229,6 +1231,7 @@ fileVersion = { 20160702 } entry = debugIntField1, "debug i1",int,"%d" entry = debugIntField2, "debug i2",int,"%d" entry = debugIntField3, "debug i3",int,"%d" + entry = warningCounter, "warn",int,"%d" entry = tCharge, "tCharge",float,"%.3f" diff --git a/java_console/.idea/runConfigurations/AverageAnglesUtil.xml b/java_console/.idea/runConfigurations/AverageAnglesUtil.xml new file mode 100644 index 0000000000..c71b8ed91e --- /dev/null +++ b/java_console/.idea/runConfigurations/AverageAnglesUtil.xml @@ -0,0 +1,22 @@ + + + + + + + + \ No newline at end of file diff --git a/java_console/models/src/com/rusefi/core/Sensor.java b/java_console/models/src/com/rusefi/core/Sensor.java index 0338b126db..722ab57c26 100644 --- a/java_console/models/src/com/rusefi/core/Sensor.java +++ b/java_console/models/src/com/rusefi/core/Sensor.java @@ -92,6 +92,7 @@ public enum Sensor { T_CHARGE(SensorCategory.FUEL, FieldType.FLOAT, 52, BackgroundColor.MUD, 30, 140), DWELL(SensorCategory.OPERATIONS, FieldType.FLOAT, 60, BackgroundColor.MUD, 1, 10), actualLastInjection(SensorCategory.FUEL, FieldType.FLOAT, 64, BackgroundColor.MUD, 0, 30, "ms"), + debugFloatField1(SensorCategory.OPERATIONS, 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), @@ -108,12 +109,17 @@ public enum Sensor { CHARGE_AIR_MASS(SensorCategory.OPERATIONS, FieldType.FLOAT, 180, BackgroundColor.MUD), cltCorrection(SensorCategory.OPERATIONS, FieldType.FLOAT, 184, BackgroundColor.MUD, 0, 5), runningFuel(SensorCategory.OPERATIONS, FieldType.FLOAT, 188, BackgroundColor.MUD, 0, 15, "ms"), + debugIntField1(SensorCategory.OPERATIONS, FieldType.INT, 192, BackgroundColor.MUD, 0, 5), injectorLagMs(SensorCategory.FUEL, FieldType.FLOAT, 196, BackgroundColor.MUD, 0, 15, "ms"), debugFloatField2(SensorCategory.OPERATIONS, FieldType.FLOAT, 200, BackgroundColor.MUD, 0, 5), debugFloatField3(SensorCategory.OPERATIONS, FieldType.FLOAT, 204, BackgroundColor.MUD, 0, 5), debugFloatField4(SensorCategory.OPERATIONS, FieldType.FLOAT, 208, BackgroundColor.MUD, 0, 5), debugFloatField5(SensorCategory.OPERATIONS, FieldType.FLOAT, 212, BackgroundColor.MUD, 0, 5), + debugIntField2(SensorCategory.OPERATIONS, FieldType.INT, 216, BackgroundColor.MUD, 0, 5), + debugIntField3(SensorCategory.OPERATIONS, FieldType.INT, 220, BackgroundColor.MUD, 0, 5), + + warningCounter(SensorCategory.OPERATIONS, FieldType.INT, 236, 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), diff --git a/java_console/ui/src/com/rusefi/Launcher.java b/java_console/ui/src/com/rusefi/Launcher.java index d46fffa477..b8667b2e24 100644 --- a/java_console/ui/src/com/rusefi/Launcher.java +++ b/java_console/ui/src/com/rusefi/Launcher.java @@ -39,7 +39,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; * @see EngineSnifferPanel */ public class Launcher { - public static final int CONSOLE_VERSION = 20160707; + public static final int CONSOLE_VERSION = 20160713; public static final boolean SHOW_STIMULATOR = false; private static final String TAB_INDEX = "main_tab"; protected static final String PORT_KEY = "port"; diff --git a/java_console/ui/src/com/rusefi/SensorLogger.java b/java_console/ui/src/com/rusefi/SensorLogger.java index b38909a12b..31d96e4325 100644 --- a/java_console/ui/src/com/rusefi/SensorLogger.java +++ b/java_console/ui/src/com/rusefi/SensorLogger.java @@ -35,6 +35,15 @@ public class SensorLogger { Sensor.injectorLagMs, Sensor.VSS, Sensor.SPEED2RPM, + Sensor.debugFloatField1, + Sensor.debugFloatField2, + Sensor.debugFloatField3, + Sensor.debugFloatField4, + Sensor.debugFloatField5, + Sensor.debugIntField1, + Sensor.debugIntField2, + Sensor.debugIntField3, + Sensor.warningCounter, Sensor.MAF, Sensor.IAT}; private static long fileStartTime;