void theMultishuttle_OnArrivedAtDropStationConvPosB(object sender, PickDropStationArrivalEventArgs e) { if (e._numberOfLoads == 2 && e._elevator.ElevatorConveyor.Route.Loads.Count == 0) { string[] ulIDs = ((CaseData)e._caseLoad.Case_Data).UserData.Split(','); Case_Load loadA = Case_Load.GetCaseFromIdentification(ulIDs[0]); Case_Load loadB = Case_Load.GetCaseFromIdentification(ulIDs[1]); ((CaseData)loadA.Case_Data).CurrentPosition = string.Format("D{0}{1}{2}002{3}", e._locationName.AisleNumber().ToString().PadLeft(2, '0'), theMultishuttle.ElevatorGroup(e._locationName), (char)e._locationName.Side(), e._locationName.Level()); ((CaseData)loadB.Case_Data).CurrentPosition = string.Format("D{0}{1}{2}001{3}", e._locationName.AisleNumber().ToString().PadLeft(2, '0'), theMultishuttle.ElevatorGroup(e._locationName), (char)e._locationName.Side(), e._locationName.Level()); string bodyA = mheController_Multishuttle.CreateMissionDataSetBody((CaseData)loadA.Case_Data); string bodyB = mheController_Multishuttle.CreateMissionDataSetBody((CaseData)loadB.Case_Data); mheController_Multishuttle.SendTelegram("02", bodyB + "," + bodyA, 2); TryGetNewElevatorTask(e._elevator.CurrentTask, loadA, loadB); } }
void theMultishuttle_OnArrivedAtDropStationConvPosB(object sender, PickDropStationArrivalEventArgs e) { //IDCICaseLoadType load = (IDCICaseLoadType)e._caseLoad; if (e._numberOfLoads == 2 && e._elevator.ElevatorConveyor.Route.Loads.Count == 0) // Double dropoff received { e._elevator.SetNewElevatorTask(); } }
void theMultishuttle_OnArrivedAtPickStationConvPosA(object sender, PickDropStationArrivalEventArgs e) { if (e._numberOfLoads == 2) { var loc = theMultishuttle.ConveyorLocations.Find(x => x.LocName == e._locationName); var conv = loc.Parent.Parent.Parent as PickStationConveyor; var loadB = conv.TransportSection.Route.Loads.ToList().Find(x => ((Case_Load)x).SSCCBarcode != e._caseLoad.SSCCBarcode); string body = mheController_Multishuttle.CreatePickStationDataSetBody((Case_Load)loadB, e._caseLoad); mheController_Multishuttle.SendTelegram("25", body, 1); } }
void multiShuttle_OnArrivedAtPickStationConvPosA(object sender, PickDropStationArrivalEventArgs e) { string str = string.Format("{0}B", e._locationName.Substring(0, e._locationName.Length - 1)); var locB = theMultishuttle.ConveyorLocations.Find(x => x.LocName == str); if (locB.Active) { ElevatorTask elevatorTask = new ElevatorTask(); elevatorTask.BarcodeLoadB = ((Case_Load)locB.ActiveLoad).SSCCBarcode; elevatorTask.BarcodeLoadA = e._caseLoad.SSCCBarcode; elevatorTask.DestinationLoadA = "01L06IB"; elevatorTask.DestinationLoadB = "01L08IB"; // Randomly choose between doing a single cycle off load and a double offload // This assumes that that there will be space for a double somewhere but woulf bbe easy to check for this condition // if (rand.Next(0, 2) == 0) //{ // ////UnLoad cycle single // elevatorTask.UnloadCycle = Cycle.Single; // //var infeedsWithSpace = theMultishuttle.RackConveyors.FindAll(x => (x.RackConveyorType == MultiShuttleDirections.Infeed && x.TransportSection.Route.Loads.Count < 2)); // //var infeedConv = infeedsWithSpace[rand.Next(infeedsWithSpace.Count)]; // //infeedsWithSpace.Remove(infeedConv); //remove so that it is not choosen again for this task // elevatorTask.DestinationLoadA = string.Format("{0}L02IB", e._elevator.AisleNumber.ToString().PadLeft(2, '0')); // //infeedConv = infeedsWithSpace[rand.Next(infeedsWithSpace.Count)]; //rechoose infeedConv // elevatorTask.DestinationLoadB = string.Format("{0}L04IB", e._elevator.AisleNumber.ToString().PadLeft(2, '0')); //} // else { //Unload cycle Double //var infeedsWithSpace = theMultishuttle.RackConveyors.FindAll(x => (x.RackConveyorType == MultiShuttleDirections.Infeed && x.TransportSection.Route.Loads.Count == 0)); //var infeedConv = infeedsWithSpace[rand.Next(infeedsWithSpace.Count)]; elevatorTask.DestinationLoadA = string.Format("{0}L20IB", e._elevator.AisleNumber.ToString().PadLeft(2, '0')); elevatorTask.DestinationLoadB = elevatorTask.DestinationLoadA; elevatorTask.UnloadCycle = Cycle.Double; } elevatorTask.SourceLoadA = e._locationName; elevatorTask.SourceLoadB = locB.LocName; elevatorTask.LoadCycle = Cycle.Double; elevatorTask.Flow = TaskType.Infeed; e._elevator.ElevatorTasks.Add(elevatorTask); } LoadTransfering = false; }
void theMultishuttle_OnArrivedAtDropStationConvPosA(object sender, PickDropStationArrivalEventArgs e) { if (e._elevator.CurrentTask != null && e._elevator.CurrentTask.RelevantElevatorTask(e._caseLoad) && e._elevator.CurrentTask.UnloadCycle == Cycle.Single) { ((CaseData)e._caseLoad.Case_Data).CurrentPosition = string.Format("D{0}{1}{2}002{3}", e._locationName.AisleNumber().ToString().PadLeft(2, '0'), theMultishuttle.ElevatorGroup(e._locationName), (char)e._locationName.Side(), e._locationName.Level()); string body = mheController_Multishuttle.CreateMissionDataSetBody((CaseData)e._caseLoad.Case_Data); mheController_Multishuttle.SendTelegram("02", body, 1); TryGetNewElevatorTask(e._elevator.CurrentTask, e._caseLoad); } }
void theMultishuttle_OnArrivedAtDropStationConvPosA(object sender, PickDropStationArrivalEventArgs e) { DCICaseData caseData = e._caseLoad.Case_Data as DCICaseData; caseData.Current = caseData.Destination; e._caseLoad.UserData = null; string sendMessage; sendMessage = controller.CreateTelegramFromLoad(TelegramTypes.TUReport, e._caseLoad); controller.SendTelegram(sendMessage); if (e._elevator.CurrentTask != null && e._elevator.CurrentTask.RelevantElevatorTask(e._caseLoad)) { e._elevator.SetNewElevatorTask(); } }
void theMultishuttle_OnArrivedAtPickStationConvPosA(object sender, PickDropStationArrivalEventArgs e) { IATCCaseLoadType caseloadA = (IATCCaseLoadType)(e._caseLoad); caseloadA.Location = FormatPickDropLocation(e._locationName, ConveyorTypes.Pick); //Update the location caseloadA.Destination = caseloadA.Location; string tlg = mheController_Multishuttle.CreateTelegramFromLoad(TelegramTypes.TransportRequestTelegram, caseloadA); string[] tlgSplit = tlg.Split(','); tlgSplit.SetFieldValue(TelegramFields.stateCode, "OK"); caseloadA.UserData = string.Join(",", tlgSplit); //putting it in user data alows easer message creation for the ATC multipal messages , the load reference is held on the conveyor see below var loc = theMultishuttle.ConveyorLocations.Find(x => x.LocName == e._locationName); var conv = loc.Parent.Parent.Parent as PickStationConveyor; if (e._numberOfLoads == 2) { var caseLoadB = (IATCCaseLoadType)conv.TransportSection.Route.Loads.Last.Value; //Front load if (caseLoadB == caseloadA) { Core.Environment.Log.Write($"{this.theMultishuttle.Name} Error: theMultishuttle_OnArrivedAtPickStationConvPosA LoadA == LoadB!!"); Core.Environment.Scene.Pause(); } mheController_Multishuttle.RemoveIgnoreCase(caseLoadB); string bodyB = (string)(caseLoadB.UserData); //Grab the already created message from the load using the load reference string bodyA = (string)(caseloadA.UserData); if (MultiPSTelegrams) { string sendTelegram = Telegrams.CreateMultipalMessage(new List <string>() { bodyB, bodyA }, TelegramTypes.MultipleTransportRequestTelegram, mheController_Multishuttle.Name); mheController_Multishuttle.SendTelegram(sendTelegram, true); } else { mheController_Multishuttle.SendTelegram(bodyB, true); //MRP 24-10-2018. Wait until transport telegram is received for load B. mheController_Multishuttle.SendTelegram(bodyA, true); //position A load } mheController_Multishuttle.PickStationLock(caseLoadB); } }
void theMultishuttle_OnArrivedAtDropStationConvPosA(object sender, PickDropStationArrivalEventArgs e) { IATCCaseLoadType load = (IATCCaseLoadType)e._caseLoad; load.Location = load.Destination; load.UserData = null; string sendMessage; sendMessage = mheController_Multishuttle.CreateTelegramFromLoad(TelegramTypes.MultishuttleTransportFinishedTelegram, load); sendMessage = sendMessage.SetFieldValue(TelegramFields.dropIndex, load.DropIndex.ToString()); mheController_Multishuttle.SendTelegram(sendMessage, true); if (e._elevator.CurrentTask != null && e._elevator.CurrentTask.RelevantElevatorTask(e._caseLoad)) { e._elevator.SetNewElevatorTask(); } }
void theMultishuttle_OnArrivedAtPickStationConvPosA(object sender, PickDropStationArrivalEventArgs e) { Case_Load caseLoad = e._caseLoad; DCICaseData caseData = new DCICaseData(); caseData.Length = caseLoad.Length; caseData.Width = caseLoad.Width; caseData.Height = caseLoad.Height; caseData.Weight = caseLoad.Weight; //DCICaseData caseData = caseLoad.Case_Data as DCICaseData; caseLoad.Case_Data = caseData; caseData.Current = FormatPickDropLocation(e._locationName, ConveyorTypes.Pick); //Update the location caseData.Destination = caseData.Current; caseData.Source = caseData.Current; caseData.TUType = tuType; string telegram = controller.CreateTelegramFromLoad(TelegramTypes.TUDataRequest, caseLoad); telegram.SetFieldValue(controller, TelegramFields.EventCode, "OK"); caseLoad.UserData = telegram;//string.Join(",", tlgSplit); //putting it in user data alows easer message creation for the ATC multipal messages , the load reference is held on the conveyor see below var loc = theMultishuttle.ConveyorLocations.Find(x => x.LocName == e._locationName); var conv = loc.Parent.Parent.Parent as PickStationConveyor; if (e._numberOfLoads == 2) { string[] bodies = new string[2]; bodies[0] = (string)((Case_Load)conv.UserData).UserData; //Grab the already created message from the load using the conveyor load reference created below bodies[1] = (string)(caseLoad.UserData); string sendTelegram = controller.Template.GroupTelegrams(controller, TelegramTypes.TUDataRequest, bodies, true); controller.SendTelegram(sendTelegram); } else //save the load reference so that if a second load arrives multipal telegram construction is easier { conv.UserData = caseLoad; //save case load to userdata for easier multipal message creation i.e. when e._numberOfLoads == 2 } }
private void multiShuttle_OnArrivedAtPickStationConvPosB(object sender, PickDropStationArrivalEventArgs e) { //if (!LoadTransfering) // A load is(not) currently transferring but is not yet at the pickstation //{ // 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()), // DestinationLoadB = "01L12IB", // SourceLoadB = e._locationName, // LoadCycle = Cycle.Single, // UnloadCycle = Cycle.Single, // Flow = TaskType.Infeed // }; // e._elevator.ElevatorTasks.Add(elevatorTask); // } //} }
/// <summary> /// if there are 2 loads on the pick station then this would be in theMultishuttle_OnArrivedAtPickStationConvPosA event /// </summary> void theMultishuttle_OnArrivedAtPickStationConvPosB(object sender, PickDropStationArrivalEventArgs e) { controller.SendTelegram((string)e._caseLoad.UserData); //telegram already created when at location A }
/// <summary> /// if there are 2 loads on the pick station then this would be in theMultishuttle_OnArrivedAtPickStationConvPosA event /// </summary> void theMultishuttle_OnArrivedAtPickStationConvPosB(object sender, PickDropStationArrivalEventArgs e) { mheController_Multishuttle.SendTelegram((string)e._caseLoad.UserData, true); //telegram already created when at location A mheController_Multishuttle.PickStationLock((IATCCaseLoadType)e._caseLoad); }
/// <summary> /// if there are 2 loads on the pick station then this would be in theMultishuttle_OnArrivedAtPickStationConvPosA event /// </summary> void theMultishuttle_OnArrivedAtPickStationConvPosB(object sender, PickDropStationArrivalEventArgs e) { string body = mheController_Multishuttle.CreatePickStationDataSetBody(e._caseLoad, null); mheController_Multishuttle.SendTelegram("25", body, 1); }
void theMultishuttle_OnLoadTransferingToPickStation(object sender, PickDropStationArrivalEventArgs e) { LoadTransfering = true; }