From 4f2dbd1f6a1ec2d9c3c39b4a37b0b7c9ddece4aa Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 23 九月 2021 15:24:01 +0800
Subject: [PATCH] 主页刷新优化
---
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 136 +++++++++++++++++++++++++++++++++++++++++----
1 files changed, 123 insertions(+), 13 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index 1158bc6..b979155 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -381,34 +381,41 @@
case SPK.SensorTemperature:
{
- string str =new InpOrOutLogicMethod { }.GetText(dicList);
+ string str =new InpOrOutLogicMethod { }.GetText(dicList, "temperature");
inputView.btnState.Text = str;
}
break;
case SPK.SensorHumidity:
{
- string str = new InpOrOutLogicMethod { }.GetText(dicList);
+ string str = new InpOrOutLogicMethod { }.GetText(dicList, "humidity");
inputView.btnState.Text = str;
}
break;
case SPK.SensorCO2:
{
- string str = new InpOrOutLogicMethod { }.GetText(dicList);
+ string str = new InpOrOutLogicMethod { }.GetText(dicList, "co2");
inputView.btnState.Text = str;
}
break;
case SPK.SensorPm25:
{
- string str = new InpOrOutLogicMethod { }.GetText(dicList);
+ string str = new InpOrOutLogicMethod { }.GetText(dicList, "pm25");
inputView.btnState.Text = str;
}
break;
case SPK.SensorTVOC:
{
- string str = new InpOrOutLogicMethod { }.GetText(dicList);
+ string str = new InpOrOutLogicMethod { }.GetText(dicList, "tvoc");
+ inputView.btnState.Text = str;
+
+ }
+ break;
+ case SPK.SensorHcho:
+ {
+ string str = new InpOrOutLogicMethod { }.GetText(dicList, "hcho");
inputView.btnState.Text = str;
}
@@ -651,11 +658,6 @@
if (device.spk == SPK.SensorEnvironment
|| device.spk == SPK.SensorEnvironment2
|| device.spk == SPK.SensorEnvironment3
- || device.spk == SPK.SensorTemperature
- || device.spk == SPK.SensorHumidity
- || device.spk == SPK.SensorCO2
- || device.spk == SPK.SensorPm25
- || device.spk == SPK.SensorTVOC
)
{
//杩欎釜璁惧姣旇緝鐗规畩
@@ -708,7 +710,6 @@
case "pm25":
{
conditionDeviceFunList.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue);
-
}
break;
case "tvoc":
@@ -716,8 +717,49 @@
conditionDeviceFunList.PmCo2TvocAction(thisView, device, "tvoc", StringId.tvoc, indexVulae, true, stateValue);
}
break;
+ case "hcho":
+ {
+ conditionDeviceFunList.PmCo2TvocAction(thisView, device, "hcho", StringId.Formaldehyde, indexVulae, true, stateValue);
+ }
+ break;
}
}
+
+ }
+ else if (device.spk == SPK.SensorTemperature)
+ {
+
+ new InpOrOutLogicMethod().SensorView(thisView, device, "temperature", indexVulae);
+
+ }
+ else if ( device.spk == SPK.SensorHumidity)
+ {
+
+ new InpOrOutLogicMethod().SensorView(thisView, device, "humidity", indexVulae);
+
+ }
+ else if (device.spk == SPK.SensorCO2)
+ {
+
+ new InpOrOutLogicMethod().SensorView(thisView, device, "co2", indexVulae);
+
+ }
+ else if (device.spk == SPK.SensorPm25)
+ {
+
+ new InpOrOutLogicMethod().SensorView(thisView, device, "pm25", indexVulae);
+
+ }
+ else if (device.spk == SPK.SensorTVOC)
+ {
+
+ new InpOrOutLogicMethod().SensorView(thisView, device, "tvoc", indexVulae);
+
+ }
+ else if (device.spk == SPK.SensorHcho)
+ {
+
+ new InpOrOutLogicMethod().SensorView(thisView, device, "hcho", indexVulae);
}
else
@@ -2096,12 +2138,11 @@
/// </summary>
/// <param name="dicList">鐘舵�佹暟鎹垪琛�</param>
/// <returns></returns>
- private string GetText(List<Dictionary<string, string>> dicList)
+ private string GetText(List<Dictionary<string, string>> dicList,string key)
{
string strtext = "";
foreach (var dic in dicList)
{
- string key = dic["key"];
string value = dic["value"];
string comparator = dic["comparator"];
switch (key)
@@ -2148,11 +2189,80 @@
strtext = Language.StringByID(StringId.tvoc) + new PublicInterface { }.GetString("tvoc", value);
}
break;
+ case "hcho":
+ {
+ strtext = Language.StringByID(StringId.Formaldehyde) + new PublicInterface { }.GetString("hcho", value);
+ }
+ break;
}
}
return strtext;
}
+ private void SensorView(FrameLayout thisView, Function device,string key, int indexVulae) {
+ //杩欎釜璁惧姣旇緝鐗规畩
+ ConditionDeviceFunList conditionDeviceFunList = new ConditionDeviceFunList();
+ ///褰撳墠鐨勭储寮曞�兼暟鎹璞�
+ Input inputedit = Logic.currlogic.input[indexVulae];
+ ///鐘舵�佸��
+ string stateValue = "";
+ foreach (var dic in inputedit.condition)
+ {
+ string comparator = dic["comparator"];
+ stateValue = dic["value"];
+ switch (key)
+ {
+ case "temperature":
+ {
+ int titleInt = 0;
+ if (comparator == ">")
+ {
+ titleInt = StringId.wendugaoyu;
+ }
+ else if (comparator == "<")
+ {
+ titleInt = StringId.wendudiyu;
+ }
+ conditionDeviceFunList.InputBoxAction(device, titleInt, indexVulae, true, stateValue);
+ }
+ break;
+ case "humidity":
+ {
+ int titleInt = 0;
+ if (comparator == ">")
+ {
+ titleInt = StringId.shidugaoyu;
+ }
+ else if (comparator == "<")
+ {
+ titleInt = StringId.shidudiyu;
+ }
+ conditionDeviceFunList.InputBoxAction(device, titleInt, indexVulae, true, stateValue);
+ }
+ break;
+ case "co2":
+ {
+ conditionDeviceFunList.PmCo2TvocAction(thisView, device, "co2", StringId.co2, indexVulae, true, stateValue);
+ }
+ break;
+ case "pm25":
+ {
+ conditionDeviceFunList.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue);
+ }
+ break;
+ case "tvoc":
+ {
+ conditionDeviceFunList.PmCo2TvocAction(thisView, device, "tvoc", StringId.tvoc, indexVulae, true, stateValue);
+ }
+ break;
+ case "hcho":
+ {
+ conditionDeviceFunList.PmCo2TvocAction(thisView, device, "hcho", StringId.Formaldehyde, indexVulae, true, stateValue);
+ }
+ break;
+ }
+ }
+ }
}
}
--
Gitblit v1.8.0