From 58ccc89832196860a74609a1c54b40b7c6f7faed Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 16 十一月 2023 11:51:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wxr-udp修改验证' into Wxr-V2.4.2
---
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 126 +++++++++++++++++++++++------------------
1 files changed, 71 insertions(+), 55 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index c0a2216..c5fbf03 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -181,7 +181,7 @@
}
}
break;
- //浼犳劅鍣�
+ //绱ф�ユ眰鍔╀紶鎰熷櫒
case SPK.SensorHelp:
{
string value = this.GetKeyValue("alarm_status", dicList);
@@ -218,9 +218,9 @@
case SPK.SensorDryContact2:
{
- string value = this.GetKeyValue("on_off", dicList);
+ string value = this.GetKeyValue("contact_status", dicList);
inputView.btnState.Text = Language.StringByID(StringId.offLogic);
- if (value == "on")
+ if (value == "open")
{
inputView.btnState.Text = Language.StringByID(StringId.onLogic);
}
@@ -473,7 +473,7 @@
}
break;
case SPK.Ev_Ipcam:
- if (inputCondition.identifier == "motiondetect_event")
+ if (inputCondition.identifier == Constant.intelligentDetection_event)
{
inputView.btnState.Text = Language.StringByID(StringId.shi);
}
@@ -489,7 +489,7 @@
string value = this.GetKeyValue("people_status", dicList);
if (string.IsNullOrEmpty(value))
{
- inputView.btnState.Text = inputCondition.hold_time + "s";
+ inputView.btnState.Text = LogicMethod.Current.getTimeStr(inputCondition.hold_time).Replace("0s", "");
break;
}
@@ -502,8 +502,19 @@
}
if (!string.IsNullOrEmpty(inputCondition.hold_time) && int.Parse(inputCondition.hold_time) > 0)
{
-
- inputView.btnState.Text += "鎸佺画" + inputCondition.hold_time + "s";
+ int time = int.Parse(inputCondition.hold_time);
+ inputView.btnState.Text += "鎸佺画" + LogicMethod.Current.getTimeStr(inputCondition.hold_time).Replace("0s", "");
+ }
+ if (!string.IsNullOrEmpty(inputCondition.detect_type))
+ {
+ if (inputCondition.detect_type == "1")
+ {
+ inputView.btnState.Text += "," + Language.StringByID(StringId.gaibiancaizhixing);
+ }
+ else
+ {
+ inputView.btnState.Text += "," + Language.StringByID(StringId.shoudaojiuzhixing);
+ }
}
@@ -1055,6 +1066,7 @@
}
}
break;
+ case SPK.OtherCommon:
case SPK.AirSwitch:
case SPK.LightSwitch:
//鎻掑骇
@@ -1509,22 +1521,21 @@
break;
case SPK.ElectricalTvHisense:
{
- string on_off = GetKeyValue("on_off", dicList);
+ string on = GetKeyValue("wol", dicList);
+ string off = GetKeyValue("on_off", dicList);
string volumet = GetKeyValue("set_volume", dicList);
string signal = GetKeyValue("signal", dicList);
- if (!string.IsNullOrEmpty(on_off))
- {
- if (on_off == "on")
- {
- stateStr = Language.StringByID(StringId.onLogic);
- }
- else
- {
- stateStr = Language.StringByID(StringId.offLogic);
- //濡傛灉鍏充簡锛屽叾瀹冨睘鎬т笉鏄剧ず
- break;
- }
+ if (!string.IsNullOrEmpty(off))
+ {
+ stateStr = Language.StringByID(StringId.offLogic);
+ //濡傛灉鍏充簡锛屽叾瀹冨睘鎬т笉鏄剧ず
+ break;
+ }
+
+ if (!string.IsNullOrEmpty(on))
+ {
+ stateStr = Language.StringByID(StringId.onLogic);
}
if (!string.IsNullOrEmpty(stateStr))
{
@@ -1716,6 +1727,7 @@
break;
case SPK.ElectricSocket:
//寮�鍏崇伅鍏�
+ case SPK.OtherCommon:
case SPK.AirSwitch:
case SPK.LightSwitch:
//鏈烘鎵�
@@ -2291,7 +2303,7 @@
foreach (var dic in dicList)
{
string value = dic["value"];
- if (value == "on")
+ if (value == "on"|| value == "open")
{
button1.Text = Language.StringByID(StringId.onLogic);
}
@@ -2525,19 +2537,22 @@
{
case "on_off":
{
- switch (value)
+ if (value == "off")
{
- case "on":
- {
- button1.Text = Language.StringByID(StringId.onLogic);
- }
- break;
- case "off":
- {
- button1.Text = Language.StringByID(StringId.offLogic);
- }
- break;
+ button1.Text = Language.StringByID(StringId.offLogic);
+
}
+
+ }
+ break;
+ case "wol":
+ {
+ if (value == "on")
+ {
+ button1.Text = Language.StringByID(StringId.onLogic);
+
+ }
+
}
break;
@@ -2889,29 +2904,30 @@
string state = "";
var minutes = timeValue / 60;
var seconds = timeValue % 60;
- if (minutes != 0)
- {
- if (seconds == 0)
- {
- state = minutes.ToString() + Language.StringByID(StringId.minute);
- }
- else
- {
- state = minutes.ToString() + Language.StringByID(StringId.minute) + seconds.ToString() + Language.StringByID(StringId.s);
- }
- }
- else
- {
- if (seconds != 0)
- {
- state = seconds.ToString() + Language.StringByID(StringId.s);
- }
- }
- if (!string.IsNullOrEmpty(state))
- {
- state = Language.StringByID(StringId.delayLogic) + state;
- }
- return state;
+ return LogicMethod.Current.getTimeStr(strTimeValue).Replace("0s","");
+ //if (minutes != 0)
+ //{
+ // if (seconds == 0)
+ // {
+ // state = minutes.ToString() + Language.StringByID(StringId.minute);
+ // }
+ // else
+ // {
+ // state = minutes.ToString() + Language.StringByID(StringId.minute) + seconds.ToString() + Language.StringByID(StringId.s);
+ // }
+ //}
+ //else
+ //{
+ // if (seconds != 0)
+ // {
+ // state = seconds.ToString() + Language.StringByID(StringId.s);
+ // }
+ //}
+ //if (!string.IsNullOrEmpty(state))
+ //{
+ // state = Language.StringByID(StringId.delayLogic) + state;
+ //}
+ //return state;
}
/// <summary>
/// 鑾峰彇鏄剧ず闈㈢啛鏂囨湰
--
Gitblit v1.8.0