From dfd3bdc07c49fab66b38382e0bbe7c91bdf4f15b Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 28 四月 2020 15:03:43 +0800
Subject: [PATCH] 合并新代码,提供逻辑需要的门锁接口

---
 ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 53 insertions(+), 7 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
old mode 100755
new mode 100644
index 6af7fad..2e14264
--- a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
@@ -476,7 +476,16 @@
             var listDevice = new List<CommonDevice>();
             for (int i = 0; i < rowInfo.listDeviceKeys.Count; i++)
             {
-                var device = LocalDevice.Current.GetDevice(rowInfo.listDeviceKeys[i]);
+                var device = LocalDevice.Current.GetDevice(rowInfo.listDeviceKeys[i]);
+
+                //鑾峰彇璁惧绫诲瀷鐨�
+                var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
+                //鏂伴闈㈡澘涓嬬殑鍥炶矾涓嶆樉绀猴紝锛堝鏂伴銆佹俯/婀垮害浼犳劅鍣ㄥ垯涓嶆樉绀猴級
+                if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir)
+                {
+                    continue;
+                }
+
                 if (device != null)
                 {
                     listDevice.Add(device);
@@ -513,6 +522,11 @@
                     else if (device.Type == DeviceType.Thermostat)
                     {
                         cardContr = new Controls.DeviceAcRowControl(listView.rowSpace / 2);
+                    }
+                    // 鏂伴
+                    else if (device.Type == DeviceType.FreshAir)
+                    {
+                        cardContr = new Controls.DeviceFreshAirRowControl(listView.rowSpace / 2);
                     }
                     //褰╃伅(璋冨厜鍣�)
                     else if (device.Type == DeviceType.DimmableLight)
@@ -611,21 +625,43 @@
             }
 
             var dicSceneContr = new Dictionary<int, SceneCategoryView>();
-            var listview = new VerticalListControl();
-            functionSceneBodyView.AddChidren(listview);
+            //涓讳汉锛岀鐞嗗憳涓撶敤鍒锋柊鎺т欢
+            VerticalListRefreshControl listview1 = null;
+            //鎴愬憳涓撶敤涓嶈兘鍒锋柊鐨勬帶浠�
+            VerticalListControl listview2 = null;
+            //if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
+            //{
+            //    listview1 = new VerticalListRefreshControl();
+            //    functionSceneBodyView.AddChidren(listview1);
+            //}
+            //else
+            {
+                listview2 = new VerticalListControl();
+                functionSceneBodyView.AddChidren(listview2);
+            }
+
             foreach (var scene in listScene)
             {
                 //鍦烘櫙鍗$墖鎺т欢
                 var sceneView = new SceneCategoryView();
-                listview.AddChidren(sceneView);
+                listview1?.AddChidren(sceneView);
+                listview2?.AddChidren(sceneView);
                 sceneView.InitControl(scene, room);
 
                 dicSceneContr[scene.Id] = sceneView;
             }
             HdlThreadLogic.Current.RunThread(() =>
             {
-                //鑾峰彇鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂�
-                this.GetAllDelayScene(dicSceneContr, listview);
+                if (listview1 != null)
+                {
+                    //鑾峰彇鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂�
+                    this.GetAllDelayScene(dicSceneContr, listview1);
+                }
+                else
+                {
+                    //鑾峰彇鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂�
+                    this.GetAllDelayScene(dicSceneContr, listview2);
+                }
             }, ShowErrorMode.NO);
         }
 
@@ -633,7 +669,7 @@
         /// 鑾峰彇鍏ㄩ儴鍦烘櫙鐨勫欢鏃舵椂闂�
         /// </summary>
         /// <param name="dicSceneContr"></param>
-        private async void GetAllDelayScene(Dictionary<int, SceneCategoryView> dicSceneContr, VerticalListControl listview)
+        private async void GetAllDelayScene(Dictionary<int, SceneCategoryView> dicSceneContr, ViewGroup listview)
         {
             //璇诲彇鍏ㄩ儴鐨勫欢鏃舵椂闂�
             var result = await Scene.CatDelaySceneAsync();
@@ -744,6 +780,11 @@
                             //绌鸿皟鏄壒娈婄殑,瀹冪殑寮�鍏虫槸灞炴�т笂鎶ユ潵鐫�.宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉
                             this.dicDeviceRowControl[mainKeys].SetHadGetResponeResultStatu();
                         }
+                        if (report.DeviceStatusReport.CluterID == 514 && report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
+                        {
+                            //鏂伴鏄壒娈婄殑,瀹冪殑寮�鍏虫槸灞炴�т笂鎶ユ潵鐫�.宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉
+                            this.dicDeviceRowControl[mainKeys].SetHadGetResponeResultStatu();
+                        }
                         this.dicDeviceRowControl[mainKeys].RefreshControlInfo(locadevice);
                     }
                 }, ShowErrorMode.NO);
@@ -850,6 +891,11 @@
                     LocalDevice.Current.GetDeviceObjectIcon(typeInfo.ConcreteType, ref path1, ref path2);
                     dic[typeInfo.BeloneTextId].IconPath = path1;
                     dic[typeInfo.BeloneTextId].IconPathSelected = path2;
+                    if (device.Type == DeviceType.FreshAir)
+                    {
+                        dic[typeInfo.BeloneTextId].IconPath = "Device/FreshAirEpoint.png";
+                        dic[typeInfo.BeloneTextId].IconPathSelected = "Device/FreshAirEpointSelected.png";
+                    }
                     dic[typeInfo.BeloneTextId].TextId = typeInfo.BeloneTextId;
                 }
                 dic[typeInfo.BeloneTextId].listDeviceKeys.Add(LocalDevice.Current.GetDeviceMainKeys(device));

--
Gitblit v1.8.0