From c1d681f496f2e1c53f88472d803e3c95fab521af Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期四, 29 七月 2021 09:46:16 +0800
Subject: [PATCH] 萤石测试通过
---
HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs | 91 +++++++++++++++++++++++++--------------------
1 files changed, 51 insertions(+), 40 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
index 9113330..372f4bb 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
@@ -279,7 +279,6 @@
var jay = jArray[a];
//鏁版嵁杩斿簭鍒楀寲涓篖ogic瀵硅薄
var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay);
- Console.WriteLine("鑾峰彇閫昏緫==="+str);
var logic = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic>(str);
if (logic != null)
{
@@ -288,38 +287,39 @@
if (if_logic == null)
{
- //Logic newlogic = new Logic();
- //newlogic.name = logic.name;
- //newlogic.userLogicId = logic.userLogicId;
- //newlogic.sid = logic.sid;
- //newlogic.relation = logic.relation;
- //newlogic.enable = logic.enable;
- //newlogic.cycle = logic.cycle;
- //for (int i = 0; i < logic.input.Count; i++)
- //{
- // if (logic.input[i] == null || string.IsNullOrEmpty(logic.input[i].condition_type))
- // {
- // //闃叉璋冭瘯杞欢涔变紶涓滆タ涓婃潵;
- // //闃叉鏈夌┖瀵硅薄锛�
- // //姝e父鎯呭喌涓嬩笉浼氬嚭鐜扮殑鐜拌薄锛�
- // continue;
- // }
- // newlogic.input.Add(logic.input[i]);
- //}
- //for (int i = 0; i < logic.output.Count; i++)
- //{
- // if (logic.output[i] == null || string.IsNullOrEmpty(logic.output[i].target_type))
- // {
- // //闃叉璋冭瘯杞欢涔变紶涓滆タ涓婃潵;
- // //闃叉鏈夌┖瀵硅薄锛�
- // //姝e父鎯呭喌涓嬩笉浼氳鐜拌薄锛�
- // continue;
- // }
- // newlogic.output.Add(logic.output[i]);
- //}
-
+ Logic newlogic = new Logic();
+ newlogic.name = logic.name;
+ newlogic.userLogicId = logic.userLogicId;
+ newlogic.sid = logic.sid;
+ newlogic.relation = logic.relation;
+ newlogic.enable = logic.enable;
+ newlogic.cycle = logic.cycle;
+ for (int i = 0; i < logic.input.Count; i++)
+ {
+ if (logic.input[i] == null || string.IsNullOrEmpty(logic.input[i].condition_type))
+ {
+ //闃叉璋冭瘯杞欢涔变紶涓滆タ涓婃潵;
+ //闃叉鏈夌┖瀵硅薄锛�
+ //姝e父鎯呭喌涓嬩笉浼氬嚭鐜扮殑鐜拌薄锛�
+ continue;
+ }
+ newlogic.input.Add(logic.input[i]);
+ }
+ for (int i = 0; i < logic.output.Count; i++)
+ {
+ if (logic.output[i] == null || string.IsNullOrEmpty(logic.output[i].target_type))
+ {
+ //闃叉璋冭瘯杞欢涔变紶涓滆タ涓婃潵;
+ //闃叉鏈夌┖瀵硅薄锛�
+ //姝e父鎯呭喌涓嬩笉浼氳鐜拌薄锛�
+ continue;
+ }
+ newlogic.output.Add(logic.output[i]);
+ }
+ newlogic.noticeConfig = logic.noticeConfig;
+ newlogic.pushConfigs = logic.pushConfigs;
//娣诲姞閫昏緫
- Logic.LogicList.Add(logic);
+ Logic.LogicList.Add(newlogic);
}
}
@@ -359,7 +359,8 @@
//2-鍔熻兘鍥炬爣
for (int i = 0; i < logic.input.Count; i++)
{
-
+ if (logic.input[i] == null)
+ continue;
var int1 = int.Parse(logic.input[i].condition_type);
int iconInt = 0;
switch (int1)
@@ -374,6 +375,14 @@
case 3:
{
iconInt = 2;
+
+ }
+ break;
+ case 4:
+ case 6:
+ case 9:
+ {
+ iconInt = 3;
}
break;
@@ -468,6 +477,12 @@
strIcon = "LogicIcon/selectTheFun.png";
}
break;
+ case 3:
+ {
+
+ strIcon = "LogicIcon/shiwaitianqi.png";
+ }
+ break;
case 11:
{
//鍒嗗壊鏉′欢鍜岀洰鏍囩殑鍥炬爣
@@ -496,9 +511,9 @@
}
}
/// <summary>
- /// 鍒ゆ柇缃戝叧绫诲瀷
+ /// 鍒ゆ柇缃戝叧绫诲瀷(0:bus缃戝叧锛�1:A鍗忚缃戝叧)
/// </summary>
- /// <returns></returns>
+ /// <returns>true=A鍗忚缃戝叧;false=bus缃戝叧</returns>
public static bool IsGatewayType
{
get
@@ -507,11 +522,7 @@
{
return true;
}
- else
- {
- return false;
-
- }
+ return false;
}
}
}
--
Gitblit v1.8.0