From e46aa927d231af83724683c7286d9db503e24cf7 Mon Sep 17 00:00:00 2001
From: z8018 <1282578289@qq.com>
Date: 星期二, 10 六月 2025 11:46:20 +0800
Subject: [PATCH] 1

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/GantryPositionJob.cs |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/GantryPositionJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/GantryPositionJob.cs"
index e799eba..5f61979 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/GantryPositionJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/GantryPositionJob.cs"
@@ -10,11 +10,18 @@
 
 namespace WIDESEAWCS_Tasks
 {
+    /// <summary>
+    /// 榫欓棬浣嶇疆浣滀笟浠诲姟锛岀敤浜庤鍙栧苟鏇存柊H鍜孼杞磋澶囩殑浣嶇疆淇℃伅
+    /// </summary>
+    /// <remarks>
+    /// 1. 浠嶫obParams涓幏鍙栬澶囧弬鏁� <br/>
+    /// 2. 璇诲彇H杞磋澶囦綅缃苟鏇存柊鍒癘Positions.HPositions瀛楀吀 <br/>
+    /// 3. 璇诲彇Z杞磋澶囦綅缃苟鏇存柊鍒癘Positions.ZPositions瀛楀吀 <br/>
+    /// 4. 澶勭悊杩囩▼涓崟鑾峰苟璁板綍寮傚父
+    /// </remarks>
     [DisallowConcurrentExecution]
     public class GantryPositionJob : JobBase, IJob
     {
-
-
         public GantryPositionJob()
         {
 
@@ -22,11 +29,9 @@
 
         public Task Execute(IJobExecutionContext context)
         {
-
             bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
-            if (flag && value != null && value is OtherDevice)
+            if (flag && value != null && value is OtherDevice otherDevice)
             {
-                OtherDevice otherDevice = (OtherDevice)value;
                 try
                 {
                     {
@@ -46,7 +51,10 @@
                                     PositionR = hPositions[i * 4 + 3]
                                 };
 
-                                OPositions.HPositions.TryAdd(hDeviceChildCodes[i], position);
+                                if(!OPositions.HPositions.TryAdd(hDeviceChildCodes[i], position))
+                                {
+                                    OPositions.HPositions[hDeviceChildCodes[i]] = position;
+                                }
                             }
                         }
                     }
@@ -68,7 +76,10 @@
                                     PositionR = zPositions[i * 4 + 3]
                                 };
 
-                                OPositions.ZPositions.TryAdd(zDeviceChildCodes[i], position);
+                               if(! OPositions.ZPositions.TryAdd(zDeviceChildCodes[i], position))
+                                {
+                                    OPositions.ZPositions[zDeviceChildCodes[i]] = position;
+                                }
                             }
                         }
                     }

--
Gitblit v1.9.3