From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs |  100 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 90 insertions(+), 10 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
index b09fc48..c6625c0 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
@@ -41,7 +41,7 @@
             var middle = new VerticalScrolViewLayout
             {
                 Y = view.topRowLayout.Bottom,
-                Height = Application.GetRealHeight(1920 - 184 - 180),
+                Height = Application.GetRealHeight(Method.H - 184 - 180),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
@@ -139,7 +139,7 @@
                             {
                                 var deviceinof = Method.GetCommonDevice(conditions["MacAddr"], conditions["Epoint"]);
                                 selecteddevice.deviceNameBtn.Visible = true;
-                                selecteddevice.deviceNameBtn.Text = LocalDevice.Current.GetDeviceEpointName(deviceinof);
+                                selecteddevice.deviceNameBtn.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(deviceinof);
                                 selecteddevice.regionNameBtn.Visible = true;
                                 Method.RoomNmae(selecteddevice.regionNameBtn, deviceinof);
                                 selecteddevice.edit.Tag = i;
@@ -176,7 +176,7 @@
                     ///鍒犻櫎鎺т欢
                     selecteddevice.del.MouseUpEventHandler += (sender, e) =>
                     {
-                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
+                        var alert = new ShowMsgControl(ShowMsgType.Confirm,
                       Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                       Language.StringByID(MyInternationalizationString.confrim));
                         alert.Show();
@@ -246,7 +246,7 @@
                             {
 
                                 var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
-                                name =LocalDevice.Current.GetDeviceEpointName(deviceinof);
+                                name =HdlDeviceCommonLogic.Current.GetDeviceEpointName(deviceinof);
                                 actiondevice.regionNameBtn.Visible = true;
                                 Method.RoomNmae(actiondevice.regionNameBtn, deviceinof);
 
@@ -504,7 +504,86 @@
                                             }
                                         }
                                         break;
+                                    case DeviceType.ColorTemperatureLight:
+                                        {
+                                            icon = "ZigeeLogic/nightLight.png";
+                                            var taskList = actions["TaskList"] as List<Dictionary<string, string>>;
+                                            if (taskList == null)
+                                            {
+                                                continue;
+                                            }
+                                            foreach (var tasks in taskList)
+                                            {
+                                                switch (tasks["TaskType"])
+                                                {
+                                                    case "1":
+                                                        {
+                                                            if (tasks["Data1"] == "0")
+                                                            {
+                                                                state += Language.StringByID(MyInternationalizationString.close) + ";";
+                                                            }
+                                                            else
+                                                            {
+                                                                state += Language.StringByID(MyInternationalizationString.open) + ";";
+                                                            }
+                                                        }
+                                                        break;
 
+                                                }
+                                            }
+                                            foreach (var tasks in taskList)
+                                            {
+                                                switch (tasks["TaskType"])
+                                                {
+
+                                                    case "3":
+                                                        {
+                                                            var intvalue = int.Parse(tasks["Data1"]);
+                                                            var lightbrightnessvalue = (intvalue * 100) / 254;
+                                                            state += Language.StringByID(MyInternationalizationString.brightness) + lightbrightnessvalue.ToString() + "%;";
+                                                        }
+                                                        break;
+
+                                                }
+                                            }
+                                            foreach (var tasks in taskList)
+                                            {
+                                                switch (tasks["TaskType"])
+                                                {
+
+                                                    case "7":
+                                                        {
+                                                            if (tasks["Data1"] == "0")
+                                                            {
+                                                                state += Language.StringByID(MyInternationalizationString.buzzer) + Language.StringByID(MyInternationalizationString.close) + ";";
+                                                            }
+                                                            else
+                                                            {
+                                                                state += Language.StringByID(MyInternationalizationString.buzzer) + Language.StringByID(MyInternationalizationString.open) + ";";
+                                                            }
+                                                        }
+                                                        break;
+
+                                                }
+                                            }
+                                            foreach (var tasks in taskList)
+                                            {
+                                                switch (tasks["TaskType"])
+                                                {
+
+                                                    case "8":
+                                                        {
+                                                            var intvalue = int.Parse(tasks["Data1"]);
+                                                            var colorTemperatureValue = 1000000 / (intvalue * 100);
+                                                            state += Language.StringByID(MyInternationalizationString.colorTemperature) + colorTemperatureValue.ToString() + "K";
+                                                        }
+                                                        break;
+                                                }
+                                            }
+
+                                            state = state.TrimEnd(';');//鍘绘帀鏈�鍚庨偅涓�";"
+                                        }
+                                        break;
                                 }
 
 
@@ -512,9 +591,9 @@
                             break;
                         case 2:
                             {
-                                actiondevice.edit.Visible = false;//闅愯棌缂栬緫鎸夐挳(鍦烘櫙涓嶉渶瑕佺紪杈�)
-                                //鍦ㄦ湰鍦版煡鎵捐鍦烘櫙;
-                                var sceneinof = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(Convert.ToInt32(actions["DeviceAddr"].ToString()));
+                                actiondevice.edit.Visible = false;//闅愯棌缂栬緫鎸夐挳(鍦烘櫙涓嶉渶瑕佺紪杈�)
+                                //鍦ㄦ湰鍦版煡鎵捐鍦烘櫙;
+                                var sceneinof = HdlSceneLogic.Current.GetSceneUIBySceneId(Convert.ToInt32(actions["DeviceAddr"].ToString()));
                                 //鏈湴娌℃湁瀛樺湪;
                                 if (sceneinof == null)
                                 {
@@ -542,7 +621,7 @@
                                 name = sceneinof.Name;
                                 actiondevice.regionNameBtn.Visible = true;
                                 /////閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О
-                                actiondevice.regionNameBtn.Text = UserCenter.HdlRoomLogic.Current.GetRoomNameBySceneId(sceneinof.Id);
+                                actiondevice.regionNameBtn.Text = HdlRoomLogic.Current.GetRoomNameBySceneId(sceneinof.Id);
 
                             }
                             break;
@@ -559,6 +638,7 @@
                     actiondevice.selecetddevicestateBtn.Text = state;
 
                     ///缂栬緫
+                    actiondevice.edit.Tag = i.ToString();
                     actiondevice.edit.MouseUpEventHandler += (sender, e) =>
                     {
                         switch (linkType)
@@ -569,7 +649,7 @@
                                     var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
                                     var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
                                     this.AddChidren(flMain);
-                                    CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "action_lockaction");
+                                    CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "action_lockaction", int.Parse(actiondevice.edit.Tag.ToString()));
                                 }
                                 break;
 
@@ -580,7 +660,7 @@
                     actiondevice.del.MouseUpEventHandler += (sender, e) =>
                     {
 
-                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
+                        var alert = new ShowMsgControl(ShowMsgType.Confirm,
                              Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                              Language.StringByID(MyInternationalizationString.confrim));
                         alert.Show();

--
Gitblit v1.8.0