From f49856cb0e1e9d95fe11bb64054a407f69943d16 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 30 十一月 2020 19:34:35 +0800
Subject: [PATCH] 2020-11-30-1
---
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 112 insertions(+), 1 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index c00a35e..5f3a71b 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -68,6 +68,7 @@
{//寮�鍏崇伅
foreach (var dic in dicList)
{
+
string value = dic["value"];
if (value == "on")
{
@@ -94,6 +95,8 @@
int indexVulae = int.Parse(inputView.btnClick.Tag.ToString());
//鏍囪缂栬緫鐘舵��
bool edit = true;
+ //琛ㄧず鏄潯浠�
+ string if_type = LogicMethod.condition_if;
switch (button.Name)
{
case "1":
@@ -125,7 +128,7 @@
var device = LogicMethod.GetDevice(inputCondition.sid);
DeviceFunList deviceFunList = new DeviceFunList();
MainPage.BasePageView.AddChidren(deviceFunList);
- deviceFunList.Show(device, indexVulae,edit);
+ deviceFunList.Show(device, indexVulae,edit, if_type);
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
}
break;
@@ -144,7 +147,115 @@
public static void OutputTarget(FrameLayout thisView, VerticalScrolViewLayout viewLayout)
{
+ for (int i = 0; i < Logic.currlogic.output.Count; i++)
+ {
+ Output outputTarget = Logic.currlogic.output[i];
+ ///鍚勭鏉′欢鐨刅iew
+ LogicView.AddOutputInputView targetView = new LogicView.AddOutputInputView();
+ viewLayout.AddChidren(targetView.FLayoutView());
+ ///璁板綍鏉′欢绫诲瀷
+ targetView.btnClick.Name = outputTarget.target_type;
+ ///璁板綍鏉′欢绱㈠紩
+ targetView.btnClick.Tag = i;
+ ///鏉′欢鐘舵�佹暟缁�
+ List<Dictionary<string, string>> dicList = outputTarget.status as List<Dictionary<string, string>>;
+ //鏄剧ず鏉′欢鍚勭绫诲瀷鐘舵��
+ switch (outputTarget.target_type)
+ {
+ case "1":
+ {
+ //鐢╯id鎵惧埌璁惧锛�
+ var device = LogicMethod.GetDevice(outputTarget.sid);
+ //鐢ㄨ澶囩殑functionType绫诲瀷鎵惧埌瀵瑰簲鍥炬爣锛�
+ targetView.btnIcon.UnSelectedImagePath = LogicMethod.GetIconPath(device.functionType);
+ //鏄剧ず璁惧鍚嶇О
+ targetView.btnText.Text = device.name;
+ //鏀瑰彉璁惧鍚嶇О鏄剧ず鎺т欢瀹藉害
+ targetView.btnText.Width = Application.GetRealWidth(80);
+ //鍖哄埆涓嶅悓璁惧锛屾樉绀轰笉鍚岃澶囩姸鎬�
+ switch (device.functionType)
+ {
+ case FunctionType.Relay:
+ {//寮�鍏崇伅
+ foreach (var dic in dicList)
+ {
+ string value = dic["value"];
+ if (value == "on")
+ {
+ targetView.btnState.Text = Language.StringByID(StringId.onLogic);
+
+ }
+ else
+ {
+ targetView.btnState.Text = Language.StringByID(StringId.offLogic);
+ }
+ }
+ }
+ break;
+ }
+ }
+ break;
+ case "2":
+ {
+ //鐢╯id鎵惧埌鍦烘櫙锛�
+ var scene = LogicMethod.GetSecne(outputTarget.sid);
+ targetView.btnIcon.UnSelectedImagePath = "LogicIcon/scene.png";
+ targetView.btnNextIcon.Visible = false;
+ //鏄剧ず鍦烘櫙鍚嶇О
+ targetView.btnText.Text = scene.name;
+ }
+ break;
+ case "3":
+ {
+ targetView.btnIcon.UnSelectedImagePath = "LogicIcon/delayed.png";
+ foreach (var dic in dicList)
+ {
+ string value = dic["value"];
+ targetView.btnText.Text =value;
+ }
+ }
+ break;
+ }
+ //鍐嶆缂栬緫鏉′欢鐘舵�佺偣鍑讳簨浠�
+ targetView.btnClick.MouseUpEventHandler += (sen, e) =>
+ {
+ Button button = (Button)sen;
+ //鎵惧埌褰撳墠缂栬緫鐨勭储寮�
+ int indexVulae = int.Parse(targetView.btnClick.Tag.ToString());
+ //鏍囪缂栬緫鐘舵��
+ bool edit = true;
+ //琛ㄧず鏄洰鏍�
+ string if_type = LogicMethod.target_if;
+ switch (button.Name)
+ {
+ case "1":
+ {
+ //鐢╯id鎵惧埌璁惧锛�
+ var device = LogicMethod.GetDevice(outputTarget.sid);
+ DeviceFunList deviceFunList = new DeviceFunList();
+ MainPage.BasePageView.AddChidren(deviceFunList);
+ deviceFunList.Show(device, indexVulae, edit, if_type);
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ }
+ break;
+ case "3":
+ {
+
+ FrameLayout fLayout = new FrameLayout
+ {
+ BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+ };
+ thisView.AddChidren(fLayout);
+ AddTarget addTarget = new AddTarget();
+ addTarget.Delayed(fLayout, edit, indexVulae);
+
+
+ }
+ break;
+ }
+ };
+ }
}
}
--
Gitblit v1.8.0