From 4dce704aaf8587cf3f91cf88f2208315a03c4cbb Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 08 四月 2020 13:54:58 +0800
Subject: [PATCH] 先上传一个版本

---
 ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs |   73 ++++++++++++++++++------------------
 1 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs b/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
index 77d71a7..266fff7 100755
--- a/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
@@ -45,7 +45,7 @@
         /// <summary>
         /// deviceUI
         /// </summary>
-        public DeviceUI deviceUI;
+        public CommonDevice deviceUI;
         /// <summary>
         /// 鍔熻兘绫诲瀷
         /// </summary>
@@ -82,11 +82,11 @@
         /// <summary>
         /// dList
         /// </summary>
-        private List<DeviceUI> devList;
+        private List<CommonDevice> devList;
         /// <summary>
         /// 鐩稿悓绫诲瀷鐨勮澶囧垪琛�
         /// </summary>
-        private Dictionary<int, List<DeviceUI>> typeDeviceDic;
+        private Dictionary<int, List<CommonDevice>> typeDeviceDic;
         /// <summary>
         /// 璁惧绫诲瀷鐨勫浘id
         /// </summary>
@@ -138,7 +138,7 @@
         /// </summary>
         private void InitData()
         {
-            typeDeviceDic = new Dictionary<int, List<DeviceUI>> { };
+            typeDeviceDic = new Dictionary<int, List<CommonDevice>> { };
             typeIdDic = new Dictionary<int, DeviceConcreteType> { };
         }
 
@@ -147,12 +147,12 @@
         /// </summary>
         private void RefreshData(Common.Room room)
         {
-            devList = room.DeviceUIList;
+            devList = UserCenter.HdlRoomLogic.Current.GetRoomListDevice(room);
             typeDeviceDic.Clear();
             typeIdDic.Clear();
             foreach (var device in devList)
             {
-                var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device.CommonDevice);
+                var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device);
                 if (info.BeloneType == DeviceBeloneType.A寮�鍏� || info.BeloneType == DeviceBeloneType.A褰╃伅
                     || info.BeloneType == DeviceBeloneType.A鎻掑骇 || info.BeloneType == DeviceBeloneType.A鏅鸿兘绌哄紑
                     || info.BeloneType == DeviceBeloneType.A鐏厜 || info.BeloneType == DeviceBeloneType.A绌鸿皟
@@ -162,7 +162,7 @@
                 {
                     if (typeDeviceDic.ContainsKey(info.BeloneTextId) == false)
                     {
-                        var sameDevList = new List<DeviceUI> { };
+                        var sameDevList = new List<CommonDevice> { };
                         sameDevList.Add(device);
                         typeDeviceDic[info.BeloneTextId] = sameDevList;
                     }
@@ -288,7 +288,8 @@
             bodyFrameLayout.AddChidren(functionSceneBodyView);
 
             RoomButton curBtn = new RoomButton(0, 0);
-            foreach (var room in Common.Room.CurrentRoom.GetRoomsByFloorIdAppendLoveRoom(floorId))
+            var lisrRoom = UserCenter.HdlRoomLogic.Current.GetRoomsByFloorIdAppendLoveRoom(floorId);
+            foreach (var room in lisrRoom)
             {
                 var row = new FrameLayout()
                 {
@@ -431,7 +432,7 @@
 
             deviceListScrolView.RemoveAll();
 
-            var sameTypeList = new List<DeviceUI> { };
+            var sameTypeList = new List<CommonDevice> { };
             sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())];
 
             foreach (var device in sameTypeList)
@@ -449,7 +450,7 @@
 
                 var deviceRow = new FunctionRow(0, 35);
                 deviceRow.Init(device.IconPath, device.OnlineIconPath, true);
-                deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice));
+                deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(device));
                 deviceRow.IsSelected = true;
                 deviceRow.HideSwitchBtn(false);
                 deviceRow.NameBtn.BackgroundColor = ZigbeeColor.Current.GXCRedColor;
@@ -497,7 +498,7 @@
         /// ShowSelectAction
         /// </summary>
         /// <param name="device"></param>
-        private void ShowSelectAction(DeviceUI device, SceneTargetDeviceUI sceneTarget)
+        private void ShowSelectAction(CommonDevice device, SceneTargetDeviceUI sceneTarget)
         {
             var dialog = new FrameLayout()
             {
@@ -510,23 +511,23 @@
                 dialog.RemoveFromParent();
             };
 
-            if (device.CommonDevice.Type == ZigBee.Device.DeviceType.OnOffOutput)
+            if (device.Type == ZigBee.Device.DeviceType.OnOffOutput)
             {
                 SelectOnoffOutput(dialog, device, sceneTarget);
             }
-            else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.AirSwitch)
+            else if (device.Type == ZigBee.Device.DeviceType.AirSwitch)
             {
                 SelectOnoffOutput(dialog, device, sceneTarget);
             }
-            else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.DimmableLight)
+            else if (device.Type == ZigBee.Device.DeviceType.DimmableLight)
             {
                 SelectDimmableLight(dialog, device, sceneTarget);
             }
-            else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
+            else if (device.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
             {
                 SelectWindowCoveringDevice(dialog, device, sceneTarget);
             }
-            else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.Thermostat)
+            else if (device.Type == ZigBee.Device.DeviceType.Thermostat)
             {
                 SelectThermostat(dialog, device, sceneTarget);
             }
@@ -538,7 +539,7 @@
         /// <param name="dialog"></param>
         /// <param name="device"></param>
         /// <param name="sceneTarget"></param>
-        private void SelectOnoffOutput(FrameLayout dialog, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+        private void SelectOnoffOutput(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
         {
             var selectFL = new FrameLayout
             {
@@ -587,7 +588,7 @@
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
-                Text = Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice)
+                Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
             };
             titleFL.AddChidren(deviceName);
 
@@ -657,7 +658,7 @@
 
             comfrimBtn.MouseUpEventHandler = (sender, e) =>
             {
-                var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { };
+                var taskList = new List<Safeguard.TaskListInfo> { };
                 int taskType = 1;
                 int data1 = 0;
                 int data2 = 0;
@@ -674,7 +675,7 @@
                     data1 = 0;
                     data2 = 0;
                 }
-                var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+                var taskInfo = new Safeguard.TaskListInfo
                 {
                     TaskType = taskType,
                     Data1 = data1,
@@ -694,7 +695,7 @@
         /// <param name="dialog"></param>
         /// <param name="device"></param>
         /// <param name="sceneTarget"></param>
-        private void SelectWindowCoveringDevice(FrameLayout dialog, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+        private void SelectWindowCoveringDevice(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
         {
             var selectFL = new FrameLayout
             {
@@ -743,7 +744,7 @@
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
-                Text = Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice)
+                Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
             };
             titleFL.AddChidren(deviceName);
 
@@ -820,7 +821,7 @@
 
             comfrimBtn.MouseUpEventHandler = (sender, e) =>
             {
-                var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { };
+                var taskList = new List<Safeguard.TaskListInfo> { };
 
                 int taskType = 6;
                 int data1 = 0;
@@ -839,7 +840,7 @@
                     data2 = open.SeekBar.Progress;
                 }
 
-                var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+                var taskInfo = new Safeguard.TaskListInfo
                 {
                     TaskType = taskType,
                     Data1 = data1,
@@ -859,7 +860,7 @@
         /// <param name="dialog"></param>
         /// <param name="device"></param>
         /// <param name="sceneTarget"></param>
-        private void SelectDimmableLight(FrameLayout dialog, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+        private void SelectDimmableLight(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
         {
             var selectFL = new FrameLayout
             {
@@ -909,7 +910,7 @@
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
                 TextAlignment = TextAlignment.CenterLeft,
-                Text = Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice)
+                Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
             };
             titleFL.AddChidren(deviceName);
 
@@ -986,7 +987,7 @@
 
             comfrimBtn.MouseUpEventHandler = (sender, e) =>
             {
-                var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { };
+                var taskList = new List<Safeguard.TaskListInfo> { };
 
                 int taskType = 3;
                 int data1 = 0;
@@ -1005,7 +1006,7 @@
                     data2 = 0;
                 }
 
-                var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+                var taskInfo = new Safeguard.TaskListInfo
                 {
                     TaskType = taskType,
                     Data1 = data1,
@@ -1025,7 +1026,7 @@
         /// <param name="dialog"></param>
         /// <param name="device"></param>
         /// <param name="sceneTarget"></param>
-        private void SelectThermostat(FrameLayout dialog, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+        private void SelectThermostat(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
         {
             var selectFL = new FrameLayout
             {
@@ -1075,7 +1076,7 @@
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
                 TextAlignment = TextAlignment.CenterLeft,
-                Text = Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice)
+                Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
             };
             titleFL.AddChidren(deviceName);
 
@@ -1169,7 +1170,7 @@
             comfrimBtn.MouseUpEventHandler = (sender, e) =>
             {
 
-                var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { };
+                var taskList = new List<Safeguard.TaskListInfo> { };
 
                 int taskType = 5;
                 int data1 = 0;
@@ -1180,7 +1181,7 @@
                     //鍏�
                     data1 = 3;
                     data2 = 0;
-                    var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+                    var taskInfo = new Safeguard.TaskListInfo
                     {
                         TaskType = taskType,
                         Data1 = data1,
@@ -1191,7 +1192,7 @@
                 else
                 {
                     //fan
-                    var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+                    var taskInfo = new Safeguard.TaskListInfo
                     {
                         TaskType = taskType,
                         Data1 = 6,
@@ -1200,7 +1201,7 @@
                     taskList.Add(taskInfo);
 
                     //mode
-                    var taskInfo2 = new ZigBee.Device.Scene.TaskListInfo
+                    var taskInfo2 = new Safeguard.TaskListInfo
                     {
                         TaskType = taskType,
                         Data1 = 3,
@@ -1212,7 +1213,7 @@
                     if (open.modeList[modelId] == 4)
                     {
                         //heat
-                        var taskInfo3 = new ZigBee.Device.Scene.TaskListInfo
+                        var taskInfo3 = new Safeguard.TaskListInfo
                         {
                             TaskType = taskType,
                             Data1 = 4,
@@ -1224,7 +1225,7 @@
                     else
                     {
                         //heat
-                        var taskInfo3 = new ZigBee.Device.Scene.TaskListInfo
+                        var taskInfo3 = new Safeguard.TaskListInfo
                         {
                             TaskType = taskType,
                             Data1 = 5,

--
Gitblit v1.8.0