From e5f993f52e09eb46878baced83bb8492f147d41c Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 04 十一月 2019 17:58:40 +0800
Subject: [PATCH] 2019-11-04-1

---
 ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
index 2c46711..84b4e7a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
@@ -175,7 +175,7 @@
             btnIcon.ButtonClickEvent += (sender, e) =>
             {
                 //鑿滃崟鎺т欢
-                var frameMenu = new TopRightMenuControl(this, 2);
+                var frameMenu = new TopRightMenuControl(2);
                 //闃插尯鍒楄〃
                 string menu1 = Language.StringByID(R.MyInternationalizationString.uGarrisonAreaList);
                 frameMenu.AddRowMenu(menu1, "Item/GarrisonList.png", "Item/GarrisonListSelected.png", () =>
@@ -320,7 +320,7 @@
 
             this.dicSensorStatuView.Clear();
 
-            //娣诲姞鍒楄〃鎺т欢 
+            //娣诲姞鍒楄〃鎺т欢
             frameLayoutDraw.RemoveAll();
             var listView = new VerticalFrameControl(35);
             listView.Height = frameLayoutDraw.Height;
@@ -444,16 +444,19 @@
             {
                 return;
             }
-            var timeValue = (DateTime.Now - oldGetOnlineTime).Milliseconds;
-            if (timeValue <= 10000)
+            if (oldGetOnlineTime.Year != 1900)
             {
-                //鏈�灏戣闂撮殧鍗佺,鎵嶅幓閲嶆柊鑾峰彇
-                return;
+                var timeValue = (DateTime.Now - oldGetOnlineTime).TotalSeconds;
+                if (timeValue < 10)
+                {
+                    //鏈�灏戣闂撮殧鍗佺,鎵嶅幓閲嶆柊鑾峰彇
+                    return;
+                }
             }
             oldGetOnlineTime = DateTime.Now;
 
             //浠庤澶囧垪琛ㄤ腑鑾峰彇鍦ㄧ嚎鐘舵��
-            HdlThreadLogic.Current.RunThread(async () =>
+            HdlThreadLogic.Current.RunThread(() =>
             {
                 //棣栧厛鑾峰彇杩欎簺浼犳劅鍣ㄦ墍鍦ㄧ殑缃戝叧
                 var listWay = new List<ZbGateway>();
@@ -474,18 +477,18 @@
                         //鐣岄潰鍏抽棴
                         return;
                     }
-                    await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
+                    Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
                 }
             });
         }
 
         /// <summary>
-        /// 鎺ュ彈璁惧鍦ㄧ嚎鎺ㄩ��(涓嶈蹇樿鏈�鍚庡畠浼氭帹閫佷竴涓狽ull鐨勪笢瑗胯繃鏉�)
+        /// 鎺ュ彈璁惧鍦ㄧ嚎鎺ㄩ��
         /// </summary>
         /// <param name="device"></param>
         private void ReceiveDeviceStatuPush(CommonDevice device)
         {
-            if (this.Parent == null || device == null)
+            if (this.Parent == null)
             {
                 //鐣岄潰鍏抽棴
                 return;

--
Gitblit v1.8.0