mirror of https://github.com/FOME-Tech/fome-fw.git
pause port scanning while a job is running
This commit is contained in:
parent
6fe13904af
commit
a82bb10a71
|
@ -84,7 +84,7 @@ public enum SerialPortScanner {
|
|||
}
|
||||
}
|
||||
|
||||
private volatile boolean isRunning = true;
|
||||
private volatile boolean isRunning = false;
|
||||
|
||||
private final Object lock = new Object();
|
||||
private AvailableHardware knownHardware = null;
|
||||
|
@ -204,7 +204,8 @@ public enum SerialPortScanner {
|
|||
}
|
||||
}
|
||||
|
||||
private void startTimer() {
|
||||
public void startTimer() {
|
||||
isRunning = true;
|
||||
Thread portsScanner = new Thread(() -> {
|
||||
boolean isFirstTime = true;
|
||||
while (isRunning) {
|
||||
|
|
|
@ -112,7 +112,11 @@ public class ProgramSelector {
|
|||
|
||||
final UpdateOperationCallbacks callbacks = new UpdateStatusWindow(appendBundleName(jobName + " " + Launcher.CONSOLE_VERSION));
|
||||
final Consumer<UpdateOperationCallbacks> job2 = job;
|
||||
ExecHelper.submitAction(() -> job2.accept(callbacks), "mx");
|
||||
ExecHelper.submitAction(() -> {
|
||||
SerialPortScanner.INSTANCE.stopTimer();
|
||||
job2.accept(callbacks);
|
||||
SerialPortScanner.INSTANCE.startTimer();
|
||||
}, "mx");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue