From 900ba43848342a26ee25d091d2769111469a6d32 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 26 Jul 2020 23:34:37 -0400 Subject: [PATCH 01/24] proxy progress? that should be a positive change --- .../src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java b/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java index 5da1d462e3..327c519eab 100644 --- a/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java +++ b/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java @@ -232,7 +232,7 @@ public class BinaryProtocolServer implements BinaryProtocolCommands { int fromPacket = IoHelper.getCrc32(packet); if (crc != fromPacket) throw new IllegalStateException("CRC mismatch crc=" + Integer.toString(crc, 16) + " vs packet=" + Integer.toString(fromPacket, 16) + " len=" + packet.length + " data: " + IoStream.printHexBinary(packet)); -// todo?! in.onPacketArrived(); + in.onPacketArrived(); return new Packet(packet, crc); } From c0878620c3e1a7353bf06392ee0837807923f1de Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 00:16:38 -0400 Subject: [PATCH 02/24] code comments --- .../src/main/java/com/rusefi/ts_plugin/RemoteTab.java | 2 +- .../test/java/com/rusefi/ts_plugin/PluginBodySandbox.java | 4 +++- .../test/java/com/rusefi/ts_plugin/RemoteTabSandbox.java | 3 +++ .../src/com/rusefi/ts_plugin/PluginLauncherSandbox.java | 3 +++ .../src/com/rusefi/ts_plugin/TsPluginLauncher.java | 5 +++++ .../src/com/rusefi/ts_plugin/Updater.java | 8 ++++++-- 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/RemoteTab.java b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/RemoteTab.java index 384dc59adf..8e048270b1 100644 --- a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/RemoteTab.java +++ b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/RemoteTab.java @@ -29,7 +29,7 @@ import java.util.concurrent.atomic.AtomicReference; import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; /** - * see RemoteTabSandbox + * @see RemoteTabSandbox */ public class RemoteTab { private static final String APPLICATION_PORT = "application_port"; diff --git a/java_tools/ts_plugin/src/test/java/com/rusefi/ts_plugin/PluginBodySandbox.java b/java_tools/ts_plugin/src/test/java/com/rusefi/ts_plugin/PluginBodySandbox.java index aa8dc15c1b..c7fdacc9be 100644 --- a/java_tools/ts_plugin/src/test/java/com/rusefi/ts_plugin/PluginBodySandbox.java +++ b/java_tools/ts_plugin/src/test/java/com/rusefi/ts_plugin/PluginBodySandbox.java @@ -14,7 +14,9 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; /** - * @see PluginLauncherSandbox + * Sandbox for plugin body + * + * @see PluginLauncherSandbox for plugin auto-update launcher */ public class PluginBodySandbox { diff --git a/java_tools/ts_plugin/src/test/java/com/rusefi/ts_plugin/RemoteTabSandbox.java b/java_tools/ts_plugin/src/test/java/com/rusefi/ts_plugin/RemoteTabSandbox.java index f2f8ee4b61..12facbfd40 100644 --- a/java_tools/ts_plugin/src/test/java/com/rusefi/ts_plugin/RemoteTabSandbox.java +++ b/java_tools/ts_plugin/src/test/java/com/rusefi/ts_plugin/RemoteTabSandbox.java @@ -2,6 +2,9 @@ package com.rusefi.ts_plugin; import com.rusefi.ui.util.FrameHelper; +/** + * @see PluginBodySandbox + */ public class RemoteTabSandbox { public static void main(String[] args) { new FrameHelper().showFrame(new RemoteTab().getContent()); diff --git a/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/PluginLauncherSandbox.java b/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/PluginLauncherSandbox.java index 7805fbca63..61f375c8bb 100644 --- a/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/PluginLauncherSandbox.java +++ b/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/PluginLauncherSandbox.java @@ -2,6 +2,9 @@ package com.rusefi.ts_plugin; import javax.swing.*; +/** + * Sandbox for {@link TsPluginLauncher} + */ public class PluginLauncherSandbox { public static void main(String[] args) { JFrame frame = new JFrame(); diff --git a/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/TsPluginLauncher.java b/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/TsPluginLauncher.java index 0f47aca0a2..c07cab8391 100644 --- a/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/TsPluginLauncher.java +++ b/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/TsPluginLauncher.java @@ -7,7 +7,12 @@ import org.putgemin.VerticalFlowLayout; import javax.swing.*; /** + * This class is the more permanent part of the plug, it's responsible for refreshing and launcher PluginEntry via reflections. + * which downloads the main more volatile UI part (PluginEntry) + * * by the way TS installs stuff into %user%\.efianalytics\TunerStudio\plugins folder + * @see PluginLauncherSandbox sandbox for this + * see PluginEntry */ public class TsPluginLauncher implements ApplicationPlugin { public static final int BUILD_VERSION = 3; diff --git a/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/Updater.java b/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/Updater.java index 3fdb229e5d..2a91be9391 100644 --- a/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/Updater.java +++ b/java_tools/ts_plugin_launcher/src/com/rusefi/ts_plugin/Updater.java @@ -20,9 +20,13 @@ import java.util.concurrent.atomic.AtomicInteger; import static com.rusefi.ts_plugin.TsPluginLauncher.VERSION; +/** + * Download fresh copy of {@link #PLUGIN_BODY_JAR} and launch {@link #PLUGIN_ENTRY_CLASS} via reflection. + */ public class Updater { + private static final String PLUGIN_ENTRY_CLASS = "com.rusefi.ts_plugin.PluginEntry"; private static final String PLUGIN_BODY_JAR = "rusefi_plugin_body.jar"; - public static final String LOCAL_JAR_FILE_NAME = FileUtil.RUSEFI_SETTINGS_FOLDER + File.separator + PLUGIN_BODY_JAR; + private static final String LOCAL_JAR_FILE_NAME = FileUtil.RUSEFI_SETTINGS_FOLDER + File.separator + PLUGIN_BODY_JAR; private static final String TITLE = "rusEFI plugin installer " + VERSION; private final JPanel content = new JPanel(new VerticalFlowLayout()); @@ -187,7 +191,7 @@ public class Updater { private static Class getPluginClass() throws MalformedURLException, ClassNotFoundException { URLClassLoader jarClassLoader = AutoupdateUtil.getClassLoaderByJar(LOCAL_JAR_FILE_NAME); - return Class.forName("com.rusefi.ts_plugin.PluginEntry", true, jarClassLoader); + return Class.forName(PLUGIN_ENTRY_CLASS, true, jarClassLoader); } private void replaceWith(TsPluginBody instance) { From 6dace7ce0d617077657b5339e4757abe3c49e5de Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 00:48:04 -0400 Subject: [PATCH 03/24] broadcast tab seems to work now?! --- .../com/rusefi/autodetect/PortDetector.java | 10 +++- .../rusefi/autodetect/SerialAutoChecker.java | 0 .../com/rusefi/proxy/NetworkConnector.java | 4 ++ .../rusefi/tools/NetworkConnectorStartup.java | 3 +- .../com/rusefi/ts_plugin/BroadcastTab.java | 58 ++++++++++++++++++- .../com/rusefi/ts_plugin/PluginEntry.java | 8 +++ .../java/com/rusefi/ts_plugin/RemoteTab.java | 6 +- .../java/com/rusefi/ts_plugin/UploadTab.java | 3 +- 8 files changed, 82 insertions(+), 10 deletions(-) rename java_console/{ui => io}/src/main/java/com/rusefi/autodetect/PortDetector.java (89%) rename java_console/{ui => io}/src/main/java/com/rusefi/autodetect/SerialAutoChecker.java (100%) diff --git a/java_console/ui/src/main/java/com/rusefi/autodetect/PortDetector.java b/java_console/io/src/main/java/com/rusefi/autodetect/PortDetector.java similarity index 89% rename from java_console/ui/src/main/java/com/rusefi/autodetect/PortDetector.java rename to java_console/io/src/main/java/com/rusefi/autodetect/PortDetector.java index f4d7778adc..d06ce4e72e 100644 --- a/java_console/ui/src/main/java/com/rusefi/autodetect/PortDetector.java +++ b/java_console/io/src/main/java/com/rusefi/autodetect/PortDetector.java @@ -1,6 +1,6 @@ package com.rusefi.autodetect; -import com.rusefi.FileLog; +import com.devexperts.logging.Logging; import com.rusefi.NamedThreadFactory; import com.rusefi.io.IoStream; import com.rusefi.io.LinkManager; @@ -19,19 +19,23 @@ import java.util.function.Function; * Andrey Belomutskiy, (c) 2013-2020 */ public class PortDetector { + private final static Logging log = Logging.getLogging(PortDetector.class); + private static final NamedThreadFactory AUTO_DETECT_PORT = new NamedThreadFactory("AutoDetectPort"); /** * Connect to all serial ports and find out which one respond first * @param callback + * @return port name on which rusEFI was detected or null if none */ + @Nullable public static String autoDetectSerial(Function callback) { String[] serialPorts = getPortNames(); if (serialPorts.length == 0) { - System.err.println("No serial ports detected"); + log.error("No serial ports detected"); return null; } - FileLog.MAIN.logLine("Trying " + Arrays.toString(serialPorts)); + log.info("Trying " + Arrays.toString(serialPorts)); List serialFinder = new ArrayList<>(); CountDownLatch portFound = new CountDownLatch(1); AtomicReference result = new AtomicReference<>(); diff --git a/java_console/ui/src/main/java/com/rusefi/autodetect/SerialAutoChecker.java b/java_console/io/src/main/java/com/rusefi/autodetect/SerialAutoChecker.java similarity index 100% rename from java_console/ui/src/main/java/com/rusefi/autodetect/SerialAutoChecker.java rename to java_console/io/src/main/java/com/rusefi/autodetect/SerialAutoChecker.java diff --git a/java_console/io/src/main/java/com/rusefi/proxy/NetworkConnector.java b/java_console/io/src/main/java/com/rusefi/proxy/NetworkConnector.java index f7d873c591..f4893a41e6 100644 --- a/java_console/io/src/main/java/com/rusefi/proxy/NetworkConnector.java +++ b/java_console/io/src/main/java/com/rusefi/proxy/NetworkConnector.java @@ -34,6 +34,10 @@ public class NetworkConnector implements Closeable { private final static Logging log = Logging.getLogging(NetworkConnector.class); private boolean isClosed; + public NetworkConnectorResult runNetworkConnector(String authToken, String controllerPort, NetworkConnectorContext context) { + return runNetworkConnector(authToken, controllerPort, context, ReconnectListener.VOID); + } + public NetworkConnectorResult runNetworkConnector(String authToken, String controllerPort, NetworkConnectorContext context, ReconnectListener reconnectListener) { LinkManager controllerConnector = new LinkManager() .setCompositeLogicEnabled(false) diff --git a/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java b/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java index 87e8fd3589..0e8d529000 100644 --- a/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java +++ b/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java @@ -5,7 +5,6 @@ import com.rusefi.auth.AutoTokenUtil; import com.rusefi.autodetect.PortDetector; import com.rusefi.proxy.NetworkConnector; import com.rusefi.proxy.NetworkConnectorContext; -import com.rusefi.tools.online.ProxyClient; import com.rusefi.ui.AuthTokenPanel; public class NetworkConnectorStartup { @@ -25,7 +24,7 @@ public class NetworkConnectorStartup { NetworkConnectorContext connectorContext = new NetworkConnectorContext(); - NetworkConnector.NetworkConnectorResult networkConnectorResult = new NetworkConnector().runNetworkConnector(authToken, autoDetectedPort, connectorContext, NetworkConnector.ReconnectListener.VOID); + NetworkConnector.NetworkConnectorResult networkConnectorResult = new NetworkConnector().runNetworkConnector(authToken, autoDetectedPort, connectorContext); log.info("Running with oneTimeToken=" + networkConnectorResult.getOneTimeToken()); } } diff --git a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/BroadcastTab.java b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/BroadcastTab.java index e7781fcdef..00946947bb 100644 --- a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/BroadcastTab.java +++ b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/BroadcastTab.java @@ -1,15 +1,69 @@ package com.rusefi.ts_plugin; +import com.rusefi.auth.AutoTokenUtil; +import com.rusefi.autodetect.PortDetector; +import com.rusefi.autoupdate.AutoupdateUtil; import com.rusefi.proxy.NetworkConnector; +import com.rusefi.proxy.NetworkConnectorContext; +import com.rusefi.ui.AuthTokenPanel; +import com.rusefi.ui.util.URLLabel; +import org.putgemin.VerticalFlowLayout; import javax.swing.*; +/** + * @see PluginEntry + */ public class BroadcastTab { - private final JComponent content = new JPanel(); + private final JComponent content = new JPanel(new VerticalFlowLayout()); + + private final JLabel help = new URLLabel(RemoteTab.HOWTO_REMOTE_TUNING); + + private final JLabel status = new JLabel(); public BroadcastTab() { -// NetworkConnector + JButton broadcast = new JButton("Broadcast"); + broadcast.addActionListener(e -> { + String authToken = AuthTokenPanel.getAuthToken(); + if (!AutoTokenUtil.isToken(authToken)) { + status.setText("Auth token is required to broadcast ECU"); + return; + } + + new Thread(() -> { + String autoDetectedPort = PortDetector.autoDetectSerial(null); + SwingUtilities.invokeLater(() -> { + startBroadcasting(authToken, autoDetectedPort); + }); + + }).start(); + }); + + content.add(broadcast); + content.add(status); + content.add(help); + content.add(new JLabel(PluginEntry.LOGO)); + + AutoupdateUtil.trueLayout(content); + } + + private void startBroadcasting(String authToken, String autoDetectedPort) { + if (autoDetectedPort == null) { + status.setText("rusEFI ECU not detected.
Please make sure that TunerStudio is currently not connected to ECU."); + } else { + status.setText("rusEFI detected at " + autoDetectedPort); + + NetworkConnectorContext connectorContext = new NetworkConnectorContext(); + + new Thread(() -> { + NetworkConnector.NetworkConnectorResult networkConnectorResult = new NetworkConnector().runNetworkConnector(authToken, autoDetectedPort, connectorContext); + + SwingUtilities.invokeLater(() -> status.setText("One time password to connect to this ECU: " + networkConnectorResult.getOneTimeToken())); + + }).start(); + } + AutoupdateUtil.trueLayout(content); } public JComponent getContent() { diff --git a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/PluginEntry.java b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/PluginEntry.java index 9f9a011387..f96efc3498 100644 --- a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/PluginEntry.java +++ b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/PluginEntry.java @@ -1,6 +1,7 @@ package com.rusefi.ts_plugin; import com.efiAnalytics.plugin.ecu.ControllerAccess; +import com.rusefi.autoupdate.AutoupdateUtil; import com.rusefi.ts_plugin.util.ManifestHelper; import com.rusefi.tune.xml.Constant; @@ -11,10 +12,17 @@ import java.util.function.Supplier; /** * {@link TsPluginLauncher} creates an instance of this class via reflection. + * @see UploadTab upload tune & TODO upload logs + * @see RemoteTab remote ECU access & control + * @see BroadcastTab offer your ECU for remove access & control + * @see PluginBodySandbox */ public class PluginEntry implements TsPluginBody { private final JPanel content = new JPanel(new BorderLayout()); + static final ImageIcon LOGO = AutoupdateUtil.loadIcon("/rusefi_online_color_300.png"); + + /** * the real constructor - this one is invoked via reflection */ diff --git a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/RemoteTab.java b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/RemoteTab.java index 8e048270b1..c5a1d57eb4 100644 --- a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/RemoteTab.java +++ b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/RemoteTab.java @@ -29,10 +29,14 @@ import java.util.concurrent.atomic.AtomicReference; import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; /** + * remote ECU access & control + * * @see RemoteTabSandbox + * @see PluginEntry */ public class RemoteTab { private static final String APPLICATION_PORT = "application_port"; + public static final String HOWTO_REMOTE_TUNING = "https://github.com/rusefi/rusefi/wiki/HOWTO-Remote-Tuning"; private final JComponent content = new JPanel(new BorderLayout()); private final JPanel list = new JPanel(new VerticalFlowLayout()); @@ -87,7 +91,7 @@ public class RemoteTab { topPanel.add(oneTimePasswordControl); topLines.add(topPanel); - topLines.add(new URLLabel("https://github.com/rusefi/rusefi/wiki/HOWTO-Remote-Tuning")); + topLines.add(new URLLabel(HOWTO_REMOTE_TUNING)); content.add(topLines, BorderLayout.NORTH); content.add(list, BorderLayout.CENTER); diff --git a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/UploadTab.java b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/UploadTab.java index 9862103691..6b36fa6f75 100644 --- a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/UploadTab.java +++ b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/UploadTab.java @@ -142,8 +142,7 @@ public class UploadTab { content.add(uploadView.getContent()); content.add(upload); - ImageIcon LOGO = AutoupdateUtil.loadIcon("/rusefi_online_color_300.png"); - content.add(new JLabel(LOGO)); + content.add(new JLabel(PluginEntry.LOGO)); content.add(tokenPanel.getContent()); content.add(new URLLabel(REO_URL)); From 07f317c3fefd2a021125d32965603e2a7942af1d Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 00:54:48 -0400 Subject: [PATCH 04/24] broadcast tab seems to work now?! --- .../com/rusefi/proxy/NetworkConnector.java | 10 ++++---- .../rusefi/tools/NetworkConnectorStartup.java | 2 +- .../test/java/com/rusefi/FullServerTest.java | 2 +- .../src/test/java/com/rusefi/ServerTest.java | 5 +--- .../rusefi/proxy/NetworkConnectorTest.java | 2 +- .../com/rusefi/ts_plugin/BroadcastTab.java | 23 +++++++++++++++---- 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/java_console/io/src/main/java/com/rusefi/proxy/NetworkConnector.java b/java_console/io/src/main/java/com/rusefi/proxy/NetworkConnector.java index f4893a41e6..0c8024d606 100644 --- a/java_console/io/src/main/java/com/rusefi/proxy/NetworkConnector.java +++ b/java_console/io/src/main/java/com/rusefi/proxy/NetworkConnector.java @@ -34,11 +34,11 @@ public class NetworkConnector implements Closeable { private final static Logging log = Logging.getLogging(NetworkConnector.class); private boolean isClosed; - public NetworkConnectorResult runNetworkConnector(String authToken, String controllerPort, NetworkConnectorContext context) { - return runNetworkConnector(authToken, controllerPort, context, ReconnectListener.VOID); + public NetworkConnectorResult start(String authToken, String controllerPort, NetworkConnectorContext context) { + return start(authToken, controllerPort, context, ReconnectListener.VOID); } - public NetworkConnectorResult runNetworkConnector(String authToken, String controllerPort, NetworkConnectorContext context, ReconnectListener reconnectListener) { + public NetworkConnectorResult start(String authToken, String controllerPort, NetworkConnectorContext context, ReconnectListener reconnectListener) { LinkManager controllerConnector = new LinkManager() .setCompositeLogicEnabled(false) .setNeedPullData(false); @@ -78,7 +78,7 @@ public class NetworkConnector implements Closeable { proxyReconnectSemaphore.acquire(); try { - runNetworkConnector(context.serverPortForControllers(), controllerConnector, authToken, (String message) -> { + start(context.serverPortForControllers(), controllerConnector, authToken, (String message) -> { log.error(message + " Disconnect from proxy server detected, now sleeping " + context.reconnectDelay() + " seconds"); sleep(context.reconnectDelay() * Timeouts.SECOND); log.debug("Releasing semaphore"); @@ -98,7 +98,7 @@ public class NetworkConnector implements Closeable { } @NotNull - private static SessionDetails runNetworkConnector(int serverPortForControllers, LinkManager linkManager, String authToken, final TcpIoStream.DisconnectListener disconnectListener, int oneTimeToken, ControllerInfo controllerInfo, final NetworkConnectorContext context) throws IOException { + private static SessionDetails start(int serverPortForControllers, LinkManager linkManager, String authToken, final TcpIoStream.DisconnectListener disconnectListener, int oneTimeToken, ControllerInfo controllerInfo, final NetworkConnectorContext context) throws IOException { IoStream targetEcuSocket = linkManager.getConnector().getBinaryProtocol().getStream(); SessionDetails deviceSessionDetails = new SessionDetails(controllerInfo, authToken, oneTimeToken); diff --git a/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java b/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java index 0e8d529000..c98b29f468 100644 --- a/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java +++ b/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java @@ -24,7 +24,7 @@ public class NetworkConnectorStartup { NetworkConnectorContext connectorContext = new NetworkConnectorContext(); - NetworkConnector.NetworkConnectorResult networkConnectorResult = new NetworkConnector().runNetworkConnector(authToken, autoDetectedPort, connectorContext); + NetworkConnector.NetworkConnectorResult networkConnectorResult = new NetworkConnector().start(authToken, autoDetectedPort, connectorContext); log.info("Running with oneTimeToken=" + networkConnectorResult.getOneTimeToken()); } } diff --git a/java_console/ui/src/test/java/com/rusefi/FullServerTest.java b/java_console/ui/src/test/java/com/rusefi/FullServerTest.java index 3df6febfa4..8c57c8919a 100644 --- a/java_console/ui/src/test/java/com/rusefi/FullServerTest.java +++ b/java_console/ui/src/test/java/com/rusefi/FullServerTest.java @@ -101,7 +101,7 @@ public class FullServerTest { }; // start "rusEFI network connector" to connect controller with backend since in real life controller has only local serial port it does not have network - NetworkConnector.NetworkConnectorResult networkConnectorResult = new NetworkConnector().runNetworkConnector(TestHelper.TEST_TOKEN_1, TestHelper.LOCALHOST + ":" + controllerPort, networkConnectorContext, NetworkConnector.ReconnectListener.VOID); + NetworkConnector.NetworkConnectorResult networkConnectorResult = new NetworkConnector().start(TestHelper.TEST_TOKEN_1, TestHelper.LOCALHOST + ":" + controllerPort, networkConnectorContext, NetworkConnector.ReconnectListener.VOID); ControllerInfo controllerInfo = networkConnectorResult.getControllerInfo(); TestHelper.assertLatch("controllerRegistered", controllerRegistered); diff --git a/java_console/ui/src/test/java/com/rusefi/ServerTest.java b/java_console/ui/src/test/java/com/rusefi/ServerTest.java index df25aeacc3..39cf0ef246 100644 --- a/java_console/ui/src/test/java/com/rusefi/ServerTest.java +++ b/java_console/ui/src/test/java/com/rusefi/ServerTest.java @@ -1,6 +1,5 @@ package com.rusefi; -import com.opensr5.Logger; import com.rusefi.config.generated.Fields; import com.rusefi.io.IoStream; import com.rusefi.io.commands.GetOutputsCommand; @@ -34,8 +33,6 @@ import static org.junit.Assert.assertEquals; * https://github.com/rusefi/web_backend/blob/master/documentation/rusEFI%20remote.png */ public class ServerTest { - private final static Logger logger = Logger.CONSOLE; - @Before public void setup() throws MalformedURLException { BackendTestHelper.commonServerTest(); @@ -126,7 +123,7 @@ covered by FullServerTest TestHelper.createVirtualController(controllerPort, new ConfigurationImage(Fields.TOTAL_CONFIG_SIZE), logger); // start "rusEFI network connector" to connect controller with backend since in real life controller has only local serial port it does not have network - SessionDetails deviceSessionDetails = NetworkConnector.runNetworkConnector(MockRusEfiDevice.TEST_TOKEN_1, TestHelper.LOCALHOST + ":" + controllerPort, serverPortForControllers); + SessionDetails deviceSessionDetails = NetworkConnector.start(MockRusEfiDevice.TEST_TOKEN_1, TestHelper.LOCALHOST + ":" + controllerPort, serverPortForControllers); assertTrue(controllerRegistered.await(READ_IMAGE_TIMEOUT, TimeUnit.MILLISECONDS)); diff --git a/java_console/ui/src/test/java/com/rusefi/proxy/NetworkConnectorTest.java b/java_console/ui/src/test/java/com/rusefi/proxy/NetworkConnectorTest.java index 854b685536..19ab1938e0 100644 --- a/java_console/ui/src/test/java/com/rusefi/proxy/NetworkConnectorTest.java +++ b/java_console/ui/src/test/java/com/rusefi/proxy/NetworkConnectorTest.java @@ -75,7 +75,7 @@ public class NetworkConnectorTest { reconnectCounter.countDown(); } }; - new NetworkConnector().runNetworkConnector(TestHelper.TEST_TOKEN_1, TestHelper.LOCALHOST + ":" + controllerPort, connectorContext, reconnectListener); + new NetworkConnector().start(TestHelper.TEST_TOKEN_1, TestHelper.LOCALHOST + ":" + controllerPort, connectorContext, reconnectListener); assertLatch(reconnectCounter); diff --git a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/BroadcastTab.java b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/BroadcastTab.java index 00946947bb..bce97a6c7e 100644 --- a/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/BroadcastTab.java +++ b/java_tools/ts_plugin/src/main/java/com/rusefi/ts_plugin/BroadcastTab.java @@ -10,6 +10,8 @@ import com.rusefi.ui.util.URLLabel; import org.putgemin.VerticalFlowLayout; import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; /** * @see PluginEntry @@ -17,12 +19,13 @@ import javax.swing.*; public class BroadcastTab { private final JComponent content = new JPanel(new VerticalFlowLayout()); - private final JLabel help = new URLLabel(RemoteTab.HOWTO_REMOTE_TUNING); - private final JLabel status = new JLabel(); + private final JButton disconnect = new JButton("Disconnect"); + private NetworkConnector networkConnector; public BroadcastTab() { JButton broadcast = new JButton("Broadcast"); + disconnect.setEnabled(false); broadcast.addActionListener(e -> { String authToken = AuthTokenPanel.getAuthToken(); @@ -40,9 +43,18 @@ public class BroadcastTab { }).start(); }); + disconnect.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + networkConnector.close(); + disconnect.setEnabled(false); + } + }); + content.add(broadcast); content.add(status); - content.add(help); + content.add(disconnect); + content.add(new URLLabel(RemoteTab.HOWTO_REMOTE_TUNING)); content.add(new JLabel(PluginEntry.LOGO)); AutoupdateUtil.trueLayout(content); @@ -53,11 +65,14 @@ public class BroadcastTab { status.setText("rusEFI ECU not detected.
Please make sure that TunerStudio is currently not connected to ECU."); } else { status.setText("rusEFI detected at " + autoDetectedPort); + disconnect.setEnabled(true); NetworkConnectorContext connectorContext = new NetworkConnectorContext(); new Thread(() -> { - NetworkConnector.NetworkConnectorResult networkConnectorResult = new NetworkConnector().runNetworkConnector(authToken, autoDetectedPort, connectorContext); + networkConnector = new NetworkConnector(); + + NetworkConnector.NetworkConnectorResult networkConnectorResult = networkConnector.start(authToken, autoDetectedPort, connectorContext); SwingUtilities.invokeLater(() -> status.setText("One time password to connect to this ECU: " + networkConnectorResult.getOneTimeToken())); From f760f951a145cdae81333b797a121e5fccc59a85 Mon Sep 17 00:00:00 2001 From: kon Date: Sun, 26 Jul 2020 21:58:22 -0700 Subject: [PATCH 05/24] updated TS terminology --- firmware/integration/rusefi_config.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index b5690901ad..76b5a3b8e3 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -432,7 +432,7 @@ ThermistorConf iat; float knockBandCustom;+We calculate knock band based of cylinderBore\n Use this to override - kHz knock band override;"kHz", 1, 0.0, 0.0, 10.0, 2 -float[DWELL_CURVE_SIZE] sparkDwellRpmBins;On single-coil or wasted spark setups you have to lower dwell at high RPM;"RPM", 1, 0.0, 0.0, 18000, 2 +float[DWELL_CURVE_SIZE] sparkDwellRpmBins;On Single-Coil or Wasted Spark setups you have to lower dwell at high RPM;"RPM", 1, 0.0, 0.0, 18000, 2 float[DWELL_CURVE_SIZE] sparkDwellValues;;"ms", 1, 0.0, 0.0, 30.0, 2 struct_no_prefix specs_s @@ -457,7 +457,7 @@ int sensorSnifferRpmThreshold;+Disable sensor sniffer above this rpm;"RPM", int rpmHardLimit;set rpm_hard_limit X;"rpm", 1, 0, 0, 20000.0, 2 -#define engine_load_mode_e_enum "MAF", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge", "Alpha-N", "INVALID" +#define engine_load_mode_e_enum "MAF", "Alpha-N/TPS", "INVALID", "Speed Density", "MAF Air Charge", "Alpha-N", "INVALID" custom engine_load_mode_e 4 bits, U32, @OFFSET@, [0:2], @@engine_load_mode_e_enum@@ @@ -470,8 +470,8 @@ injection_mode_e injectionMode;+This is where the fuel injection type is defined angle_t extraInjectionOffset;+this is about deciding when the injector starts it's squirt\nSee also injectionPhase map\ntodo: do we need even need this since we have the map anyway?;"deg", 1, 0.0, -720, 720, 2 angle_t crankingTimingAngle;+Ignition advance angle used during engine cranking, 5-10 degrees will work as a base setting for most engines.\nset cranking_timing_angle X; "deg", 1, 0.0, -360, 360, 2 -custom ignition_mode_e 4 bits, U32, @OFFSET@, [0:1], "One coil", "Individual Coils", "Wasted", "Two distributors" -ignition_mode_e ignitionMode;+"One Coil" is for use on distributed ignition system. "Individual Coils" is to be used when you have one coil per cylinder (COP or similar). "Wasted" means one coil is driving two spark plugs in two cylinders, with one of the sparks not doing anything since it's happening on the exhaust cycle\nset ignition_mode X +custom ignition_mode_e 4 bits, U32, @OFFSET@, [0:1], "Single Coil", "Individual Coils", "Wasted Spark", "Two Distributors" +ignition_mode_e ignitionMode;+"Single Coil" is for use on distributed ignition system. "Individual Coils" is to be used when you have one coil per cylinder (COP or similar). "Wasted Spark" means one coil is driving two spark plugs in two cylinders, with one of the sparks not doing anything since it's happening on the exhaust cycle\nset ignition_mode X angle_t ignitionOffset;+this value could be used to offset the whole ignition timing table by a constant;"RPM", 1, 0, 0, 3000.0, 0 @@ -932,7 +932,7 @@ bit useFSIO6ForRevLimiter; adc_channel_e vRefAdcChannel; uint8_t etbNeutralPosition;+Expected neutral position;"%", 1, 0, 0, 100, 0 -custom idle_mode_e 4 bits, U32, @OFFSET@, [0:0], "Automatic", "Manual" +custom idle_mode_e 4 bits, U32, @OFFSET@, [0:0], "Closed Loop", "Open Loop" idle_mode_e idleMode;See also idleRpmPid; bit isInjectionEnabled;+Enable fuel injection - This is default off for new projects as a safety feature, set to "true" to enable fuel injection and further injector settings. @@ -950,7 +950,7 @@ custom idle_mode_e 4 bits, U32, @OFFSET@, [0:0], "Automatic", "Manual" bit isManualSpinningMode;Usually if we have no trigger events that means engine is stopped\nUnless we are troubleshooting and spinning the engine by hand - this case a longer\ndelay is needed bit twoWireBatchInjection;+This is needed if your coils are individually wired and you wish to use batch injection.\nenable two_wire_batch_injection bit useOnlyRisingEdgeForTrigger;+VR sensors are only precise on rising front\nenable trigger_only_front - bit twoWireBatchIgnition;+This is needed if your coils are individually wired (COP) and you wish to use batch ignition (wasted spark). + bit twoWireBatchIgnition;+This is needed if your coils are individually wired (COP) and you wish to use batch ignition (Wasted Spark). bit useFixedBaroCorrFromMap bit useSeparateAdvanceForCranking;+This activates a separate advance table for cranking conditions, this allows cranking advance to be RPM dependant. bit useAdvanceCorrectionsForCranking;+This enables the various ignition corrections during cranking (IAT, CLT, FSIO and PID idle). From 82f99350ec05ce2c8dc7a68542ffdb887142dc2a Mon Sep 17 00:00:00 2001 From: GitHub build-firmware Action Date: Mon, 27 Jul 2020 05:00:36 +0000 Subject: [PATCH 06/24] Auto-generated configs and docs --- firmware/controllers/generated/fsio_enums_generated.def | 2 +- firmware/controllers/generated/fsio_getters.def | 2 +- firmware/controllers/generated/fsio_names.def | 2 +- firmware/controllers/generated/fsio_strings.def | 2 +- firmware/controllers/generated/signature_all.h | 6 +++--- firmware/controllers/generated/signature_frankenso_na6.h | 6 +++--- firmware/controllers/generated/signature_kin.h | 6 +++--- firmware/controllers/generated/signature_mre_f4.h | 6 +++--- firmware/controllers/generated/signature_mre_f7.h | 6 +++--- firmware/controllers/generated/signature_prometheus_405.h | 6 +++--- firmware/controllers/generated/signature_prometheus_469.h | 6 +++--- firmware/controllers/generated/signature_proteus_f4.h | 6 +++--- firmware/controllers/generated/signature_proteus_f7.h | 6 +++--- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/firmware/controllers/generated/fsio_enums_generated.def b/firmware/controllers/generated/fsio_enums_generated.def index f8061c8950..768f6d6128 100644 --- a/firmware/controllers/generated/fsio_enums_generated.def +++ b/firmware/controllers/generated/fsio_enums_generated.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 26 19:08:53 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 05:00:16 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer FSIO_SETTING_FANONTEMPERATURE = 1000, diff --git a/firmware/controllers/generated/fsio_getters.def b/firmware/controllers/generated/fsio_getters.def index 2a72c4a745..a94902ec75 100644 --- a/firmware/controllers/generated/fsio_getters.def +++ b/firmware/controllers/generated/fsio_getters.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 26 19:08:53 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 05:00:16 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer case FSIO_SETTING_FANONTEMPERATURE: diff --git a/firmware/controllers/generated/fsio_names.def b/firmware/controllers/generated/fsio_names.def index f46e7172d4..6358971982 100644 --- a/firmware/controllers/generated/fsio_names.def +++ b/firmware/controllers/generated/fsio_names.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 26 19:08:53 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 05:00:16 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer static LENameOrdinalPair lefanOnTemperature(FSIO_SETTING_FANONTEMPERATURE, "cfg_fanOnTemperature"); diff --git a/firmware/controllers/generated/fsio_strings.def b/firmware/controllers/generated/fsio_strings.def index 942b35e90e..2d181c1f7c 100644 --- a/firmware/controllers/generated/fsio_strings.def +++ b/firmware/controllers/generated/fsio_strings.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 26 19:08:53 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 05:00:16 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer case FSIO_SETTING_FANONTEMPERATURE: diff --git a/firmware/controllers/generated/signature_all.h b/firmware/controllers/generated/signature_all.h index 551f4619e6..4776974625 100644 --- a/firmware/controllers/generated/signature_all.h +++ b/firmware/controllers/generated/signature_all.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD all -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 1848812543 -#define TS_SIGNATURE "rusEFI 2020.07.26.all.1848812543" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 488619068 +#define TS_SIGNATURE "rusEFI 2020.07.27.all.488619068" diff --git a/firmware/controllers/generated/signature_frankenso_na6.h b/firmware/controllers/generated/signature_frankenso_na6.h index b39a979bc1..466d3beefc 100644 --- a/firmware/controllers/generated/signature_frankenso_na6.h +++ b/firmware/controllers/generated/signature_frankenso_na6.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD frankenso_na6 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 2964705052 -#define TS_SIGNATURE "rusEFI 2020.07.26.frankenso_na6.2964705052" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 3281572063 +#define TS_SIGNATURE "rusEFI 2020.07.27.frankenso_na6.3281572063" diff --git a/firmware/controllers/generated/signature_kin.h b/firmware/controllers/generated/signature_kin.h index 7209efa488..3de7f03257 100644 --- a/firmware/controllers/generated/signature_kin.h +++ b/firmware/controllers/generated/signature_kin.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD kin -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 2735505253 -#define TS_SIGNATURE "rusEFI 2020.07.26.kin.2735505253" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 3491848358 +#define TS_SIGNATURE "rusEFI 2020.07.27.kin.3491848358" diff --git a/firmware/controllers/generated/signature_mre_f4.h b/firmware/controllers/generated/signature_mre_f4.h index 49d7a37413..0d4120a71c 100644 --- a/firmware/controllers/generated/signature_mre_f4.h +++ b/firmware/controllers/generated/signature_mre_f4.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD mre_f4 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 667710833 -#define TS_SIGNATURE "rusEFI 2020.07.26.mre_f4.667710833" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 1424059058 +#define TS_SIGNATURE "rusEFI 2020.07.27.mre_f4.1424059058" diff --git a/firmware/controllers/generated/signature_mre_f7.h b/firmware/controllers/generated/signature_mre_f7.h index 32c51d18cc..2cd4726351 100644 --- a/firmware/controllers/generated/signature_mre_f7.h +++ b/firmware/controllers/generated/signature_mre_f7.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD mre_f7 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 667710833 -#define TS_SIGNATURE "rusEFI 2020.07.26.mre_f7.667710833" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 1424059058 +#define TS_SIGNATURE "rusEFI 2020.07.27.mre_f7.1424059058" diff --git a/firmware/controllers/generated/signature_prometheus_405.h b/firmware/controllers/generated/signature_prometheus_405.h index 350be31347..26b04527ca 100644 --- a/firmware/controllers/generated/signature_prometheus_405.h +++ b/firmware/controllers/generated/signature_prometheus_405.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD prometheus_405 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 2603514747 -#define TS_SIGNATURE "rusEFI 2020.07.26.prometheus_405.2603514747" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 3892536504 +#define TS_SIGNATURE "rusEFI 2020.07.27.prometheus_405.3892536504" diff --git a/firmware/controllers/generated/signature_prometheus_469.h b/firmware/controllers/generated/signature_prometheus_469.h index 7d34426963..01ad89fd07 100644 --- a/firmware/controllers/generated/signature_prometheus_469.h +++ b/firmware/controllers/generated/signature_prometheus_469.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD prometheus_469 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 2603514747 -#define TS_SIGNATURE "rusEFI 2020.07.26.prometheus_469.2603514747" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 3892536504 +#define TS_SIGNATURE "rusEFI 2020.07.27.prometheus_469.3892536504" diff --git a/firmware/controllers/generated/signature_proteus_f4.h b/firmware/controllers/generated/signature_proteus_f4.h index 808253fa23..109aa5d9c6 100644 --- a/firmware/controllers/generated/signature_proteus_f4.h +++ b/firmware/controllers/generated/signature_proteus_f4.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD proteus_f4 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 3819164208 -#define TS_SIGNATURE "rusEFI 2020.07.26.proteus_f4.3819164208" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 2425277939 +#define TS_SIGNATURE "rusEFI 2020.07.27.proteus_f4.2425277939" diff --git a/firmware/controllers/generated/signature_proteus_f7.h b/firmware/controllers/generated/signature_proteus_f7.h index 57c42c4072..34bd42e683 100644 --- a/firmware/controllers/generated/signature_proteus_f7.h +++ b/firmware/controllers/generated/signature_proteus_f7.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD proteus_f7 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 3819164208 -#define TS_SIGNATURE "rusEFI 2020.07.26.proteus_f7.3819164208" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 2425277939 +#define TS_SIGNATURE "rusEFI 2020.07.27.proteus_f7.2425277939" From 4015f29949c5008c54cd9c39b028f27e4d84bc4d Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 09:45:52 -0400 Subject: [PATCH 07/24] docs --- firmware/integration/rusefi_config.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index b5690901ad..313da9ac2c 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -18,6 +18,9 @@ ! rename the bit or substitute unused integer with any new fields of the same size ! invoke gen_config.bat to apply the tools which would generate .h and .ini files ! +! Q: Which files to include into Pull Requests? +! A: Please only include source files (.txt and .input) into a PR, we have amazing GitHub Actions which would do the rest really +! really nicely! ! ! each field is declared as ! type name;comment From f65961dff180938ee352151eb657616482e071de Mon Sep 17 00:00:00 2001 From: GitHub build-firmware Action Date: Mon, 27 Jul 2020 13:48:00 +0000 Subject: [PATCH 08/24] Auto-generated configs and docs --- firmware/controllers/generated/fsio_enums_generated.def | 2 +- firmware/controllers/generated/fsio_getters.def | 2 +- firmware/controllers/generated/fsio_names.def | 2 +- firmware/controllers/generated/fsio_strings.def | 2 +- firmware/controllers/generated/signature_all.h | 6 +++--- firmware/controllers/generated/signature_frankenso_na6.h | 6 +++--- firmware/controllers/generated/signature_kin.h | 6 +++--- firmware/controllers/generated/signature_mre_f4.h | 6 +++--- firmware/controllers/generated/signature_mre_f7.h | 6 +++--- firmware/controllers/generated/signature_prometheus_405.h | 6 +++--- firmware/controllers/generated/signature_prometheus_469.h | 6 +++--- firmware/controllers/generated/signature_proteus_f4.h | 6 +++--- firmware/controllers/generated/signature_proteus_f7.h | 6 +++--- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/firmware/controllers/generated/fsio_enums_generated.def b/firmware/controllers/generated/fsio_enums_generated.def index f8061c8950..6f4c6a76e7 100644 --- a/firmware/controllers/generated/fsio_enums_generated.def +++ b/firmware/controllers/generated/fsio_enums_generated.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 26 19:08:53 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 13:47:09 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer FSIO_SETTING_FANONTEMPERATURE = 1000, diff --git a/firmware/controllers/generated/fsio_getters.def b/firmware/controllers/generated/fsio_getters.def index 2a72c4a745..04caf03810 100644 --- a/firmware/controllers/generated/fsio_getters.def +++ b/firmware/controllers/generated/fsio_getters.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 26 19:08:53 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 13:47:09 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer case FSIO_SETTING_FANONTEMPERATURE: diff --git a/firmware/controllers/generated/fsio_names.def b/firmware/controllers/generated/fsio_names.def index f46e7172d4..a6ab3fe490 100644 --- a/firmware/controllers/generated/fsio_names.def +++ b/firmware/controllers/generated/fsio_names.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 26 19:08:53 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 13:47:09 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer static LENameOrdinalPair lefanOnTemperature(FSIO_SETTING_FANONTEMPERATURE, "cfg_fanOnTemperature"); diff --git a/firmware/controllers/generated/fsio_strings.def b/firmware/controllers/generated/fsio_strings.def index 942b35e90e..9e6aed85d0 100644 --- a/firmware/controllers/generated/fsio_strings.def +++ b/firmware/controllers/generated/fsio_strings.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 26 19:08:53 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 13:47:09 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer case FSIO_SETTING_FANONTEMPERATURE: diff --git a/firmware/controllers/generated/signature_all.h b/firmware/controllers/generated/signature_all.h index 551f4619e6..8698c1d093 100644 --- a/firmware/controllers/generated/signature_all.h +++ b/firmware/controllers/generated/signature_all.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD all -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 1848812543 -#define TS_SIGNATURE "rusEFI 2020.07.26.all.1848812543" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 173557045 +#define TS_SIGNATURE "rusEFI 2020.07.27.all.173557045" diff --git a/firmware/controllers/generated/signature_frankenso_na6.h b/firmware/controllers/generated/signature_frankenso_na6.h index b39a979bc1..1dc8d1fa55 100644 --- a/firmware/controllers/generated/signature_frankenso_na6.h +++ b/firmware/controllers/generated/signature_frankenso_na6.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD frankenso_na6 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 2964705052 -#define TS_SIGNATURE "rusEFI 2020.07.26.frankenso_na6.2964705052" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 3571395030 +#define TS_SIGNATURE "rusEFI 2020.07.27.frankenso_na6.3571395030" diff --git a/firmware/controllers/generated/signature_kin.h b/firmware/controllers/generated/signature_kin.h index 7209efa488..fda207018a 100644 --- a/firmware/controllers/generated/signature_kin.h +++ b/firmware/controllers/generated/signature_kin.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD kin -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 2735505253 -#define TS_SIGNATURE "rusEFI 2020.07.26.kin.2735505253" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 3345389999 +#define TS_SIGNATURE "rusEFI 2020.07.27.kin.3345389999" diff --git a/firmware/controllers/generated/signature_mre_f4.h b/firmware/controllers/generated/signature_mre_f4.h index 49d7a37413..6d3337c833 100644 --- a/firmware/controllers/generated/signature_mre_f4.h +++ b/firmware/controllers/generated/signature_mre_f4.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD mre_f4 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 667710833 -#define TS_SIGNATURE "rusEFI 2020.07.26.mre_f4.667710833" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 1134990267 +#define TS_SIGNATURE "rusEFI 2020.07.27.mre_f4.1134990267" diff --git a/firmware/controllers/generated/signature_mre_f7.h b/firmware/controllers/generated/signature_mre_f7.h index 32c51d18cc..7cede4e937 100644 --- a/firmware/controllers/generated/signature_mre_f7.h +++ b/firmware/controllers/generated/signature_mre_f7.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD mre_f7 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 667710833 -#define TS_SIGNATURE "rusEFI 2020.07.26.mre_f7.667710833" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 1134990267 +#define TS_SIGNATURE "rusEFI 2020.07.27.mre_f7.1134990267" diff --git a/firmware/controllers/generated/signature_prometheus_405.h b/firmware/controllers/generated/signature_prometheus_405.h index 350be31347..783e7cfd67 100644 --- a/firmware/controllers/generated/signature_prometheus_405.h +++ b/firmware/controllers/generated/signature_prometheus_405.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD prometheus_405 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 2603514747 -#define TS_SIGNATURE "rusEFI 2020.07.26.prometheus_405.2603514747" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 4282686897 +#define TS_SIGNATURE "rusEFI 2020.07.27.prometheus_405.4282686897" diff --git a/firmware/controllers/generated/signature_prometheus_469.h b/firmware/controllers/generated/signature_prometheus_469.h index 7d34426963..16f1fe23e3 100644 --- a/firmware/controllers/generated/signature_prometheus_469.h +++ b/firmware/controllers/generated/signature_prometheus_469.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD prometheus_469 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 2603514747 -#define TS_SIGNATURE "rusEFI 2020.07.26.prometheus_469.2603514747" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 4282686897 +#define TS_SIGNATURE "rusEFI 2020.07.27.prometheus_469.4282686897" diff --git a/firmware/controllers/generated/signature_proteus_f4.h b/firmware/controllers/generated/signature_proteus_f4.h index 808253fa23..444cc7ebef 100644 --- a/firmware/controllers/generated/signature_proteus_f4.h +++ b/firmware/controllers/generated/signature_proteus_f4.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD proteus_f4 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 3819164208 -#define TS_SIGNATURE "rusEFI 2020.07.26.proteus_f4.3819164208" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 2278110458 +#define TS_SIGNATURE "rusEFI 2020.07.27.proteus_f4.2278110458" diff --git a/firmware/controllers/generated/signature_proteus_f7.h b/firmware/controllers/generated/signature_proteus_f7.h index 57c42c4072..0f2f6705da 100644 --- a/firmware/controllers/generated/signature_proteus_f7.h +++ b/firmware/controllers/generated/signature_proteus_f7.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD proteus_f7 -#define SIGNATURE_DATE 2020.07.26 -#define SIGNATURE_HASH 3819164208 -#define TS_SIGNATURE "rusEFI 2020.07.26.proteus_f7.3819164208" +#define SIGNATURE_DATE 2020.07.27 +#define SIGNATURE_HASH 2278110458 +#define TS_SIGNATURE "rusEFI 2020.07.27.proteus_f7.2278110458" From 8bc1636e82e1177bdadcdbe9ceb8680d56c69707 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 19:42:29 -0400 Subject: [PATCH 09/24] QC build is broken that's kind of funny --- .github/workflows/build-firmware.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-firmware.yaml b/.github/workflows/build-firmware.yaml index 3a65b143ae..d01e3a5d6e 100644 --- a/.github/workflows/build-firmware.yaml +++ b/.github/workflows/build-firmware.yaml @@ -18,6 +18,7 @@ jobs: # Board configurations - build-target: frankenso_na6 folder: frankenso + ini-file: rusefi_frankenso_na6.ini - build-target: kinetis folder: kinetis @@ -28,7 +29,7 @@ jobs: - build-target: mre_f4_hardware_QC_special_build folder: microrusefi - ini-file: rusefi_microrusefi.ini + ini-file: rusefi_mre_f4.ini - build-target: mre_f7 folder: microrusefi From ffa9de7040d92aca93c4fe9a29c33e2b4a307080 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 20:23:57 -0400 Subject: [PATCH 10/24] auxTempSensor text output --- firmware/config/boards/microrusefi/board_configuration.cpp | 6 ++++++ firmware/controllers/engine_controller.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/firmware/config/boards/microrusefi/board_configuration.cpp b/firmware/config/boards/microrusefi/board_configuration.cpp index 8468c44de3..7dc37bf3d3 100644 --- a/firmware/config/boards/microrusefi/board_configuration.cpp +++ b/firmware/config/boards/microrusefi/board_configuration.cpp @@ -166,6 +166,12 @@ static void setupDefaultSensorInputs() { // iat = "23 - AN temp 2" engineConfiguration->iat.adcChannel = EFI_ADC_1; engineConfiguration->iat.config.bias_resistor = 2700; + + +#if HW_CHECK_MODE + engineConfiguration->auxTempSensor1.adcChannel = EFI_ADC_2; + engineConfiguration->auxTempSensor2.adcChannel = EFI_ADC_3; +#endif // HW_CHECK_MODE } void setPinConfigurationOverrides(void) { diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 3d60580522..4a6416dcf2 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -324,6 +324,8 @@ static void printAnalogInfo(void) { printAnalogChannelInfo("pPS", engineConfiguration->throttlePedalPositionAdcChannel); printAnalogChannelInfo("CLT", engineConfiguration->clt.adcChannel); printAnalogChannelInfo("IAT", engineConfiguration->iat.adcChannel); + printAnalogChannelInfo("AuxT1", engineConfiguration->auxTempSensor1.adcChannel); + printAnalogChannelInfo("AuxT2", engineConfiguration->auxTempSensor2.adcChannel); printAnalogChannelInfo("MAF", engineConfiguration->mafAdcChannel); for (int i = 0; i < FSIO_ANALOG_INPUT_COUNT ; i++) { adc_channel_e ch = engineConfiguration->fsioAdc[i]; From 4e2f365879dc92d48f899dc20a8e8d93d722233f Mon Sep 17 00:00:00 2001 From: GitHub set-date Action Date: Tue, 28 Jul 2020 00:32:43 +0000 Subject: [PATCH 11/24] Update date --- firmware/controllers/date_stamp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/controllers/date_stamp.h b/firmware/controllers/date_stamp.h index 9444b9690d..8ce8f733fa 100644 --- a/firmware/controllers/date_stamp.h +++ b/firmware/controllers/date_stamp.h @@ -1,2 +1,2 @@ #pragma once -#define VCS_DATE 20200727 +#define VCS_DATE 20200728 From 8071a448e1673a27db60e33800c2cc8eb53fff1a Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 21:23:03 -0400 Subject: [PATCH 12/24] bugfix: unhandled exception if trying to run two instances of console --- .../rusefi/io/ConnectionFailedListener.java | 5 ++++ .../rusefi/io/ConnectionStateListener.java | 4 +--- .../main/java/com/rusefi/io/LinkManager.java | 2 +- .../rusefi/io/tcp/BinaryProtocolProxy.java | 2 +- .../rusefi/io/tcp/BinaryProtocolServer.java | 24 +++++++++---------- .../rusefi/io/tcp/ServerSocketFunction.java | 8 +++++++ .../src/test/java/com/rusefi/TestHelper.java | 12 ++++++---- .../java/com/rusefi/ui/console/MainFrame.java | 18 ++++---------- .../java/com/rusefi/BackendTestHelper.java | 13 ++++++++-- .../io/TcpCommunicationIntegrationTest.java | 3 ++- .../main/java/com/rusefi/server/Backend.java | 4 ++-- .../com/rusefi/server/BackendLauncher.java | 4 +++- 12 files changed, 58 insertions(+), 41 deletions(-) create mode 100644 java_console/io/src/main/java/com/rusefi/io/ConnectionFailedListener.java create mode 100644 java_console/io/src/main/java/com/rusefi/io/tcp/ServerSocketFunction.java diff --git a/java_console/io/src/main/java/com/rusefi/io/ConnectionFailedListener.java b/java_console/io/src/main/java/com/rusefi/io/ConnectionFailedListener.java new file mode 100644 index 0000000000..e3c512b5f4 --- /dev/null +++ b/java_console/io/src/main/java/com/rusefi/io/ConnectionFailedListener.java @@ -0,0 +1,5 @@ +package com.rusefi.io; + +public interface ConnectionFailedListener { + void onConnectionFailed(); +} diff --git a/java_console/io/src/main/java/com/rusefi/io/ConnectionStateListener.java b/java_console/io/src/main/java/com/rusefi/io/ConnectionStateListener.java index 50f1adb174..ab3010882c 100644 --- a/java_console/io/src/main/java/com/rusefi/io/ConnectionStateListener.java +++ b/java_console/io/src/main/java/com/rusefi/io/ConnectionStateListener.java @@ -4,13 +4,11 @@ package com.rusefi.io; * @author Andrey Belomutskiy * 3/1/2017 */ -public interface ConnectionStateListener { +public interface ConnectionStateListener extends ConnectionFailedListener { ConnectionStateListener VOID = new AbstractConnectionStateListener(); /** * This method is invoked once we have connection & configuration from controller */ void onConnectionEstablished(); - - void onConnectionFailed(); } diff --git a/java_console/io/src/main/java/com/rusefi/io/LinkManager.java b/java_console/io/src/main/java/com/rusefi/io/LinkManager.java index 379a214ee6..afba623d37 100644 --- a/java_console/io/src/main/java/com/rusefi/io/LinkManager.java +++ b/java_console/io/src/main/java/com/rusefi/io/LinkManager.java @@ -196,7 +196,7 @@ public class LinkManager implements Closeable { return connector; } - public void start(String port, ConnectionStateListener stateListener) { + public void start(String port, ConnectionFailedListener stateListener) { Objects.requireNonNull(port, "port"); log.info("LinkManager: Starting " + port); if (isLogViewerMode(port)) { diff --git a/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolProxy.java b/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolProxy.java index 695599e487..cdcaae1d0f 100644 --- a/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolProxy.java +++ b/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolProxy.java @@ -29,7 +29,7 @@ public class BinaryProtocolProxy { */ public static final int USER_IO_TIMEOUT = 10 * Timeouts.MINUTE; - public static ServerSocketReference createProxy(IoStream targetEcuSocket, int serverProxyPort, AtomicInteger relayCommandCounter) { + public static ServerSocketReference createProxy(IoStream targetEcuSocket, int serverProxyPort, AtomicInteger relayCommandCounter) throws IOException { Function clientSocketRunnableFactory = clientSocket -> () -> { TcpIoStream clientStream = null; try { diff --git a/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java b/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java index 327c519eab..4e211c9317 100644 --- a/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java +++ b/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java @@ -43,25 +43,25 @@ public class BinaryProtocolServer implements BinaryProtocolCommands { public AtomicInteger unknownCommands = new AtomicInteger(); - public static final Function SECURE_SOCKET_FACTORY = rusEFISSLContext::getSSLServerSocket; + public static final ServerSocketFunction SECURE_SOCKET_FACTORY = rusEFISSLContext::getSSLServerSocket; - public static final Function PLAIN_SOCKET_FACTORY = port -> { - try { - ServerSocket serverSocket = new ServerSocket(port); - log.info("ServerSocket " + port + " created"); - return serverSocket; - } catch (IOException e) { - throw new IllegalStateException("Error binding server socket " + port, e); - } + public static final ServerSocketFunction PLAIN_SOCKET_FACTORY = port -> { + ServerSocket serverSocket = new ServerSocket(port); + log.info("ServerSocket " + port + " created"); + return serverSocket; }; private static ConcurrentHashMap THREAD_FACTORIES_BY_NAME = new ConcurrentHashMap<>(); public void start(LinkManager linkManager) { + try { start(linkManager, DEFAULT_PROXY_PORT, Listener.empty(), new Context()); + } catch (IOException e) { + log.error("Error starting local proxy", e); + } } - public void start(LinkManager linkManager, int port, Listener serverSocketCreationCallback, Context context) { + public void start(LinkManager linkManager, int port, Listener serverSocketCreationCallback, Context context) throws IOException { log.info("BinaryProtocolServer on " + port); Function clientSocketRunnableFactory = clientSocket -> () -> { @@ -84,11 +84,11 @@ public class BinaryProtocolServer implements BinaryProtocolCommands { * @param serverSocketCreationCallback this callback is invoked once we open the server socket * @return */ - public static ServerSocketReference tcpServerSocket(int port, String threadName, Function socketRunnableFactory, Listener serverSocketCreationCallback) { + public static ServerSocketReference tcpServerSocket(int port, String threadName, Function socketRunnableFactory, Listener serverSocketCreationCallback) throws IOException { return tcpServerSocket(socketRunnableFactory, port, threadName, serverSocketCreationCallback, PLAIN_SOCKET_FACTORY); } - public static ServerSocketReference tcpServerSocket(Function clientSocketRunnableFactory, int port, String threadName, Listener serverSocketCreationCallback, Function nonSecureSocketFunction) { + public static ServerSocketReference tcpServerSocket(Function clientSocketRunnableFactory, int port, String threadName, Listener serverSocketCreationCallback, ServerSocketFunction nonSecureSocketFunction) throws IOException { ThreadFactory threadFactory = getThreadFactory(threadName); Objects.requireNonNull(serverSocketCreationCallback, "serverSocketCreationCallback"); diff --git a/java_console/io/src/main/java/com/rusefi/io/tcp/ServerSocketFunction.java b/java_console/io/src/main/java/com/rusefi/io/tcp/ServerSocketFunction.java new file mode 100644 index 0000000000..9297af2e75 --- /dev/null +++ b/java_console/io/src/main/java/com/rusefi/io/tcp/ServerSocketFunction.java @@ -0,0 +1,8 @@ +package com.rusefi.io.tcp; + +import java.io.IOException; +import java.net.ServerSocket; + +public interface ServerSocketFunction { + ServerSocket apply(int port) throws IOException; +} diff --git a/java_console/io/src/test/java/com/rusefi/TestHelper.java b/java_console/io/src/test/java/com/rusefi/TestHelper.java index d7e2ec0ec8..c6c1d26a43 100644 --- a/java_console/io/src/test/java/com/rusefi/TestHelper.java +++ b/java_console/io/src/test/java/com/rusefi/TestHelper.java @@ -47,7 +47,7 @@ public class TestHelper { } @NotNull - public static BinaryProtocolServer createVirtualController(ConfigurationImage ci, int port, Listener serverSocketCreationCallback, BinaryProtocolServer.Context context) { + public static BinaryProtocolServer createVirtualController(ConfigurationImage ci, int port, Listener serverSocketCreationCallback, BinaryProtocolServer.Context context) throws IOException { BinaryProtocolState state = new BinaryProtocolState(); state.setController(ci); state.setCurrentOutputs(new byte[1 + Fields.TS_OUTPUT_SIZE]); @@ -83,9 +83,13 @@ public class TestHelper { public static BinaryProtocolServer createVirtualController(int controllerPort, ConfigurationImage controllerImage, BinaryProtocolServer.Context context) throws InterruptedException { CountDownLatch controllerCreated = new CountDownLatch(1); - BinaryProtocolServer server = createVirtualController(controllerImage, controllerPort, parameter -> controllerCreated.countDown(), context); - assertLatch(controllerCreated); - return server; + try { + BinaryProtocolServer server = createVirtualController(controllerImage, controllerPort, parameter -> controllerCreated.countDown(), context); + assertLatch(controllerCreated); + return server; + } catch (IOException e) { + throw new IllegalStateException(e); + } } public static SessionDetails createTestSession(String authToken, String signature) { diff --git a/java_console/ui/src/main/java/com/rusefi/ui/console/MainFrame.java b/java_console/ui/src/main/java/com/rusefi/ui/console/MainFrame.java index f4e2462e8e..519fe9476f 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/console/MainFrame.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/console/MainFrame.java @@ -13,6 +13,7 @@ import com.rusefi.ui.util.UiUtils; import java.util.TimeZone; +import static com.devexperts.logging.Logging.getLogging; import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; public class MainFrame { @@ -21,7 +22,7 @@ public class MainFrame { /** * @see StartupFrame */ - private FrameHelper frame = new FrameHelper() { + private final FrameHelper frame = new FrameHelper() { @Override protected void onWindowOpened() { FileLog.MAIN.logLine("onWindowOpened"); @@ -42,22 +43,13 @@ public class MainFrame { } }; - public ConnectionStateListener listener; + public ConnectionFailedListener listener; public MainFrame(ConsoleUI consoleUI, TabbedPanel tabbedPane) { this.consoleUI = consoleUI; this.tabbedPane = tabbedPane; - listener = new AbstractConnectionStateListener() { - @Override - public void onConnectionEstablished() { - FileLog.MAIN.logLine("onConnectionEstablished"); - // tabbedPane.romEditorPane.showContent(); - tabbedPane.settingsTab.showContent(); - tabbedPane.logsManager.showContent(); - tabbedPane.fuelTunePane.showContent(); - new BinaryProtocolServer().start(consoleUI.uiContext.getLinkManager()); - } + listener = () -> { }; } @@ -87,8 +79,6 @@ public class MainFrame { @Override public void onConnectionEstablished() { - FileLog.MAIN.logLine("onConnectionEstablished"); -// tabbedPane.romEditorPane.showContent(); tabbedPane.settingsTab.showContent(); tabbedPane.logsManager.showContent(); tabbedPane.fuelTunePane.showContent(); diff --git a/java_console/ui/src/test/java/com/rusefi/BackendTestHelper.java b/java_console/ui/src/test/java/com/rusefi/BackendTestHelper.java index 8ca507dc0a..5cbe9a430f 100644 --- a/java_console/ui/src/test/java/com/rusefi/BackendTestHelper.java +++ b/java_console/ui/src/test/java/com/rusefi/BackendTestHelper.java @@ -8,6 +8,7 @@ import com.rusefi.server.rusEFISSLContext; import com.rusefi.tools.online.HttpUtil; import org.jetbrains.annotations.NotNull; +import java.io.IOException; import java.net.MalformedURLException; import java.util.concurrent.CountDownLatch; @@ -16,13 +17,21 @@ import static com.rusefi.TestHelper.assertLatch; public class BackendTestHelper { public static void runApplicationConnectorBlocking(Backend backend, int serverPortForRemoteUsers) throws InterruptedException { CountDownLatch applicationServerCreated = new CountDownLatch(1); - backend.runApplicationConnector(serverPortForRemoteUsers, parameter -> applicationServerCreated.countDown()); + try { + backend.runApplicationConnector(serverPortForRemoteUsers, parameter -> applicationServerCreated.countDown()); + } catch (IOException e) { + throw new IllegalStateException(e); + } assertLatch(applicationServerCreated); } public static void runControllerConnectorBlocking(Backend backend, int serverPortForControllers) throws InterruptedException { CountDownLatch controllerServerCreated = new CountDownLatch(1); - backend.runControllerConnector(serverPortForControllers, parameter -> controllerServerCreated.countDown()); + try { + backend.runControllerConnector(serverPortForControllers, parameter -> controllerServerCreated.countDown()); + } catch (IOException e) { + throw new IllegalStateException(e); + } assertLatch(controllerServerCreated); } diff --git a/java_console/ui/src/test/java/com/rusefi/io/TcpCommunicationIntegrationTest.java b/java_console/ui/src/test/java/com/rusefi/io/TcpCommunicationIntegrationTest.java index 1c34f7e38d..cb1c3a4a19 100644 --- a/java_console/ui/src/test/java/com/rusefi/io/TcpCommunicationIntegrationTest.java +++ b/java_console/ui/src/test/java/com/rusefi/io/TcpCommunicationIntegrationTest.java @@ -10,6 +10,7 @@ import com.rusefi.io.tcp.BinaryProtocolProxy; import com.rusefi.io.tcp.BinaryProtocolServer; import org.junit.Test; +import java.io.IOException; import java.util.Objects; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; @@ -83,7 +84,7 @@ public class TcpCommunicationIntegrationTest { } @Test - public void testProxy() throws InterruptedException { + public void testProxy() throws InterruptedException, IOException { ConfigurationImage serverImage = TestHelper.prepareImage(239, TestHelper.createIniField(Fields.CYLINDERSCOUNT)); int controllerPort = 6102; diff --git a/java_tools/proxy_server/src/main/java/com/rusefi/server/Backend.java b/java_tools/proxy_server/src/main/java/com/rusefi/server/Backend.java index baaba549eb..cd83b16067 100644 --- a/java_tools/proxy_server/src/main/java/com/rusefi/server/Backend.java +++ b/java_tools/proxy_server/src/main/java/com/rusefi/server/Backend.java @@ -161,7 +161,7 @@ public class Backend implements Closeable { } } - public void runApplicationConnector(int serverPortForApplications, Listener serverSocketCreationCallback) { + public void runApplicationConnector(int serverPortForApplications, Listener serverSocketCreationCallback) throws IOException { this.serverPortForApplications = serverPortForApplications; // connection from authenticator app which proxies for Tuner Studio // authenticator pushed hello packet on connect @@ -246,7 +246,7 @@ public class Backend implements Closeable { log.info("Disconnecting application " + applicationConnectionState); } - public void runControllerConnector(int serverPortForControllers, Listener serverSocketCreationCallback) { + public void runControllerConnector(int serverPortForControllers, Listener serverSocketCreationCallback) throws IOException { this.serverPortForControllers = serverPortForControllers; log.info("Starting controller connector at " + serverPortForControllers); controllerConnector = BinaryProtocolServer.tcpServerSocket(controllerSocket -> () -> { diff --git a/java_tools/proxy_server/src/main/java/com/rusefi/server/BackendLauncher.java b/java_tools/proxy_server/src/main/java/com/rusefi/server/BackendLauncher.java index 36e9958111..7b8f914824 100644 --- a/java_tools/proxy_server/src/main/java/com/rusefi/server/BackendLauncher.java +++ b/java_tools/proxy_server/src/main/java/com/rusefi/server/BackendLauncher.java @@ -4,8 +4,10 @@ import com.rusefi.proxy.client.LocalApplicationProxy; import com.rusefi.tools.online.HttpUtil; import com.rusefi.tools.online.ProxyClient; +import java.io.IOException; + public class BackendLauncher { - public static void main(String[] args) { + public static void main(String[] args) throws IOException { /* todo rusEFISSLContext.setupCertificates(new File("keystore.jks"), System.getProperty("RUSEFI_KEYSTORE_PASSWORD")); */ From eaff89eacb4653d56f7c26fa56ea51e48bd05834 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 22:05:40 -0400 Subject: [PATCH 13/24] QC config --- firmware/config/boards/microrusefi/board_configuration.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/config/boards/microrusefi/board_configuration.cpp b/firmware/config/boards/microrusefi/board_configuration.cpp index 7dc37bf3d3..123df8b9ef 100644 --- a/firmware/config/boards/microrusefi/board_configuration.cpp +++ b/firmware/config/boards/microrusefi/board_configuration.cpp @@ -167,6 +167,8 @@ static void setupDefaultSensorInputs() { engineConfiguration->iat.adcChannel = EFI_ADC_1; engineConfiguration->iat.config.bias_resistor = 2700; + setCommonNTCSensor(&engineConfiguration->auxTempSensor1, 2700); + setCommonNTCSensor(&engineConfiguration->auxTempSensor2, 2700); #if HW_CHECK_MODE engineConfiguration->auxTempSensor1.adcChannel = EFI_ADC_2; From 57d6295116da8a75aef65dc92e15557b96d5ebf1 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 22:38:35 -0400 Subject: [PATCH 14/24] aux temp info console --- java_console/models/src/main/java/com/rusefi/core/Sensor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java_console/models/src/main/java/com/rusefi/core/Sensor.java b/java_console/models/src/main/java/com/rusefi/core/Sensor.java index 4e48e84366..f0e21d5e76 100644 --- a/java_console/models/src/main/java/com/rusefi/core/Sensor.java +++ b/java_console/models/src/main/java/com/rusefi/core/Sensor.java @@ -32,6 +32,8 @@ public enum Sensor { INT_TEMP(GAUGE_NAME_CPU_TEMP, SensorCategory.OPERATIONS, FieldType.INT8, 10, 1, 0, 5, "C"), CLT(GAUGE_NAME_CLT, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 12, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"), IAT(GAUGE_NAME_IAT, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 14, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"), + AuxT1("AuxT1", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 16, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"), + AuxT2("AuxT2", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 18, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"), // throttle, pedal TPS(GAUGE_NAME_TPS, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 20, 1.0 / PACK_MULT_PERCENT, 0, 100, "%"), // throttle position sensor From fb250c0309605cab09af2c0ecd708c1b9653a06b Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 22:49:59 -0400 Subject: [PATCH 15/24] analog temperature inputs validation for quality control --- firmware/console/binary/tunerstudio.cpp | 8 +++++--- firmware/controllers/algo/engine.cpp | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index b05a22c134..3cb3af385f 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -898,10 +898,12 @@ int tunerStudioHandleCrcCommand(ts_channel_s *tsChannel, char *data, int incomin break; #endif /* ENABLE_PERF_TRACE */ case TS_GET_CONFIG_ERROR: { -#if HW_CHECK_MODE - #define configError "FACTORY_MODE_PLEASE_CONTACT_SUPPORT" -#else char * configError = getFirmwareError(); +#if HW_CHECK_MODE + // analog input errors are returned as firmware error in QC mode + if (!hasFirmwareError()) { + strcpy(configError, "FACTORY_MODE_PLEASE_CONTACT_SUPPORT"); + } #endif // HW_CHECK_MODE sr5SendResponse(tsChannel, TS_CRC, reinterpret_cast(configError), strlen(configError)); break; diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index ffdea7208c..7f20c1656f 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -130,6 +130,14 @@ static void cylinderCleanupControl(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif } +#if HW_CHECK_MODE +static void assertCloseTo(const char * msg, float actual, float expected) { + if (actual < 0.9 * expected || actual > 1.1 * expected) { + firmwareError(OBD_PCM_Processor_Fault, "%s analog input validation failed %f vs %f", msg, actual, expected); + } +} +#endif // HW_CHECK_MODE + void Engine::periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { ScopePerf perf(PE::EnginePeriodicSlowCallback); @@ -163,7 +171,14 @@ void Engine::periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } #endif - slowCallBackWasInvoked = TRUE; + slowCallBackWasInvoked = true; + +#if HW_CHECK_MODE + assertCloseTo("clt", Sensor::get(SensorType::Clt).Value, 49.3); + assertCloseTo("iat", Sensor::get(SensorType::Iat).Value, 73.2); + assertCloseTo("aut1", Sensor::get(SensorType::AuxTemp1).Value, 13.8); + assertCloseTo("aut2", Sensor::get(SensorType::AuxTemp2).Value, 6.2); +#endif // HW_CHECK_MODE } From 127c1021c953ab6062298bcf47d339ecc624c73b Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 22:50:48 -0400 Subject: [PATCH 16/24] aux temperature gauges for TS --- firmware/tunerstudio/rusefi.input | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 6152e24619..0f6f6f1f55 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -206,8 +206,8 @@ enable2ndByteCanID = false internalMcuTemperature = scalar,S08, 11, "deg C", 1, 0 coolant = scalar, S16, 12, "deg C",{1/@@PACK_MULT_TEMPERATURE@@}, 0.0 intake = scalar, S16, 14, "deg C",{1/@@PACK_MULT_TEMPERATURE@@}, 0.0 -; todo: aux1 -; todo: aux2 + auxt1 = scalar, S16, 16, "deg C",{1/@@PACK_MULT_TEMPERATURE@@}, 0.0 + auxt2 = scalar, S16, 18, "deg C",{1/@@PACK_MULT_TEMPERATURE@@}, 0.0 ; throttle, pedal @@ -942,6 +942,8 @@ gaugeCategory = Sensors - Extra 1 internalMcuTemperatureGauge = internalMcuTemperature, @@GAUGE_NAME_ECU_TEMPERATURE@@, "C", 0, 100, 0, 0, 75, 100, 0, 0 OilPressGauge = oilPressure, "Oil Pressure", "kPa", 0, 750, 35, 75, 550, 700, 0, 0 idleAirValvePositionGauge = idleAirValvePosition, "Idle position", "%", 0, 100, 0, 0, 100, 100, 1, 1 + AuxT1Gauge = auxt1, "Aux temp 1", "deg C", -40, 140, -15, 1, 95, 110, 1, 1 + AuxT2Gauge = auxt2, "Aux temp 2", "deg C", -40, 140, -15, 1, 95, 110, 1, 1 gaugeCategory = Ignition ignadvGauge = ignitionAdvance, "Ignition timing", "degrees", -100, 100, -999, -999, 999, 999, 1, 1 From 3e2145a7e1cb308009d1288cf06627a9bc5f123b Mon Sep 17 00:00:00 2001 From: GitHub build-firmware Action Date: Tue, 28 Jul 2020 02:58:52 +0000 Subject: [PATCH 17/24] Auto-generated configs and docs --- firmware/controllers/generated/signature_all.h | 6 +++--- firmware/controllers/generated/signature_frankenso_na6.h | 6 +++--- firmware/controllers/generated/signature_kin.h | 6 +++--- firmware/controllers/generated/signature_mre_f4.h | 6 +++--- firmware/controllers/generated/signature_mre_f7.h | 6 +++--- firmware/controllers/generated/signature_prometheus_405.h | 6 +++--- firmware/controllers/generated/signature_prometheus_469.h | 6 +++--- firmware/controllers/generated/signature_proteus_f4.h | 6 +++--- firmware/controllers/generated/signature_proteus_f7.h | 6 +++--- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/firmware/controllers/generated/signature_all.h b/firmware/controllers/generated/signature_all.h index 8698c1d093..4626fe65f0 100644 --- a/firmware/controllers/generated/signature_all.h +++ b/firmware/controllers/generated/signature_all.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD all -#define SIGNATURE_DATE 2020.07.27 -#define SIGNATURE_HASH 173557045 -#define TS_SIGNATURE "rusEFI 2020.07.27.all.173557045" +#define SIGNATURE_DATE 2020.07.28 +#define SIGNATURE_HASH 2435517493 +#define TS_SIGNATURE "rusEFI 2020.07.28.all.2435517493" diff --git a/firmware/controllers/generated/signature_frankenso_na6.h b/firmware/controllers/generated/signature_frankenso_na6.h index 1dc8d1fa55..0df096261d 100644 --- a/firmware/controllers/generated/signature_frankenso_na6.h +++ b/firmware/controllers/generated/signature_frankenso_na6.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD frankenso_na6 -#define SIGNATURE_DATE 2020.07.27 -#define SIGNATURE_HASH 3571395030 -#define TS_SIGNATURE "rusEFI 2020.07.27.frankenso_na6.3571395030" +#define SIGNATURE_DATE 2020.07.28 +#define SIGNATURE_HASH 1336697046 +#define TS_SIGNATURE "rusEFI 2020.07.28.frankenso_na6.1336697046" diff --git a/firmware/controllers/generated/signature_kin.h b/firmware/controllers/generated/signature_kin.h index fda207018a..80d41de074 100644 --- a/firmware/controllers/generated/signature_kin.h +++ b/firmware/controllers/generated/signature_kin.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD kin -#define SIGNATURE_DATE 2020.07.27 -#define SIGNATURE_HASH 3345389999 -#define TS_SIGNATURE "rusEFI 2020.07.27.kin.3345389999" +#define SIGNATURE_DATE 2020.07.28 +#define SIGNATURE_HASH 1544933551 +#define TS_SIGNATURE "rusEFI 2020.07.28.kin.1544933551" diff --git a/firmware/controllers/generated/signature_mre_f4.h b/firmware/controllers/generated/signature_mre_f4.h index 6d3337c833..7640791cef 100644 --- a/firmware/controllers/generated/signature_mre_f4.h +++ b/firmware/controllers/generated/signature_mre_f4.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD mre_f4 -#define SIGNATURE_DATE 2020.07.27 -#define SIGNATURE_HASH 1134990267 -#define TS_SIGNATURE "rusEFI 2020.07.27.mre_f4.1134990267" +#define SIGNATURE_DATE 2020.07.28 +#define SIGNATURE_HASH 3637893819 +#define TS_SIGNATURE "rusEFI 2020.07.28.mre_f4.3637893819" diff --git a/firmware/controllers/generated/signature_mre_f7.h b/firmware/controllers/generated/signature_mre_f7.h index 7cede4e937..63777ac932 100644 --- a/firmware/controllers/generated/signature_mre_f7.h +++ b/firmware/controllers/generated/signature_mre_f7.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD mre_f7 -#define SIGNATURE_DATE 2020.07.27 -#define SIGNATURE_HASH 1134990267 -#define TS_SIGNATURE "rusEFI 2020.07.27.mre_f7.1134990267" +#define SIGNATURE_DATE 2020.07.28 +#define SIGNATURE_HASH 3637893819 +#define TS_SIGNATURE "rusEFI 2020.07.28.mre_f7.3637893819" diff --git a/firmware/controllers/generated/signature_prometheus_405.h b/firmware/controllers/generated/signature_prometheus_405.h index 783e7cfd67..787785aa9b 100644 --- a/firmware/controllers/generated/signature_prometheus_405.h +++ b/firmware/controllers/generated/signature_prometheus_405.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD prometheus_405 -#define SIGNATURE_DATE 2020.07.27 -#define SIGNATURE_HASH 4282686897 -#define TS_SIGNATURE "rusEFI 2020.07.27.prometheus_405.4282686897" +#define SIGNATURE_DATE 2020.07.28 +#define SIGNATURE_HASH 1681380529 +#define TS_SIGNATURE "rusEFI 2020.07.28.prometheus_405.1681380529" diff --git a/firmware/controllers/generated/signature_prometheus_469.h b/firmware/controllers/generated/signature_prometheus_469.h index 16f1fe23e3..ee31f56abc 100644 --- a/firmware/controllers/generated/signature_prometheus_469.h +++ b/firmware/controllers/generated/signature_prometheus_469.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD prometheus_469 -#define SIGNATURE_DATE 2020.07.27 -#define SIGNATURE_HASH 4282686897 -#define TS_SIGNATURE "rusEFI 2020.07.27.prometheus_469.4282686897" +#define SIGNATURE_DATE 2020.07.28 +#define SIGNATURE_HASH 1681380529 +#define TS_SIGNATURE "rusEFI 2020.07.28.prometheus_469.1681380529" diff --git a/firmware/controllers/generated/signature_proteus_f4.h b/firmware/controllers/generated/signature_proteus_f4.h index 444cc7ebef..0b09bfdb0d 100644 --- a/firmware/controllers/generated/signature_proteus_f4.h +++ b/firmware/controllers/generated/signature_proteus_f4.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD proteus_f4 -#define SIGNATURE_DATE 2020.07.27 -#define SIGNATURE_HASH 2278110458 -#define TS_SIGNATURE "rusEFI 2020.07.27.proteus_f4.2278110458" +#define SIGNATURE_DATE 2020.07.28 +#define SIGNATURE_HASH 481983994 +#define TS_SIGNATURE "rusEFI 2020.07.28.proteus_f4.481983994" diff --git a/firmware/controllers/generated/signature_proteus_f7.h b/firmware/controllers/generated/signature_proteus_f7.h index 0f2f6705da..64dbc5bac6 100644 --- a/firmware/controllers/generated/signature_proteus_f7.h +++ b/firmware/controllers/generated/signature_proteus_f7.h @@ -3,6 +3,6 @@ // #define SIGNATURE_BOARD proteus_f7 -#define SIGNATURE_DATE 2020.07.27 -#define SIGNATURE_HASH 2278110458 -#define TS_SIGNATURE "rusEFI 2020.07.27.proteus_f7.2278110458" +#define SIGNATURE_DATE 2020.07.28 +#define SIGNATURE_HASH 481983994 +#define TS_SIGNATURE "rusEFI 2020.07.28.proteus_f7.481983994" From 50b10e288e8d5642a28442610817f50ee4ba6b5f Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Jul 2020 23:30:14 -0400 Subject: [PATCH 18/24] two bytes of dead code --- .../models/src/main/java/com/rusefi/core/SensorCentral.java | 2 +- .../ui/src/main/java/com/rusefi/sensor_logs/SensorLogger.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/java_console/models/src/main/java/com/rusefi/core/SensorCentral.java b/java_console/models/src/main/java/com/rusefi/core/SensorCentral.java index 32f15d4af9..c377e42cd2 100644 --- a/java_console/models/src/main/java/com/rusefi/core/SensorCentral.java +++ b/java_console/models/src/main/java/com/rusefi/core/SensorCentral.java @@ -11,9 +11,9 @@ import java.util.concurrent.CopyOnWriteArrayList; *

* Date: 1/6/13 * Andrey Belomutskiy, (c) 2013-2020 + * @see SensorLog */ public class SensorCentral implements ISensorCentral { - public static final String RPM_KEY = "rpm"; private static final SensorCentral INSTANCE = new SensorCentral(); private final SensorsHolder sensorsHolder = new SensorsHolder(); diff --git a/java_console/ui/src/main/java/com/rusefi/sensor_logs/SensorLogger.java b/java_console/ui/src/main/java/com/rusefi/sensor_logs/SensorLogger.java index b213a155fc..e5a4d5d6b1 100644 --- a/java_console/ui/src/main/java/com/rusefi/sensor_logs/SensorLogger.java +++ b/java_console/ui/src/main/java/com/rusefi/sensor_logs/SensorLogger.java @@ -82,14 +82,12 @@ public class SensorLogger { Sensor.engineMakeCodeNameCrc16, Sensor.tuneCrc16, }; - private final UIContext uiContext; - private List sensorLogs; + private final List sensorLogs; private boolean isInitialized; public SensorLogger(UIContext uiContext) { - this.uiContext = uiContext; sensorLogs = Arrays.asList(new PlainTextSensorLog(uiContext), new BinarySensorLogRestarter()); } From 3653dcc85b6e299695207568b1e6662a61b40cca Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 28 Jul 2020 00:24:52 -0400 Subject: [PATCH 19/24] a bit more control over output stream --- .../src/main/java/com/rusefi/io/tcp/TcpIoStream.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/java_console/io/src/main/java/com/rusefi/io/tcp/TcpIoStream.java b/java_console/io/src/main/java/com/rusefi/io/tcp/TcpIoStream.java index 862d1c93c1..b97f804815 100644 --- a/java_console/io/src/main/java/com/rusefi/io/tcp/TcpIoStream.java +++ b/java_console/io/src/main/java/com/rusefi/io/tcp/TcpIoStream.java @@ -7,10 +7,7 @@ import com.rusefi.io.serial.AbstractIoStream; import com.rusefi.shared.FileUtil; import org.jetbrains.annotations.NotNull; -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; +import java.io.*; import java.net.Socket; /** @@ -37,10 +34,7 @@ public class TcpIoStream extends AbstractIoStream { throw new NullPointerException("socket"); this.socket = socket; InputStream input = new BufferedInputStream(socket.getInputStream()); - OutputStream output = socket.getOutputStream(); - if (output == null) - throw new NullPointerException("output"); - this.output = output; + this.output = new BufferedOutputStream(socket.getOutputStream()); this.input = input; this.dataBuffer = IncomingDataBuffer.createDataBuffer(loggingPrefix, this); } From eab5db4b14d13a576783331374748e17aed17532 Mon Sep 17 00:00:00 2001 From: kon Date: Mon, 27 Jul 2020 21:40:50 -0700 Subject: [PATCH 20/24] getting config ready for PR --- firmware/integration/rusefi_config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 9c440ffef3..fab4423a94 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -935,7 +935,7 @@ bit useFSIO6ForRevLimiter; adc_channel_e vRefAdcChannel; uint8_t etbNeutralPosition;+Expected neutral position;"%", 1, 0, 0, 100, 0 -custom idle_mode_e 4 bits, U32, @OFFSET@, [0:0], "Closed Loop", "Open Loop" +custom idle_mode_e 4 bits, U32, @OFFSET@, [0:0], "Automatic", "Manual" idle_mode_e idleMode;See also idleRpmPid; bit isInjectionEnabled;+Enable fuel injection - This is default off for new projects as a safety feature, set to "true" to enable fuel injection and further injector settings. From bf771cfc550180c5e6b3ca61b7e7085345dd59e5 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 28 Jul 2020 00:58:03 -0400 Subject: [PATCH 21/24] more info --- .../main/java/com/rusefi/server/ControllerConnectionState.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java_tools/proxy_server/src/main/java/com/rusefi/server/ControllerConnectionState.java b/java_tools/proxy_server/src/main/java/com/rusefi/server/ControllerConnectionState.java index 153986e2b9..10628feca8 100644 --- a/java_tools/proxy_server/src/main/java/com/rusefi/server/ControllerConnectionState.java +++ b/java_tools/proxy_server/src/main/java/com/rusefi/server/ControllerConnectionState.java @@ -79,6 +79,7 @@ public class ControllerConnectionState { public String toString() { return "ControllerConnectionState{" + "userDetails=" + userDetails + + ", controllerKey=" + controllerKey + ", isClosed=" + isClosed + ", twoKindSemaphore=" + twoKindSemaphore + '}'; From 5498fe424e38dda97ac431bc0af5144828ca6655 Mon Sep 17 00:00:00 2001 From: kon Date: Mon, 27 Jul 2020 22:10:29 -0700 Subject: [PATCH 22/24] tiny typo --- firmware/integration/rusefi_config.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index fab4423a94..63ba0d0b9c 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -435,7 +435,7 @@ ThermistorConf iat; float knockBandCustom;+We calculate knock band based of cylinderBore\n Use this to override - kHz knock band override;"kHz", 1, 0.0, 0.0, 10.0, 2 -float[DWELL_CURVE_SIZE] sparkDwellRpmBins;On Single-Coil or Wasted Spark setups you have to lower dwell at high RPM;"RPM", 1, 0.0, 0.0, 18000, 2 +float[DWELL_CURVE_SIZE] sparkDwellRpmBins;On Single Coil or Wasted Spark setups you have to lower dwell at high RPM;"RPM", 1, 0.0, 0.0, 18000, 2 float[DWELL_CURVE_SIZE] sparkDwellValues;;"ms", 1, 0.0, 0.0, 30.0, 2 struct_no_prefix specs_s @@ -1676,4 +1676,4 @@ end_struct #define show_test_presets true #define show_Frankenso_presets true #define show_microRusEFI_presets true -#define show_Proteus_presets true \ No newline at end of file +#define show_Proteus_presets true From 6f66246724a218addea0a643c3854ec79dbbbdb8 Mon Sep 17 00:00:00 2001 From: GitHub build-firmware Action Date: Tue, 28 Jul 2020 13:12:43 +0000 Subject: [PATCH 23/24] Auto-generated configs and docs --- firmware/controllers/generated/fsio_enums_generated.def | 2 +- firmware/controllers/generated/fsio_getters.def | 2 +- firmware/controllers/generated/fsio_names.def | 2 +- firmware/controllers/generated/fsio_strings.def | 2 +- firmware/controllers/generated/signature_all.h | 4 ++-- firmware/controllers/generated/signature_frankenso_na6.h | 4 ++-- firmware/controllers/generated/signature_kin.h | 4 ++-- firmware/controllers/generated/signature_mre_f4.h | 4 ++-- firmware/controllers/generated/signature_mre_f7.h | 4 ++-- firmware/controllers/generated/signature_prometheus_405.h | 4 ++-- firmware/controllers/generated/signature_prometheus_469.h | 4 ++-- firmware/controllers/generated/signature_proteus_f4.h | 4 ++-- firmware/controllers/generated/signature_proteus_f7.h | 4 ++-- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/firmware/controllers/generated/fsio_enums_generated.def b/firmware/controllers/generated/fsio_enums_generated.def index 6f4c6a76e7..454ba06590 100644 --- a/firmware/controllers/generated/fsio_enums_generated.def +++ b/firmware/controllers/generated/fsio_enums_generated.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 13:47:09 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Tue Jul 28 13:12:08 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer FSIO_SETTING_FANONTEMPERATURE = 1000, diff --git a/firmware/controllers/generated/fsio_getters.def b/firmware/controllers/generated/fsio_getters.def index 04caf03810..06a179ea14 100644 --- a/firmware/controllers/generated/fsio_getters.def +++ b/firmware/controllers/generated/fsio_getters.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 13:47:09 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Tue Jul 28 13:12:08 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer case FSIO_SETTING_FANONTEMPERATURE: diff --git a/firmware/controllers/generated/fsio_names.def b/firmware/controllers/generated/fsio_names.def index a6ab3fe490..bc2202ffd5 100644 --- a/firmware/controllers/generated/fsio_names.def +++ b/firmware/controllers/generated/fsio_names.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 13:47:09 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Tue Jul 28 13:12:08 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer static LENameOrdinalPair lefanOnTemperature(FSIO_SETTING_FANONTEMPERATURE, "cfg_fanOnTemperature"); diff --git a/firmware/controllers/generated/fsio_strings.def b/firmware/controllers/generated/fsio_strings.def index 9e6aed85d0..92a23ce5f5 100644 --- a/firmware/controllers/generated/fsio_strings.def +++ b/firmware/controllers/generated/fsio_strings.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Mon Jul 27 13:47:09 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Tue Jul 28 13:12:08 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer case FSIO_SETTING_FANONTEMPERATURE: diff --git a/firmware/controllers/generated/signature_all.h b/firmware/controllers/generated/signature_all.h index 4626fe65f0..78bbf70a7f 100644 --- a/firmware/controllers/generated/signature_all.h +++ b/firmware/controllers/generated/signature_all.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD all #define SIGNATURE_DATE 2020.07.28 -#define SIGNATURE_HASH 2435517493 -#define TS_SIGNATURE "rusEFI 2020.07.28.all.2435517493" +#define SIGNATURE_HASH 1542883429 +#define TS_SIGNATURE "rusEFI 2020.07.28.all.1542883429" diff --git a/firmware/controllers/generated/signature_frankenso_na6.h b/firmware/controllers/generated/signature_frankenso_na6.h index 0df096261d..5b7f882663 100644 --- a/firmware/controllers/generated/signature_frankenso_na6.h +++ b/firmware/controllers/generated/signature_frankenso_na6.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD frankenso_na6 #define SIGNATURE_DATE 2020.07.28 -#define SIGNATURE_HASH 1336697046 -#define TS_SIGNATURE "rusEFI 2020.07.28.frankenso_na6.1336697046" +#define SIGNATURE_HASH 2238833798 +#define TS_SIGNATURE "rusEFI 2020.07.28.frankenso_na6.2238833798" diff --git a/firmware/controllers/generated/signature_kin.h b/firmware/controllers/generated/signature_kin.h index 80d41de074..2d4d46d448 100644 --- a/firmware/controllers/generated/signature_kin.h +++ b/firmware/controllers/generated/signature_kin.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD kin #define SIGNATURE_DATE 2020.07.28 -#define SIGNATURE_HASH 1544933551 -#define TS_SIGNATURE "rusEFI 2020.07.28.kin.1544933551" +#define SIGNATURE_HASH 2529711359 +#define TS_SIGNATURE "rusEFI 2020.07.28.kin.2529711359" diff --git a/firmware/controllers/generated/signature_mre_f4.h b/firmware/controllers/generated/signature_mre_f4.h index 7640791cef..fee7bb8022 100644 --- a/firmware/controllers/generated/signature_mre_f4.h +++ b/firmware/controllers/generated/signature_mre_f4.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD mre_f4 #define SIGNATURE_DATE 2020.07.28 -#define SIGNATURE_HASH 3637893819 -#define TS_SIGNATURE "rusEFI 2020.07.28.mre_f4.3637893819" +#define SIGNATURE_HASH 302538475 +#define TS_SIGNATURE "rusEFI 2020.07.28.mre_f4.302538475" diff --git a/firmware/controllers/generated/signature_mre_f7.h b/firmware/controllers/generated/signature_mre_f7.h index 63777ac932..a80875d065 100644 --- a/firmware/controllers/generated/signature_mre_f7.h +++ b/firmware/controllers/generated/signature_mre_f7.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD mre_f7 #define SIGNATURE_DATE 2020.07.28 -#define SIGNATURE_HASH 3637893819 -#define TS_SIGNATURE "rusEFI 2020.07.28.mre_f7.3637893819" +#define SIGNATURE_HASH 302538475 +#define TS_SIGNATURE "rusEFI 2020.07.28.mre_f7.302538475" diff --git a/firmware/controllers/generated/signature_prometheus_405.h b/firmware/controllers/generated/signature_prometheus_405.h index 787785aa9b..5b72e1f00e 100644 --- a/firmware/controllers/generated/signature_prometheus_405.h +++ b/firmware/controllers/generated/signature_prometheus_405.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD prometheus_405 #define SIGNATURE_DATE 2020.07.28 -#define SIGNATURE_HASH 1681380529 -#define TS_SIGNATURE "rusEFI 2020.07.28.prometheus_405.1681380529" +#define SIGNATURE_HASH 2934591713 +#define TS_SIGNATURE "rusEFI 2020.07.28.prometheus_405.2934591713" diff --git a/firmware/controllers/generated/signature_prometheus_469.h b/firmware/controllers/generated/signature_prometheus_469.h index ee31f56abc..90548ab2f3 100644 --- a/firmware/controllers/generated/signature_prometheus_469.h +++ b/firmware/controllers/generated/signature_prometheus_469.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD prometheus_469 #define SIGNATURE_DATE 2020.07.28 -#define SIGNATURE_HASH 1681380529 -#define TS_SIGNATURE "rusEFI 2020.07.28.prometheus_469.1681380529" +#define SIGNATURE_HASH 2934591713 +#define TS_SIGNATURE "rusEFI 2020.07.28.prometheus_469.2934591713" diff --git a/firmware/controllers/generated/signature_proteus_f4.h b/firmware/controllers/generated/signature_proteus_f4.h index 0b09bfdb0d..cf3b47dae4 100644 --- a/firmware/controllers/generated/signature_proteus_f4.h +++ b/firmware/controllers/generated/signature_proteus_f4.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD proteus_f4 #define SIGNATURE_DATE 2020.07.28 -#define SIGNATURE_HASH 481983994 -#define TS_SIGNATURE "rusEFI 2020.07.28.proteus_f4.481983994" +#define SIGNATURE_HASH 3597138346 +#define TS_SIGNATURE "rusEFI 2020.07.28.proteus_f4.3597138346" diff --git a/firmware/controllers/generated/signature_proteus_f7.h b/firmware/controllers/generated/signature_proteus_f7.h index 64dbc5bac6..00e86821f0 100644 --- a/firmware/controllers/generated/signature_proteus_f7.h +++ b/firmware/controllers/generated/signature_proteus_f7.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD proteus_f7 #define SIGNATURE_DATE 2020.07.28 -#define SIGNATURE_HASH 481983994 -#define TS_SIGNATURE "rusEFI 2020.07.28.proteus_f7.481983994" +#define SIGNATURE_HASH 3597138346 +#define TS_SIGNATURE "rusEFI 2020.07.28.proteus_f7.3597138346" From 2bad7ed180748e5d65fbcf49eb9e2368933dd381 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 28 Jul 2020 12:13:55 -0700 Subject: [PATCH 24/24] deprecate --- firmware/console/status_loop.cpp | 2 +- firmware/controllers/algo/accel_enrichment.cpp | 2 +- firmware/controllers/can/obd2.cpp | 2 +- firmware/controllers/engine_cycle/main_trigger_callback.cpp | 2 +- firmware/controllers/math/closed_loop_fuel.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index e909f76461..a335f20fa0 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -323,7 +323,7 @@ static void showFuelInfo2(float rpm, float engineLoad) { #if EFI_ENGINE_CONTROL static void showFuelInfo(void) { - showFuelInfo2((float) GET_RPM(), getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE)); + showFuelInfo2((float) GET_RPM(), getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE)); } #endif diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index 1cac524bf7..9f57435073 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -315,7 +315,7 @@ void TpsAccelEnrichment::onEngineCycleTps(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } void LoadAccelEnrichment::onEngineCycle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - onNewValue(getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX); + onNewValue(getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX); } AccelEnrichment::AccelEnrichment() { diff --git a/firmware/controllers/can/obd2.cpp b/firmware/controllers/can/obd2.cpp index 252ac28284..ec623102ff 100644 --- a/firmware/controllers/can/obd2.cpp +++ b/firmware/controllers/can/obd2.cpp @@ -123,7 +123,7 @@ static void handleGetDataRequest(const CANRxFrame& rx) { obdSendValue(1, pid, 2, (2<<8)|(0)); // 2 = "Closed loop, using oxygen sensor feedback to determine fuel mix" break; case PID_ENGINE_LOAD: - obdSendValue(1, pid, 1, getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE) * 2.55f); + obdSendValue(1, pid, 1, getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE) * 2.55f); break; case PID_COOLANT_TEMP: obdSendValue(1, pid, 1, Sensor::get(SensorType::Clt).value_or(0) + 40.0f); diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.cpp b/firmware/controllers/engine_cycle/main_trigger_callback.cpp index 08f624300c..d288983017 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.cpp +++ b/firmware/controllers/engine_cycle/main_trigger_callback.cpp @@ -528,7 +528,7 @@ void updatePrimeInjectionPulseState(DECLARE_ENGINE_PARAMETER_SIGNATURE) { static void showMainInfo(Engine *engine) { #if EFI_PROD_CODE int rpm = GET_RPM(); - float el = getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE); + float el = getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE); scheduleMsg(logger, "rpm %d engine_load %.2f", rpm, el); scheduleMsg(logger, "fuel %.2fms timing %.2f", getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX), engine->engineState.timingAdvance); #endif /* EFI_PROD_CODE */ diff --git a/firmware/controllers/math/closed_loop_fuel.cpp b/firmware/controllers/math/closed_loop_fuel.cpp index 6abfa49928..bdb552e09c 100644 --- a/firmware/controllers/math/closed_loop_fuel.cpp +++ b/firmware/controllers/math/closed_loop_fuel.cpp @@ -84,7 +84,7 @@ float fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return 1.0f; } - size_t binIdx = computeStftBin(GET_RPM(), getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE), CONFIG(stft)); + size_t binIdx = computeStftBin(GET_RPM(), getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE), CONFIG(stft)); #if EFI_TUNER_STUDIO if (engineConfiguration->debugMode == DBG_FUEL_PID_CORRECTION) {