huanghongfeng
7 天以前 8c8a68df710d568f5f2b358c1e8c4b4799547d0b
´úÂë¹ÜÀí/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)
            {