| | |
| | | |
| | | SecurityAlarm alarm; |
| | | |
| | | public AddOutputPage(SecurityAlarm inOutput ,Action<SecurityAlarm> action) |
| | | public AddOutputPage(SecurityAlarm inOutput, Action<SecurityAlarm> action) |
| | | { |
| | | bodyView = this; |
| | | refreshAction = action; |
| | |
| | | functionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = showdFunctionTypeRow.Bottom, |
| | | Height = Application.GetRealHeight(530 -100), |
| | | Height = Application.GetRealHeight(530 - 100), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | |
| | | /// <summary> |
| | | /// 配置数据 |
| | | /// </summary> |
| | | void SetData(string roomId="") |
| | | void SetData(string roomId = "") |
| | | { |
| | | allocatedList.Clear(); |
| | | foreach (var function in FunctionList.List.GetLightList()) |
| | |
| | | var output = alarm.output.Find((obj) => obj.sid == function.sid); |
| | | if (output == null) |
| | | { |
| | | output = new SecurityOutput() { status = new List<SecurityOutputStatus> { new SecurityOutputStatus { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = "on" |
| | | } } }; |
| | | |
| | | output = new SecurityOutput(); |
| | | //{ |
| | | // status = new List<SecurityOutputStatus> { new SecurityOutputStatus { |
| | | // key = FunctionAttributeKey.OnOff, |
| | | // value = "on" |
| | | // } |
| | | // } |
| | | //}; |
| | | |
| | | output.sid = function.sid; |
| | | } |
| | | //else |
| | | //{ |
| | | // output.addCondition = true; |
| | | //} |
| | | |
| | | FrameLayout functionRow = new FrameLayout() |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = output.StateText() |
| | | }; |
| | | functionRow.AddChidren(btnState); |
| | | |
| | | |
| | | Button btnChooseIcon = new Button() |
| | | { |
| | |
| | | |
| | | btnChooseIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected; |
| | | var tempLocal = alarm.input.Find((obj) => |
| | | var tempLocal = alarm.output.Find((obj) => |
| | | obj.sid == output.sid |
| | | ); |
| | | if (tempLocal == null && !string.IsNullOrEmpty(output.spk)) |
| | | { |
| | | ShowStateDialog(output, btnState, btnChooseIcon); |
| | | } |
| | | if (btnChooseIcon.IsSelected) |
| | | { |
| | | //input.addCondition = true; |
| | | if (tempLocal == null) |
| | | alarm.output.Add(output); |
| | | } |
| | | else |
| | | { |
| | | //input.addCondition = false; |
| | | if (tempLocal != null) |
| | | { |
| | | alarm.output.Remove(output); |
| | |
| | | |
| | | var localOutput = alarm.output.Find((obj) => obj.sid == output.sid); |
| | | |
| | | if (localOutput!=null) |
| | | if (localOutput != null) |
| | | { |
| | | btnChooseIcon.IsSelected = true; |
| | | btnState.Text = output.StateText(); |
| | |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.On, |
| | | TextID = StringId.Open, |
| | | }; |
| | | optinView.AddChidren(btnOpen); |
| | | optinView.AddChidren(new Button() |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextID = StringId.OFF, |
| | | TextID = StringId.Close, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | optinView.AddChidren(btnClose); |
| | | if (output.status.Count > 0) |
| | | { |
| | | btnOpen.IsSelected = output.status[0].value.ToLower() == "on"; |
| | | btnOpen.IsSelected = output.status[0].value.ToLower() == "on"; |
| | | btnClose.IsSelected = !btnOpen.IsSelected; |
| | | } |
| | | |
| | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |