From b4f5f74d74a0a0996358d8348956601b30f17266 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 08 十二月 2021 16:07:51 +0800
Subject: [PATCH] 隐藏安防

---
 HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs |   35 ++++++++++++++++-------------------
 1 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs
index 4ff5844..4f7abb9 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs
@@ -207,20 +207,17 @@
                 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()
                 {
@@ -260,9 +257,9 @@
                     TextAlignment = TextAlignment.CenterRight,
                     TextSize = CSS_FontSize.TextFontSize,
                     TextColor = CSS_Color.PromptingColor1,
+                    Text = output.StateText()
                 };
                 functionRow.AddChidren(btnState);
-
 
                 Button btnChooseIcon = new Button()
                 {
@@ -277,18 +274,20 @@
 
                 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);
@@ -358,7 +357,7 @@
                 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()
@@ -373,7 +372,7 @@
                 TextAlignment = TextAlignment.Center,
                 SelectedTextColor = CSS_Color.MainColor,
                 TextColor = CSS_Color.PromptingColor1,
-                TextID = StringId.OFF,
+                TextID = StringId.Close,
                 TextSize = CSS_FontSize.SubheadingFontSize,
             };
             optinView.AddChidren(btnClose);
@@ -455,8 +454,6 @@
             };
 
         }
-
-
 
 
         /// <summary>

--
Gitblit v1.8.0