public string CreatePickStationDataSetBody(Case_Load caseload2, Case_Load caseload1) { string body = ""; PickStationConveyor pSC = ((PickStationConveyor)caseload2.CurrentActionPoint.Parent.Parent.Parent); string PickStation = string.Format("P{0}{1}{2}002{3}", pSC.LocationA.LocName.AisleNumber().ToString().PadLeft(2, '0'), pSC.Elevator.GroupName, (char)pSC.LocationA.LocName.Side(), pSC.Name.Substring(4, 2)); if (caseload1 == null) { body = string.Format("{0},,{1},{2},,,", PickStation, caseload2.SSCCBarcode, "00"); //(caseload2.Height * 1000).ToString()); } else { body = string.Format("{0},,{1},{2},,{3},{4}", PickStation, caseload2.SSCCBarcode, //(caseload2.Height * 1000).ToString(), "00", caseload1.SSCCBarcode, // (caseload1.Height * 1000).ToString()); "00"); } return(body); }
void theMultishuttle_OnArrivedAtPickStationConvPosB(object sender, MultiShuttle.Assemblies.PickDropStationArrivalEventArgs e) { var locB = theMultishuttle.ConveyorLocations.Find(x => x.LocName == e._locationName); PickStationConveyor psConv = locB.Parent.Parent.Parent as PickStationConveyor; if (psConv.TransportSection.Route.Loads.Count == 1) { ElevatorTask elevatorTask = new ElevatorTask() { BarcodeLoadB = e._caseLoad.SSCCBarcode, DestinationLoadB = string.Format("01L{0}IB", GetRandomLevel()), SourceLoadB = e._locationName, LoadCycle = Cycle.Single, UnloadCycle = Cycle.Single, Flow = TaskType.Infeed }; e._elevator.ElevatorTasks.Add(elevatorTask); } new EventWaiter(TestFunc); }
private void TUMissionSingleBlock(string telegram) { try { if (Core.Environment.InvokeRequired) { Core.Environment.Invoke(() => TUMissionSingleBlock(telegram)); return; } //Look for the load somewhere in the model, if the load is found then change it's status, if not create it at the current location Case_Load caseLoad = Case_Load.GetCaseFromIdentification(telegram.GetFieldValue(this, TelegramFields.TUIdent)); if (caseLoad != null) { DCICaseData caseData = caseLoad.Case_Data as DCICaseData; UpDateLoadParameters(telegram, caseLoad); if (telegram.GetFieldValue(this, TelegramFields.Current).LocationType() == LocationTypes.PickStation) { //Check how many loads are at the pickstation, first i need to find the pick station string currentLoc = telegram.GetFieldValue(this, TelegramFields.Current); string destLoc = telegram.GetFieldValue(this, TelegramFields.Destination); string aisle = GetPSDSLocFields(currentLoc, PSDSRackLocFields.Aisle); string side = GetPSDSLocFields(currentLoc, PSDSRackLocFields.Side); string psLevel = GetPSDSLocFields(currentLoc, PSDSRackLocFields.Level); string psA = string.Format("{0}{1}{2}{3}A", aisle, side, psLevel, GetPSDSLocFields(currentLoc, PSDSRackLocFields.ConvType)); string psB = string.Format("{0}{1}{2}{3}B", aisle, side, psLevel, GetPSDSLocFields(currentLoc, PSDSRackLocFields.ConvType)); MultiShuttle ms = GetMultishuttleFromAisleNum(psA); PickStationConveyor psConv = ms.PickStationConveyors.Find(x => x.Name == string.Format("{0}{1}PS{2}", aisle, side, psLevel)); //Check how many loads are on the pickstation if there is only 1 then send a single mission if (psConv.LocationA.Active && psConv.LocationB.Active) { Case_Load caseA = psConv.LocationA.ActiveLoad as Case_Load; Case_Load caseB = psConv.LocationB.ActiveLoad as Case_Load; DCICaseData caseDataA = caseA.Case_Data as DCICaseData; DCICaseData caseDataB = caseB.Case_Data as DCICaseData; //This is a double move to the elevator so don't send a single if (caseB.Identification == telegram.GetFieldValue(this, TelegramFields.TUIdent)) //LocationB just set the destination { UpDateLoadParameters(telegram, caseB); return; } else if (caseA.Identification == telegram.GetFieldValue(this, TelegramFields.TUIdent)) //LocationA Should be the second message so create the elevator task { UpDateLoadParameters(telegram, caseA); string DestLoadA, DestLoadB; if (caseDataA.Destination.LocationType() == LocationTypes.DropStation && GetPSDSLocFields(caseDataA.Destination, PSDSRackLocFields.Side) != side) { //First check if the destination is to a drop station... check if the drop station is on this elevator //If not choose a destination to level 1 and remember the load route DestLoadA = string.Format("{0}{1}{2}{3}B", GetPSDSLocFields(caseDataA.Current, PSDSRackLocFields.Aisle), GetPSDSLocFields(caseDataA.Current, PSDSRackLocFields.Side), FindLevelForReject(ms), "I"); } else { DestLoadA = string.Format("{0}{1}{2}{3}B", aisle, side, //GetLocFields(caseDataA.Destination, PSDSRackLocFields.Level), //GetLocFields(caseDataA.Destination, PSDSRackLocFields.ConvType)); GetLocFields(caseDataA.Destination, PSDSRackLocFields.Level) != "" ? GetLocFields(caseDataA.Destination, PSDSRackLocFields.Level) : GetBinLocField(caseDataA.Destination, BinLocFields.YLoc), GetLocFields(caseDataA.Destination, PSDSRackLocFields.ConvType) != "" ? GetLocFields(caseDataA.Destination, PSDSRackLocFields.ConvType) : "I"); } if (caseDataB.Destination.LocationType() == LocationTypes.DropStation && GetPSDSLocFields(caseDataB.Destination, PSDSRackLocFields.Side) != side) { //First check if the destination is to a drop station... check if the drop station is on this elevator //If not choose a destination to level 1 and remember the load route DestLoadB = string.Format("{0}{1}{2}{3}B", GetPSDSLocFields(caseDataB.Current, PSDSRackLocFields.Aisle), GetPSDSLocFields(caseDataB.Current, PSDSRackLocFields.Side), FindLevelForReject(ms), "I"); } else { DestLoadB = string.Format("{0}{1}{2}{3}B", aisle, side, GetLocFields(caseDataB.Destination, PSDSRackLocFields.Level) != "" ? GetLocFields(caseDataB.Destination, PSDSRackLocFields.Level) : GetBinLocField(caseDataB.Destination, BinLocFields.YLoc), GetLocFields(caseDataB.Destination, PSDSRackLocFields.ConvType) != "" ? GetLocFields(caseDataB.Destination, PSDSRackLocFields.ConvType) : "I"); } ElevatorTask et = new ElevatorTask(caseA.Identification, caseB.Identification) { LoadCycle = Cycle.Double, Flow = TaskType.Infeed, SourceLoadA = psA, SourceLoadB = psB, DestinationLoadA = DestLoadA, DestinationLoadB = DestLoadB, UnloadCycle = Cycle.Single }; if (et.DestinationLoadA == et.DestinationLoadB) { et.UnloadCycle = Cycle.Double; } ms.elevators.First(x => x.ElevatorName == side + aisle).ElevatorTasks.Add(et); } else { Log.Write(string.Format("Error {0}: None of the tuIdents match any of the loads at the PS on StartTransportTelegram"), Color.Orange); } } else { SingleLoadAtPS(telegram, caseLoad); } } else if (telegram.GetFieldValue(this, TelegramFields.Current).LocationType() == LocationTypes.RackConvOut) { LoadAtRackConv(telegram, caseLoad); } else if (telegram.GetFieldValue(this, TelegramFields.Current).LocationType() == LocationTypes.RackConvIn && caseData.Current == telegram.GetFieldValue(this, TelegramFields.Current)) //Mission for load at Infeed Rack conveyor { ShuttleTask st = new ShuttleTask(); string destination = caseData.Destination; if (destination.LocationType() != LocationTypes.BinLocation) { Log.Write("WARNING: Arrived at infeed rack and destination is NOT a binlocation.", Color.Red); return; } string current = telegram.GetFieldValue(this, TelegramFields.Current); string aisle = GetRackLocFields(current, PSDSRackLocFields.Aisle); string side = GetRackLocFields(current, PSDSRackLocFields.Side); string location = string.Format("{0}{1}{2}IB", aisle, side, GetRackLocFields(current, PSDSRackLocFields.Level)); MultiShuttle ms = GetMultishuttleFromAisleNum(location); int level; st.Destination = DCIbinLocToMultiShuttleLoc(destination, out level, ms); st.Level = level; st.LoadID = caseLoad.Identification; st.Source = location; ms.shuttlecars[level].ShuttleTasks.Add(st); } else { Log.Write(string.Format("{0}: MultishuttleStartTransportTelegram received but the load was found elsewhere in the model ({1}) message ignored", Name, caseData.Current), Color.Red); } } //Anything FROM a binloc will not have a load until the shuttle gets to the bin location at this point it will be created. else if (telegram.GetFieldValue(this, TelegramFields.Current).LocationType() == LocationTypes.BinLocation) { CreateShuttleTask(telegram); } else if (telegram.GetFieldValue(this, TelegramFields.Current).LocationType() == LocationTypes.BinLocation && telegram.GetFieldValue(this, TelegramFields.Destination).LocationType() == LocationTypes.DropStation) //It's a shuffle move { SingleLoadOut(telegram); } else { Log.Write("Error: Load not found in StartTransportTelegramReceived", Color.Red); } } catch (Exception ex) { Log.Write(ex.ToString()); if (ex.InnerException != null) { Log.Write(ex.InnerException.ToString()); } } }