From 425b2352c57a377b1594097a69aabcc87207b683 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 02 八月 2019 14:11:32 +0800
Subject: [PATCH] 2019-8-2 14:10:43 1.修改地热演示页面;

---
 hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java |   79 +++++++++++++++++++++------------------
 1 files changed, 42 insertions(+), 37 deletions(-)

diff --git a/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java b/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java
index 721b46f..8fb85bf 100644
--- a/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java
+++ b/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java
@@ -90,7 +90,6 @@
     public static boolean isGeothermalCtrlSuccess = false; //鍒ゆ柇鍦扮儹妯″潡鏄惁鎺у埗鎴愬姛
 
 
-
     /**
      * 鍒濆鍖朣DK
      *
@@ -1009,7 +1008,9 @@
                     ) {
                         List<AppliancesInfo> infos = devicesDataList.get(i).getAppliancesInfoList();
                         for (int j = 0, len2 = infos.size(); j < len2; j++) {
-                            if (infos.get(j).getChannelNum() == (getDatas.addBytes[0] & 0xFF)) {
+                            if (infos.get(j).getBigType() == Configuration.FRESH_AIR_BIG_TYPE
+                                    && infos.get(j).getDeviceType() == HDLApConfig.TYPE_FRESH_AIR
+                                    && infos.get(j).getChannelNum() == (getDatas.addBytes[0] & 0xFF)) {
 
                                 devicesDataList.get(i).getAppliancesInfoList().get(j).setFeedbackState(getDatas.addBytes);
                                 AppliancesInfo mFreshAirInfo = devicesDataList.get(i).getAppliancesInfoList().get(j);
@@ -1029,12 +1030,13 @@
 
     /**
      * 澶勭悊鍦扮儹璁惧鎺у埗鏁版嵁
-     *  20190710
+     * 20190710
+     *
      * @param getDatas
      */
     private static void handleGeothermalCtrlData(UdpDataBean getDatas) {
         switch (getDatas.command) {
-                //2019-07-09 鍦扮儹妯″潡
+            //2019-07-09 鍦扮儹妯″潡
             case Configuration.GEOTHERMAL_MODULE_CTRL_BACK_COMMAND:
                 outter:
                 for (int i = 0, len = devicesDataList.size(); i < len; i++) {
@@ -1044,8 +1046,10 @@
 
                         List<AppliancesInfo> infos = devicesDataList.get(i).getAppliancesInfoList();
                         for (int j = 0, len2 = infos.size(); j < len2; j++) {
-                            if(getDatas.addBytes.length > 0) {
-                                if (infos.get(j).getChannelNum() == (getDatas.addBytes[0] & 0xFF)) {
+                            if (getDatas.addBytes.length > 0) {
+                                if (infos.get(j).getBigType() == Configuration.GEOTHERMAL_BIG_TYPE
+                                        && infos.get(j).getDeviceType() == HDLApConfig.TYPE_GEOTHERMAL_MODULE
+                                        && infos.get(j).getChannelNum() == (getDatas.addBytes[0] & 0xFF)) {
                                     if (getDatas.addBytes.length >= 8) {
                                         byte[] getBytes = devicesDataList.get(i).getAppliancesInfoList().get(j).getFeedbackState();
                                         if (getBytes == null || getBytes.length < 10) {
@@ -1942,7 +1946,7 @@
             ) {
                 List<AppliancesInfo> infos = devicesDataList.get(i).getAppliancesInfoList();
                 for (int j = 0, len2 = infos.size(); j < len2; j++) {
-                    HDLLog.info("HDL big:锛�"+devicesDataList.get(i).getAppliancesInfoList().get(j).getBigType());
+                    HDLLog.info("HDL big:锛�" + devicesDataList.get(i).getAppliancesInfoList().get(j).getBigType());
                     switch (devicesDataList.get(i).getAppliancesInfoList().get(j).getBigType()) {
                         case Configuration.LIGTH_BIG_TYPE:
                             isGetDeviceStateSuccess = true;
@@ -2194,7 +2198,7 @@
                             HDLLog.info("handle state 娌℃湁鎵惧埌鍖归厤绫诲瀷");
                             break;
                     }
-//                    break outter;
+
                 }
                 break outter;
             }
@@ -2204,6 +2208,7 @@
     /**
      * 澶勭悊鏂伴璁惧鐘舵�佹暟鎹�
      * 20190710鏂板
+     *
      * @param getDatas
      */
     private static void handleFreshAirStateData(UdpDataBean getDatas) {
@@ -2214,18 +2219,17 @@
             ) {
                 List<AppliancesInfo> infos = devicesDataList.get(i).getAppliancesInfoList();
                 for (int j = 0, len2 = infos.size(); j < len2; j++) {
-                    switch (devicesDataList.get(i).getAppliancesInfoList().get(j).getDeviceType()) {
-                        case HDLApConfig.TYPE_FRESH_AIR:
-                            isGetDeviceStateSuccess = true;
-                            devicesDataList.get(i).getAppliancesInfoList().get(j).setFeedbackState(getDatas.addBytes);
-                            EventBus.getDefault().post(new DeviceStateEvent(devicesDataList.get(i).getAppliancesInfoList().get(j), true));
+                    if (infos.get(j).getBigType() == Configuration.FRESH_AIR_BIG_TYPE
+                            && infos.get(j).getDeviceType() == HDLApConfig.TYPE_FRESH_AIR
+                            && infos.get(j).getChannelNum() == (getDatas.addBytes[0] & 0xFF)) {//2019-07-17
 
-                            break;
-                        default:
-                            HDLLog.info("handleFreshAirStateData 娌℃湁鎵惧埌鍖归厤绫诲瀷");
-                            break;
+                        isGetDeviceStateSuccess = true;
+                        devicesDataList.get(i).getAppliancesInfoList().get(j).setFeedbackState(getDatas.addBytes);
+                        EventBus.getDefault().post(new DeviceStateEvent(devicesDataList.get(i).getAppliancesInfoList().get(j), true));
+                        break outter;
+                    }else {
+                        HDLLog.info("handleFreshAirStateData 娌℃湁鎵惧埌鍖归厤绫诲瀷");
                     }
-
                 }
                 break outter;
             }
@@ -2236,6 +2240,7 @@
     /**
      * 澶勭悊鍦扮儹璁惧鐘舵�佹暟鎹�
      * 20190710鏂板
+     *
      * @param getDatas
      */
     private static void handleGeothermalStateData(UdpDataBean getDatas) {
@@ -2246,34 +2251,34 @@
             ) {
                 List<AppliancesInfo> infos = devicesDataList.get(i).getAppliancesInfoList();
                 for (int j = 0, len2 = infos.size(); j < len2; j++) {
-                    switch (devicesDataList.get(i).getAppliancesInfoList().get(j).getDeviceType()) {
-                        case HDLApConfig.TYPE_GEOTHERMAL_MODULE:
-
-                            if(getDatas.addBytes.length >= 10) {
-                                byte[] getBytes = devicesDataList.get(i).getAppliancesInfoList().get(j).getFeedbackState();
-                                if (getBytes == null || getBytes.length < 10) {
-                                    getBytes = new byte[10];
-                                }
-                                System.arraycopy(getDatas.addBytes, 0, getBytes, 0, 10);//20190710鏌ヨ鍦扮儹鐘舵�佸弽棣堬紝鍙彇鍓�10浣嶆暟鎹�
-                                devicesDataList.get(i).getAppliancesInfoList().get(j).setFeedbackState(getBytes);
-                                isGetDeviceStateSuccess = true;
-                                EventBus.getDefault().post(new DeviceStateEvent(devicesDataList.get(i).getAppliancesInfoList().get(j), true));
-                            }else {
-                                HDLLog.E("鍦扮儹鐘舵�佸弽棣堟暟鎹紓甯�");
+                    if (infos.get(j).getBigType() == Configuration.GEOTHERMAL_BIG_TYPE
+                            && infos.get(j).getDeviceType() == HDLApConfig.TYPE_GEOTHERMAL_MODULE
+                            && infos.get(j).getChannelNum() == (getDatas.addBytes[0] & 0xFF)) {//2019-07-17
+                        if (getDatas.addBytes.length >= 10) {
+                            byte[] getBytes = devicesDataList.get(i).getAppliancesInfoList().get(j).getFeedbackState();
+                            if (getBytes == null || getBytes.length < 10) {
+                                getBytes = new byte[10];
                             }
+                            System.arraycopy(getDatas.addBytes, 0, getBytes, 0, 10);//20190710鏌ヨ鍦扮儹鐘舵�佸弽棣堬紝鍙彇鍓�10浣嶆暟鎹�
+                            devicesDataList.get(i).getAppliancesInfoList().get(j).setFeedbackState(getBytes);
+                            isGetDeviceStateSuccess = true;
+                            EventBus.getDefault().post(new DeviceStateEvent(devicesDataList.get(i).getAppliancesInfoList().get(j), true));
+                        } else {
+                            HDLLog.E("鍦扮儹鐘舵�佸弽棣堟暟鎹紓甯�");
+                        }
 
-                            break;
-                        default:
-                            HDLLog.info("handleGeothermalStateData 娌℃湁鎵惧埌鍖归厤绫诲瀷");
-                            break;
+                        break outter;
+                    }else {
+                        HDLLog.info("handleFreshAirStateData 娌℃湁鎵惧埌鍖归厤绫诲瀷");
                     }
-
                 }
                 break outter;
             }
         }
     }
 
+
+
     /**
      * 姝ゆ柟娉曞熀鏈病鐢ㄥ埌锛岄�昏緫妯″潡鐨勬帶鍒朵俊鎭凡缁忓湪handleCtrlData涓鐞嗚繃浜�
      * <p>

--
Gitblit v1.8.0