From e28d283bd27db2c40ff435c517db54e2010e8ae6 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 24 十二月 2019 14:31:56 +0800
Subject: [PATCH] 2019.12.24

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs |   88 +++++++++++++++++++++++++++++++-------------
 1 files changed, 62 insertions(+), 26 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
index 55c143d..3d6dcec 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
@@ -24,6 +24,10 @@
         /// </summary>
         private bool m_isOnline = false;
         /// <summary>
+        /// 浼犳劅鍣ㄦ帹閫佷腑
+        /// </summary>
+        private bool sensorPushing = false;
+        /// <summary>
         /// 鍦ㄧ嚎鐘舵��
         /// </summary>
         public bool isOnline
@@ -42,13 +46,13 @@
         /// </summary>
         public IconViewControl btnIcon = null;
         /// <summary>
-        /// 璁惧绫诲瀷鎺т欢
-        /// </summary>
-        private NormalViewControl btnDeviceObject = null;
-        /// <summary>
         /// 璁惧澶囨敞鎺т欢
         /// </summary>
         private NormalViewControl btnDeviceName = null;
+        /// <summary>
+        /// 璁惧鎴块棿鎺т欢
+        /// </summary>
+        private NormalViewControl btnDeviceRoom = null;
 
         #endregion
 
@@ -74,32 +78,30 @@
             btnIcon = frameTable.AddLeftIcon(81);
             Common.LocalDevice.Current.SetDeviceBeloneIconToControl(btnIcon, listDevice);
 
-            //璁惧绫诲瀷
-            string objText = Common.LocalDevice.Current.GetDeviceObjectText(listDevice);
-            btnDeviceObject = frameTable.AddLeftCaption(objText, 800, 60, true);
-            btnDeviceObject.TextSize = 15;
-            //杩欎釜鍧愭爣鏈夌偣鐗规畩
-            btnDeviceObject.Y = Application.GetRealHeight(12) + this.chidrenYaxis;
-            btnDeviceObject.Text = Common.LocalDevice.Current.GetDeviceObjectText(listDevice);
-            frameTable.AddChidren(btnDeviceObject, ChidrenBindMode.BindEventOnly);
-
             //璁惧
             string deviceName = Common.LocalDevice.Current.GetDeviceMacName(listDevice[0]);
-            btnDeviceName = frameTable.AddLeftCaption(deviceName, 800, 49, true);
+            btnDeviceName = frameTable.AddLeftCaption(deviceName, 800, 60, true);
+            btnDeviceName.TextSize = 15;
             //杩欎釜鍧愭爣鏈夌偣鐗规畩
-            btnDeviceName.Y = Application.GetRealHeight(72) + this.chidrenYaxis;
-            btnDeviceName.TextSize = 12;
-            btnDeviceName.TextColor = UserCenterColor.Current.TextGrayColor1;
-            btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceMacName(listDevice[0]);
+            btnDeviceName.Y = Application.GetRealHeight(12) + this.chidrenYaxis;
+            btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceObjectText(listDevice);
             frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+
+            //鎴块棿
+            string roomName = Common.LocalDevice.Current.GeteRealDeviceRoomName(listDevice[0]);
+            btnDeviceRoom = frameTable.AddLeftCaption(roomName, 800, 49, true);
+            //杩欎釜鍧愭爣鏈夌偣鐗规畩
+            btnDeviceRoom.Y = Application.GetRealHeight(72) + this.chidrenYaxis;
+            btnDeviceRoom.TextSize = 12;
+            btnDeviceRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnDeviceRoom.Text = Common.LocalDevice.Current.GetDeviceMacName(listDevice[0]);
+            frameTable.AddChidren(btnDeviceRoom, ChidrenBindMode.BindEventOnly);
 
             //搴曠嚎
             frameTable.AddBottomLine();
 
             //璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥
             this.isOnline = listDevice[0].IsOnline == 1;
-
-            listDevice = null;
         }
 
         #endregion
@@ -114,11 +116,11 @@
         {
             if (isOnline == false)
             {
-                btnDeviceObject.TextColor = UserCenterColor.Current.TextGrayColor1;
+                btnDeviceName.TextColor = UserCenterColor.Current.TextGrayColor1;
             }
             else
             {
-                btnDeviceObject.TextColor = UserCenterColor.Current.TextColor1;
+                btnDeviceName.TextColor = UserCenterColor.Current.TextColor1;
             }
         }
 
@@ -137,15 +139,49 @@
             var listDevice = Common.LocalDevice.Current.GetDevicesByMac(this.deviceMac);
             //鍥炬爣
             Common.LocalDevice.Current.SetDeviceBeloneIconToControl(btnIcon, listDevice);
-            //璁惧绫诲瀷
-            btnDeviceObject.Text = Common.LocalDevice.Current.GetDeviceObjectText(listDevice);
             //璁惧
             btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceMacName(listDevice[0]);
+            //璁惧鎴块棿
+            btnDeviceRoom.Text = Common.LocalDevice.Current.GeteRealDeviceRoomName(listDevice[0]);
             //璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥
             this.isOnline = listDevice[0].IsOnline == 1;
-
-            listDevice = null;
         }
+
+
+        /// <summary>
+        /// 鏄剧ず浼犳劅鍣ㄤ笂鎶ョ殑鐗规晥
+        /// </summary>
+        public void StartSensorPushAppeal()
+        {
+            if (this.sensorPushing == true)
+            {
+                //浼犳劅鍣ㄦ鍦ㄧ壒鏁堜腑
+                return;
+            }
+            this.sensorPushing = true;
+            //璁惧
+            uint oldTextColor1 = btnDeviceName.TextColor;
+            btnDeviceName.TextColor = UserCenterColor.Current.TextOrangeColor;
+            //璁惧鎴块棿
+            uint oldTextColor2 = btnDeviceRoom.TextColor;
+            btnDeviceRoom.TextColor = UserCenterColor.Current.TextOrangeColor;
+            HdlThreadLogic.Current.RunThread(() =>
+            {
+                System.Threading.Thread.Sleep(5000);
+                HdlThreadLogic.Current.RunMain(() =>
+                {
+                    if (btnDeviceName.Parent != null)
+                    {
+                        //璁惧
+                        btnDeviceName.TextColor = oldTextColor1;
+                        //璁惧鎴块棿
+                        btnDeviceRoom.TextColor = oldTextColor2;
+                    }
+                    this.sensorPushing = false;
+                }, ShowErrorMode.NO);
+            });
+        }
+
         #endregion
     }
 }

--
Gitblit v1.8.0