| | |
| | | btnIcon.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //菜单控件
|
| | | var frameMenu = new TopRightMenuControl(this, 2);
|
| | | var frameMenu = new TopRightMenuControl(2);
|
| | | //防区列表
|
| | | string menu1 = Language.StringByID(R.MyInternationalizationString.uGarrisonAreaList);
|
| | | frameMenu.AddRowMenu(menu1, "Item/GarrisonList.png", "Item/GarrisonListSelected.png", () =>
|
| | |
| | |
|
| | | this.dicSensorStatuView.Clear();
|
| | |
|
| | | //添加列表控件 |
| | | //添加列表控件
|
| | | frameLayoutDraw.RemoveAll();
|
| | | var listView = new VerticalFrameControl(35);
|
| | | listView.Height = frameLayoutDraw.Height;
|
| | | frameLayoutDraw.AddChidren(listView);
|
| | |
|
| | | new System.Threading.Thread(() =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //获取安防的全部传感器设备的信息
|
| | | var dicDevice = HdlSafeguardLogic.Current.GetAllSensorDeviceInfo();
|
| | |
| | | }
|
| | | });
|
| | | }
|
| | | })
|
| | | { IsBackground = true }.Start();
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | var timeValue = (DateTime.Now - oldGetOnlineTime).Milliseconds;
|
| | | if (timeValue <= 10000)
|
| | | if (oldGetOnlineTime.Year != 1900)
|
| | | {
|
| | | //最少要间隔十秒,才去重新获取
|
| | | return;
|
| | | var timeValue = (DateTime.Now - oldGetOnlineTime).TotalSeconds;
|
| | | if (timeValue < 10)
|
| | | {
|
| | | //最少要间隔十秒,才去重新获取
|
| | | return;
|
| | | }
|
| | | }
|
| | | oldGetOnlineTime = DateTime.Now;
|
| | |
|
| | | //从设备列表中获取在线状态
|
| | | new System.Threading.Thread(async () =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //首先获取这些传感器所在的网关
|
| | | var listWay = new List<ZbGateway>();
|
| | |
| | | //界面关闭
|
| | | return;
|
| | | }
|
| | | await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
|
| | | Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
|
| | | }
|
| | | })
|
| | | { IsBackground = true }.Start();
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 接受设备在线推送(不要忘记最后它会推送一个Null的东西过来)
|
| | | /// 接受设备在线推送
|
| | | /// </summary>
|
| | | /// <param name="device"></param>
|
| | | private void ReceiveDeviceStatuPush(CommonDevice device)
|
| | | {
|
| | | if (this.Parent == null || device == null)
|
| | | if (this.Parent == null)
|
| | | {
|
| | | //界面关闭
|
| | | return;
|
| | |
| | | listView.Height = frameLayoutDraw.Height;
|
| | | frameLayoutDraw.AddChidren(listView);
|
| | |
|
| | | new System.Threading.Thread(() =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | var dicAlarm = HdlAlarmsLogic.Current.GetSafeguardAlarmInfo();
|
| | | var dicInfo = new Dictionary<string, Dictionary<int, List<SafeguardAlarmInfo>>>();
|
| | |
| | | //开启传感器报警监视
|
| | | this.StartCheckDeviceAlarm();
|
| | | });
|
| | | })
|
| | | { IsBackground = true }.Start();
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <summary>
|
| | | /// 自身的上层界面关闭后,它自身处于最上层时,触发的事件
|
| | | /// </summary>
|
| | | public override void FormActionAgainEvent()
|
| | | public override int FormActionAgainEvent()
|
| | | {
|
| | | //设置布防按钮的可视状态
|
| | | garrisonControl?.SetButtonVisible();
|
| | |
| | | //设置传感器数据到画面
|
| | | this.SetSensorDataToForm();
|
| | | }
|
| | | return 1;
|
| | | }
|
| | |
|
| | | #endregion |