From 5da77491ac8c860187aa958f00daee7c0d35fcf1 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期六, 23 十一月 2024 11:31:24 +0800
Subject: [PATCH] 屏闭掉升级演示程序,开放正式程序
---
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java | 76 ++++++++++++++++++++-----------------
1 files changed, 41 insertions(+), 35 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 1add08d..440c046 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
@@ -154,7 +154,7 @@
@Override
public Object execute() throws Exception {
while(!this.stop){
- if(!runDemo()){
+ if(!runInDemo()){
this.stop = true ;
}else{
try {
@@ -188,7 +188,7 @@
}
}
}
- private boolean runDemo(){
+ private boolean runInDemo(){
for(UpgradeRtu rtu : cache.ugRtuStateList){
this.rtuUpgrade(rtu) ;
}
@@ -226,36 +226,6 @@
//绂荤嚎鐨勶紝涓嶅鐞�
return ;
}
- int n = Integer.parseInt(new CreateRandom().create(2)) ;
- if(n == 4
- || n == 14
- || n == 24
- || n == 34
- || n == 44
- || n == 54
- || n == 64
- || n == 74
- || n == 84
- || n == 95
- || n == 45
- || n == 46
- || n == 47
- || n == 48
- || n == 49){
- if(rtu.currentPackage == 1){
- //1鍖呮
- rtu.state = UpgradeRtu.STATE_FAILONE ;
- return ;
- }
- }
-
- if(n == 45){
- if(rtu.currentPackage != 1){
- //鍗囨
- rtu.state = UpgradeRtu.STATE_FAIL ;
- return ;
- }
- }
if(rtu.currentPackage == rtu.totalPackage){
//鍗囩骇缁撴潫
@@ -263,9 +233,35 @@
rtu.isOver = true ;
return ;
}
+ if(rtu.reTryTimes >= 2){
+ //閲嶈瘯娆℃暟杈惧埌鏈�澶у��
+ if(rtu.state == UpgradeRtu.STATE_FAILONE ||
+ rtu.state == UpgradeRtu.STATE_FAIL){
+ //鍙堝け璐ヤ簡锛岃涓虹粨鏉熶簡
+ rtu.isOver = true ;
+ return ;
+ }
+ }
- if(rtu.state != UpgradeRtu.STATE_FAILONE &&
- rtu.state != UpgradeRtu.STATE_FAIL){
+ int n = Integer.parseInt(new CreateRandom().create(3)) ;
+ if(n == 540 || n == 541 || n == 542 || n == 543 || n == 544 || n == 545 || n == 546 || n == 547 || n == 548 || n == 549 ){
+ if(rtu.currentPackage == 1){
+ //1鍖呮
+ rtu.state = UpgradeRtu.STATE_FAILONE ;
+ return ;
+ }
+ }
+
+ if(n == 450 || n == 451 || n == 452 || n == 453 || n == 454 || n == 455){
+ if(rtu.currentPackage != 1){
+ //鍗囨
+ rtu.state = UpgradeRtu.STATE_FAIL ;
+ return ;
+ }
+ }
+
+ if(rtu.state == UpgradeRtu.STATE_FAILONE ||
+ rtu.state == UpgradeRtu.STATE_FAIL){
if(rtu.reTryTimes < 2){
rtu.state = UpgradeRtu.STATE_RUNNING ;
rtu.currentPackage = 1 ;
@@ -283,7 +279,6 @@
rtu.currentPackage += 1 ;
rtu.currentRamAddr = 0x00 + UpgradeRtu.RAMADDRADD ;
rtu.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
- rtu.reTryTimes = 0 ;
rtu.isOver = false ;
}
@@ -301,6 +296,7 @@
for(UpgradeRtu rtu : cache.ugRtuStateList){
if(rtu.state == UpgradeRtu.STATE_OFFLINE){
cache.ugOverallState.offLineTotal ++ ;
+ cache.ugOverallState.failTotal++;
}else if(rtu.state == UpgradeRtu.STATE_UNSTART){
cache.ugOverallState.unStartTotal ++ ;
}else if(rtu.state == UpgradeRtu.STATE_RUNNING){
@@ -312,6 +308,7 @@
cache.ugOverallState.failOneTotal++;
cache.ugOverallState.failTotal++;
}else if(rtu.state == UpgradeRtu.STATE_FAIL) {
+ cache.ugOverallState.failMultiTotal++;
cache.ugOverallState.failTotal++;
}
if(rtu.isOver){
@@ -322,6 +319,15 @@
if(!hasRunning){
cache.ugOverallState.allOver = true ;
}
+ if(cache.ugOverallState.allOver){
+ cache.ugOverallState.overTotal = 0;
+ if(cache.ugRtuStateList != null && cache.ugRtuStateList.size() > 0){
+ for(UpgradeRtu rtu : cache.ugRtuStateList){
+ rtu.isOver = true ;
+ cache.ugOverallState.overTotal++;
+ }
+ }
+ }
return hasRunning ;
}
}
--
Gitblit v1.8.0