void theMultishuttle_OnArrivedAtOutfeedRackConvPosB(object sender, RackConveyorArrivalEventArgs e) { //e._caseLoad.Stop(); IATCCaseLoadType atcLoad = e._caseLoad as IATCCaseLoadType; //If destination is a drop station ("D") there will be no new StartTransportTelegram so continue and create a elevator task if (BaseATCController.GetLocFields(atcLoad.Destination, PSDSRackLocFields.ConvType) == "D") { if (e._elevator.CurrentTask == null || (e._elevator.CurrentTask != null && !e._elevator.CurrentTask.RelevantElevatorTask(e._caseLoad))) { string level = BaseATCController.GetPSDSLocFields(((IATCCaseLoadType)e._caseLoad).Destination, PSDSRackLocFields.Level); // create an elevator task string aisle = e._locationName.AisleNumber().ToString().PadLeft(2, '0'); char side = (char)e._locationName.Side(); ElevatorTask et = new ElevatorTask(null, e._caseLoad.Identification) { SourceLoadB = e._locationName, DestinationLoadB = string.Format("{0}{1}{2}{3}A", aisle, side, level, (char)ConveyorTypes.Drop), // aasyyxz: a=aisle, s = side, yy = level, x = input or output, Z = loc A or B e.g. 01R05OA DropIndexLoadB = atcLoad.DropIndex, LoadCycle = Cycle.Single, UnloadCycle = Cycle.Single, Flow = TaskType.Outfeed }; string elevatorName = string.Format("{0}{1}", side, aisle); theMultishuttle.elevators.First(x => x.ElevatorName == elevatorName).ElevatorTasks.Add(et); } } }
/// <summary> /// Get the load X Location position from either the source or destination field (must be a valid bin location) /// </summary> /// <param name="field">Either source or destination field of a telegram</param> /// <returns>float position that the palletCrane should travel to</returns> private float GetXLoc(string field) { string xLoc = BaseATCController.GetBinLocField(field, BinLocFields.XLoc); string rast = BaseATCController.GetBinLocField(field, BinLocFields.RasterType); string posi = BaseATCController.GetBinLocField(field, BinLocFields.RasterPos); return(thePalletCrane.CalculateLengthFromXLoc(xLoc, rast, posi)); }
private int GetDepth(string field) { string yLoc = BaseATCController.GetBinLocField(field, BinLocFields.Depth); int result; if (int.TryParse(yLoc, out result)) { return(result); } return(0); }
private Side?GetSide(string field) { string side = BaseATCController.GetBinLocField(field, BinLocFields.Side); if (side.ToLower() == "l" || side == "1") { return(Side.Left); } if (side.ToLower() == "r" || side == "2") { return(Side.Right); } return(null); }
void theMultishuttle_OnArrivedAtOutfeedRackConvPosA(object sender, RackConveyorArrivalEventArgs e) { IATCCaseLoadType caseload = (IATCCaseLoadType)(e._caseLoad); caseload.Location = FormatRackConvLocation(e._locationName, ConveyorTypes.OutfeedRack); //Update the location if (BaseATCController.GetLocFields(caseload.Destination, PSDSRackLocFields.ConvType) == "D") { string sendMessage = mheController_Multishuttle.CreateTelegramFromLoad(TelegramTypes.LocationArrivedTelegram, caseload); mheController_Multishuttle.SendTelegram(sendMessage, true); //Always Send a notification at location A //Combine a task with an existing task but only if the final destination is a drop station because if destination is the rack conveyor then we need to wait for another message from the WMS if (e._elevator.CurrentTask != null && e._rackConveyor.LocationB.Active && !e._elevator.CurrentTask.RelevantElevatorTask(e._rackConveyor.LocationB.ActiveLoad)) { string aisle = e._elevator.AisleNumber.ToString().PadLeft(2, '0'); string level = BaseATCController.GetLocFields(((IATCCaseLoadType)e._caseLoad).Destination, PSDSRackLocFields.Level); string destLoadA = string.Format("{0}{1}{2}{3}A", aisle, (char)e._locationName.Side(), level, (char)ConveyorTypes.Drop); //Create the task but do not add it to elevator tasks list ElevatorTask et = new ElevatorTask(e._caseLoad.Identification, null) { SourceLoadA = e._locationName, DestinationLoadA = destLoadA, SourceLoadAConv = theMultishuttle.GetConveyorFromLocName(e._locationName), DestinationLoadAConv = theMultishuttle.GetConveyorFromLocName(destLoadA), Elevator = e._elevator }; //This task should just be added and not combined as the combining is now done later //TODO: Make it so that direct outfeed loads still work et.CreateNewDoubleLoadCycleTask(et, e._rackConveyor.LocationB.ActiveLoad.Identification); } } else { string sendMessage = mheController_Multishuttle.CreateTelegramFromLoad(TelegramTypes.MultishuttleTransportFinishedTelegram, caseload); mheController_Multishuttle.SendTelegram(sendMessage, true); //Always Send a notification at location A } }
void theMultishuttle_OnArrivedAtShuttle(object sender, TaskEventArgs e) { IATCCaseLoadType load = (IATCCaseLoadType)e._load; //load.Location = string.Format("MSAI{0}LV{1}SH01", BaseATCController.GetRackLocFields(load.Destination, PSDSRackLocFields.Aisle), BaseATCController.GetRackLocFields(load.Destination, PSDSRackLocFields.Level)); string aisle = BaseATCController.GetBinLocField(load.Source, BinLocFields.Aisle); if (aisle == "" && ((ShuttleTask)e._task).Source.Length > 2) //If you cannot get the aisle from the bin location, then get from the task instead { string checkAisle = ((ShuttleTask)e._task).Source.Substring(0, 2); int result; if (int.TryParse(checkAisle, out result)) { aisle = checkAisle; } } //load.Location = string.Format("MSAI{0}LV{1}SH01", BaseATCController.GetBinLocField(load.Source, BinLocFields.Aisle), ((ShuttleTask)e._task).Level.ToString().PadLeft(2, '0')); load.Location = string.Format("MSAI{0}LV{1}SH01", aisle, ((ShuttleTask)e._task).Level.ToString().PadLeft(2, '0')); string sendMessage = mheController_Multishuttle.CreateTelegramFromLoad(TelegramTypes.LocationArrivedTelegram, load); mheController_Multishuttle.SendTelegram(sendMessage, true); }
/// <summary> /// Get the load Y Location position from either the source or destination field (must be a valid bin location) /// </summary> /// <param name="field">Either source or destination field of a telegram</param> /// <returns>float position that the palletCrane should travel to</returns> private float GetYLoc(string field) { string yLoc = BaseATCController.GetBinLocField(field, BinLocFields.YLoc); return(thePalletCrane.CalculateHeightFromYLoc(yLoc)); }