コード例 #1
0
        public ACMD ConvertToCmd(BLL.PortStationBLL portStationBLL, BLL.SequenceBLL sequenceBLL, AVEHICLE assignVehicle)
        {
            var source_port_station = portStationBLL.OperateCatch.getPortStation(this.HOSTSOURCE);
            var desc_port_station   = portStationBLL.OperateCatch.getPortStation(this.HOSTDESTINATION);
            //如果HostSource port是與車子一樣的話,代表是要去進行Unload的動作
            bool source_is_a_port = portStationBLL.OperateCatch.IsExist(this.HOSTSOURCE);

            string     host_source = source_is_a_port ? this.HOSTSOURCE : "";
            E_CMD_TYPE cmd_type    = source_is_a_port ? E_CMD_TYPE.LoadUnload : E_CMD_TYPE.Unload; //如果Source不是Port的話,則代表是在車上

            string from_adr = source_port_station == null ? string.Empty : source_port_station.ADR_ID;
            string to_adr   = desc_port_station == null ? string.Empty : desc_port_station.ADR_ID;

            return(new ACMD()
            {
                ID = sequenceBLL.getCommandID(SCAppConstants.GenOHxCCommandType.Auto),
                TRANSFER_ID = this.ID,
                VH_ID = assignVehicle.VEHICLE_ID,
                CARRIER_ID = this.CARRIER_ID,
                CMD_TYPE = cmd_type,
                SOURCE = from_adr,
                DESTINATION = to_adr,
                PRIORITY = this.PRIORITY_SUM,
                CMD_INSER_TIME = DateTime.Now,
                CMD_STATUS = E_CMD_STATUS.Queue,
                SOURCE_PORT = host_source,
                DESTINATION_PORT = this.HOSTDESTINATION,
                COMPLETE_STATUS = ProtocolFormat.OHTMessage.CompleteStatus.Move
            });
        }
コード例 #2
0
        public string getSourcePortEQID(BLL.PortStationBLL portStationBLL)
        {
            var port_station = portStationBLL.OperateCatch.getPortStation(this.HOSTSOURCE);

            if (port_station == null)
            {
                return("");
            }
            return(SCUtility.Trim(port_station.EQPT_ID, true));
        }
コード例 #3
0
        public AEQPT getTragetPortEQ(BLL.PortStationBLL portStationBLL, BLL.EqptBLL eqptBLL)
        {
            var port_station = portStationBLL.OperateCatch.getPortStation(this.HOSTDESTINATION);

            if (port_station == null)
            {
                return(null);
            }
            return(port_station.GetEqpt(eqptBLL));
        }
コード例 #4
0
        public AEQPT getSourcePortEQ(BLL.PortStationBLL portStationBLL, BLL.EqptBLL eqptBLL)
        {
            var port_station = portStationBLL.OperateCatch.getPortStation(this.SOURCE_PORT);

            if (port_station == null)
            {
                return(null);
            }
            return(port_station.GetEqpt(eqptBLL));
        }
コード例 #5
0
        public string getTragetPortAdrID(BLL.PortStationBLL portStationBLL)
        {
            var port_station = portStationBLL.OperateCatch.getPortStation(this.HOSTDESTINATION);

            if (port_station == null)
            {
                return("");
            }
            return(SCUtility.Trim(port_station.ADR_ID, true));
        }
コード例 #6
0
        public bool IsTargetPortAGVStation(BLL.PortStationBLL portStationBLL, BLL.EqptBLL eqptBLL)
        {
            var port_station = portStationBLL.OperateCatch.getPortStation(this.DESTINATION_PORT);

            if (port_station == null)
            {
                return(false);
            }
            return(port_station.GetEqptType(eqptBLL) == SCAppConstants.EqptType.AGVStation);
        }
コード例 #7
0
        public bool IsSourcePortAGVStation(BLL.PortStationBLL portStationBLL, BLL.EqptBLL eqptBLL)
        {
            var port_station = portStationBLL.OperateCatch.getPortStation(this.HOSTSOURCE);

            if (port_station == null)
            {
                return(false);
            }
            return(port_station.GetEqpt(eqptBLL) is IAGVStationType);
        }
コード例 #8
0
        public string getSourcePortGroupID(BLL.PortStationBLL portStationBLL)
        {
            var port_station = portStationBLL.OperateCatch.getPortStation(ID);

            if (port_station == null)
            {
                return("");
            }
            return(SCUtility.Trim(port_station.GROUP_ID, true));
        }
コード例 #9
0
        public bool IsPort(BLL.PortStationBLL portStationBLL)
        {
            List <APORTSTATION> ports = portStationBLL.OperateCatch.getPortStationByAdrID(ADR_ID);

            //if (ports == null || ports.Count() == 0)
            //{
            //    string virtual_adr = replaceFirstChar(ADR_ID);
            //    ports = portStationBLL.OperateCatch.getPortStationByAdrID(virtual_adr);
            //}
            return(ports != null && ports.Count() > 0);
        }
コード例 #10
0
        public string getSourcePortNodeID(BLL.PortStationBLL portStationBLL, BLL.EqptBLL eqptBLL)
        {
            var port_station = portStationBLL.OperateCatch.getPortStation(this.HOSTSOURCE);

            if (port_station == null)
            {
                return("");
            }
            var eq = port_station.GetEqpt(eqptBLL);

            if (eq == null)
            {
                return("");
            }
            return(SCUtility.Trim(eq.NODE_ID, true));
        }
コード例 #11
0
        public bool isWillPutToSt(BLL.VehicleBLL vehicleBLL, BLL.PortStationBLL portStationBLL, BLL.EqptBLL eqptBLL)
        {
            if (!IsCarryCommand)
            {
                return(false);
            }
            bool is_carry_cmd_cst = vehicleBLL.cache.IsCarryCstByCstID(VH_ID, CARRIER_ID);

            if (is_carry_cmd_cst)
            {
                bool is_target_port_agv_st = IsTargetPortAGVStation(portStationBLL, eqptBLL);
                return(is_target_port_agv_st);
            }
            else
            {
                return(false);
            }
        }