From eda3fb873e59544ff36301b51e05aef64f87b0f9 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期五, 27 八月 2021 13:21:21 +0800 Subject: [PATCH] Merge branch 'newBranch1' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into newBranch1 --- HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs | 77 +++++--------------------------------- 1 files changed, 11 insertions(+), 66 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..661dbcd 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs @@ -164,32 +164,12 @@ 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"; - } - AddDic("pm2.5", "=", value); + var value= pmView.GetValue("pm25", text); + AddDic("pm2.5", "in", value); }); } /// <summary> @@ -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