From 6522bd29763e214e10699c3c46ca9292bea071aa Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 30 Jan 2023 08:31:46 -0500 Subject: [PATCH] LTS: firmware matcher needs to learn to migrate fix #5015 --- .../io/src/main/java/com/rusefi/io/DfuHelper.java | 13 ++++++++----- .../main/java/com/rusefi/core/io/BundleUtil.java | 4 ++++ .../main/java/com/rusefi/core/rusEFIVersion.java | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/java_console/io/src/main/java/com/rusefi/io/DfuHelper.java b/java_console/io/src/main/java/com/rusefi/io/DfuHelper.java index 4eb87a1bcc..8d24486a23 100644 --- a/java_console/io/src/main/java/com/rusefi/io/DfuHelper.java +++ b/java_console/io/src/main/java/com/rusefi/io/DfuHelper.java @@ -31,19 +31,22 @@ public class DfuHelper { } public static boolean sendDfuRebootCommand(JComponent parent, String signature, IoStream stream, StatusConsumer messages) { - RusEfiSignature s = SignatureHelper.parse(signature); - String bundleName = BundleUtil.readBundleFullName(); - if (bundleName != null && s != null) { + RusEfiSignature controllerSignature = SignatureHelper.parse(signature); + String fileSystemBundleTarget = BundleUtil.getBundleTarget(); + if (fileSystemBundleTarget != null && controllerSignature != null) { +/* +todo: fix https://github.com/rusefi/rusefi/issues/5016 String signatureWithPrefix; if ("all".equals(s.getBundleTarget())) { signatureWithPrefix = PREFIX; } else { signatureWithPrefix = PREFIX + "_" + s.getBundleTarget(); } +*/ // hack: QC firmware self-identifies as "normal" not QC firmware :( - if (!bundleName.equalsIgnoreCase(signatureWithPrefix) && !bundleName.contains("_QC_")) { - String message = String.format("You have \"%s\" controller does not look right to program it with \"%s\"", s.getBundleTarget(), bundleName); + if (!fileSystemBundleTarget.equalsIgnoreCase(controllerSignature.getBundleTarget()) && !fileSystemBundleTarget.contains("_QC_")) { + String message = String.format("You have \"%s\" controller does not look right to program it with \"%s\"", controllerSignature.getBundleTarget(), fileSystemBundleTarget); log.info(message); SwingUtilities.invokeLater(() -> { diff --git a/java_console/shared_io/src/main/java/com/rusefi/core/io/BundleUtil.java b/java_console/shared_io/src/main/java/com/rusefi/core/io/BundleUtil.java index faa7c84820..18fd8f9973 100644 --- a/java_console/shared_io/src/main/java/com/rusefi/core/io/BundleUtil.java +++ b/java_console/shared_io/src/main/java/com/rusefi/core/io/BundleUtil.java @@ -36,6 +36,10 @@ public class BundleUtil { return bundle; } + public static String getBundleTarget() { + return getBundleTarget(readBundleFullName()); + } + public static String getBundleTarget(String s) { if (s == null) return null; diff --git a/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java b/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java index 451cfa72fc..e7939114a9 100644 --- a/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java +++ b/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java @@ -6,7 +6,7 @@ import java.net.URL; import java.util.concurrent.atomic.AtomicReference; public class rusEFIVersion { - public static final int CONSOLE_VERSION = 20230107; + public static final int CONSOLE_VERSION = 20230130; public static AtomicReference firmwareVersion = new AtomicReference<>("N/A"); public static long classBuildTimeMillis() {