From 2a23fbede38fadaf7060510a3cd72a93a8a95ec0 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 18 十二月 2020 17:49:46 +0800
Subject: [PATCH] 2020-12-18-3
---
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 52 +++++++++++++++++++++++++++++++++++++---------------
1 files changed, 37 insertions(+), 15 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index 7a6bcc0..7eee6bc 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -21,7 +21,7 @@
///璁板綍鏉′欢绫诲瀷
inputView.btnClick.Name = inputCondition.condition_type;
///璁板綍鏉′欢绱㈠紩
- inputView.btnClick.Tag = i;
+ inputView.btnClick.Tag = inputCondition.sid;
///鏉′欢鐘舵�佹暟缁�
List<Dictionary<string, string>> dicList = inputCondition.condition as List<Dictionary<string, string>>;
//鏄剧ず鏉′欢鍚勭绫诲瀷鐘舵��
@@ -29,7 +29,7 @@
{
case "1":
{
- inputView.btnIcon.UnSelectedImagePath = "LogicIcon/timecondition.png";
+ inputView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png";
foreach (var dic in dicList)
{
string value = dic["value"];
@@ -40,7 +40,7 @@
break;
case "2":
{
- inputView.btnIcon.UnSelectedImagePath = "LogicIcon/timecondition.png";
+ inputView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png";
foreach (var dic in dicList)
{
string value = dic["value"];
@@ -67,12 +67,12 @@
case FunctionType.Dimmer:
case FunctionType.RGB:
case FunctionType.RGBW:
- case FunctionType.CCT:
+ case FunctionType.ColorTemperature:
case FunctionType.Relay:
//绐楀笜
case FunctionType.Curtain:
- case FunctionType.RollerCurtain:
- case FunctionType.TrietexCurtain:
+ case FunctionType.RollingShutter:
+ case FunctionType.MotorCurtain:
//绌鸿皟
case FunctionType.AC:
//鍦扮儹
@@ -104,7 +104,19 @@
{
Button button = (Button)sen;
//鎵惧埌褰撳墠缂栬緫鐨勭储寮�
- int indexVulae = int.Parse(inputView.btnClick.Tag.ToString());
+ int indexVulae = 0;
+ for (int index = 0; index < Logic.currlogic.input.Count; index++)
+ {
+ Input input = Logic.currlogic.input[index];
+ if (input.sid == inputView.btnClick.Tag.ToString())
+ {
+ //鐢ㄦ埛鍙兘鍒犻櫎鏁版嵁锛屼娇鍒楄〃绱㈠紩鍙戠敓鏀瑰彉锛�
+ //閫氳繃鍞竴sid閲嶆柊鏌ユ壘鍒扮储寮曚笖鏇存柊绱㈠紩鍊�
+ indexVulae = index;
+ break;
+ }
+ }
+
//鏍囪缂栬緫鐘舵��
bool edit = true;
switch (button.Name)
@@ -131,7 +143,6 @@
timeTpye.TimeHorizon(fLayout, edit, indexVulae);
}
break;
-
case "3":
{
//鐢╯id鎵惧埌璁惧锛�
@@ -172,10 +183,10 @@
///璁板綍鏉′欢绫诲瀷
targetView.btnClick.Name = outputTarget.target_type;
///璁板綍鏉′欢绱㈠紩
- targetView.btnClick.Tag = i;
+ targetView.btnClick.Tag = outputTarget.sid;
///鏉′欢鐘舵�佹暟缁�
List<Dictionary<string, string>> dicList = outputTarget.status as List<Dictionary<string, string>>;
- //鏄剧ず鏉′欢鍚勭绫诲瀷鐘舵��
+ //鏄剧ず杈撳嚭鏉′欢鍚勭绫诲瀷鐘舵��
switch (outputTarget.target_type)
{
case "1":
@@ -214,7 +225,7 @@
break;
case FunctionType.RGB:
case FunctionType.RGBW:
- case FunctionType.CCT:
+ case FunctionType.ColorTemperature:
case FunctionType.Dimmer:
{
string on_off = GetKeyValue("on_off", dicList);
@@ -275,8 +286,8 @@
targetView.btnState.Text = stateStr;
}
break;
- case FunctionType.TrietexCurtain:
- case FunctionType.RollerCurtain:
+ case FunctionType.MotorCurtain:
+ case FunctionType.RollingShutter:
{//寮�鍏崇伅
string on_off = GetKeyValue("on_off", dicList);
string brightness = GetKeyValue("brightness", dicList);
@@ -309,7 +320,7 @@
}
- if (on_off != "" && on_off == "stop")
+ if (on_off != "" && on_off == "stop"|| on_off != "" && on_off == "off")
{
targetView.btnState.Text = Language.StringByID(StringId.stop);
}
@@ -543,7 +554,18 @@
{
Button button = (Button)sen;
//鎵惧埌褰撳墠缂栬緫鐨勭储寮�
- int indexVulae = int.Parse(targetView.btnClick.Tag.ToString());
+ int indexVulae =0;
+ for (int index = 0; index < Logic.currlogic.output.Count; index++)
+ {
+ Output target = Logic.currlogic.output[index];
+ if (target.sid == targetView.btnClick.Tag.ToString())
+ {
+ //鐢ㄦ埛鍙兘鍒犻櫎鏁版嵁锛屼娇鍒楄〃绱㈠紩鍙戠敓鏀瑰彉锛�
+ //閫氳繃鍞竴sid閲嶆柊鏌ユ壘鍒扮储寮曚笖鏇存柊绱㈠紩鍊�
+ indexVulae = index;
+ break;
+ }
+ }
//鏍囪缂栬緫鐘舵��
bool edit = true;
switch (button.Name)
--
Gitblit v1.8.0