From 8ce0f9b1e568dd9125e74421cd02fbc29381c1f1 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 29 七月 2020 12:53:33 +0800 Subject: [PATCH] 新版本 --- ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs index d30d6cd..2fe6c56 100755 --- a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs @@ -78,6 +78,8 @@ this.AddNormalDeviceReportEvent(); //娣诲姞浼犳劅鍣ㄧ姸鎬佷笂鎶ヤ簨浠� this.AddSensorDeviceReportEvent(); + //寮�鍚紶鎰熷櫒鐘舵�佽繕鍘熺殑绾跨▼ + this.StartRecoverSenorStatuThread(); } /// <summary> @@ -460,6 +462,7 @@ { //鍏堟竻绌� listView.RemoveAll(); + this.dicDeviceRowControl = new Dictionary<string, Controls.DeviceRowCommon>(); var listDevice = new List<CommonDevice>(); for (int i = 0; i < rowInfo.listDeviceKeys.Count; i++) @@ -888,6 +891,44 @@ #endregion + #region 鈻� 浼犳劅鍣ㄧ姸鎬佽繕鍘焈____________________ + + /// <summary> + /// 寮�鍚紶鎰熷櫒鐘舵�佽繕鍘熺殑绾跨▼ + /// </summary> + private void StartRecoverSenorStatuThread() + { + HdlThreadLogic.Current.RunThread(() => + { + while (this.Parent != null) + { + try + { + var dicControl = this.dicDeviceRowControl; + foreach (var contr in dicControl.Values) + { + //濡傛灉鏄紶鎰熷櫒,鍒欏埛鏂扮姸鎬� + if (contr.device.Type == DeviceType.IASZone && contr.Parent != null + && ((IASZone)contr.device).iASInfo == null) + { + HdlThreadLogic.Current.RunMain(() => + { + //璁惧鐘舵�佸繀椤诲埛鏂� + string statuText = HdlDeviceOtherLogic.Current.GetDeviceStatu(contr.device); + contr.SetDeviceStatuText(statuText); + + }, ShowErrorMode.NO); + } + } + System.Threading.Thread.Sleep(8000); + } + catch { System.Threading.Thread.Sleep(3000); } + } + }); + } + + #endregion + #region 鈻� 鏁村悎璁惧___________________________ /// <summary> -- Gitblit v1.8.0