From eb1be49158ad456fe7adba5c85247e0c308b764a Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 25 六月 2025 00:37:46 +0800
Subject: [PATCH] 简化写入逻辑并移除验证步骤在 `SiemensS7Communicator.cs` 文件中,移除了原有的读取和验证写入值的逻辑,替换为直接返回 `true` 表示写入成功。同时,在 `try` 块中添加了 `#region` 指令以提高代码可读性。保留了写入失败时的异常处理逻辑。

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs |   18 +++++++++++++++++-
 1 files changed, 17 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..e38f9fa 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;
         }
@@ -166,6 +176,11 @@
         private Dt_Task? GetTask(CommonStackerStationCrane commonStackerCrane)
         {
             Dt_Task task;
+            task = _taskService.QueryOutFireAlarmTask(commonStackerCrane.DeviceCode);
+            if (task != null)
+            {
+                return task;
+            }
 
             task = _taskService.QueryRelocationTask(commonStackerCrane.DeviceCode);
             if (task != null)
@@ -294,6 +309,7 @@
             stackerCraneTaskCommand.WorkType = 1;
             stackerCraneTaskCommand.TrayType = 0;
             stackerCraneTaskCommand.StartCommand = 1;
+            stackerCraneTaskCommand.FireCommand = Convert.ToInt16(task.TaskType == (int)TaskOutboundTypeEnum.OutFireAlarm ? 2 : 0);
 
             string[] sourceCodes = task.SourceAddress.Split("-");
             if (sourceCodes.Length == 3)

--
Gitblit v1.9.3