From 3c2c295ec48587fe9d9f656e0baa74c71a3884f7 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期日, 27 十月 2024 16:46:45 +0800
Subject: [PATCH] 1、苏有勋把开关阀报(功能码83)报中的控制器时钟去除掉了,通信中间件解决这个报文时,把开阀报中的开阀时间当作控制器时钟,把关阀报中的关阀时间作为控制器时钟; 2、优化代码。

---
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/DriverV202404.java |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/DriverV202404.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/DriverV202404.java
index 3602d3d..142836d 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/DriverV202404.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/DriverV202404.java
@@ -24,6 +24,20 @@
 		downCpParams = new ParseParamsForDownV202404() ;
 	}
 
+	/**
+	 * 娓呯┖鑷繁
+	 */
+	@Override
+	public void clear() {
+		if(this.upCpParams != null){
+			this.upCpParams.clear();
+		}
+		if(this.downCpParams != null){
+			this.downCpParams.clear();
+		}
+		this.reportOrResponse_trueOrFalse = null ;
+		this.rtuAddrInData = null ;
+	}
 
 	/**
 	 * 鎵弿璇嗗埆鍔熻兘鐮佹敞瑙g被
@@ -44,7 +58,7 @@
 	 */
 	@Override
 	public MidResult[] parseData(Boolean isLowPower, String rtuAddr, byte[] upBuffer, String upHex, DriverParserDataCallback callback, Object... params) {
-		reportOrResponse_trueOrFalse = null ;
+		this.clear();
 		boolean isFail = false ;
 		String upCode = null ;
 		try{
@@ -75,8 +89,7 @@
 			
 			upData.setSubData(dV1_0_1) ;
 			
-			this.upCpParams.clear();
-			this.upCpParams.setValue(ProtocolConstantV206V202404.protocolName, 
+			this.upCpParams.setValue(ProtocolConstantV206V202404.protocolName,
 					rtuAddr, 
 					upCode,
 					upHex, 
@@ -99,7 +112,7 @@
 			isFail = true ;
 			return new MidResult[]{(new MidResultError(ProtocolConstantV206V202404.protocolName, rtuAddr, "涓ラ噸閿欒锛屽垎鏋怰tu鏁版嵁鍑洪敊锛佹暟鎹负锛�" + upHex + (e.getMessage() == null?"":("锛屽嚭閿欎俊鎭細" + e.getMessage())), e))} ;
 		} finally{
-			callback.callback(rtuAddr, upCode, CodeV202404.getCodeName(upCode), upHex, reportOrResponse_trueOrFalse, isFail, rtuAddrInData);
+			callback.callback(rtuAddr, upCode, CodeV202404.getCodeName(upCode), upHex, reportOrResponse_trueOrFalse, isFail, rtuAddr);
 		}
 	}
 
@@ -111,6 +124,7 @@
 	 */
 	@Override
 	public MidResult[] createCommand(Boolean isLowPower, Command command, Object... params) {
+		this.clear();
 		String RtuResultSendWebUrl = command.getRtuResultSendWebUrl() ;
 		if(RtuResultSendWebUrl == null || RtuResultSendWebUrl.trim().equals("")){
 			return new MidResult[]{(new MidResultError(ProtocolConstantV206V202404.protocolName, null, "涓ラ噸閿欒锛屽懡浠や腑rtu杩斿洖鍛戒护缁撴灉鍙戝悜鐩殑鍦皐eb URL涓虹┖锛屼笉鑳芥瀯寤轰换浣曞懡浠わ紒", null))} ;
@@ -122,7 +136,6 @@
 		try {
 			String commandCode = command.getCode() ;
 			
-			this.downCpParams.clear();
 			this.downCpParams.setValue(
 					RtuResultSendWebUrl,
 					ProtocolConstantV206V202404.protocolName, 

--
Gitblit v1.8.0