Only: improve logging #6699

This commit is contained in:
kifir23917 2024-07-17 02:56:14 +03:00 committed by rusefillc
parent 210d21eee5
commit 012dec829b
1 changed files with 17 additions and 16 deletions

View File

@ -174,7 +174,7 @@ public class ProgramSelector {
final UpdateOperationCallbacks callbacks
) {
callbacks.log("Waiting for ECU to reboot to OpenBlt...", false, true);
try {
String[] currentPorts = null;
for (int attemptsCount = 0; attemptsCount < 150; attemptsCount++) {
// Give the bootloader sec to enumerate
@ -186,14 +186,15 @@ public class ProgramSelector {
// Check that the ECU disappeared from the "after" list
final boolean ecuPortStillAlive = !PortDetector.AUTO.equals(ecuPort) && Arrays.stream(currentPorts).anyMatch(ecuPort::equals);
if (!ecuPortStillAlive) {
callbacks.logLine("[Disappeared]");
return new Pair<>(true, currentPorts);
} else {
callbacks.log(".", false, false);
}
}
callbacks.logLine("[Not found]");
return new Pair<>(false, currentPorts);
} finally {
callbacks.log("", true, false);
}
}
private static void flashOpenbltSerialAutomatic(JComponent parent, String ecuPort, UpdateOperationCallbacks callbacks) {