| | |
| | | this.AddNormalDeviceReportEvent();
|
| | | //添加传感器状态上报事件
|
| | | this.AddSensorDeviceReportEvent();
|
| | | //开启传感器状态还原的线程
|
| | | this.StartRecoverSenorStatuThread();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | {
|
| | | //先清空
|
| | | listView.RemoveAll();
|
| | | this.dicDeviceRowControl = new Dictionary<string, Controls.DeviceRowCommon>();
|
| | |
|
| | | var listDevice = new List<CommonDevice>();
|
| | | for (int i = 0; i < rowInfo.listDeviceKeys.Count; i++)
|
| | |
| | | }
|
| | |
|
| | | }, ShowErrorMode.NO);
|
| | | });
|
| | | }
|
| | |
|
| | | #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); }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|