From 75dcfe564467731b993519eb59ce330703ed1d5b Mon Sep 17 00:00:00 2001
From: xiazhengtongxue <133085197+xiazhengtongxue@users.noreply.github.com>
Date: 星期六, 25 四月 2026 16:26:04 +0800
Subject: [PATCH] Merge branch 'dev' of http://115.159.85.185:8098/r/SuZhouGuanHong/ShanMeiXinNengYuan into dev

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
index 1fd2000..a950009 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
@@ -130,12 +130,20 @@
         /// <param name="conveyorLine">杈撻�佺嚎璁惧瀵硅薄锛岀敤浜庡啓鍏ョ洰鏍囧湴鍧�鍜� ACK 淇″彿</param>
         /// <param name="nextAddress">涓嬩竴鍦板潃/鐩爣璁惧缂栫爜锛岀敤浜庤瘑鍒洰鏍囪澶囩被鍨�</param>
         /// <param name="childDeviceCode">褰撳墠瀛愯澶囩紪鐮侊紝鐢ㄤ簬绮剧‘瀹氫綅鍐欏叆鍝釜瀛愯澶�</param>
-        public void HandleInboundNextAddress(CommonConveyorLine conveyorLine, string nextAddress, string childDeviceCode)
+        public bool HandleInboundNextAddress(CommonConveyorLine conveyorLine, string nextAddress, string childDeviceCode)
         {
             // 璁板綍鍏ュ簱鍦烘櫙鐨勮皟璇曟棩蹇楋紝鍖呭惈瀛愯澶囧拰鐩爣鍦板潃淇℃伅
             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)
+            {
+                return conveyorLine.SetValue(ConveyorLineDBNameNew.Target, Convert.ToInt16(nextAddress), childDeviceCode);
+            }
+            return false;
         }
 
         /// <summary>
@@ -148,12 +156,20 @@
         /// <param name="conveyorLine">杈撻�佺嚎璁惧瀵硅薄锛岀敤浜庡啓鍏ョ洰鏍囧湴鍧�鍜� ACK 淇″彿</param>
         /// <param name="nextAddress">涓嬩竴鍦板潃/鐩爣璁惧缂栫爜锛岀敤浜庤瘑鍒洰鏍囪澶囩被鍨�</param>
         /// <param name="childDeviceCode">褰撳墠瀛愯澶囩紪鐮侊紝鐢ㄤ簬绮剧‘瀹氫綅鍐欏叆鍝釜瀛愯澶�</param>
-        public void HandleOutboundNextAddress(CommonConveyorLine conveyorLine, string nextAddress, string childDeviceCode)
+        public bool HandleOutboundNextAddress(CommonConveyorLine conveyorLine, string nextAddress, string childDeviceCode)
         {
             // 璁板綍鍑哄簱鍦烘櫙鐨勮皟璇曟棩蹇楋紝鍖呭惈瀛愯澶囧拰鐩爣鍦板潃淇℃伅
             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)
+            {
+                return conveyorLine.SetValue(ConveyorLineDBNameNew.Target, Convert.ToInt16(nextAddress), childDeviceCode);
+            }
+            return false;
         }
 
         /// <summary>

--
Gitblit v1.9.3