From 90fadf3023d54d780154eaa2a839e2106317297f Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期一, 05 七月 2021 13:38:59 +0800 Subject: [PATCH] 代码合并整理 --- HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs | 81 +++++++++++++++++++++++++++++++++------- 1 files changed, 66 insertions(+), 15 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs index d8930a7..5781fc1 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) => { @@ -164,11 +164,31 @@ public void PmAction(FrameLayout frame, string stateValue = "") { PublicInterface pmView = new PublicInterface(); - var pmListStr = pmView.GetViewList("pm25"); - pmView.SingleSelectionShow(frame, pmListStr, Language.StringByID(StringId.PM25), pmView.GetString("pm25", stateValue) + var pmListStr = pmView.GetViewList("pm2.5"); + pmView.SingleSelectionShow(frame, pmListStr, Language.StringByID(StringId.PM25), GetString(stateValue) , (text) => { - var value= pmView.GetValue("pm25", 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); }); } @@ -181,13 +201,13 @@ private void AddDic(string keyValue, string comparator, string value) { Input input = new Input(); - input.sid = LogicMethod.CurrLogicMethod.NewSid(); + input.sid = LogicMethod.NewSid(); input.condition_type = "4"; Dictionary<string, string> dic = new Dictionary<string, string>(); - 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); + LogicMethod.dictionary(dic, "key", keyValue); + LogicMethod.dictionary(dic, "comparator", comparator); + LogicMethod.dictionary(dic, "data_type", "float"); + LogicMethod.dictionary(dic, "value", value); input.condition.Add(dic); AddCondition(input, keyValue, comparator); } @@ -197,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; @@ -227,7 +247,7 @@ Logic.currlogic.input.Add(input); } - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); @@ -241,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++) { @@ -257,6 +277,37 @@ return false; } - + + 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