From 263401d40b2d9d2c1b36a24f33d45c5cb7192518 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 十二月 2020 15:51:54 +0800
Subject: [PATCH] 20201223-6

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs |   60 ++++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 40 insertions(+), 20 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
index 2b375d9..95b5452 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
@@ -34,8 +34,8 @@
             };
             //鑾峰彇鑷姩鍖栧垪琛�
             GetLogicList();
-            // for (int i = Logic.LogicList.Count-1; i >= 0; i--)闄嶅簭鎺掑垪
-            for (int i = 0; i < Logic.LogicList.Count; i++)
+             for (int i = Logic.LogicList.Count-1; i >= 0; i--)//闄嶅簭鎺掑垪
+            //for (int i = 0; i < Logic.LogicList.Count; i++)
             {
                 var currLogic = Logic.LogicList[i];
                 ///涓婁笅闂撮殧12鍍忕礌
@@ -43,7 +43,7 @@
                 LogicView.SingleLogicView logicView = new LogicView.SingleLogicView();
                 vv.AddChidren(logicView.FLayoutView());
                 logicView.btnLogicName.Text = currLogic.name;
-                logicView.btnWeekText.Text = GetWeekText(currLogic);
+                logicView.btnWeekText.Text = GetCyclicText(currLogic);
                 logicView.btnclick.MouseUpEventHandler += (sen, e) =>
                 {
                     Logic.currlogic = currLogic;
@@ -52,6 +52,7 @@
                     addLogic.Show();
                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                 };
+                //寮�鍏冲浘鏍囩殑鐐瑰嚮浜嬩欢
                 logicView.btnSwitchIcon.MouseUpEventHandler += (sender1, e1) =>
                 {
                     logicView.btnSwitchIcon.IsSelected = !logicView.btnSwitchIcon.IsSelected;
@@ -59,20 +60,29 @@
                     {
                         logicView.btnSwitchIcon.IsSelected = true;
                         currLogic.enable = "true";
-
-
                     }
                     else
                     {
                         logicView.btnSwitchIcon.IsSelected = false;
                         currLogic.enable = "false";
                     }
-                    Send.switchLogic(currLogic);
+                    //Send.switchLogic(currLogic);
+                    new System.Threading.Thread(() =>
+                    {
+                        try
+                        {
+                            //閫昏緫浣胯兘鐨勫懡浠�
+                            Send.SwitchLogic(currLogic);
 
+                        }
+                        catch { }
+                       
+                    })
+                    { IsBackground = true }.Start();
                 };
                 GetSelectIcon(logicView.frameLayout, currLogic);
-                //if (i==0)闄嶅簭鎺掑垪
-                if (Logic.LogicList.Count - 1 == i)
+                if (i==0)//闄嶅簭鎺掑垪
+                //if (Logic.LogicList.Count - 1 == i)
                 {
                     ///鏈�鍚庝竴涓窛绂绘渶搴曢儴12,鐣岄潰鏄剧ず鏁堟灉浣滅敤;
                     vv.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) });
@@ -100,12 +110,12 @@
                 automationPage.AddChidren(btnTipNot);
                 Button btnTipNotText = new Button()
                 {
-                    Y = btnTipNot.Bottom,
-                    Height = Application.GetRealWidth(100),
-                    TextID = StringId.TipNotOpen,
+                    Y = btnTipNot.Bottom + Application.GetRealHeight(16),
+                    Height = Application.GetRealHeight(20),
+                    TextID = StringId.logicnull,
                     TextAlignment = TextAlignment.Center,
-                    TextColor = CSS.CSS_Color.TextualColor,
-                    TextSize = CSS.CSS_FontSize.PromptFontSize_FirstLevel,
+                    TextSize = LogicView.TextSize.text14,
+                    TextColor = CSS.CSS_Color.textConfirmColor,
                 };
                 automationPage.AddChidren(btnTipNotText);
             }
@@ -125,7 +135,7 @@
         ///杩斿洖寰幆鎻忚堪鏂囨湰
         /// </summary>
         /// <param name="logic"></param>
-        public static string GetWeekText(Logic logic)
+        public static string GetCyclicText(Logic logic) 
         {
 
             string weekName = "";
@@ -158,7 +168,7 @@
             return weekName;
         }
         /// <summary>
-        /// 鑾峰彇鏄熸湡鐨勫瓧绗︿覆
+        /// 杩斿洖鏄熸湡鎻忚堪鏂囨湰
         /// </summary>
         /// <param name="weekList"></param>
         /// <returns></returns>
@@ -200,7 +210,6 @@
             return weekTextName.TrimEnd(',');
         }
 
-
         /// <summary>
         /// 鑾峰彇姣忔湀鐨勫瓧绗︿覆
         /// </summary>
@@ -222,9 +231,8 @@
         /// <summary>
         /// 鑾峰彇閫昏緫鍒楄〃
         /// </summary>
-        private static void GetLogicList()
+        public static void GetLogicList()
         {
-
             if (Logic.LogicList.Count != 0)
             {
                 //鑷姩鍖栧垪琛ㄤ负0鎵嶅幓鑾峰彇鑷姩鍖栧垪琛紱
@@ -232,7 +240,7 @@
             }
             List<string> logicIdList = new List<string>();
             //鑾峰彇閫昏緫ID鍒楄〃
-            var idStr = Send.getLogicIdList();
+            var idStr = Send.GetLogicIdList();
             if (idStr.Code == "0" && idStr.Data != null && idStr.Data.ToString() != "")
             {
                 var date = Newtonsoft.Json.JsonConvert.SerializeObject(idStr.Data);
@@ -244,7 +252,7 @@
                 }
             }
             //鑾峰彇鑷姩鍖栧垪琛�
-            var logicStr = Send.getLogic(logicIdList);
+            var logicStr = Send.GetLogic(logicIdList);
             if (logicStr.Code == "0" && logicStr.Data != null && logicStr.Data.ToString() != "")
             {
                 //鑾峰彇閫昏緫璇︾粏杩斿洖鏄竴涓暟缁�(object绫诲瀷杞崲涓烘暟缁�);
@@ -303,6 +311,12 @@
             //2-鍔熻兘鍥炬爣
             for (int i = 0; i < logic.input.Count; i++)
             {
+                if (logic.input[i] == null)
+                {
+                    //闃叉鏈夌殑绌哄璞★紱
+                    //姝e父鎯呭喌涓嬩笉浼氳鐜拌薄锛�
+                    continue;
+                }
 
                 var int1 = int.Parse(logic.input[i].condition_type);
                 int iconInt = 0;
@@ -339,6 +353,12 @@
             //14-寤舵椂鍥炬爣
             for (int i = 0; i < logic.output.Count; i++)
             {
+                if (logic.output[i] == null)
+                {
+                    //闃叉鏈夌殑绌哄璞★紱
+                    //姝e父鎯呭喌涓嬩笉浼氳鐜拌薄锛�
+                    continue;
+                }
                 var int1 = int.Parse(logic.output[i].target_type);
                 int iconInt = 0;
                 switch (int1)

--
Gitblit v1.8.0