From 3b3f39b55ba6d04a95536bebd6233b2a6e464290 Mon Sep 17 00:00:00 2001
From: xxyy <cathay_xy@163.com>
Date: 星期二, 18 二月 2025 10:20:02 +0800
Subject: [PATCH] 更新命名空间、异常处理和任务逻辑

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
index 1b17388..73152f9 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
@@ -22,6 +22,7 @@
 using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
 using WIDESEAWCS_SignalR;
 using WIDESEAWCS_Tasks.StackerCraneJob;
+using WIDESEAWCS_Common;
 
 namespace WIDESEAWCS_Tasks
 {
@@ -67,7 +68,12 @@
 
                         if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
                         {
-                            Dt_Task? task = GetTask(commonStackerCrane);
+                            Dt_Task? task = null;
+                            if (StaticVariable.isLineRun)
+                            {
+                                StaticVariable.isStackerRun = false;
+                                task = GetTask(commonStackerCrane);
+                            }
                             if (task != null)
                             {
                                 StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
@@ -125,6 +131,10 @@
                 WriteError("CommonStackerStationCraneJob", "test", ex);
                 //Console.WriteLine(nameof(CommonStackerCraneJob) + ":" + ex.ToString());
             }
+            finally
+            {
+                StaticVariable.isStackerRun = true;
+            }
             //WriteDebug("CommonStackerStationCraneJob", "test");
             return Task.CompletedTask;
         }

--
Gitblit v1.9.3