From 83f3c63f1cae6224320a8d19251e3bc0404da096 Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期五, 26 九月 2025 14:54:44 +0800
Subject: [PATCH] 出入库

---
 代码管理/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/GetDeviceAddress.cs |  116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 109 insertions(+), 7 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/GetDeviceAddress.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/GetDeviceAddress.cs"
index 23e19e6..2c5c8fb 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/GetDeviceAddress.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/GetDeviceAddress.cs"
@@ -8,6 +8,7 @@
 using WIDESEAWCS_QuartzJob;
 using WIDESEA_Common.Log;
 using System.Xml.Linq;
+using SixLabors.ImageSharp;
 
 namespace WIDESEAWCS_Tasks.StackerCraneJob
 {
@@ -20,18 +21,83 @@
         /// </summary>
         /// <param name="ChildPosiDeviceCode">璁惧</param>
         /// <returns></returns>
-        public static int GetEquipmentlocation(string ChildPosiDeviceCode)
+        public static int GetEquipmentlocation(string ChildPosiDeviceCode)   
         {
             IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == ChildPosiDeviceCode);
-            CommonStackerCrane Commonstacker = (CommonStackerCrane)device;
-            DeviceProDTO? deviceProDTO = GetDeviceProDTO(Commonstacker, ChildPosiDeviceCode, "RGVCurrentlocation");
-            int HCJGStatus = GetLine(Commonstacker, deviceProDTO.DeviceProAddress);
-            return HCJGStatus;
+            SpeStackerCrane speStackerCrane = (SpeStackerCrane)device;
+            GetStackerObject getStackerObject = new GetStackerObject(speStackerCrane);
+            return getStackerObject.RGVCurrentlocation;
+        }
+
+        /// <summary>
+        /// 浼犲叆璁惧锛岃繑鍥炲綋鍓嶈澶囦俊鎭�
+        /// </summary>
+        /// <param name="ChildPosiDeviceCode">璁惧</param>
+        /// <returns></returns>
+        public static int GetEquipmentInformation(string ChildPosiDeviceCode)
+        {
+            IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == ChildPosiDeviceCode);
+            SpeStackerCrane speStackerCrane = (SpeStackerCrane)device;
+            GetStackerObject getStackerObject = new GetStackerObject(speStackerCrane);
+            if (getStackerObject.RgvCraneAutoStatusValue == RgvCraneAutoStatus.Automatic &&
+                        getStackerObject.StaclerkJobJobStatusValue == RgvJobCraneStatus.Ready && getStackerObject.RgvCraneWorkStatusValue == RGVStepprocess.NoAction)
+            {
+                return getStackerObject.RGVCurrentlocation;
+            }
+            else
+            {
+                return 0;
+            }
+                
+        }
+
+        /// <summary>
+        /// 浼犲叆璁惧锛岃繑鍥炲綋鍓嶈澶囦俊鎭紙鍏ュ簱姣嶈溅锛岄渶瑕佸姞鍏ユ槸鍚︽湁璐у垽鏂�)
+        /// </summary>
+        /// <param name="ChildPosiDeviceCode">璁惧</param>
+        /// <returns></returns>
+        public static int GetEquipmentInMuche(string ChildPosiDeviceCode)
+        {
+            IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == ChildPosiDeviceCode);
+            SpeStackerCrane speStackerCrane = (SpeStackerCrane)device;
+            GetStackerObject getStackerObject = new GetStackerObject(speStackerCrane);
+            if (getStackerObject.RgvCraneAutoStatusValue == RgvCraneAutoStatus.Automatic &&
+                        getStackerObject.StaclerkJobJobStatusValue == RgvJobCraneStatus.Ready && getStackerObject.RgvCraneWorkStatusValue == RGVStepprocess.NoAction && getStackerObject.RgvCraneStatusValue == RgvEquipmentStatus.NoCargo)
+            {
+                return getStackerObject.RGVCurrentlocation;
+            }
+            else
+            {
+                return 0;
+            }
+
         }
 
 
         /// <summary>
-        /// 鏌ヨ鍏蜂綋鍦板潃
+        /// 浼犲叆璁惧缂栧彿锛屽垽鏂澶囩姸鎬佹槸鍚﹀彲杩涘叆
+        /// </summary>
+        /// <param name="ChildPosiDeviceCode"></param>
+        /// <returns></returns>
+        public static bool ReturnCurrentStatus(string ChildPosiDeviceCode)
+        {
+            IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == ChildPosiDeviceCode);
+            SpeStackerCrane speStackerCrane = (SpeStackerCrane)device;
+            GetStackerObject getStackerObject = new GetStackerObject(speStackerCrane);
+            if (getStackerObject.RgvCraneAutoStatusValue == RgvCraneAutoStatus.Automatic &&
+                        getStackerObject.StaclerkJobJobStatusValue == RgvJobCraneStatus.Ready && getStackerObject.RgvCraneWorkStatusValue == RGVStepprocess.NoAction)
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+
+        /// <summary>
+        /// 鏌ヨHCJ绔欏彴璁惧
         /// </summary>
         /// <param name="Commonstacker"></param>
         /// <param name="SCAddress"></param>
@@ -42,7 +108,17 @@
             return Commonstacker.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == SCAddress && x.DeviceProParamName == Interactivet && x.DeviceProParamType == "ReadDeviceCommand");
         }
 
-
+        /// <summary>
+        /// 鏌ヨRGV璁惧
+        /// </summary>
+        /// <param name="Commonstacker"></param>
+        /// <param name="SCAddress"></param>
+        /// <param name="Interactivet"></param>
+        /// <returns></returns>
+        public static DeviceProDTO? GetRGVDeviceProDTO(SpeStackerCrane Commonstacker, string SCAddress, string Interactivet)
+        {
+            return Commonstacker.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == SCAddress && x.DeviceProParamName == Interactivet && x.DeviceProParamType == "ReadDeviceCommand");
+        }
         /// <summary>
         /// 璇诲彇璁惧淇℃伅
         /// </summary>
@@ -50,6 +126,11 @@
         /// <param name="DeviceProDataBlock"></param>
         /// <returns></returns>
         public static int GetLine(CommonStackerCrane Commonstacker, string DeviceProDataBlock)
+        {
+            return Commonstacker.Communicator.Read<short>(DeviceProDataBlock);
+        }
+
+        public static int RGVGetLine(SpeStackerCrane Commonstacker, string DeviceProDataBlock)
         {
             return Commonstacker.Communicator.Read<short>(DeviceProDataBlock);
         }
@@ -66,5 +147,26 @@
         {
             WriteLog.Write_Log(SCLLinStack, Filename, Logtype, new { 淇℃伅 = Magessadd });
         }
+
+        /// <summary>
+        /// 浼犲叆绔欏彴缂栧彿锛屽垽鏂槸鍚︽湁璐�
+        /// </summary>
+        /// <param name="Platformnumber">绔欏彴缂栧彿</param>
+        public static bool HCJIsstock(string Platformnumber)
+        {
+            //鑾峰彇闇�瑕佸尯鍒嗘槸鍚﹀幓鍏ュ簱涓庡幓涓嶅悎鏍艰浇璐у彴浠诲姟
+            IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "HCJ2000");
+            CommonStackerCrane Commonstacker = (CommonStackerCrane)device;
+            DeviceProDTO? deviceProDTO = GetDeviceProDTO(Commonstacker, Platformnumber.ToString(), "HCJ_GoodsStatus");
+            int HCJGStatus = GetLine(Commonstacker, deviceProDTO.DeviceProAddress);
+            if (HCJGStatus == 0)    //涓烘棤璐�
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
     }
 }

--
Gitblit v1.9.3