From 83507320f6d155fe5f3cf0f4d0cae4d81b18fe17 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 21 Dec 2019 19:59:33 -0500 Subject: [PATCH] refactoring & docs update --- firmware/development/engine_sniffer.cpp | 2 +- firmware/integration/rusefi_config.txt | 2 ++ java_console/autotest/src/com/rusefi/IoUtil.java | 4 +--- java_console/autotest/src/com/rusefi/TestingUtils.java | 5 ++++- .../models/src/com/rusefi/config/generated/Fields.java | 3 ++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/firmware/development/engine_sniffer.cpp b/firmware/development/engine_sniffer.cpp index 6be646565a..39b27c0000 100644 --- a/firmware/development/engine_sniffer.cpp +++ b/firmware/development/engine_sniffer.cpp @@ -270,7 +270,7 @@ void initWaveChart(WaveChart *chart) { addConsoleActionI("chartsize", setChartSize); addConsoleActionI("chart", setChartActive); #if ! EFI_UNIT_TEST - addConsoleAction("reset_engine_chart", resetNow); + addConsoleAction(CMD_RESET_ENGINE_SNIFFER, resetNow); #endif } diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 14efdc4bdf..7cefab865b 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -1301,6 +1301,8 @@ end_struct #define CMD_CALIBRATE_PEDAL_DOWN "calibrate_pedal_down" #define CMD_ETB_DUTY "set_etb_duty" +#define CMD_RESET_ENGINE_SNIFFER "reset_engine_chart" + #define CMD_ENGINE_TYPE "engine_type" #define CMD_TRIGGERINFO "triggerinfo" #define CMD_WRITECONFIG "writeconfig" diff --git a/java_console/autotest/src/com/rusefi/IoUtil.java b/java_console/autotest/src/com/rusefi/IoUtil.java index a89f9697b0..2cc9b60384 100644 --- a/java_console/autotest/src/com/rusefi/IoUtil.java +++ b/java_console/autotest/src/com/rusefi/IoUtil.java @@ -20,8 +20,6 @@ import static com.rusefi.waves.EngineReport.isCloseEnough; */ public class IoUtil { - public static final String RESET_ENGINE_CHART = "reset_engine_chart"; - /** * Send a command and wait for the confirmation * @@ -87,7 +85,7 @@ public class IoUtil { if (!isCloseEnough(rpm, actualRpm)) throw new IllegalStateException("rpm change did not happen: " + rpm + ", actual " + actualRpm); - sendCommand(RESET_ENGINE_CHART); + sendCommand(Fields.CMD_RESET_ENGINE_SNIFFER); } static void waitForFirstResponse() throws InterruptedException { diff --git a/java_console/autotest/src/com/rusefi/TestingUtils.java b/java_console/autotest/src/com/rusefi/TestingUtils.java index 06155f85ba..afc17449ce 100644 --- a/java_console/autotest/src/com/rusefi/TestingUtils.java +++ b/java_console/autotest/src/com/rusefi/TestingUtils.java @@ -1,5 +1,6 @@ package com.rusefi; +import com.rusefi.config.generated.Fields; import com.rusefi.core.EngineState; import com.rusefi.io.LinkManager; import com.rusefi.waves.EngineChart; @@ -111,6 +112,8 @@ public class TestingUtils { * setting change? * * also open question why do we skip TWO full charts. maybe we account for fast or slow callback period? + * + * WOW, actually we DO have CMD_RESET_ENGINE_SNIFFER already and yet things are STILL pretty slow and unreliable?! */ getNextWaveChart(); getNextWaveChart(); @@ -118,7 +121,7 @@ public class TestingUtils { } static String getNextWaveChart() { - IoUtil.sendCommand(IoUtil.RESET_ENGINE_CHART); + IoUtil.sendCommand(Fields.CMD_RESET_ENGINE_SNIFFER); String result = getEngineChart(); FileLog.MAIN.logLine("current chart: " + result); return result; diff --git a/java_console/models/src/com/rusefi/config/generated/Fields.java b/java_console/models/src/com/rusefi/config/generated/Fields.java index 1f3aab3511..03d7fd1c07 100644 --- a/java_console/models/src/com/rusefi/config/generated/Fields.java +++ b/java_console/models/src/com/rusefi/config/generated/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config.generated; -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sat Dec 14 16:03:19 EST 2019 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sat Dec 21 19:54:06 EST 2019 // by class com.rusefi.output.FileJavaFieldsConsumer import com.rusefi.config.*; @@ -245,6 +245,7 @@ public class Fields { public static final String CMD_PINS = "pins"; public static final String CMD_REBOOT = "reboot"; public static final String CMD_REBOOT_DFU = "reboot_dfu"; + public static final String CMD_RESET_ENGINE_SNIFFER = "reset_engine_chart"; public static final String CMD_TRIGGER_HW_INPUT = "trigger_hw_input"; public static final String CMD_TRIGGERINFO = "triggerinfo"; public static final String CMD_WRITECONFIG = "writeconfig";