From 23532fa8ad34c89b6d24b01eaef6475fd0aad898 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 15 四月 2020 18:08:24 +0800
Subject: [PATCH] ???????

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs |   78 +++++++++++++++++++++++++++------------
 1 files changed, 54 insertions(+), 24 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs
index 4be90e7..64b9ea0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetForm.cs
@@ -83,7 +83,7 @@
                 {
                     if (listDataRoom.Count > 0)
                     {
-                        //鍒濆鍖栨埧闂村拰璁惧鍒楄〃
+                        //鍒濆鍖栨埧闂村拰璁惧鍒楄〃 
                         this.InitRoomAndDeviceRow(listDataRoom);
                     }
                     else
@@ -201,38 +201,63 @@
 
             DeviceSimpleSelectControl oldSelectContr = null;
             var listDevice = this.dicShowDevice[roomId];
+            //鑾峰彇璁惧绫诲瀷鐨�
+            var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
             //妫�鏌ョ鍚堢殑璁惧
-
-            for (int i = 0; i < listDevice.Count; i++)
+            List<CommonDevice> listSupportDevice = new List<CommonDevice> { };
+            foreach (var dev in listDevice)
             {
-                string mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(listDevice[i]);
-                var contr = new DeviceSimpleSelectControl(listDevice[i], false, this.listView.rowSpace / 2);
+                //鏂伴闈㈡澘鐨勬柊椋庤澶囷紝鍒欎笉鏄剧ず
+                if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir)
+                {
+                    continue;
+                }
+                if (dev.Type == DeviceType.FreshAir)
+                {
+                    listSupportDevice.Add(dev);
+                }
+            }
+
+            DeviceSimpleSelectControl oldDeviceSimpleSelectControl = null;
+            int curIndex = 0;
+            for (int i = 0; i < listSupportDevice.Count; i++)
+            {
+                string mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(listSupportDevice[i]);
+                var contr = new DeviceSimpleSelectControl(listSupportDevice[i], false, this.listView.rowSpace / 2);
                 listView.AddChidren(contr);
                 contr.InitControl();
-                if (i != listDevice.Count - 1)
+                if (i != listSupportDevice.Count - 1)
                 {
                     //搴曠嚎
                     contr.AddBottomLine();
                 }
+
                 contr.ButtonClickEvent += (sender, e) =>
                 {
-                    contr.IsSelected = !contr.IsSelected;
-                    //閫夋嫨浜嗗埆鐨勮澶�
-                    if (contr.IsSelected == true)
+                    if (contr.IsSelected)
                     {
-                        if (oldSelectContr != null)
-                        {
-                            oldSelectContr.IsSelected = false;
-                        }
-                        oldSelectContr = contr;
-                        this.bindTargetKey = mainKey;
+                        return;
                     }
-                    //鍙栨秷閫夋嫨
-                    else
-                    {
-                        oldSelectContr = null;
-                        this.bindTargetKey = string.Empty;
-                    }
+                    contr.IsSelected = true;
+                    oldSelectContr = contr;
+                    this.bindTargetKey = mainKey;
+                    //contr.IsSelected = !contr.IsSelected;
+                    ////閫夋嫨浜嗗埆鐨勮澶�
+                    //if (contr.IsSelected == true)
+                    //{
+                    //    if (oldSelectContr != null)
+                    //    {
+                    //        oldSelectContr.IsSelected = false;
+                    //    }
+                    //    oldSelectContr = contr;
+                    //    this.bindTargetKey = mainKey;
+                    //}
+                    ////鍙栨秷閫夋嫨
+                    //else
+                    //{
+                    //    oldSelectContr = null;
+                    //    this.bindTargetKey = string.Empty;
+                    //}
                 };
                 if (this.bindTargetKey == mainKey)
                 {
@@ -277,10 +302,15 @@
                 var device = Common.LocalDevice.Current.GetDevice(deviceKeys);
                 if (device != null)
                 {
-                    canShow = true;
-                    //鏀堕泦鍙互鏄剧ず鐨勮澶�
-                    this.dicShowDevice[room.Id].Add(device);
+                    if (device.Type == DeviceType.FreshAir)
+                    {
+                        //canShow = true;//聽聽杩欎釜鐣岄潰涓嶆樉绀烘埧闂�
+                        //鏀堕泦鍙互鏄剧ず鐨勮澶�
+                        this.dicShowDevice[room.Id].Add(device);
+                    }
                 }
+
+
             }
             return canShow;
         }

--
Gitblit v1.8.0