From a0e0f51ebbfdb6b3d6371eaa1b3b3fc8560dc9d7 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期四, 14 十一月 2024 14:04:25 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java | 39 +++++++++++++++++++++++---------------- 1 files changed, 23 insertions(+), 16 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java index abf7883..c32acaa 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java @@ -112,6 +112,14 @@ private static ThreadJob threadJob ; + protected void resetDemo(){ + if(threadJob != null){ + threadJob.stop() ; + threadJob = null ; + } + cache = null ; + } + protected void demo(){ if(cache == null){ UgRtuTask tpo = this.sv.selectLastTask() ; @@ -137,7 +145,17 @@ threadJob = new ThreadJob() { @Override public Object execute() throws Exception { - runDemo() ; + while(!this.stop){ + if(!runDemo()){ + this.stop = true ; + }else{ + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } return null; } }; @@ -162,22 +180,11 @@ } } } - private void runDemo(){ - boolean hasRunning = true ; - while (true){ - for(UpgradeRtu rtu : cache.ugRtuStateList){ - this.rtuUpgrade(rtu) ; - } - hasRunning = this.statisticsNowUpgradeState() ; - if(!hasRunning){ - break ; - } - try { - Thread.sleep(500); - } catch (InterruptedException e) { - e.printStackTrace(); - } + private boolean runDemo(){ + for(UpgradeRtu rtu : cache.ugRtuStateList){ + this.rtuUpgrade(rtu) ; } + return this.statisticsNowUpgradeState() ; } private void rtuUpgrade(UpgradeRtu rtu){ if(rtu.lastDownDt == null){ -- Gitblit v1.8.0