1
z8018
2025-06-10 e46aa927d231af83724683c7286d9db503e24cf7
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/GantryPositionJob.cs
@@ -10,11 +10,18 @@
namespace WIDESEAWCS_Tasks
{
    /// <summary>
    /// é¾™é—¨ä½ç½®ä½œä¸šä»»åŠ¡ï¼Œç”¨äºŽè¯»å–å¹¶æ›´æ–°H和Z轴设备的位置信息
    /// </summary>
    /// <remarks>
    /// 1. ä»ŽJobParams中获取设备参数 <br/>
    /// 2. è¯»å–H轴设备位置并更新到OPositions.HPositions字典 <br/>
    /// 3. è¯»å–Z轴设备位置并更新到OPositions.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;
                                }
                            }
                        }
                    }