From d66fdfdeaf6a0fbfdeed97848ee507243977878e Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 17 一月 2024 16:35:48 +0800
Subject: [PATCH] 2024-01-17 朱宝民 获取未绑控制器的取水口列表

---
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java
index c1b8d7f..e9677bb 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java
@@ -82,11 +82,29 @@
 	public String parseRtuAddr(byte[] bs)throws Exception{
 		String rtuAddrBCD = "" + ByteUtil.BCD2Long_BE(bs, ProtocolConstantV206V1_0_0.rtuAddr1Index_start, ProtocolConstantV206V1_0_0.rtuAddr1Index_end) ;
 		String rtuAddrStr = "" + ByteUtilUnsigned.bytes2Short_BE(bs, ProtocolConstantV206V1_0_0.rtuAddr2Index_start) ;
-		while(rtuAddrStr.length() < 4){
+		while(rtuAddrStr.length() < 5){
 			rtuAddrStr = "0" + rtuAddrStr ;
 		}
 		return rtuAddrBCD + rtuAddrStr ;
 	}
+
+
+	/**
+	 * 鍒嗘瀽Rtu鍦板潃
+	 * @param bs 涓婅瀛楄妭鏁扮粍
+	 * @param index 鍚浣�
+	 * @return 鎺у埗鍣ㄥ湴鍧�
+	 * @throws Exception 寮傚父
+	 */
+	public String parseRtuAddr(byte[] bs, int index)throws Exception{
+		String rtuAddrBCD = "" + ByteUtil.BCD2Long_BE(bs, index, index + 2) ;
+		String rtuAddrStr = "" + ByteUtilUnsigned.bytes2Short_BE(bs, index + 3) ;
+		while(rtuAddrStr.length() < 5){
+			rtuAddrStr = "0" + rtuAddrStr ;
+		}
+		return rtuAddrBCD + rtuAddrStr ;
+	}
+
 
 	/**
 	 * 鍒嗘瀽鍔熻兘鐮�
@@ -145,6 +163,7 @@
 			case 7 -> "绱ф�ュ叧闃�";
 			case 8 -> "鐢ㄦ埛杩滅▼寮�闃�";
 			case 9 -> "鐢ㄦ埛杩滅▼鍏抽榾";
+			case 16 -> "绠¢亾鏃犳按鑷姩鍏抽榾";
 			default -> "鏈煡";
 		};
 	}

--
Gitblit v1.8.0