From aef56e88ed1faeaa221f36b462a1120d7960e2fa Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 22 十二月 2020 15:09:01 +0800
Subject: [PATCH] 2020-12-22-4

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs |   32 +++++++++++---------------------
 1 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index 2968b81..6ea774e 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -173,7 +173,7 @@
         /// <param name="viewLayout">涓婁笅婊戝姩鎺т欢</param>
         public static void OutputTarget(FrameLayout thisView, VerticalScrolViewLayout viewLayout)
         {
-
+            
             for (int i = 0; i < Logic.currlogic.output.Count; i++)
             {
                 Output outputTarget = Logic.currlogic.output[i];
@@ -230,33 +230,23 @@
                                     {
                                         string on_off = GetKeyValue("on_off", dicList);
                                         string brightness = GetKeyValue("brightness", dicList);
-                                        if (on_off != "")
+                                        if (on_off == "on" && brightness != "")
                                         {
-                                            if (on_off == "on")
-                                            {
-                                                stateStr = Language.StringByID(StringId.onLogic);
-                                               
-                                            }
-                                            else
-                                            {
-                                                stateStr = Language.StringByID(StringId.offLogic);
-                                               
-                                            }
+                                            stateStr = Language.StringByID(StringId.onLogic) + brightness + "%";
                                         }
-                                        if (brightness != "")
+                                        else if (on_off == "on")
                                         {
-                                            stateStr += brightness + "%";
+                                            stateStr = Language.StringByID(StringId.onLogic);
                                         }
-                                        if (on_off != "" && on_off == "off")
+                                        else if (on_off == "off")
                                         {
-                                            targetView.btnState.Text = Language.StringByID(StringId.offLogic);
+                                            stateStr = Language.StringByID(StringId.offLogic);
                                         }
-                                        else
+                                        else if (brightness != "")
                                         {
-                                            targetView.btnState.Text = stateStr;
-
+                                            stateStr = brightness + "%";
                                         }
-                                       
+                                        targetView.btnState.Text = stateStr;
                                     }
                                     break;
                                 case FunctionType.Curtain:
@@ -567,7 +557,7 @@
         /// <param name="keyValue"></param>
         /// <param name="dicList"></param>
         /// <returns></returns>
-        private static string GetKeyValue(string keyValue, List<Dictionary<string, string>> dicList)
+        public static string GetKeyValue(string keyValue, List<Dictionary<string, string>> dicList)
         {
 
             string valueStr = "";

--
Gitblit v1.8.0