From 6b7a07bcbe147be7ed64994c40bcc5b0a2042aae Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 05 七月 2021 11:23:35 +0800
Subject: [PATCH] 代码合并-温居城

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs |   75 +++++--------------------------------
 1 files changed, 10 insertions(+), 65 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs
index 8d7f8e3..d8930a7 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs
@@ -164,31 +164,11 @@
         public void PmAction(FrameLayout frame, string stateValue = "")
         {
             PublicInterface pmView = new PublicInterface();
-            var pmListStr = pmView.GetViewList("pm2.5");
-            pmView.SingleSelectionShow(frame, pmListStr, Language.StringByID(StringId.PM25), GetString(stateValue)
+            var pmListStr = pmView.GetViewList("pm25");
+            pmView.SingleSelectionShow(frame, pmListStr, Language.StringByID(StringId.PM25), pmView.GetString("pm25", stateValue)
                , (text) =>
                {
-                   string value = "";
-                   if (text == Language.StringByID(StringId.pmyou))
-                   {
-                       value = "10";
-                   }
-                   else if (text == Language.StringByID(StringId.pmliang))
-                   {
-                       value = "50";
-                   }
-                   else if (text == Language.StringByID(StringId.pmqingdu))
-                   {
-                       value = "90";
-                   }
-                   else if (text == Language.StringByID(StringId.pmzhongdu))
-                   {
-                       value = "130";
-                   }
-                   else if (text == Language.StringByID(StringId.pmzhongduwuran))
-                   {
-                       value = "170";
-                   }
+                   var value= pmView.GetValue("pm25", text);
                    AddDic("pm2.5", "=", value);
                });
         }
@@ -201,13 +181,13 @@
         private void AddDic(string keyValue, string comparator, string value)
         {
             Input input = new Input();
-            input.sid = LogicMethod.NewSid();
+            input.sid = LogicMethod.CurrLogicMethod.NewSid();
             input.condition_type = "4";
             Dictionary<string, string> dic = new Dictionary<string, string>();
-            LogicMethod.dictionary(dic, "key", keyValue);
-            LogicMethod.dictionary(dic, "comparator", comparator);
-            LogicMethod.dictionary(dic, "data_type", "float");
-            LogicMethod.dictionary(dic, "value", value);
+            LogicMethod.CurrLogicMethod.dictionary(dic, "key", keyValue);
+            LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", comparator);
+            LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "float");
+            LogicMethod.CurrLogicMethod.dictionary(dic, "value", value);
             input.condition.Add(dic);
             AddCondition(input, keyValue, comparator);
         }
@@ -247,7 +227,7 @@
                 Logic.currlogic.input.Add(input);
             }
 
-            LogicMethod.RemoveAllView();
+            LogicMethod.CurrLogicMethod.RemoveAllView();
             AddLogic addLogic = new AddLogic();
             MainPage.BasePageView.AddChidren(addLogic);
             addLogic.Show();
@@ -277,41 +257,6 @@
             return false;
         }
 
-        /// <summary>
-        /// 鏁板�艰繑鍥炴枃鏈�
-        /// </summary>
-        /// <param name="strValue">鍊�</param>
-        /// <returns></returns>
-        public string GetString(string strValue)
-        {
-            string text = "";
-            int intValue = 0;
-            if (strValue != "")
-            {
-                intValue = int.Parse(strValue);
-            }
-            if (intValue > 0 && intValue < 35)
-            {
-                text = Language.StringByID(StringId.pmyou);
-            }
-            else if (intValue > 35 && intValue < 75)
-            {
-                text = Language.StringByID(StringId.pmliang);
-            }
-            else if (intValue > 75 && intValue < 115)
-            {
-                text = Language.StringByID(StringId.pmqingdu);
-            }
-            else if (intValue > 115 && intValue < 150)
-            {
-                text = Language.StringByID(StringId.pmzhongdu);
-            }
-            else if (intValue > 150)
-            {
-                text = Language.StringByID(StringId.pmzhongduwuran);
-            }
-
-            return text;
-        }
+     
     }
 }

--
Gitblit v1.8.0