From e238b9cc3caef879fd907ceab8997d08ae891ea3 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 04 十一月 2021 09:22:08 +0800
Subject: [PATCH] BUG修复
---
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 170 +++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 148 insertions(+), 22 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..cc30118 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -135,7 +135,8 @@
//鍖哄埆涓嶅悓璁惧锛屾樉绀轰笉鍚岃澶囩姸鎬�
switch (device.spk)
{
- //寮�鍏崇伅鍏� light.Switch
+ //寮�鍏崇伅鍏�
+ case SPK.AirSwitch:
case SPK.LightDimming:
case SPK.LightRGB:
case SPK.LightRGBW:
@@ -146,12 +147,13 @@
case SPK.CurtainRoller:
case SPK.CurtainTrietex:
//绌鸿皟
- case SPK.AcStandard:
+ case SPK.AcStandard:case SPK.HvacAC:
//鍦扮儹
- case SPK.FloorHeatStandard:
+ case SPK.HvacFloorHeat:case SPK.FloorHeatStandard:
//鏂伴
case SPK.AirFreshStandard:
- {//寮�鍏崇伅
+ case SPK.HvacAirFresh:
+ {//寮�鍏崇伅
foreach (var dic in dicList)
{
@@ -205,6 +207,7 @@
}
break;
case SPK.SensorDryContact:
+ case SPK.SensorDryContact2:
{
foreach (var dic in dicList)
{
@@ -269,6 +272,7 @@
switch (dic["key"])
{
case "status":
+ case "people_status":
{
if (value == "true")
{
@@ -302,6 +306,7 @@
}
break;
case SPK.SenesorMegahealth:
+ case SPK.SenesorMegahealth2:
{
foreach (var dic in dicList)
{
@@ -381,34 +386,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 +663,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 +715,6 @@
case "pm25":
{
conditionDeviceFunList.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue);
-
}
break;
case "tvoc":
@@ -716,8 +722,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
@@ -860,6 +907,7 @@
//鍖哄埆涓嶅悓璁惧锛屾樉绀轰笉鍚岃澶囩姸鎬�
switch (device.spk)
{
+ case SPK.AirSwitch:
case SPK.LightSwitch:
{//寮�鍏崇伅
@@ -933,6 +981,7 @@
}
break;
case SPK.AcStandard:
+ case SPK.HvacAC:
{
string on_off = GetKeyValue("on_off", dicList);
string set_temp = GetKeyValue("set_temp", dicList);
@@ -1031,7 +1080,7 @@
}
break;
- case SPK.FloorHeatStandard:
+ case SPK.FloorHeatStandard:case SPK.HvacFloorHeat:
{
string on_off = GetKeyValue("on_off", dicList);
string set_temp = GetKeyValue("set_temp", dicList);
@@ -1104,6 +1153,7 @@
}
break;
case SPK.AirFreshStandard:
+ case SPK.HvacAirFresh:
{
string on_off = GetKeyValue("on_off", dicList);
string fan = GetKeyValue("fan", dicList);
@@ -1308,6 +1358,7 @@
switch (device.spk)
{
//寮�鍏崇伅鍏�
+ case SPK.AirSwitch:
case SPK.LightSwitch:
{
foreach (var dic in dicList)
@@ -1390,6 +1441,7 @@
}
break;
case SPK.AcStandard:
+ case SPK.HvacAC:
{
foreach (var dic in dicList)
{
@@ -1500,7 +1552,7 @@
}
break;
- case SPK.FloorHeatStandard:
+ case SPK.FloorHeatStandard:case SPK.HvacFloorHeat:
{
foreach (var dic in dicList)
@@ -1584,6 +1636,7 @@
}
break;
case SPK.AirFreshStandard:
+ case SPK.HvacAirFresh:
{
foreach (var dic in dicList)
@@ -1608,8 +1661,8 @@
}
}
break;
-
- case "fan":
+
+ case "fan":
{
if (button2 == null)
{
@@ -1684,6 +1737,7 @@
}
break;
case SPK.SensorDryContact:
+ case SPK.SensorDryContact2:
{
foreach (var dic in dicList)
{
@@ -1741,6 +1795,7 @@
switch (dic["key"])
{
case "status":
+ case "people_status":
{
if (value == "true")
{
@@ -1773,6 +1828,7 @@
}
break;
case SPK.SenesorMegahealth:
+ case SPK.SenesorMegahealth2:
{
foreach (var dic in dicList)
{
@@ -1869,6 +1925,7 @@
//鍖哄埆涓嶅悓璁惧锛屾樉绀轰笉鍚岃澶囩姸鎬�
switch (device.spk)
{
+ case SPK.AirSwitch:
case SPK.LightSwitch:
{//寮�鍏崇伅
@@ -1941,7 +1998,8 @@
}
break;
case SPK.AcStandard:
- case SPK.FloorHeatStandard:
+ case SPK.HvacAC:
+ case SPK.FloorHeatStandard:case SPK.HvacFloorHeat:
{
foreach (var dic in dicList)
{
@@ -2096,12 +2154,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 +2205,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