From 8c8a68df710d568f5f2b358c1e8c4b4799547d0b Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期五, 31 十月 2025 15:24:34 +0800
Subject: [PATCH] 安全门,出入库

---
 代码管理/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/GetDeviceAddress.cs |  138 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 135 insertions(+), 3 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 f971694..f8adeee 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"
@@ -10,6 +10,7 @@
 using System.Xml.Linq;
 using SixLabors.ImageSharp;
 using WIDESEAWCS_QuartzJob.Service;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
 
 namespace WIDESEAWCS_Tasks.StackerCraneJob
 {
@@ -191,7 +192,6 @@
         /// <param name="Platformnumber">绔欏彴缂栧彿</param>
         public static bool HCJIsstock(string Platformnumber)
         {
-            return true;
             //鑾峰彇闇�瑕佸尯鍒嗘槸鍚﹀幓鍏ュ簱涓庡幓涓嶅悎鏍艰浇璐у彴浠诲姟
             IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "HCJ2000");
             CommonConveyorLine Commonstacker = (CommonConveyorLine)device;
@@ -225,7 +225,7 @@
         }
 
         /// <summary>
-        /// 鍒ゆ柇3涓畨鍏ㄩ棬鐘舵��
+        /// 鍒ゆ柇3涓珯鍙�
         /// </summary>
         public static bool AQMStatus(List<AGVStation> aGVStatList)
         {
@@ -252,7 +252,8 @@
             
         }
 
-        public static List<string> StationareaList = new List<string>() { "RGV111", "RGV116", "RGV110", "RGV112", "RGV114", "RGV115" };
+        public static List<string> StationareaList = new List<string>() { "RGV111", "RGV116", "RGV110", "RGV112", "RGV114", "RGV115","RGV118" };
+        public static List<string> InStationareaList = new List<string>() { "RGV101", "RGV103", "RGV105", "RGV108", "RGV109", "RGV104","RGV107" };
 
         public static bool OutbounMotherChildCartbool(string DeviceChildCode)
         {
@@ -277,5 +278,136 @@
                 return false;
             }
         }
+
+        /// <summary>
+        /// 璇诲彇瀛愭槸鍚︿负鎵嬪姩
+        /// </summary>
+        public static bool OutRGVStatice()
+        {
+            bool rgvbool=true;
+            foreach (string AGVStation in StationareaList)
+            {
+                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == AGVStation);
+                if (device == null)  continue;
+                SpeStackerCrane Commonstacker = (SpeStackerCrane)device;
+
+                DeviceProDTO? deviceProDTO = Commonstacker.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == AGVStation && x.DeviceProParamName == "RgvCraneAutoStatus" && x.DeviceProParamType == "RgvCraneAutoStatus");
+                int RGVState = GetDeviceAddress.RGVGetLine(Commonstacker, deviceProDTO.DeviceProAddress);
+                if (RGVState == 1)
+                {
+                   return false;
+                }
+            }
+            return rgvbool;
+        }
+
+        public static bool InRGVStatice()
+        {
+            bool rgvbool = true;
+            foreach (string AGVStation in InStationareaList)
+            {
+                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == AGVStation);
+                if (device == null)  continue;
+                SpeStackerCrane Commonstacker = (SpeStackerCrane)device;
+
+                DeviceProDTO? deviceProDTO = Commonstacker.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == AGVStation && x.DeviceProParamName == "RgvCraneAutoStatus" && x.DeviceProParamType == "RgvCraneAutoStatus");
+                int RGVState = GetDeviceAddress.RGVGetLine(Commonstacker, deviceProDTO.DeviceProAddress);
+                if (RGVState == 1)
+                {
+                    return false;
+                }
+            }
+            return rgvbool;
+        }
+
+        /// <summary>
+        /// 鍑哄簱锛岃鍙朢GV鏄惁涓虹┖闂�
+        /// </summary>
+        /// <returns></returns>
+        public static bool OutRGVRGVStepprocess()
+        {
+            bool rgvbool = true;
+            foreach (string AGVStation in StationareaList)
+            {
+                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == AGVStation);
+                if (device == null)  continue;
+                SpeStackerCrane Commonstacker = (SpeStackerCrane)device;
+
+                DeviceProDTO? deviceProDTO = Commonstacker.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == AGVStation && x.DeviceProParamName == "RGVStepprocess" && x.DeviceProParamType == "RGVStepprocess");
+                int RGVState = GetDeviceAddress.RGVGetLine(Commonstacker, deviceProDTO.DeviceProAddress);
+                if (RGVState != 0)
+                {
+                   return false;
+                }
+            }
+            return rgvbool;
+        }
+
+        public static bool InRGVRGVStepprocess()
+        {
+            bool rgvbool = true;
+            foreach (string AGVStation in InStationareaList)
+            {
+                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == AGVStation);
+                if (device == null)  continue;
+                SpeStackerCrane Commonstacker = (SpeStackerCrane)device;
+
+                DeviceProDTO? deviceProDTO = Commonstacker.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == AGVStation && x.DeviceProParamName == "RGVStepprocess" && x.DeviceProParamType == "RGVStepprocess");
+                int RGVState = GetDeviceAddress.RGVGetLine(Commonstacker, deviceProDTO.DeviceProAddress);
+                if (RGVState != 0)
+                {
+                   return false;
+                }
+            }
+            return rgvbool;
+        }
+
+        public static bool WriteSecurityDoorpolice(string DeviceCode,string WriteType,int Writevalue)
+        {
+            try
+            {
+                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "HCJ2000");
+                if (device == null) return false;
+                CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device;
+                DeviceProDTO? deviceProDTO = commonConveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == DeviceCode && x.DeviceProParamName == WriteType && x.DeviceProParamType == "DeviceCommand");
+                return commonConveyorLine.Communicator.Write<short>(deviceProDTO.DeviceProAddress, (short)Writevalue);
+            }
+            catch (Exception)
+            {
+                return false;
+                throw;
+            }
+        }
+
+
+        public static List<string> AQMListdata = new List<string>() { "AQM001", "AQM002"};
+        /// <summary>
+        /// 鍒ゆ柇瀹夊叏闂ㄧ姸鎬�
+        /// </summary>
+        /// <param name="aqmtype">1涓哄嚭搴撳畨鍏ㄩ棬3鍙凤紝2涓哄叆搴撳畨鍏ㄩ棬鍒ゆ柇</param>
+        /// <returns></returns>
+        public static bool ReadAqmDecicStice(int aqmtype)
+        {
+            IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "HCJ2000");
+            CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device;
+            if (aqmtype == 1)
+            {
+                DeviceProDTO? deviceProDTO = commonConveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == "AQM003" && x.DeviceProParamName == "IndicatorStatus" && x.DeviceProParamType == "ReadDeviceCommand");
+                short AQMldeng = commonConveyorLine.Communicator.Read<short>(deviceProDTO.DeviceProDataBlock);
+                if (AQMldeng == 2) return false;
+            }
+            else
+            {
+                foreach (string aqmname in AQMListdata)
+                {
+                    DeviceProDTO? deviceProDTO = commonConveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == aqmname && x.DeviceProParamName == "IndicatorStatus" && x.DeviceProParamType == "ReadDeviceCommand");
+                    short AQMldeng = commonConveyorLine.Communicator.Read<short>(deviceProDTO.DeviceProDataBlock);
+                    if (AQMldeng == 2) return false;
+                }
+            }
+            return true;
+        }
+
+
     }
 }

--
Gitblit v1.9.3