From 0b4792ff8245f9eac16e6d02452eb9a091f6f72b Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期二, 28 十月 2025 19:42:04 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/GetDeviceAddress.cs |   74 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 72 insertions(+), 2 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..7413c8b 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;
@@ -252,7 +252,7 @@
             
         }
 
-        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 bool OutbounMotherChildCartbool(string DeviceChildCode)
         {
@@ -277,5 +277,75 @@
                 return false;
             }
         }
+
+        /// <summary>
+        /// 璇诲彇瀛愭槸鍚︿负鎵嬪姩
+        /// </summary>
+        public static bool OutRGVStatice()
+        {
+            bool rgvbool=false;
+            foreach (string AGVStation in StationareaList)
+            {
+                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == AGVStation);
+                if (device == null) return false;
+                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 == 0)
+                {
+                    rgvbool= true;
+                }
+            }
+            return rgvbool;
+        }
+
+        public static bool WriteSecurityDoorpolice(string DeviceCode,string WriteType,int Writevalue)
+        {
+            try
+            {
+                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == DeviceCode);
+                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.DeviceProDataBlock, (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