From d5088d3bb198c0f53d4716022f010a02ac393977 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 25 八月 2022 15:06:01 +0800
Subject: [PATCH] 2022年08月25日15:04:41

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

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
index 66fe538..1a14583 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
@@ -73,7 +73,7 @@
                         try
                         {
                             //閫昏緫浣胯兘鐨勫懡浠�
-                            Send.SwitchLogic(currLogic);
+                            Send.Current.SwitchLogic(currLogic);
 
                         }
                         catch { }
@@ -268,8 +268,8 @@
             }
             List<string> logicIdList = new List<string>();
             //鑾峰彇閫昏緫ID鍒楄〃
-            var idStr = Send.GetLogicIdList();
-            if (idStr.Code == "0" && idStr.Data != null && idStr.Data.ToString() != "")
+            var idStr = Send.Current.GetLogicIdList();
+            if (idStr != null)
             {
                 var date = Newtonsoft.Json.JsonConvert.SerializeObject(idStr.Data);
                 var dateList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LogicData>>(date);
@@ -280,17 +280,13 @@
                 }
             }
             //鑾峰彇鑷姩鍖栧垪琛�
-            var logicStr = Send.GetLogic(logicIdList);
-            if (logicStr.Code == "0" && logicStr.Data != null && logicStr.Data.ToString() != "")
+            var logicListStr = Send.Current.GetLogic(logicIdList);
+            if (logicListStr != null)
             {
-                //鑾峰彇閫昏緫璇︾粏杩斿洖鏄竴涓暟缁�(object绫诲瀷杞崲涓烘暟缁�);
-                var jArray = JArray.Parse(logicStr.Data.ToString());
-                for (int a = 0; a < jArray.Count; a++)
+                var logicList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Logic>>(logicListStr.Data.ToString());
+                for (int j = 0; j < logicList.Count; j++)
                 {
-                    var jay = jArray[a];
-                    //鏁版嵁杩斿簭鍒楀寲涓篖ogic瀵硅薄
-                    var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay);
-                    var logic = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic>(str);
+                    var logic = logicList[j];
                     if (logic != null)
                     {
                         //鏌ユ壘鏄惁宸茬粡瀛樺湪璇ラ�昏緫

--
Gitblit v1.8.0