LTS: firmware matcher needs to learn to migrate

fix #5015
This commit is contained in:
rusefi 2023-01-30 08:31:46 -05:00
parent df3f924dc5
commit 6522bd2976
3 changed files with 13 additions and 6 deletions

View File

@ -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(() -> {

View File

@ -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;

View File

@ -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<String> firmwareVersion = new AtomicReference<>("N/A");
public static long classBuildTimeMillis() {