| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |