From 3fac3fde950fac3057e5766fa350f20d454b53a0 Mon Sep 17 00:00:00 2001
From: czw <selecti@yeah.net>
Date: 星期一, 14 七月 2025 11:38:54 +0800
Subject: [PATCH] 1

---
 2025年6月12日/AuxAllWCS/Build/Project/代码/VS自定义类/AutoThread.cs |   85 +++++++++++++++++++++++++++---------------
 1 files changed, 55 insertions(+), 30 deletions(-)

diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs"
index 968a572..aafd1d1 100644
--- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs"
+++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs"
@@ -137,35 +137,35 @@
             {
                 try
                 {
-                    foreach (var ip in new List<string> {
-                    device1.p鍙戦偅绉�涓嬬嚎.Config.IP,
-                    device1.p鍙戦偅绉�涓嬬嚎.Config.IP,
-                    device1.D瀹氬瓙1鍙锋満姊版墜.Config.IP,
-                    device1.D瀹氬瓙2鍙锋満姊版墜.Config.IP,
-                    device1.Js鎹烽『1.Config.IP,
-                    device1.Js鎹烽『2.Config.IP,
-                    device1.缁村笇灏旀姄鑷�.Config.IP,
-                    device1.缁村笇灏旀姄鑷�.Config.IP,
-                    device1.RGV.Config.IP,
-                    device1.S1002Read.Config.IP,
-                    device1.S2001Read.Config.IP,
-                    device1.S3001Read.Config.IP
-                })
-                    {
-                        string pattern = @"\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b";
+                    //    foreach (var ip in new List<string> {
+                    //    device1.p鍙戦偅绉�涓嬬嚎.Config.IP,
+                    //    device1.p鍙戦偅绉�涓嬬嚎.Config.IP,
+                    //    device1.D瀹氬瓙1鍙锋満姊版墜.Config.IP,
+                    //    device1.D瀹氬瓙2鍙锋満姊版墜.Config.IP,
+                    //    device1.Js鎹烽『1.Config.IP,
+                    //    device1.Js鎹烽『2.Config.IP,
+                    //    device1.缁村笇灏旀姄鑷�.Config.IP,
+                    //    device1.缁村笇灏旀姄鑷�.Config.IP,
+                    //    device1.RGV.Config.IP,
+                    //    device1.S1002Read.Config.IP,
+                    //    device1.S2001Read.Config.IP,
+                    //    device1.S3001Read.Config.IP
+                    //})
+                    //    {
+                    //        string pattern = @"\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b";
 
-                        var matches = Regex.Match(ip, pattern);
-                        if (matches.Success)
-                        {
-                            var b = IsMachineOnline(matches.Value);
-                            if (!Iponlines.ContainsKey(ip))
-                            {
-                                Iponlines.TryAdd(ip, b);
-                            }
-                            else
-                                Iponlines[ip] = b;
-                        }
-                    }
+                    //        var matches = Regex.Match(ip, pattern);
+                    //        if (matches.Success)
+                    //        {
+                    //            var b = IsMachineOnline(matches.Value);
+                    //            if (!Iponlines.ContainsKey(ip))
+                    //            {
+                    //                Iponlines.TryAdd(ip, b);
+                    //            }
+                    //            else
+                    //                Iponlines[ip] = b;
+                    //        }
+                    //    }
                 }
                 catch (Exception ex)
                 {
@@ -777,16 +777,26 @@
 
                 LogHelper.Info($"鏌ョ湅RGV 鐢甸噺锛氥�{tag.RGV.R褰撳墠鐢甸噺}銆�鍏呯數鐘舵�锛氥�{tag.RGV.R鍏呯數鐘舵�}銆�鏁呴殰浠g爜锛氥�{tag.RGV.RgvrunError}銆�鎵嬪姩1鑷姩2銆恵tag.RGV.R鎵嬪姩1鑷姩2}銆�);
 
+                if (tag.RGV.R鍏呯數鐘舵� == 1)
+                {
+                    LogHelper.Info($"RGV 鍏呯數妯″紡锛屼笉鐢ㄧ銆�);
+                    return;
+                }
                 if (tag.RGV.R鎵嬪姩1鑷姩2 == 1)
                 {
                     LogHelper.Info($"RGV 鎵嬪姩妯″紡锛屼笉鐢ㄧ銆�);
+                    return;
+                }
+                if (tag.RGV.RgvrunError > 0)
+                {
+                    LogHelper.Info($"RGV 鏁呴殰锛屼笉鐢ㄧ銆�);
                     return;
                 }
                 LogHelper.Info($"RGV125鍛戒护鏌ョ湅 浠诲姟鏁版嵁 workmode:{tag.RGV.workMod}\n taskmod{tag.RGV.taskmod} \n t1No:{tag.RGV.taskno1}\n t1do:{tag.RGV.task1do} \n t2No:{tag.RGV.taskno2}\n t2do:{tag.RGV.task2do}\n taskend:{tag.RGV.taskend} ");
                 if (tag.RGV.taskend == 125)
                 {
                     LogHelper.Info($"RGV 鏈�25鍛戒护鏈墽琛屻� ");
-                   
+
                     if (tag.RGV.workMod == 0 && tag.RGV.taskmod == 0 && tag.RGV.taskno1 == tag.RGV.ReadTask1No && tag.RGV.taskno2 == tag.RGV.ReadTask2No)
                     {
                         LogHelper.Info($"RGV125鍛戒护鏈墽琛�tag.RGV.workMod == 0 && tag.RGV.taskmod == 0 && tag.RGV.taskno1 == tag.RGV.ReadTask1No && tag.RGV.taskno2 == tag.RGV.ReadTask2No  鑷姩娓呴櫎125");
@@ -1589,6 +1599,11 @@
         public void ThreadEdown(Tag tag)
         {
             Console.WriteLine($"ThreadEdown 20 23 = 绌轰笅妫�祴 =================> ");
+            if (tag.RGV.R鍏呯數鐘舵� == 1 || tag.RGV.R鎵嬪姩1鑷姩2 == 1 || tag.RGV.RgvrunError > 0)
+            {
+                LogHelper.Info($"RGV 鎵嬪姩||鏁呴殰||鍏呯數锛岀┖涓嬫娴嬬粓姝€�");
+                return;
+            }
             TaskRepository taskRepository = new TaskRepository();
             foreach (var Bssx in new string[] { "1020", "1023" })
             {
@@ -1695,7 +1710,12 @@
 
         public void ThreadDdown(Tag tag)
         {
-            Console.WriteLine($"ThreadDdown 08 10 ==================> 1026");
+            Console.WriteLine($"ThreadDdown 08 16==================> 1026");
+            if (tag.RGV.R鍏呯數鐘舵� == 1 || tag.RGV.R鎵嬪姩1鑷姩2 == 1 || tag.RGV.RgvrunError > 0)
+            {
+                LogHelper.Info($"RGV 鎵嬪姩||鏁呴殰||鍏呯數锛�8 16 > 1026缁堟銆�);
+                return;
+            }
             TaskRepository taskRepository = new TaskRepository();
             foreach (var Bssx in new string[] { "1008", "1016" })
             {
@@ -1767,6 +1787,11 @@
         public void Thread0210Down(Tag tag)
         {
             Console.WriteLine($"Thread0210Down ==================>");
+            if (tag.RGV.R鍏呯數鐘舵� == 1 || tag.RGV.R鎵嬪姩1鑷姩2 == 1 || tag.RGV.RgvrunError > 0)
+            {
+                LogHelper.Info($"RGV 鎵嬪姩||鏁呴殰||鍏呯數锛�2 10 > 1017缁堟銆�);
+                return;
+            }
             TaskRepository taskRepository = new TaskRepository();
             foreach (var Bssx in new string[] { "1002", "1010" })
             {

--
Gitblit v1.9.1