From c008153a455b2c79ac9087d82bd9abf9f1eea19f Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 11 八月 2021 18:03:14 +0800
Subject: [PATCH] 2021-08-11-1

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs |   32 +++++++++++++++-----------------
 1 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
index 9c04646..ecd18e9 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -387,6 +387,8 @@
 
                     if (edit)
                     {
+                        //鏇存柊寤舵椂鏃堕棿
+                        outputDevice.delay = Logic.currlogic.output[index].delay;
                         //绉婚櫎鏃ф暟鎹�
                         Logic.currlogic.output.RemoveAt(index);
                         //鏂版暟鎹彃鍏ユ棫鏁版嵁鐨勪綅缃�;
@@ -408,7 +410,7 @@
                     this.RemoveFromParent();
                     return;
                 }
-                LogicMethod.RemoveAllView();
+                LogicMethod.CurrLogicMethod.RemoveAllView();
                 AddLogic addLogic = new AddLogic();
                 MainPage.BasePageView.AddChidren(addLogic);
                 addLogic.Show();
@@ -426,10 +428,7 @@
         private void SwitchViewMethod(Entity.Function device, Button button, int len)
         {
             #region 鐣岄潰
-            FrameLayout frame = new FrameLayout
-            {
-                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
-            };
+            FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence };
             this.AddChidren(frame);
             LogicView.SwitchView switchView = new LogicView.SwitchView();
             switchView.FLayoutView(frame, len, button.Text, (strValue) =>
@@ -517,7 +516,7 @@
         private void GetEditState(Entity.Function device, int index, Button button1, Button button2, Button button3, Button button4)
         {
             Output outputs = Logic.currlogic.output[index];
-            var dicList = outputs.status as List<Dictionary<string, string>>;
+            var dicList = outputs.status;
             //娓呴櫎涔嬪墠鏃ф暟鎹�
             dicSateteList.Clear();
             if (dicList.Count != 0)
@@ -536,23 +535,22 @@
         {
             //鏁版嵁灏佽
             Dictionary<string, string> dic = new Dictionary<string, string>();
-            LogicMethod.dictionary(dic, "key", KeyValue);
-            LogicMethod.dictionary(dic, "value", selectedValue);
-            AddDictionaryList(KeyValue, dic, dicSateteList);
+            LogicMethod.CurrLogicMethod.dictionary(dic, "key", KeyValue);
+            LogicMethod.CurrLogicMethod.dictionary(dic, "value", selectedValue);
+            AddDictionaryList(KeyValue, dic);
         }
         /// <summary>
         /// 鏇存柊鏁版嵁鍒楄〃
         /// </summary>
         /// <param name="keyValue">璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�</param> 
-        /// <param name="dictionary">閫変腑鏁版嵁</param>
-        /// <param name="dicList">瀛樺偍鏁版嵁鍒楄〃</param>
+        /// <param name="dictionary">娣诲姞閫変腑鏁版嵁</param>
         /// <returns></returns>
-        private void AddDictionaryList(string keyValue, Dictionary<string, string> dictionary, List<Dictionary<string, string>> dicList)
+        private void AddDictionaryList(string keyValue, Dictionary<string, string> dictionary)
         {
             int indexValue = -1;
-            for (int i = 0; i < dicList.Count; i++)
+            for (int i = 0; i < dicSateteList.Count; i++)
             {
-                var dic = dicList[i];
+                var dic = dicSateteList[i];
                 if (dic.ContainsValue(keyValue))
                 {
                     //鍒ゆ柇鏄惁瀛樺湪
@@ -564,14 +562,14 @@
             if (indexValue != -1)
             {
                 //瀛樺湪绉婚櫎
-                dicList.RemoveAt(indexValue);
+                dicSateteList.RemoveAt(indexValue);
                 //閲嶆柊娣诲姞
-                dicList.Insert(indexValue, dictionary);
+                dicSateteList.Insert(indexValue, dictionary);
             }
             else
             {
                 //鏂版坊鍔�
-                dicList.Add(dictionary);
+                dicSateteList.Add(dictionary);
             }
 
         }

--
Gitblit v1.8.0