| | |
| | | {
|
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
|
| | | {
|
| | | //初始化右上角图标
|
| | | this.InitTopRightIcon();
|
| | | }
|
| | |
|
| | | //初始化右上角图标
|
| | | this.InitTopRightIcon();
|
| | |
|
| | | //初始化全部内存信息
|
| | | this.InitAllMemoryData();
|
| | |
| | | /// </summary>
|
| | | private void InitTopRightIcon()
|
| | | {
|
| | | var btnIcon = new MostRightIconControl(69, 69);
|
| | | btnIcon.UnSelectedImagePath = "Item/More.png";
|
| | | topFrameLayout.AddChidren(btnIcon);
|
| | | btnIcon.InitControl();
|
| | | btnIcon.ButtonClickEvent += (sender, e) =>
|
| | | //快捷方式
|
| | | var btnShortCut = new MostRightIconControl(69, 69);
|
| | | btnShortCut.UnSelectedImagePath = "Safeguard/SafetyShortcut.png";
|
| | | btnShortCut.SelectedImagePath = "Safeguard/SafetyShortcutSelected.png";
|
| | |
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
|
| | | {
|
| | | //菜单控件
|
| | | var frameMenu = new TopRightMenuControl(this, 2);
|
| | | //防区列表
|
| | | string menu1 = Language.StringByID(R.MyInternationalizationString.uGarrisonAreaList);
|
| | | frameMenu.AddRowMenu(menu1, "Item/GarrisonList.png", "Item/GarrisonListSelected.png", () =>
|
| | | //快捷方式向左移动
|
| | | btnShortCut.X = Application.GetRealWidth(855);
|
| | |
|
| | | var btnIcon = new MostRightIconControl(69, 69);
|
| | | btnIcon.UnSelectedImagePath = "Item/More.png";
|
| | | topFrameLayout.AddChidren(btnIcon);
|
| | | btnIcon.InitControl();
|
| | | btnIcon.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new GarrisonAreaListMenuForm();
|
| | | form.AddForm();
|
| | | });
|
| | | //密码设置
|
| | | string menu2 = Language.StringByID(R.MyInternationalizationString.uPasswordSettion);
|
| | | frameMenu.AddRowMenu(menu2, "Item/PswSettion.png", "Item/PswSettionSelected.png", () =>
|
| | | //菜单控件
|
| | | var frameMenu = new TopRightMenuControl(2);
|
| | | //防区列表
|
| | | string menu1 = Language.StringByID(R.MyInternationalizationString.uGarrisonAreaList);
|
| | | frameMenu.AddRowMenu(menu1, "Item/GarrisonList.png", "Item/GarrisonListSelected.png", () =>
|
| | | {
|
| | | HdlCheckLogic.Current.CheckSecondarySecurity(() =>
|
| | | { |
| | | //验证成功
|
| | | var form = new GarrisonAreaListMenuForm();
|
| | | form.AddForm(); |
| | | }, |
| | | () =>
|
| | | {
|
| | | //请前往个人中心{0}设置二次安全验证方式
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGotoCenterAndSetSecondAuthentication).Replace("{0}", "\r\n");
|
| | | this.ShowMassage(ShowMsgType.Confirm, msg, () =>
|
| | | {
|
| | | var form = new UserMain.SecondAuthenticationForm();
|
| | | form.AddForm();
|
| | | });
|
| | | });
|
| | | });
|
| | | //密码设置
|
| | | string menu2 = Language.StringByID(R.MyInternationalizationString.uPasswordSettion);
|
| | | frameMenu.AddRowMenu(menu2, "Item/PswSettion.png", "Item/PswSettionSelected.png", () =>
|
| | | {
|
| | | var form = new PasswordMenuForm();
|
| | | form.AddForm();
|
| | | });
|
| | | };
|
| | | }
|
| | |
|
| | | topFrameLayout.AddChidren(btnShortCut);
|
| | | btnShortCut.InitControl();
|
| | | if (UserCenterResourse.Option.SafetyShortcut == true)
|
| | | {
|
| | | //使用快捷方式
|
| | | btnShortCut.IsSelected = true;
|
| | | }
|
| | | btnShortCut.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (btnShortCut.IsSelected == true)
|
| | | {
|
| | | var form = new SafetyPasswordMenuForm();
|
| | | form.AddForm();
|
| | | });
|
| | | //确定取消主页的「安防」捷径?
|
| | | this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uCancelSafetyShortcutMsg), () =>
|
| | | {
|
| | | UserCenterResourse.Option.SafetyShortcut = false;
|
| | | UserCenterResourse.Option.Save();
|
| | | btnShortCut.IsSelected = false;
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | //确定创建「安防」捷径到主页?
|
| | | this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uCreatSafetyShortcutMsg), () =>
|
| | | {
|
| | | UserCenterResourse.Option.SafetyShortcut = true;
|
| | | UserCenterResourse.Option.Save();
|
| | | btnShortCut.IsSelected = true;
|
| | | });
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | |
| | | 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 |