From 55803afe96d563947f8cbbc0bc1e01548bb53035 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 29 六月 2021 15:41:21 +0800
Subject: [PATCH] 2021-6-29-1

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs |   31 +++++++++++----
 HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs     |   16 +++++---
 .vs/HDL_APP_Project/xs/UserPrefs.xml                              |   26 +++++-------
 HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs              |    2 
 4 files changed, 45 insertions(+), 30 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index d4691c5..073c079 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,31 +1,27 @@
 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
   <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.FE1D0763-7181-4B0C-AB18-E30AA773A6FA" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs">
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs">
     <Files>
-      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs" Line="336" Column="27" />
-      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs" />
-      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs" Line="620" Column="1" />
-      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs" />
-      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs" />
-      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs" />
-      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs" />
-      <File FileName="HDL_ON/Common/R.cs" />
-      <File FileName="../EvoyoHomeNewCloud/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs" />
-      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs" />
-      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs" Line="62" Column="54" />
+      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs" Line="83" Column="43" />
+      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/Weather.cs" Line="62" Column="70" />
+      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs" Line="203" Column="24" />
+      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs" Line="1" Column="1" />
+      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs" Line="50" Column="15" />
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
         <State name="__root__">
           <Node name="HDL_APP_Project" expanded="True">
             <Node name="HDL_ON" expanded="True">
+              <Node name="Entity" expanded="True" />
               <Node name="UI" expanded="True">
                 <Node name="UI2" expanded="True">
-                  <Node name="4-PersonalCenter" expanded="True">
-                    <Node name="PirDevice" expanded="True">
-                      <Node name="BrandList.cs" selected="True" />
+                  <Node name="3-Intelligence" expanded="True">
+                    <Node name="Automation" expanded="True">
+                      <Node name="AddTarget.cs" selected="True" />
                     </Node>
                   </Node>
+                  <Node name="4-PersonalCenter" expanded="True" />
                 </Node>
               </Node>
             </Node>
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
index 6ba1356..d185e19 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
@@ -47,7 +47,7 @@
             delayView.frameLayout.Y = sceneView.frameLayout.Bottom;
             delayView.btnText.TextID = StringId.delayLogic;
             delayView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png";
-            viewLayout.AddChidren(delayView.FLayoutView());
+            //viewLayout.AddChidren(delayView.FLayoutView());
             #endregion
 
             #region  鎵�鏈夌偣鍑讳簨浠�
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
index 5e24b64..3cbd448 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -69,6 +69,7 @@
                         }
                     }
                     break;
+                //姘存蹈浼犳劅鍣�
                 case SPK.SensorWater:
                     {
                         LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -85,7 +86,9 @@
 
                     }
                     break;
+                //鐑熼浘浼犳劅鍣�
                 case SPK.SensorSmoke:
+                //鐕冩皵浼犳劅鍣�
                 case SPK.SensorGas:
                     {
                         LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -102,6 +105,7 @@
 
                     }
                     break;
+                //骞叉帴鐐�
                 case SPK.SensorDryContact:
                     {
                         LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -118,8 +122,11 @@
 
                     }
                     break;
+                //绾㈠鐝婃爮浼犳劅鍣�
                 case SPK.SensorShanLan:
+                //绾㈠瀵瑰皠浼犳劅鍣�
                 case SPK.SensorDuiShe:
+                //绾㈠绉诲姩浼犳劅鍣�
                 case SPK.SensorPir:
                     {
                         LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -135,6 +142,7 @@
                         }
                     }
                     break;
+                //闂ㄧ獥浼犳劅鍣�
                 case SPK.SensorDoorWindow:
                     {
                         LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -150,6 +158,7 @@
                         }
                     }
                     break;
+                //瓒呭0娉紶鎰熷櫒
                 case SPK.SensoruUtrasonic:
                     {
 
@@ -175,6 +184,7 @@
                         }
                     }
                     break;
+                //姣背娉紶鎰熷櫒
                 case SPK.SenesorMegahealth:
                     {
                         LogicView.FunTypeView view = new LogicView.FunTypeView();
@@ -359,7 +369,7 @@
                 //鏄剧ず鏂囨湰
                 button.TextID = intValue;
                 selectedState = device.spk + "_" + value;
-                AddDictionary(keyVlaue, value);
+                AddDictionary(keyVlaue, value, "string");
 
             });
 
@@ -391,29 +401,34 @@
         /// </summary>
         /// <param name="KeyValue">璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�</param>
         /// <param name="selectedValue">鐘舵�佸��</param>
-        private void AddDictionary(string KeyValue, string selectedValue)
+        /// <param name="data_type">绫诲瀷</param>
+        /// <param name="comparator">姣旇緝鍏崇郴</param>
+        private void AddDictionary(string KeyValue, string selectedValue,string data_type,string comparator="=")
         {
             //鏁版嵁灏佽
             Dictionary<string, string> dic = new Dictionary<string, string>();
             LogicMethod.dictionary(dic, "key", KeyValue);
-            LogicMethod.dictionary(dic, "comparator", "=");
-            LogicMethod.dictionary(dic, "data_type", "string");
+            LogicMethod.dictionary(dic, "comparator", comparator);
+            LogicMethod.dictionary(dic, "data_type", data_type);
             LogicMethod.dictionary(dic, "value", selectedValue);
-            AddDictionaryList(KeyValue, dic);
+            AddDictionaryList(KeyValue, comparator,dic);
         }
         /// <summary>
         /// 鏇存柊鏁版嵁鍒楄〃
         /// </summary>
-        /// <param name="keyValue">璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�</param> 
+        /// <param name="keyValue">璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�</param>
+        /// <param name="comparator">姣旇緝鍏崇郴</param>
         /// <param name="dictionary">娣诲姞閫変腑鏁版嵁</param>
         /// <returns></returns>
-        private void AddDictionaryList(string keyValue, Dictionary<string, string> dictionary) 
+        private void AddDictionaryList(string keyValue,string comparator, Dictionary<string, string> dictionary) 
         {
             int indexValue = -1;
             for (int i = 0; i < dicSateteList.Count; i++)
             {
                 var dic = dicSateteList[i];
-                if (dic.ContainsValue(keyValue))
+                string key = dic["key"];
+                string comparatorValue = dic["comparator"];
+                if (key == keyValue && comparatorValue == comparator)
                 {
                     //鍒ゆ柇鏄惁瀛樺湪
                     indexValue = i;
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs
index 5781fc1..8d7f8e3 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs
@@ -75,7 +75,7 @@
             pmhigherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16);
             pmhigherView.btnText.TextID = StringId.PM25;
             viewLayout.AddChidren(pmhigherView.FLayoutView());
-          
+
 
             #endregion
 
@@ -110,7 +110,7 @@
                 PmAction(this);
 
             };
-          
+
 
             #endregion
         }
@@ -119,7 +119,7 @@
         /// </summary>
         /// <param name="textInt">鏂囨湰</param>
         /// <param name="stateValue">缂栬緫涔嬪墠鐨勭姸鎬佸��,榛樿涓�20</param>
-        public void InputBoxAction(int textInt,string stateValue="20")
+        public void InputBoxAction(int textInt, string stateValue = "20")
         {
             new LogicView.TipPopView { }.InputBox(textInt, stateValue, (value) =>
             {
@@ -217,7 +217,7 @@
         /// <param name="input"></param>
         /// <param name="keyValue"></param>
         /// <param name="comparator">姣旇緝鍏崇郴</param>
-        private void AddCondition(Input input, string keyValue,string comparator)
+        private void AddCondition(Input input, string keyValue, string comparator)
         {
             ///璁板綍绱㈠紩鍊�
             int index = -1;
@@ -261,7 +261,7 @@
         /// <param name="keyValue"></param>
         /// <param name="comparator">姣旇緝鍏崇郴</param>
         /// <returns></returns>
-        private bool ExistKey(List<Dictionary<string, string>> dicList, string keyValue, string comparator) 
+        private bool ExistKey(List<Dictionary<string, string>> dicList, string keyValue, string comparator)
         {
             for (int i = 0; i < dicList.Count; i++)
             {
@@ -277,7 +277,11 @@
             return false;
         }
 
-
+        /// <summary>
+        /// 鏁板�艰繑鍥炴枃鏈�
+        /// </summary>
+        /// <param name="strValue">鍊�</param>
+        /// <returns></returns>
         public string GetString(string strValue)
         {
             string text = "";

--
Gitblit v1.8.0