| | |
| | | tempStatus.Add(new SecurityOutputStatus() { key = FunctionAttributeKey.OnOff, value = "on" }); |
| | | allocatedList.Add(new SecurityOutput |
| | | { |
| | | target_type = "0", |
| | | target_type = "1", |
| | | sid = function.sid, |
| | | status = tempStatus, |
| | | name = function.name, |
| | |
| | | tempStatus.Add(new SecurityOutputStatus() { key = "value", value = "0" }); |
| | | allocatedList.Add(new SecurityOutput |
| | | { |
| | | target_type = "1", |
| | | target_type = "2", |
| | | sid = scene.sid, |
| | | status = tempStatus, |
| | | name = scene.name, |
| | |
| | | functionListView.RemoveAll(); |
| | | foreach (var function in allocatedList) |
| | | { |
| | | 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.sid = function.sid; |
| | | } |
| | | //var output = alarm.output.Find((obj) => obj.sid == function.sid); |
| | | //if (output == null) |
| | | //{ |
| | | // output = new SecurityOutput(); |
| | | // output.sid = function.sid; |
| | | //} |
| | | |
| | | FrameLayout functionRow = new FrameLayout() |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = output.StateText() |
| | | Text = function.StateText() |
| | | }; |
| | | functionRow.AddChidren(btnState); |
| | | |
| | |
| | | btnChooseIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected; |
| | | var tempLocal = alarm.output.Find((obj) => |
| | | obj.sid == output.sid |
| | | obj.sid == function.sid |
| | | ); |
| | | if (tempLocal == null && !string.IsNullOrEmpty(output.spk)) |
| | | { |
| | | ShowStateDialog(output, btnState, btnChooseIcon); |
| | | } |
| | | //if (tempLocal == null && !string.IsNullOrEmpty(output.spk)) |
| | | //{ |
| | | // ShowStateDialog(output, btnState, btnChooseIcon); |
| | | //} |
| | | if (btnChooseIcon.IsSelected) |
| | | { |
| | | if (tempLocal == null) |
| | | alarm.output.Add(output); |
| | | alarm.output.Add(function); |
| | | ShowStateDialog(function, btnState, btnChooseIcon); |
| | | } |
| | | else |
| | | { |
| | | if (tempLocal != null) |
| | | { |
| | | alarm.output.Remove(output); |
| | | alarm.output.Remove(function); |
| | | } |
| | | } |
| | | }; |
| | | btnState.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | ShowStateDialog(output, btnState, btnChooseIcon); |
| | | btnChooseIcon.IsSelected = true; |
| | | var tempLocal = alarm.output.Find((obj) => |
| | | obj.sid == function.sid |
| | | ); |
| | | if (tempLocal == null) |
| | | alarm.output.Add(function); |
| | | ShowStateDialog(function, btnState, btnChooseIcon); |
| | | }; |
| | | |
| | | var localOutput = alarm.output.Find((obj) => obj.sid == output.sid); |
| | | var localOutput = alarm.output.Find((obj) => obj.sid == function.sid); |
| | | |
| | | if (localOutput != null) |
| | | { |
| | | btnChooseIcon.IsSelected = true; |
| | | btnState.Text = output.StateText(); |
| | | btnState.Text = function.StateText(); |
| | | } |
| | | |
| | | |
| | |
| | | TextID = StringId.Cancel, |
| | | TextColor = CSS_Color.WarningColor, |
| | | IsBold = true, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | contentView.AddChidren(btnCancel); |
| | | |