From b3d6ded23fda8033f07a01e079aa55a53918cef1 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 25 May 2020 18:38:47 -0400 Subject: [PATCH] refactoring timeouts --- java_console/autotest/src/com/rusefi/AutoTest.java | 2 +- java_console/io/src/com/rusefi/Timeouts.java | 2 +- java_console/io/src/com/rusefi/io/ConnectionStatusLogic.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java_console/autotest/src/com/rusefi/AutoTest.java b/java_console/autotest/src/com/rusefi/AutoTest.java index 09e120e90d..878e3b79ac 100644 --- a/java_console/autotest/src/com/rusefi/AutoTest.java +++ b/java_console/autotest/src/com/rusefi/AutoTest.java @@ -190,7 +190,7 @@ this is just too unreliable at this point :( FileLog.MAIN.logLine("AUTOTEST setEngineType " + type); // sendCommand(CMD_PINS); currentEngineType = type; - sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + type, COMPLEX_COMMAND_RETRY, 30); + sendCommand("set " + Fields.CMD_ENGINE_TYPE + " " + type, COMPLEX_COMMAND_RETRY, 2 * Timeouts.CMD_TIMEOUT); // TODO: document the reason for this sleep?! sleep(1); sendCommand(getEnableCommand("self_stimulation")); diff --git a/java_console/io/src/com/rusefi/Timeouts.java b/java_console/io/src/com/rusefi/Timeouts.java index ab2ba59231..ec359bb512 100644 --- a/java_console/io/src/com/rusefi/Timeouts.java +++ b/java_console/io/src/com/rusefi/Timeouts.java @@ -11,6 +11,6 @@ public interface Timeouts { int READ_IMAGE_TIMEOUT = 60 * SECOND; int CONNECTION_RESTART_DELAY = 20 * SECOND; - int CS_TIMEOUT = 3000; + int CONNECTION_STATUS_TIMEOUT = 3 * SECOND; } diff --git a/java_console/io/src/com/rusefi/io/ConnectionStatusLogic.java b/java_console/io/src/com/rusefi/io/ConnectionStatusLogic.java index 417c5a301b..a4e6f68a40 100644 --- a/java_console/io/src/com/rusefi/io/ConnectionStatusLogic.java +++ b/java_console/io/src/com/rusefi/io/ConnectionStatusLogic.java @@ -38,7 +38,7 @@ public class ConnectionStatusLogic { public static ConnectionStatusLogic INSTANCE = new ConnectionStatusLogic(); private List listeners = new CopyOnWriteArrayList<>(); - private final Timer timer = new Timer(Timeouts.CS_TIMEOUT, new ActionListener() { + private final Timer timer = new Timer(Timeouts.CONNECTION_STATUS_TIMEOUT, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // setValue(Value.NOT_CONNECTED);