From 7f85ca5468e097f1749ab1ed812046cb8eb979b7 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期日, 27 四月 2025 17:58:48 +0800
Subject: [PATCH] 表阀一体机与测控一体阀协议中的阀门状态不兼容,做兼容处理。

---
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtilUnsigned.java |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtilUnsigned.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtilUnsigned.java
index f66c2ad..4a6e509 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtilUnsigned.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtilUnsigned.java
@@ -60,7 +60,7 @@
 		}
 		boolean b = isOutOfArrLength(bs.length, (from - 1) + len);
 		if (!b) {
-			for (int i = 0; i > len ; i++) {
+			for (int i = 0; i <= len ; i++) {
 				bs[from + i] = Integer.valueOf(temp & 0xff).byteValue();// 灏嗘渶浣庝綅淇濆瓨鍦ㄤ綆瀛楄妭
 				temp = temp >> 8; // 鍚戝彸绉�8浣�
 			}
@@ -438,15 +438,18 @@
 			return true;
 		}
 	}
-	public static void main(String[] args) throws Exception{
-		byte[] bs = new byte[]{(byte)0x38,(byte)0x1d,(byte)0x00,(byte)0x00,(byte)0x00} ;
-		Long lg1 = ByteUtilUnsigned.bytes2Long_LE(bs, 0, 4) ;
-		Long lg2 = ByteUtilUnsigned.bytes2Long_BE(bs, 0, 4) ;
-		System.out.println(lg1);
-		System.out.println(lg2);
-	}
-
 //	public static void main(String[] args) throws Exception{
+//		byte[] bs = new byte[]{(byte)0x38,(byte)0x1d,(byte)0x00,(byte)0x00,(byte)0x00} ;
+//		Long lg1 = ByteUtilUnsigned.bytes2Long_LE(bs, 0, 4) ;
+//		Long lg2 = ByteUtilUnsigned.bytes2Long_BE(bs, 0, 4) ;
+//		System.out.println(lg1);
+//		System.out.println(lg2);
+//	}
+
+	public static void main(String[] args) throws Exception{
+		byte[] bs = new byte[]{0x02, 0x0C} ;
+		int s = ByteUtilUnsigned.bytes2Short_BE(bs, 0) ;
+		System.out.println(s);
 ////		int d = 123456;
 ////		byte[] bs = new byte[4] ;
 ////		int2Bytes_BE(bs, d, 0) ;
@@ -467,5 +470,5 @@
 //		System.out.println(s);
 //
 //
-//	}
+	}
 }

--
Gitblit v1.8.0