From b3a30d6dbd99de4c35129994b916825a5a546bef Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 14 十一月 2024 14:49:57 +0800 Subject: [PATCH] 1、完善升级演示代码,增加失败率; 2、修改升级状态名称。 --- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 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 c32acaa..f5db8fb 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 @@ -219,13 +219,45 @@ return ; } int n = Integer.parseInt(new CreateRandom().create(2)) ; - if(n == 44 || n == 45 || n == 54){ + 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 == 40 + || n == 41 + || n == 42 + || n == 43 + || n == 44 + || n == 45 + || n == 46 + || n == 47 + || n == 48 + || n == 49){ + if(rtu.currentPackage != 1){ + //鍗囨 + rtu.state = UpgradeRtu.STATE_FAIL ; + return ; + } + } + if(rtu.currentPackage == rtu.totalPackage){ //鍗囩骇缁撴潫 rtu.state = UpgradeRtu.STATE_SUCCESS ; -- Gitblit v1.8.0