From 157be5220d9d81bce18e8248ef6ac056415405a1 Mon Sep 17 00:00:00 2001
From: Tong <1025782220@qq.com>
Date: 星期二, 31 八月 2021 09:29:45 +0800
Subject: [PATCH] 更新推送库
---
HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs | 83 ++++++++---------------------------------
1 files changed, 16 insertions(+), 67 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs
index 5781fc1..661dbcd 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,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);
}
@@ -217,7 +197,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;
@@ -247,7 +227,7 @@
Logic.currlogic.input.Add(input);
}
- LogicMethod.RemoveAllView();
+ LogicMethod.CurrLogicMethod.RemoveAllView();
AddLogic addLogic = new AddLogic();
MainPage.BasePageView.AddChidren(addLogic);
addLogic.Show();
@@ -261,7 +241,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,37 +257,6 @@
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