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 | 83 +++++++++++++++++++++++++++++++++--------
1 files changed, 66 insertions(+), 17 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
index cde7b8f..372f4bb 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
@@ -9,7 +9,7 @@
public class MainView
{
/// <summary>
- /// 璁板綍閫昏緫鑷姩鍖栫埗鎺т欢
+ /// VerticalRefreshLayout鐖舵帶浠�
/// </summary>
public static FrameLayout automationPage;
/// <summary>
@@ -46,11 +46,12 @@
logicView.btnWeekText.Text = GetCyclicText(currLogic);
logicView.btnclick.MouseUpEventHandler += (sen, e) =>
{
- Logic.currlogic = currLogic;
- var addLogic = new AddLogic();
- MainPage.BasePageView.AddChidren(addLogic);
- addLogic.Show();
- MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ //Logic.currlogic = currLogic;
+ //var addLogic = new AddLogic();
+ //MainPage.BasePageView.AddChidren(addLogic);
+ //addLogic.Show();
+ //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ new MainView { }.SkipAddLogicPage(currLogic);
};
//寮�鍏冲浘鏍囩殑鐐瑰嚮浜嬩欢
logicView.btnSwitchIcon.MouseUpEventHandler += (sender1, e1) =>
@@ -123,13 +124,30 @@
/// <summary>
/// 鎸�+璺宠浆鍒伴�昏緫鐣岄潰鐨勬柟娉�
/// </summary>
- public static void SkipAddLogicPage()
+ public void SkipAddLogicPage(Logic logic=null)
{
- Logic.currlogic = new Logic();
- var addLogic = new AddLogic();
- MainPage.BasePageView.AddChidren(addLogic);
- addLogic.Show();
- MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ if (logic == null)
+ {
+ Logic.currlogic = new Logic();
+ }
+ else {
+ Logic.currlogic = logic;
+ }
+ if (IsGatewayType)
+ {
+ var addLogic = new AddLogic();
+ MainPage.BasePageView.AddChidren(addLogic);
+ addLogic.Show();
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ }
+ else
+ {
+
+ var onePortAutomation = new OnePortAutomation();
+ MainPage.BasePageView.AddChidren(onePortAutomation);
+ onePortAutomation.Show();
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ }
}
/// <summary>
///杩斿洖寰幆鎻忚堪鏂囨湰
@@ -209,7 +227,6 @@
}
return weekTextName.TrimEnd(',');
}
-
/// <summary>
/// 鑾峰彇姣忔湀鐨勫瓧绗︿覆
/// </summary>
@@ -244,7 +261,7 @@
if (idStr.Code == "0" && idStr.Data != null && idStr.Data.ToString() != "")
{
var date = Newtonsoft.Json.JsonConvert.SerializeObject(idStr.Data);
- var dateList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Date>>(date);
+ var dateList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LogicData>>(date);
for (int i = 0; i < dateList.Count; i++)
{
//娣诲姞閫昏緫ID
@@ -299,6 +316,8 @@
}
newlogic.output.Add(logic.output[i]);
}
+ newlogic.noticeConfig = logic.noticeConfig;
+ newlogic.pushConfigs = logic.pushConfigs;
//娣诲姞閫昏緫
Logic.LogicList.Add(newlogic);
}
@@ -323,7 +342,6 @@
}
return false;
}
-
/// <summary>
/// 鏄剧ず鏉′欢鎴栬�呯洰鏍囩被鍨嬪浘鏍�
/// </summary>
@@ -341,6 +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)
@@ -355,6 +375,14 @@
case 3:
{
iconInt = 2;
+
+ }
+ break;
+ case 4:
+ case 6:
+ case 9:
+ {
+ iconInt = 3;
}
break;
@@ -449,6 +477,12 @@
strIcon = "LogicIcon/selectTheFun.png";
}
break;
+ case 3:
+ {
+
+ strIcon = "LogicIcon/shiwaitianqi.png";
+ }
+ break;
case 11:
{
//鍒嗗壊鏉′欢鍜岀洰鏍囩殑鍥炬爣
@@ -476,13 +510,28 @@
btnIcon.UnSelectedImagePath = strIcon;
}
}
+ /// <summary>
+ /// 鍒ゆ柇缃戝叧绫诲瀷(0:bus缃戝叧锛�1:A鍗忚缃戝叧)
+ /// </summary>
+ /// <returns>true=A鍗忚缃戝叧;false=bus缃戝叧</returns>
+ public static bool IsGatewayType
+ {
+ get
+ {
+ if (Entity.DB_ResidenceData.Instance.GatewayType == 1)
+ {
+ return true;
+ }
+ return false;
+ }
+ }
}
- class Date
+ class LogicData
{
/// <summary>
/// 浜戠鍞竴id
/// </summary>
- public string userLogicId = "";
+ public string userLogicId = "";
/// <summary>
/// 缃戝叧id
/// </summary>
--
Gitblit v1.8.0