| | |
| | | this.AddNormalDeviceReportEvent();
|
| | | //添加传感器状态上报事件
|
| | | this.AddSensorDeviceReportEvent();
|
| | | //开启传感器状态还原的线程
|
| | | this.StartRecoverSenorStatuThread();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | bodyFrameLayout.RemoveAll();
|
| | | bodyFrameLayout.Height = Application.GetRealHeight(750);
|
| | | this.listBodyContr.RecoverTableHeight();
|
| | | this.dicSceneCardControl = new Dictionary<int, Controls.SceneCardControl>();
|
| | | this.dicDeviceCardControl = new Dictionary<string, Controls.DeviceCardCommon>();
|
| | | this.dicSceneCardControl.Clear();
|
| | | this.dicDeviceCardControl.Clear();
|
| | |
|
| | | var listDevice = new List<CommonDevice>();
|
| | | foreach (var mainkeys in HdlRoomLogic.Current.NowMainPageRoom.ListDevice)
|
| | |
| | | bodyFrameLayout.RemoveAll();
|
| | | bodyFrameLayout.Height = Application.GetRealHeight(750);
|
| | | this.listBodyContr.RecoverTableHeight();
|
| | | this.dicSceneCardControl = new Dictionary<int, Controls.SceneCardControl>();
|
| | | this.dicDeviceCardControl = new Dictionary<string, Controls.DeviceCardCommon>();
|
| | | this.dicSceneCardControl.Clear();
|
| | | this.dicDeviceCardControl.Clear();
|
| | |
|
| | | var listScene = new List<SceneUI>();
|
| | | foreach (int sceneId in HdlRoomLogic.Current.NowMainPageRoom.ListSceneId)
|
| | |
| | | }
|
| | |
|
| | | }, ShowErrorMode.NO);
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #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); }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|