From a7ab4b610972e20753dfedb3e5d80e4d9f017d07 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期五, 14 八月 2020 10:39:08 +0800 Subject: [PATCH] 临时备份,测试1 --- ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 47 insertions(+), 4 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs index f28273d..bd885f9 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs @@ -85,6 +85,8 @@ this.AddNormalDeviceReportEvent(); //娣诲姞浼犳劅鍣ㄧ姸鎬佷笂鎶ヤ簨浠� this.AddSensorDeviceReportEvent(); + //寮�鍚紶鎰熷櫒鐘舵�佽繕鍘熺殑绾跨▼ + this.StartRecoverSenorStatuThread(); } /// <summary> @@ -626,6 +628,11 @@ { cardContr = new Controls.DeviceFreshAirCardControl(); } + // PM2.5 + else if (device.Type == DeviceType.PMSensor) + { + cardContr = new Controls.DevicePmSensorCardControl(); + } //褰╃伅(璋冨厜鍣�) else if (device.Type == DeviceType.DimmableLight) { @@ -1066,13 +1073,15 @@ this.ShowProgressBar(); //鍒囨崲浣忓畢 - HdlResidenceLogic.Current.SwitchResidence(home.Id); + var result = HdlResidenceLogic.Current.SwitchResidence(home.Id); HdlThreadLogic.Current.RunMain(() => { - //鍒锋柊鐣岄潰 - this.ShowForm(); - + if (result == true) + { + //鍒锋柊鐣岄潰 + this.ShowForm(); + } this.CloseProgressBar(); }); }); @@ -1163,6 +1172,40 @@ #region 鈻� 浼犳劅鍣ㄧ姸鎬佽繕鍘焈____________________ + /// <summary> + /// 寮�鍚紶鎰熷櫒鐘舵�佽繕鍘熺殑绾跨▼ + /// </summary> + private void StartRecoverSenorStatuThread() + { + HdlThreadLogic.Current.RunThread(() => + { + while (this.Parent != null) + { + try + { + var dicControl = this.dicDeviceCardControl; + 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 鈻� 鍒囨崲妤煎眰___________________________ -- Gitblit v1.8.0