From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期三, 22 六月 2022 11:22:18 +0800
Subject: [PATCH] 修改引用路径

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs |  203 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 185 insertions(+), 18 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
index 12546e0..7c1caca 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
@@ -37,6 +37,14 @@
             /// 绌鸿皟鐩爣
             /// </summary>
             AC = 5,
+            /// <summary>
+            /// 鍦版殩鐩爣
+            /// </summary>
+            Fh = 6,
+            /// <summary>
+            /// 鍦癈O2鏆栫洰鏍�
+            /// </summary>
+            CO2 = 7,
         }
 
         #endregion
@@ -167,6 +175,17 @@
                             {
                                 curRoomDeviceListTemp.Add(device);
                             }
+
+                            if (device.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+                            {
+                                //鑾峰彇璁惧绫诲瀷
+                                var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
+                                //绌烘皵璐ㄩ噺浼犳劅鍣�
+                                if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+                                {
+                                    curRoomDeviceListTemp.Add(device);
+                                }
+                            }
                         }
                     }
                     break;
@@ -183,6 +202,25 @@
                                     continue;
                                 }
                                 curRoomDeviceListTemp.Add(device);
+                            }
+                        }
+                    }
+                    break;
+                case BindType.CO2:
+                    foreach (var deviceKeys in curRoom.ListDevice)
+                    {
+                        var device = LocalDevice.Current.GetDevice(deviceKeys);
+                        if (device != null)
+                        {
+                            if (device.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+                            {
+                                //鑾峰彇璁惧绫诲瀷
+                                var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
+                                //绌烘皵璐ㄩ噺浼犳劅鍣�
+                                if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+                                {
+                                    curRoomDeviceListTemp.Add(device);
+                                }
                             }
                         }
                     }
@@ -211,6 +249,10 @@
                     if (device.Type == DeviceType.TemperatureSensor)
                     {
                         var dev = device as TemperatureSensor;
+                        if (BindInfo.checkRealTemperatureDevice(device) == false)
+                        {
+                            continue;
+                        }
                         if (dev.SensorDiv == 1)
                         {
                             roomIncludeMatchTempDevice.Add(device);
@@ -252,7 +294,19 @@
                     if (device.Type == DeviceType.TemperatureSensor)
                     {
                         var dev = device as TemperatureSensor;
+                        if (BindInfo.checkRealTemperatureDevice(device) == false)
+                        {
+                            continue;
+                        }
                         if (dev.SensorDiv == 2)
+                        {
+                            roomIncludeMatchHumpDevice.Add(device);
+                        }
+
+                        //鑾峰彇璁惧绫诲瀷
+                        var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
+                        //绌烘皵璐ㄩ噺浼犳劅鍣�
+                        if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
                         {
                             roomIncludeMatchHumpDevice.Add(device);
                         }
@@ -274,10 +328,10 @@
         }
 
         /// <summary>
-        /// 鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂村垪琛�
+        /// 鑾峰彇鏀寔鐨勬埧闂村垪琛�
         /// </summary>
         /// <returns></returns>
-        public static List<Room> GetFloorRoomList()
+        public static List<Room> GetSupportRoomList()
         {
             var supportRoomListTemp = new List<Room>();
             var listAllRoom = HdlRoomLogic.Current.GetAllListRooms();
@@ -347,10 +401,7 @@
                                 var device = LocalDevice.Current.GetDevice(de);
                                 if (device != null)
                                 {
-                                    //鑾峰彇璁惧绫诲瀷鐨�
-                                    var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
-                                    //鏂伴闈㈡澘鐨勬柊椋庤澶囷紝鍒欎笉鏄剧ず
-                                    if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir)
+                                    if (BindInfo.checkRealFreshAirDevice(device) == false)
                                     {
                                         continue;
                                     }
@@ -388,6 +439,16 @@
                                     {
                                         roomIncludeMatchDevice.Add(device);
                                     }
+                                    else if (device.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+                                    {
+                                        //鑾峰彇璁惧绫诲瀷
+                                        var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
+                                        //绌烘皵璐ㄩ噺浼犳劅鍣�
+                                        if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+                                        {
+                                            roomIncludeMatchDevice.Add(device);
+                                        }
+                                    }
                                 }
                             }
                             break;
@@ -408,6 +469,25 @@
                                 }
                             }
                             break;
+                        case BindType.CO2:
+                            foreach (var de in room.ListDevice)
+                            {
+                                var device = LocalDevice.Current.GetDevice(de);
+                                if (device != null)
+                                {
+                                    if (device.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+                                    {
+                                        //鑾峰彇璁惧绫诲瀷
+                                        var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
+                                        //绌烘皵璐ㄩ噺浼犳劅鍣�
+                                        if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+                                        {
+                                            roomIncludeMatchDevice.Add(device);
+                                        }
+                                    }
+                                }
+                            }
+                            break;
                     }
 
                     if (roomIncludeMatchDevice.Count == 0)
@@ -417,7 +497,7 @@
 
                     if (!string.IsNullOrEmpty(room.FloorId))
                     {
-                        //鏈夋ゼ灞�
+                        //鏈夋ゼ灞俒鎺у埗闈㈡澘濡傛灉涓嶅湪鎴块棿锛岄粯璁や笉缁戝畾]
                         if (room.FloorId == curControlDev.currentSelectFloorId)
                         {
                             roomTempList.Add(room);
@@ -511,6 +591,14 @@
                             {
                                 undistruibuteDevList.Add(device);
                             }
+
+                            //鑾峰彇璁惧绫诲瀷
+                            var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
+                            //绌烘皵璐ㄩ噺浼犳劅鍣�
+                            if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+                            {
+                                undistruibuteDevList.Add(device);
+                            }
                         }
                         else if (device.Type == DeviceType.PMSensor)
                         {
@@ -536,6 +624,16 @@
                         {
                             undistruibuteDevList.Add(device);
                         }
+                        else if (device.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+                        {
+                            //鑾峰彇璁惧绫诲瀷
+                            var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
+                            //绌烘皵璐ㄩ噺浼犳劅鍣�
+                            if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+                            {
+                                undistruibuteDevList.Add(device);
+                            }
+                        }
                     }
                     break;
                 case BindType.AC:
@@ -548,6 +646,21 @@
                                 continue;
                             }
                             undistruibuteDevList.Add(device);
+                        }
+                    }
+                    break;
+                case BindType.CO2:
+                    foreach (var device in UndistributeCommonDeviceListTemp)
+                    {
+                        if (device.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+                        {
+                            //鑾峰彇璁惧绫诲瀷
+                            var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
+                            //绌烘皵璐ㄩ噺浼犳劅鍣�
+                            if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+                            {
+                                undistruibuteDevList.Add(device);
+                            }
                         }
                     }
                     break;
@@ -645,6 +758,17 @@
                                 {
                                     currentPanelBindSupportDeviceListTemp.Add(device);
                                 }
+
+                                if (device.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+                                {
+                                    //鑾峰彇璁惧绫诲瀷
+                                    var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
+                                    //绌烘皵璐ㄩ噺浼犳劅鍣�
+                                    if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+                                    {
+                                        currentPanelBindSupportDeviceListTemp.Add(device);
+                                    }
+                                }
                             }
                         }
                     }
@@ -668,6 +792,32 @@
                                         continue;
                                     }
                                     currentPanelBindSupportDeviceListTemp.Add(device);
+                                }
+                            }
+                        }
+                    }
+                    break;
+                case BindType.CO2:
+                    foreach (var r in supportRoomList)
+                    {
+                        if (r.ListDevice.Count == 0)
+                        {
+                            continue;
+                        }
+                        foreach (var deviceKeys in r.ListDevice)
+                        {
+                            var device = LocalDevice.Current.GetDevice(deviceKeys);
+                            if (device != null)
+                            {
+                                if (device.Type == ZigBee.Device.DeviceType.TemperatureSensor)
+                                {
+                                    //鑾峰彇璁惧绫诲瀷
+                                    var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<ZigBee.Device.CommonDevice>() { device });
+                                    //绌烘皵璐ㄩ噺浼犳劅鍣�
+                                    if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+                                    {
+                                        currentPanelBindSupportDeviceListTemp.Add(device);
+                                    }
                                 }
                             }
                         }
@@ -703,7 +853,7 @@
         }
 
         /// <summary>
-        /// 鏄惁鏄湡瀹炵殑绌鸿皟璁惧 銆愰儴鍒嗘槸鑳界粦瀹氱┖璋冪殑璁惧銆� 
+        /// 鏄惁鏄湡瀹炵殑绌鸿皟璁惧 銆愯繃婊erver绔�� 
         /// </summary>
         /// <param name="device"></param>
         /// <returns></returns>
@@ -711,7 +861,7 @@
         {
             bool result = true;
             //鑾峰彇璁惧绫诲瀷鐨�
-            var clu = device.OutClusterList.Find((obj) => obj.OutCluster == 513);
+            var clu = device.OutClusterList.Find((obj) => obj.OutCluster == 513 || obj.OutCluster == 514);
             if (clu != null)
             {
                 result = false;
@@ -720,7 +870,7 @@
         }
 
         /// <summary>
-        /// 鏄惁鏄湡瀹炵殑鏂伴璁惧 銆愰儴鍒嗘槸鑳界粦瀹氭柊椋庣殑璁惧銆� 
+        /// 鏄惁鏄湡瀹炵殑鏂伴璁惧 銆愯繃婊erver绔�� 
         /// </summary>
         /// <param name="device"></param>
         /// <returns></returns>
@@ -728,12 +878,8 @@
         {
             bool result = true;
             //鑾峰彇璁惧绫诲瀷鐨�
-            var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
-            if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir)
-            {
-                result = false;
-            }
-            if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleEnvironment)
+            var clu = device.OutClusterList.Find((obj) => obj.OutCluster == 514);
+            if (clu != null)
             {
                 result = false;
             }
@@ -741,7 +887,28 @@
         }
 
         /// <summary>
-        /// 妫�娴嬭璁惧鑳藉惁鏄剧ず
+        /// 鏄惁鏄湡瀹炵殑娓╁害璁惧 銆愯繃婊erver绔�� 
+        /// </summary>
+        /// <param name="device"></param>
+        /// <returns></returns>
+        public static bool checkRealTemperatureDevice(CommonDevice device)
+        {
+            bool result = true;
+            //鑾峰彇璁惧灞炰簬銆愮畝绾﹀鍔熻兘闈㈡澘銆�
+            var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice> { device });
+            if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleMultifunction)
+            {
+                if (device.Type == DeviceType.TemperatureSensor && device.DeviceEpoint == 1)
+                {
+                    //绠�绾﹀鍔熻兘闈㈡澘绗�1鍥炶矾鏄竴涓粦瀹氭俯婀垮害浼犳劅鍣ㄧ绫诲瀷锛屼笉鏄湡鐨勬俯婀垮害鐨勪紶鎰熷櫒锛岄渶瑕佸睆钄芥帀
+                    result = false;
+                }
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 妫�娴嬭璁惧鑳藉惁鏄剧ず銆愯繃婊erver绔�� 
         /// </summary>
         /// <param name="device"></param>
         /// <returns></returns>
@@ -1051,6 +1218,6 @@
                 btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
             }
         }
-        #endregion 
+        #endregion
     }
 }

--
Gitblit v1.8.0