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 }); }