From 556ce5b91a9544c7cea40d01f555ebe07c14377d Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 22 四月 2026 15:56:55 +0800
Subject: [PATCH] feat(StackerCraneTaskSelector): 出库任务选择时检查 TargetAddress 输送线任务冲突
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
index 24c16e3..0cd3ffd 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
@@ -1,5 +1,4 @@
-using Microsoft.Extensions.Logging;
-using WIDESEAWCS_Core.LogHelper;
+using Serilog;
using WIDESEAWCS_QuartzJob;
namespace WIDESEAWCS_Tasks
@@ -136,7 +135,14 @@
// 璁板綍鍏ュ簱鍦烘櫙鐨勮皟璇曟棩蹇楋紝鍖呭惈瀛愯澶囧拰鐩爣鍦板潃淇℃伅
WriteDebug(conveyorLine, "鍏ュ簱涓嬩竴鍦板潃", childDeviceCode, nextAddress);
// 濮旀墭閫氱敤澶勭悊鏂规硶锛屽叆搴撳搴斾笂灞傦紙isUpper: true锛�
- HandleDeviceRequest(conveyorLine, nextAddress, childDeviceCode, Layer.Upper);
+ //HandleDeviceRequest(conveyorLine, nextAddress, childDeviceCode, Layer.Upper);
+
+ var cvState = conveyorLine.GetValue<ConveyorLineDBNameNew, byte>(ConveyorLineDBNameNew.CV_State, nextAddress);
+ bool isAvailable = cvState == 2;
+ if (isAvailable)
+ {
+ conveyorLine.SetValue(ConveyorLineDBNameNew.Target, Convert.ToInt16(nextAddress), childDeviceCode);
+ }
}
/// <summary>
@@ -154,7 +160,14 @@
// 璁板綍鍑哄簱鍦烘櫙鐨勮皟璇曟棩蹇楋紝鍖呭惈瀛愯澶囧拰鐩爣鍦板潃淇℃伅
WriteDebug(conveyorLine, "鍑哄簱涓嬩竴鍦板潃", childDeviceCode, nextAddress);
// 濮旀墭閫氱敤澶勭悊鏂规硶锛屽嚭搴撳搴斾笅灞傦紙isUpper: false锛�
- HandleDeviceRequest(conveyorLine, nextAddress, childDeviceCode, Layer.Lower);
+ //HandleDeviceRequest(conveyorLine, nextAddress, childDeviceCode, Layer.Lower);
+
+ var cvState = conveyorLine.GetValue<ConveyorLineDBNameNew, byte>(ConveyorLineDBNameNew.CV_State, nextAddress);
+ bool isAvailable = cvState == 2;
+ if (isAvailable)
+ {
+ conveyorLine.SetValue(ConveyorLineDBNameNew.Target, Convert.ToInt16(nextAddress), childDeviceCode);
+ }
}
/// <summary>
@@ -276,7 +289,7 @@
if (device == null)
{
// 璁惧鏈壘鍒版椂璁板綍璋冭瘯鏃ュ織锛屾柟渚挎帓鏌ラ厤缃棶棰�
- _logger.LogDebug("FindDevice锛氭湭鎵惧埌 {DeviceName}", deviceName);
+ _logger.Debug("FindDevice锛氭湭鎵惧埌 {DeviceName}", deviceName);
}
return device; // 鍙兘涓� null锛岀敱璋冪敤鏂硅礋璐� null 妫�鏌�
}
@@ -456,4 +469,4 @@
QuartzLogHelper.LogDebug(_logger, "Handle{Scenario}锛氬瓙璁惧: {ChildDeviceCode}锛岀洰鏍囧湴鍧�: {NextAddress}", $"Handle{scenario}锛氬瓙璁惧: {childDeviceCode}锛岀洰鏍囧湴鍧�: {nextAddress}", conveyorLine.DeviceCode, scenario, childDeviceCode, nextAddress);
}
}
-}
+}
\ No newline at end of file
--
Gitblit v1.9.3