From 592974441a4df95fffd9167c90192da1a390b1c2 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 06 六月 2023 11:51:12 +0800 Subject: [PATCH] Merge branch 'Dev-Branch' --- HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs | 54 +++++++++++++++++++++++++++--------------------------- 1 files changed, 27 insertions(+), 27 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs index 4f7abb9..e1dd248 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs @@ -157,7 +157,7 @@ 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, @@ -184,7 +184,7 @@ 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, @@ -204,20 +204,12 @@ 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() { @@ -257,7 +249,7 @@ TextAlignment = TextAlignment.CenterRight, TextSize = CSS_FontSize.TextFontSize, TextColor = CSS_Color.PromptingColor1, - Text = output.StateText() + Text = function.StateText() }; functionRow.AddChidren(btnState); @@ -275,36 +267,43 @@ 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(); } @@ -394,6 +393,7 @@ TextID = StringId.Cancel, TextColor = CSS_Color.WarningColor, IsBold = true, + TextSize = CSS_FontSize.SubheadingFontSize, }; contentView.AddChidren(btnCancel); -- Gitblit v1.8.0