From 1878514e0f33afba547955bd1bbc66318a05af88 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期五, 22 十一月 2024 10:09:20 +0800 Subject: [PATCH] 升级演示程序逻辑修改 --- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java | 40 ++++++++++++++++------------------------ 1 files changed, 16 insertions(+), 24 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..b1361a7 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 @@ -226,22 +226,21 @@ //绂荤嚎鐨勶紝涓嶅鐞� 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 == rtu.totalPackage){ + //鍗囩骇缁撴潫 + rtu.state = UpgradeRtu.STATE_SUCCESS ; + rtu.isOver = true ; + return ; + } + if(rtu.reTryTimes >= 2){ + //鍗囩骇缁撴潫 + rtu.isOver = true ; + return ; + } + + int n = Integer.parseInt(new CreateRandom().create(3)) ; + if(n == 540 || n == 541 || n == 542 || n == 543 || n == 544 || n == 545){ if(rtu.currentPackage == 1){ //1鍖呮 rtu.state = UpgradeRtu.STATE_FAILONE ; @@ -249,19 +248,12 @@ } } - if(n == 45){ + 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.currentPackage == rtu.totalPackage){ - //鍗囩骇缁撴潫 - rtu.state = UpgradeRtu.STATE_SUCCESS ; - rtu.isOver = true ; - return ; } if(rtu.state != UpgradeRtu.STATE_FAILONE && -- Gitblit v1.8.0