|
|
@ -282,20 +282,24 @@ public class MainFlowCtrlScheduler implements ApplicationListener<ApplicationSta |
|
|
|
|
|
|
|
void workFn() { |
|
|
|
while (workThread.isAlive()) { |
|
|
|
var state = deviceWorkStateMgrService.getDeviceWorkState(); |
|
|
|
if (state.fatalErrorFlag) { |
|
|
|
OS.forceSleep(500); |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
switch (state.workState) { |
|
|
|
case IDLE -> onIDLE(); |
|
|
|
case WORKING -> onWorking(); |
|
|
|
case PAUSE -> onPause(); |
|
|
|
} |
|
|
|
|
|
|
|
onPostProcessing(); |
|
|
|
OS.forceSleep(500); |
|
|
|
try{ |
|
|
|
var state = deviceWorkStateMgrService.getDeviceWorkState(); |
|
|
|
if (state.fatalErrorFlag) { |
|
|
|
OS.forceSleep(500); |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
switch (state.workState) { |
|
|
|
case IDLE -> onIDLE(); |
|
|
|
case WORKING -> onWorking(); |
|
|
|
case PAUSE -> onPause(); |
|
|
|
} |
|
|
|
|
|
|
|
onPostProcessing(); |
|
|
|
OS.forceSleep(500); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("workFn error {}", e.getMessage(), e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|