1
HuBingJie
2025-11-29 0df64f37379ce5c04e380f1c411dc52b01ac6b51
´úÂë¹ÜÀí/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/GetDeviceAddress.cs
@@ -225,7 +225,7 @@
        }
        /// <summary>
        /// åˆ¤æ–­3个安全门状态
        /// åˆ¤æ–­3个站台
        /// </summary>
        public static bool AQMStatus(List<AGVStation> aGVStatList)
        {
@@ -253,6 +253,7 @@
        }
        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)
        {
@@ -283,18 +284,79 @@
        /// </summary>
        public static bool OutRGVStatice()
        {
            bool rgvbool=false;
            bool rgvbool=true;
            foreach (string AGVStation in StationareaList)
            {
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == AGVStation);
                if (device == null) return false;
                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 == 0)
                if (RGVState == 1)
                {
                    rgvbool= true;
                   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>
        /// å‡ºåº“,读取RGV是否为空闲
        /// </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;
@@ -304,11 +366,11 @@
        {
            try
            {
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == DeviceCode);
                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.DeviceProDataBlock, (short)Writevalue);
                return commonConveyorLine.Communicator.Write<short>(deviceProDTO.DeviceProAddress, (short)Writevalue);
            }
            catch (Exception)
            {
@@ -327,11 +389,12 @@
        public static bool ReadAqmDecicStice(int aqmtype)
        {
            IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "HCJ2000");
            if (device == null) return false;
            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);
                short AQMldeng = commonConveyorLine.Communicator.Read<short>(deviceProDTO.DeviceProAddress);
                if (AQMldeng == 2) return false;
            }
            else
@@ -339,7 +402,7 @@
                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);
                    short AQMldeng = commonConveyorLine.Communicator.Read<short>(deviceProDTO.DeviceProAddress);
                    if (AQMldeng == 2) return false;
                }
            }