From 1c357ae25d6858a4243552309e85c1476c9584a2 Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期一, 09 十月 2023 20:04:15 +0800
Subject: [PATCH] 优化贝博平房仓粮情解析

---
 igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/ServerRunner.java                       |   10 +++++-----
 igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grainv1/analysis/AnalysisService.java |   28 ++++------------------------
 igds-web/src/main/resources/static/img/aerial-5322_001.png                                         |    0 
 3 files changed, 9 insertions(+), 29 deletions(-)

diff --git a/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grainv1/analysis/AnalysisService.java b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grainv1/analysis/AnalysisService.java
index 0338e4f..9124cae 100644
--- a/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grainv1/analysis/AnalysisService.java
+++ b/igds-protocol-beibo/src/main/java/com/ld/igds/protocol/beibo/grainv1/analysis/AnalysisService.java
@@ -386,6 +386,8 @@
         int symbol = 0;
         for (int i = 0; i < strPoints.length() / 4; i++) {
             temp = strPoints.substring(i * 4, i * 4 + 4);
+            //楂樹綆浣嶈浆鎹㈠悗杞负16浣嶄簩杩涘埗瀛楃涓�
+            temp = BytesUtil.tran_LH(temp);
             if (temp == null) {
                 temp = "0000";
             }
@@ -470,17 +472,6 @@
         int tem = -100;
         String substring = "";
 
-        //瑙f瀽澶栨箍澶栨俯
-        String thStr = msg.getThStr().substring(6, 12);
-        humidity = BytesUtil.hexToInt(thStr.substring(0, 2));
-        grain.setHumidityOut(humidity * 1.0);
-        substring = thStr.substring(2);
-        tem = BytesUtil.hexToInt(substring);
-        grain.setTempOut(tem * 0.1);
-        if(substring.startsWith("1")){
-            grain.setTempOut(tem * -0.1);
-        }
-
         //瑙f瀽浠撳唴娓╀粨鍐呮箍
         int thConf = Integer.valueOf(depotConf.getThConf());
         int start = 0, end = 6;
@@ -488,7 +479,7 @@
             start += 6*thConf; //12-18
             end += start;
         }
-        thStr = msg.getThStr().substring(start, end);
+        String thStr = msg.getThStr().substring(start, end);
         humidity = BytesUtil.hexToInt(thStr.substring(0, 2));
         grain.setHumidityIn(humidity * 1.0);
         substring = thStr.substring(2);
@@ -582,17 +573,6 @@
         int tem = -100;
         String substring = "";
 
-        //瑙f瀽澶栨箍澶栨俯
-        String thStr = msg.getThStr().substring(6, 12);
-        humidity = BytesUtil.hexToInt(thStr.substring(0, 2));
-        grain.setHumidityOut(humidity * 1.0);
-        substring = thStr.substring(2);
-        tem = BytesUtil.hexToInt(substring);
-        grain.setTempOut(tem * 0.1);
-        if(substring.startsWith("1")){
-            grain.setTempOut(tem * -0.1);
-        }
-
         //瑙f瀽浠撳唴娓╀粨鍐呮箍
         int thConf = Integer.valueOf(depotConf.getThConf());
         int start = 0, end = 6;
@@ -600,7 +580,7 @@
             start += 6*thConf; //12-18
             end += start;
         }
-        thStr = msg.getThStr().substring(start, end);
+        String thStr = msg.getThStr().substring(start, end);
         humidity = BytesUtil.hexToInt(thStr.substring(0, 2));
         grain.setHumidityIn(humidity * 1.0);
         substring = thStr.substring(2);
diff --git a/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/ServerRunner.java b/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/ServerRunner.java
index 595f230..5d4da2c 100644
--- a/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/ServerRunner.java
+++ b/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/ServerRunner.java
@@ -31,17 +31,17 @@
 
         if (configData.getActive().indexOf("pro") >= 0) {
             //寰愰椈銆丗ZZY浜戞湇鍔″櫒浣跨敤
-//            bhznGrainServerEngine1.start(BhznGrainV1ServerEngine.PORT);
+            bhznGrainServerEngine1.start(BhznGrainV1ServerEngine.PORT);
 
             //姹熻タ璧e窞銆佸箍涓滈珮宸炰娇鐢�
-            bhznGrainServerEngine2.start(BhznGrainV2ServerEngine.PORT);
+//            bhznGrainServerEngine2.start(BhznGrainV2ServerEngine.PORT);
             //骞夸笢楂樺窞浣跨敤
            // bhznVerbServerEngine.start(BhznVerbServerEngine.PORT);
         }
         if (configData.getActive().indexOf("dev") >= 0) {
-//            bhznGrainServerEngine1.start(BhznGrainV1ServerEngine.PORT);
-            bhznGrainServerEngine2.start(BhznGrainV2ServerEngine.PORT);
-            //bhznVerbServerEngine.start(BhznVerbServerEngine.PORT);
+            bhznGrainServerEngine1.start(BhznGrainV1ServerEngine.PORT);
+//            bhznGrainServerEngine2.start(BhznGrainV2ServerEngine.PORT);
+//            bhznVerbServerEngine.start(BhznVerbServerEngine.PORT);
         }
     }
 }
diff --git a/igds-web/src/main/resources/static/img/aerial-5322_001.png b/igds-web/src/main/resources/static/img/aerial-5322_001.png
new file mode 100644
index 0000000..ac52fb7
--- /dev/null
+++ b/igds-web/src/main/resources/static/img/aerial-5322_001.png
Binary files differ

--
Gitblit v1.9.3