public static string tryGetVirturePortID(BLL.PortStationBLL portStationBLL, BLL.EqptBLL eqptBLL, string dest)
        {
            APORTSTATION port_station = portStationBLL.OperateCatch.getPortStation(dest);

            if (port_station == null)
            {
                return(dest);
            }
            var eqpt = port_station.GetEqpt(eqptBLL);

            if (eqpt is AGVStation)
            {
                var agv_station  = eqpt as AGVStation;
                var virtrue_port = agv_station.getAGVVirtruePort();
                if (agv_station.IsVirtrueUse)
                {
                    return(SCUtility.Trim(virtrue_port.PORT_ID, true));
                }
                else
                {
                    return(dest);
                }
            }
            else
            {
                return(dest);
            }
        }
        public ATRANSFER ToTRANSFER(BLL.PortStationBLL portStationBLL, BLL.EqptBLL eqprBLL)
        {
            string cmdID    = REPITEMS.COMMINFO.COMMAINFOVALUE.COMMANDID.CPVAL;
            string priority = REPITEMS.COMMINFO.COMMAINFOVALUE.PRIORITY.CPVAL;
            string replace  = REPITEMS.COMMINFO.COMMAINFOVALUE.REPLACE.CPVAL;
            string cstID    = REPITEMS.TRANINFO.TRANSFERINFOVALUE.CARRIERIDINFO.CPVAL;
            string source   = REPITEMS.TRANINFO.TRANSFERINFOVALUE.SOUINFO.CPVAL;
            string dest     = REPITEMS.TRANINFO.TRANSFERINFOVALUE.DESTINFO.CPVAL;

            dest = tryGetVirturePortID(portStationBLL, eqprBLL, dest);
            string lot_id = tryGetLotID();

            if (!int.TryParse(priority, out int ipriority))
            {
                NLog.LogManager.GetCurrentClassLogger().Warn("command id :{0} of priority parse fail. priority valus:{1}"
                                                             , cmdID
                                                             , priority);
            }
            if (!int.TryParse(replace, out int ireplace))
            {
                NLog.LogManager.GetCurrentClassLogger().Warn("command id :{0} of priority parse fail. priority valus:{1}"
                                                             , cmdID
                                                             , replace);
            }
            int port_priority = 0;

            if (!SCUtility.isEmpty(source))
            {
                APORTSTATION source_portStation = portStationBLL.OperateCatch.getPortStation(source);
                if (source_portStation == null)
                {
                    NLog.LogManager.GetCurrentClassLogger().Warn($"MCS cmd of hostsource port[{source} not exist.]");
                }
                else
                {
                    port_priority = source_portStation.PRIORITY;
                }
            }

            return(new ATRANSFER
            {
                CARRIER_ID = cstID,
                ID = cmdID,
                COMMANDSTATE = 0,
                HOSTSOURCE = source,
                HOSTDESTINATION = dest,
                PRIORITY = ipriority,
                PAUSEFLAG = "0",
                CMD_INSER_TIME = DateTime.Now,
                TIME_PRIORITY = 0,
                PORT_PRIORITY = port_priority,
                PRIORITY_SUM = ipriority + port_priority,
                REPLACE = ireplace,
                LOT_ID = lot_id
            });
        }
示例#3
0
        public List <TranTask> loadTransferTasks_ACycle(BLL.PortStationBLL portStationBLL, DataTable TranCmdPeriodicDataTable)
        {
            List <TranTask> lstTranTask = new List <TranTask>();
            var             query       = TranCmdPeriodicDataTable.AsEnumerable();

            foreach (DataRow row in query)
            {
                for (int i = 0; i < row.ItemArray.Count(); i++)
                {
                    if (i == 0)
                    {
                        continue; //跳過第一行
                    }
                    string cellData  = row[i].ToString();
                    double icellData = 0;
                    if (double.TryParse(cellData, out icellData))
                    {
                        icellData = Math.Round(icellData, 0);
                    }
                    if (icellData != 0)
                    {
                        string source_port      = row[0].ToString();
                        string destination_port = row.Table.Columns[i].ColumnName;
                        if (Common.SCUtility.isMatche(source_port, destination_port))
                        {
                            continue;
                        }
                        string car_type            = string.Empty;
                        var    source_port_station = portStationBLL.OperateCatch.getPortStation(source_port);
                        var    target_port_station = portStationBLL.OperateCatch.getPortStation(destination_port);
                        if (source_port_station != null)
                        {
                            if (source_port_station.LD_VH_TYPE == E_VH_TYPE.Clean ||
                                target_port_station == null)
                            {
                                car_type = ((int)source_port_station.LD_VH_TYPE).ToString();
                            }
                        }
                        lstTranTask.Add(new TranTask()
                        {
                            SourcePort        = source_port,
                            DestinationPort   = destination_port,
                            EachPeriodicCount = icellData.ToString(),
                            CarType           = car_type
                        });
                    }
                }
            }
            return(lstTranTask);
        }
示例#4
0
        public void start(SCApplication _app)
        {
            LineBLL        = _app.LineBLL;
            CMDBLL         = _app.CMDBLL;
            VehicleBLL     = _app.VehicleBLL;
            MapBLL         = _app.MapBLL;
            SegmentBLL     = _app.SegmentBLL;
            SectionBLL     = _app.SectionBLL;
            PortStationBLL = _app.PortStationBLL;
            ReportBLL      = _app.ReportBLL;
            VehicleService = _app.VehicleService;
            LineService    = _app.LineService;

            RouteGuide = _app.RouteGuide;

            NodeBLL = _app.NodeBLL;
            app     = _app;
        }
 public CMD_MCSObjToShow(BLL.VehicleBLL vehicleBLL, BLL.PortStationBLL portStationBLL, ACMD_MCS _cmd_mcs)
 {
     cmd_mcs        = _cmd_mcs;
     VehicleBLL     = vehicleBLL;
     PortStationBLL = portStationBLL;
 }
 public CMD_MCSObjToShow(BLL.PortStationBLL portStationBLL, ACMD_MCS _cmd_mcs)
 {
     cmd_mcs        = _cmd_mcs;
     PortStationBLL = portStationBLL;
 }
示例#7
0
 public TRANSFERObjToShow(BLL.PortStationBLL portStationBLL, VTRANSFER _cmd_mcs)
 {
     vtrnasfer      = _cmd_mcs;
     PortStationBLL = portStationBLL;
 }