From 14d7f0df63340ede75458c0e91b902376ef4dd64 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 20 十一月 2024 11:26:32 +0800
Subject: [PATCH] 1、优化代码;2、修改长级测试中发现的bug;3、通信中间件配置文件配置项修改

---
 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeRtuDev.java |   34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeRtuDev.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeRtuDev.java
index e62b19a..4490827 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeRtuDev.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeRtuDev.java
@@ -5,6 +5,7 @@
 import com.dy.common.mw.protocol.CommandType;
 import com.dy.common.softUpgrade.Com1601Vo;
 import com.dy.common.softUpgrade.state.UpgradeRtu;
+import com.dy.common.softUpgrade.state.UpgradeTaskVo;
 import com.dy.common.util.Callback;
 import com.dy.common.util.DateTime;
 import lombok.Data;
@@ -20,14 +21,19 @@
 public class UpgradeRtuDev extends UpgradeRtu {
 
     @JSONField(serialize = false)
-    private UpgradeTask task ;
+    private Integer failTryTimes ;//鍗囩骇澶辫触鍚庯紝閲嶆柊鍋胯瘯鍗囩骇娆℃暟锛�0琛ㄧず涓嶉噸鏂板伩璇曞崌绾�
+
+    @JSONField(serialize = false)
+    public UpgradeTaskVo taskVo ;//鍗囩骇浠诲姟鍊煎璞�
 
     private UpgradeRtuDev(){
     }
 
-    public UpgradeRtuDev(UpgradeTask task, String rtuAddr, int totalPackage) {
+    public UpgradeRtuDev(UpgradeTaskVo taskVo, Integer failTryTimes , String rtuAddr, int totalPackage) {
         super();
-        this.task = task ;
+        //this.task = task ;
+        this.taskVo = taskVo ;
+        this.failTryTimes = failTryTimes ;
         this.rtuAddr = rtuAddr ;
         this.state = STATE_UNSTART ;
         this.totalPackage = totalPackage ;
@@ -38,9 +44,11 @@
         this.isOver = false ;
     }
 
-    public UpgradeRtuDev(UpgradeTask task, String rtuAddr, int totalPackage, int state) {
+    public UpgradeRtuDev(UpgradeTaskVo taskVo, Integer failTryTimes, String rtuAddr, int totalPackage, int state) {
         super();
-        this.task = task ;
+        //this.task = task ;
+        this.taskVo = taskVo ;
+        this.failTryTimes = failTryTimes ;
         this.rtuAddr = rtuAddr ;
         this.state = state ;
         this.totalPackage = totalPackage ;
@@ -65,11 +73,11 @@
             callbackCom.call(createCommand1601(protocolName, protocolVersion));
         }else if(this.state == STATE_RUNNING){
             //褰撳墠鍗囩骇杩囩▼涓�
-            if(code.equals(UpgradeCode.cd_1601)){
+            if(code.equals(UpgradeCode.cd_9601)){
                 //涓嬪彂閰嶇疆杩斿洖
                 this.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
                 callbackCom.call(createCommand1602(protocolName, protocolVersion, currentPackage, currentRamAddr, softData));//涓嬪彂鏁版嵁鍖呮寚浠�
-            }else if(code.equals(UpgradeCode.cd_1602)){
+            }else if(code.equals(UpgradeCode.cd_9602)){
                 //涓嬪彂鏁版嵁鍖呰繑鍥�
                 currentPackage++ ;
                 currentRamAddr += RAMADDRADD ;
@@ -80,7 +88,7 @@
                     this.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
                     callbackCom.call(createCommand1603(protocolName, protocolVersion));//涓嬪彂鏍¢獙鎸囦护
                 }
-            }else if(code.equals(UpgradeCode.cd_1603)){
+            }else if(code.equals(UpgradeCode.cd_9603)){
                 //涓嬪彂鏍¢獙杩斿洖
                 this.isOver = true ;//鍗囩骇瀹屾垚
                 this.state = STATE_SUCCESS ;
@@ -91,7 +99,7 @@
                     //鍗囩骇鏈畬鎴�
                     if(this.state == STATE_FAILONE || this.state == STATE_FAIL){
                         //宸茬粡鏄崌绾уけ璐ユ��
-                        if(this.reTryTimes < task.failTryTimes){
+                        if(this.reTryTimes < this.failTryTimes){
                             //閲嶈瘯娆℃暟鏈揪鍒颁笂闄愶紝缁х画閲嶈瘯
                             this.reTryTimes += 1 ;
                             this.setStateAtCom1601Time();
@@ -141,10 +149,10 @@
         com.rtuResultSendWebUrl = Command.ignoreRtuResultSendWebUrl ;
 
         Com1601Vo vo = new Com1601Vo() ;
-        vo.softStoreAddr = this.task.taskVo.softStoreAddr ;
-        vo.softStartAddr = this.task.taskVo.softStartAddr ;
-        vo.totalByte =  this.task.taskVo.softBytesCalculate ;
-        vo.softCrc = this.task.taskVo.softByteSrc16;
+        vo.softStoreAddr = this.taskVo.softStoreAddr ;
+        vo.softStartAddr = this.taskVo.softStartAddr ;
+        vo.totalByte =  this.taskVo.softBytesCalculate ;
+        vo.softCrc = this.taskVo.softByteSrc16;
         com.param = vo ;
         return com ;
     }

--
Gitblit v1.8.0