From 72e1b4e4626315ebd4b879a68c94e7738fd0473e Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 28 十月 2019 11:00:28 +0800
Subject: [PATCH] 2019-10-28-1
---
ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs | 37 +++++++++++++++++++------------------
1 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
index 55ccfe5..47ea583 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", () =>
@@ -326,7 +326,7 @@
listView.Height = frameLayoutDraw.Height;
frameLayoutDraw.AddChidren(listView);
- new System.Threading.Thread(() =>
+ HdlThreadLogic.Current.RunThread(() =>
{
//鑾峰彇瀹夐槻鐨勫叏閮ㄤ紶鎰熷櫒璁惧鐨勪俊鎭�
var dicDevice = HdlSafeguardLogic.Current.GetAllSensorDeviceInfo();
@@ -363,8 +363,7 @@
}
});
}
- })
- { IsBackground = true }.Start();
+ });
}
/// <summary>
@@ -445,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;
//浠庤澶囧垪琛ㄤ腑鑾峰彇鍦ㄧ嚎鐘舵��
- new System.Threading.Thread(async () =>
+ HdlThreadLogic.Current.RunThread(async () =>
{
//棣栧厛鑾峰彇杩欎簺浼犳劅鍣ㄦ墍鍦ㄧ殑缃戝叧
var listWay = new List<ZbGateway>();
@@ -475,19 +477,18 @@
//鐣岄潰鍏抽棴
return;
}
- await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
+ await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
}
- })
- { IsBackground = true }.Start();
+ });
}
/// <summary>
- /// 鎺ュ彈璁惧鍦ㄧ嚎鎺ㄩ��(涓嶈蹇樿鏈�鍚庡畠浼氭帹閫佷竴涓狽ull鐨勪笢瑗胯繃鏉�)
+ /// 鎺ュ彈璁惧鍦ㄧ嚎鎺ㄩ��
/// </summary>
/// <param name="device"></param>
private void ReceiveDeviceStatuPush(CommonDevice device)
{
- if (this.Parent == null || device == null)
+ if (this.Parent == null)
{
//鐣岄潰鍏抽棴
return;
@@ -557,7 +558,7 @@
listView.Height = frameLayoutDraw.Height;
frameLayoutDraw.AddChidren(listView);
- new System.Threading.Thread(() =>
+ HdlThreadLogic.Current.RunThread(() =>
{
var dicAlarm = HdlAlarmsLogic.Current.GetSafeguardAlarmInfo();
var dicInfo = new Dictionary<string, Dictionary<int, List<SafeguardAlarmInfo>>>();
@@ -630,8 +631,7 @@
//寮�鍚紶鎰熷櫒鎶ヨ鐩戣
this.StartCheckDeviceAlarm();
});
- })
- { IsBackground = true }.Start();
+ });
}
/// <summary>
@@ -711,7 +711,7 @@
/// <summary>
/// 鑷韩鐨勪笂灞傜晫闈㈠叧闂悗,瀹冭嚜韬浜庢渶涓婂眰鏃�,瑙﹀彂鐨勪簨浠�
/// </summary>
- public override void FormActionAgainEvent()
+ public override int FormActionAgainEvent()
{
//璁剧疆甯冮槻鎸夐挳鐨勫彲瑙嗙姸鎬�
garrisonControl?.SetButtonVisible();
@@ -726,6 +726,7 @@
//璁剧疆浼犳劅鍣ㄦ暟鎹埌鐢婚潰
this.SetSensorDataToForm();
}
+ return 1;
}
#endregion
--
Gitblit v1.8.0