| | |
| | | /// 自定义布防区域 |
| | | /// </summary> |
| | | HorizontalScrolViewLayout customDeploymentView; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | FrameLayout alarmIconBgView; |
| | | //安防状态背景图 |
| | | Button btnArmTipIcon; |
| | | /// <summary> |
| | | /// 安防警报图标 |
| | | /// </summary> |
| | | Button btnInalarmIcon; |
| | | /// <summary> |
| | | /// 当前布防名称 |
| | | /// </summary> |
| | |
| | | Height =Application.GetRealWidth(32), |
| | | }); |
| | | |
| | | FrameLayout alarmIconBgView = new FrameLayout() |
| | | alarmIconBgView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(198), |
| | |
| | | SelectedImagePath = "FunctionIcon/ArmCenter/InDefenseBigIcon.png", |
| | | }; |
| | | alarmIconBgView.AddChidren(btnArmTipIcon); |
| | | |
| | | btnInalarmIcon = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(198), |
| | | Height = Application.GetRealWidth(198), |
| | | }; |
| | | btnInalarmIcon.MouseUpEventHandler = (sender, e) => { |
| | | if(SecurityCenter.Ins.InDefenseMode!= null) |
| | | { |
| | | SecurityCenter.Ins.InDefenseMode.alarm = false; |
| | | Control.Ins.ControlSecurity(SecurityCenter.Ins.InDefenseMode, "enable"); |
| | | } |
| | | }; |
| | | InitAlarmStatus(SecurityCenter.Ins.InAlarm); |
| | | |
| | | |
| | | btnDefenseName = new Button() |
| | | { |
| | |
| | | }; |
| | | disarmView.AddChidren(btnDisarm); |
| | | btnDisarm.MouseUpEventHandler = (sender, e) => { |
| | | foreach (var temp in FunctionList.List.securities) |
| | | //foreach (var temp in FunctionList.List.securities) |
| | | //{ |
| | | // if (temp.status == "enable") |
| | | // { |
| | | // Control.Ins.ControlSecurity(temp, "disable"); |
| | | // break; |
| | | // } |
| | | //} |
| | | if(SecurityCenter.Ins.InDefenseMode!= null) |
| | | { |
| | | if (temp.status == "enable") |
| | | { |
| | | Control.Ins.ControlSecurity(temp, "disable"); |
| | | break; |
| | | } |
| | | Control.Ins.ControlSecurity(SecurityCenter.Ins.InDefenseMode, "disable"); |
| | | } |
| | | }; |
| | | |
| | |
| | | ///刷新界面 |
| | | LoadEvent_RefreshSecurityStatus(); |
| | | |
| | | } |
| | | |
| | | public void InitAlarmStatus(bool inAlarm) |
| | | { |
| | | try |
| | | { |
| | | if (inAlarm) |
| | | { |
| | | alarmIconBgView.AddChidren(btnInalarmIcon); |
| | | } |
| | | else |
| | | { |
| | | btnInalarmIcon.RemoveFromParent(); |
| | | } |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | bodyView.disarmView.Height = Application.GetRealHeight(68); |
| | | bodyView.btnArmTipIcon.IsSelected = true; |
| | | bodyView.btnDefenseName.Text = temp.name; |
| | | |
| | | bodyView.InitAlarmStatus(temp.alarm); |
| | | break; |
| | | } |
| | | } |