xm
2020-07-31 ecba45c93391066bc30c7bd602c3a7683fbb99a7
ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
@@ -78,8 +78,6 @@
            this.AddNormalDeviceReportEvent();
            //添加传感器状态上报事件
            this.AddSensorDeviceReportEvent();
            //开启传感器状态还原的线程
            this.StartRecoverSenorStatuThread();
        }
        /// <summary>
@@ -462,7 +460,6 @@
        {
            //先清空
            listView.RemoveAll();
            this.dicDeviceRowControl = new Dictionary<string, Controls.DeviceRowCommon>();
            var listDevice = new List<CommonDevice>();
            for (int i = 0; i < rowInfo.listDeviceKeys.Count; i++)
@@ -886,44 +883,6 @@
                    }
                }, 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); }
                }
            });
        }