void lhsStartAP_OnEnter(ActionPoint sender, Core.Loads.Load load) { if (!StartAP_OnEnter(load, Side.Right, leftToRightStartAP)) //If not switching then load has diverted { DivertedLeft(load); } }
public void rackConvLocB_Enter(ActionPoint sender, Core.Loads.Load load) { if (LocationB.LocName.ConvType() == ConveyorTypes.InfeedRack) { load.Stop(); Cycle?unloadCycle = null; if (RelevantElevatorTask(LocationA, LocationB)) { unloadCycle = Elevator.CurrentTask.UnloadCycle; } TryClearElevatorTask(Elevator.CurrentTask); Elevator.ParentMultiShuttle.ArrivedAtInfeedRackConvPosB(new RackConveyorArrivalEventArgs(LocationB.LocName, (Case_Load)load, Elevator, this, unloadCycle)); } else if (LocationB.LocName.ConvType() == ConveyorTypes.OutfeedRack) //don't care what loc we use to find the conveyor { if (!RelevantElevatorTask(load) || (RelevantElevatorTask(load) && Elevator.CurrentTask.NumberOfLoadsInTask == 1 && Elevator.Lift.Route.Motor.Running)) { //If no task then stop, if a relevant task then must be a double load onto the elevator and this is the second load so don't stop //Or the task has been created when load was at A and therefore it is relevant load.Stop(); //When the load arrives at the front position also see if the elevator wants to select a new task as it will not select a sequenced task unless it is at the front position Elevator.SetNewElevatorTask(); } if (Elevator.ParentMultiShuttle.shuttlecars[Level].CurrentTask == null) { Elevator.ParentMultiShuttle.shuttlecars[Level].SetNewShuttleTask(); } Elevator.ParentMultiShuttle.ArrivedAtOutfeedRackConvPosB(new RackConveyorArrivalEventArgs(LocationB.LocName, (Case_Load)load, Elevator, this, null)); } }
private void Lifted(Core.Loads.Load load) { //Find an empty ActionPoint Core.Routes.ActionPoint ap; while (true) { int idx = Core.Environment.Random.Next(1, Core.Routes.ActionPoint.Items.Values.Count - 1); ap = Core.Routes.ActionPoint.Items["AP" + idx]; if (ap.ActiveLoad == null) { break; } } float x = ap.Position.X - loadMover.Position.X; float z = ap.Position.Z - loadMover.Position.Z; float time = MaxTime(x, z); zMoverTimer.Start(new Microsoft.DirectX.Vector3(0, 0, z), time * 2); xMoverTimer.Start(new Microsoft.DirectX.Vector3(x, 0, 0), time * 2); Core.Timer.Action(() => Arrived(load, ap), time * 2 + 1); }
void rhsStartAP_OnEnter(ActionPoint sender, Core.Loads.Load load) { if (!StartAP_OnEnter(load, Side.Left, rightToLeftStartAP)) //If not switching then load has diverted { DivertedRight(load); } }
public void rackConvLocB_Enter(ActionPoint sender, Core.Loads.Load load) { if (LocationB.LocName.ConvType() == ConveyorTypes.InfeedRack) { load.Stop(); Cycle?unloadCycle = null; if (RelevantElevatorTask(LocationA, LocationB)) { unloadCycle = Elevator.CurrentTask.UnloadCycle; } Elevator.ParentMultiShuttle.ArrivedAtInfeedRackConvPosB(new RackConveyorArrivalEventArgs(LocationB.LocName, (Case_Load)load, Elevator, this, unloadCycle)); TryClearElevatorTask(Elevator.CurrentTask); } else if (LocationB.LocName.ConvType() == ConveyorTypes.OutfeedRack) //don't care what loc we use to find the conveyor { if (!RelevantElevatorTask(load)) //If no task then stop, if a relevant task then must be a double load onto the elevator and this is the second load so don't stop //if (Elevator.CurrentTask == null || (Elevator.CurrentTask != null && !Elevator.CurrentTask.RelevantElevatorTask(load))) //If no task then stop, if a relevant task then must be a double load onto the elevator and this is the second load so don't stop { load.Stop(); } Elevator.ParentMultiShuttle.ArrivedAtOutfeedRackConvPosB(new RackConveyorArrivalEventArgs(LocationA.LocName, (Case_Load)load, Elevator, this, null)); } }
private void Arrived(Core.Loads.Load load, Core.Routes.ActionPoint ap) { float y = ap.Position.Y - loadMover.Position.Y + load.Height + loadMover.Height / 2; yMoverTimer.Start(new Microsoft.DirectX.Vector3(0, y, 0), Math.Abs(y) * 2); Core.Timer.Action(() => Drop(load, ap), Math.Abs(y) * 2 + 1); }
private void Completed(Core.Loads.Load load) { busy = false; if (jobs.Count > 0) { Action action = jobs.Dequeue(); action.Invoke(); } }
void chutePoint_OnEnter(ActionPoint sender, Core.Loads.Load load) { //A load has been discharged to this chute if (RecoverTime > 0) { RouteAvailable = RouteStatuses.Blocked; readyTimer.Stop(); readyTimer.Timeout = RecoverTime; readyTimer.Start(); } }
private void Pickup(Core.Loads.Load load) { //Go up load.Release(); loadMover.Attach(load); float y = vertMover.Position.Y - leftframe.Height + horzMover.Height / 2; yMoverTimer.Start(new Microsoft.DirectX.Vector3(0, -y, 0), Math.Abs(y) * 2); Core.Timer.Action(() => Lifted(load), Math.Abs(y) * 2 + 1); }
void apStraight_OnEnter(ActionPoint sender, Core.Loads.Load load) { if (SelectedRoute == DivertRoute.Straight) { RouteLoadStraight(load); } else if (SelectedRoute == DivertRoute.Divert) { RouteLoadDivert(load); } }
private void Upper2_OnEnter(ActionPoint sender, Core.Loads.Load load) { lastUpper2 = load; load.UserData = "PICKED"; //Is there something at lower1 that could be released? if (lower1.Active && (string)lower1.ActiveLoad.UserData == "PICKED") { releaseLower1(); } ArrivedAtPosition2(new LiftArrivalArgs(load)); }
private void CreateLoads() { foreach (var ap in Core.Routes.ActionPoint.Items.Values) { if (ap.Name == "AP1" || ap.Name == "AP2" || ap.Name == "AP3" || ap.Name == "AP4" || ap.Name == "AP5" || ap.Name == "AP6" || ap.Name == "AP7" || ap.Name == "AP8") { Core.Loads.Load load = Core.Loads.Load.CreateBox(0.6f, 0.4f, 0.6f, Color.OldLace); load.Switch(ap); load.Stop(); } } }
private void Drop(Core.Loads.Load load, Core.Routes.ActionPoint ap) { float y = vertMover.Position.Y - leftframe.Height + horzMover.Height / 2; loadMover.UnAttach(); load.Switch(ap); load.Stop(); yMoverTimer.Start(new Microsoft.DirectX.Vector3(0, -y, 0), Math.Abs(y) * 2); Core.Timer.Action(() => Completed(load), Math.Abs(y) * 2 + 1); }
public void rackConvLocA_Enter(ActionPoint sender, Core.Loads.Load load) { if (LocationA.LocName.ConvType() == ConveyorTypes.OutfeedRack) { Elevator.ParentMultiShuttle.ArrivedAtOutfeedRackConvPosA(new RackConveyorArrivalEventArgs(LocationA.LocName, (Case_Load)load, Elevator, this, null)); Elevator.ParentMultiShuttle.shuttlecars[Level].CurrentTask = null; //If outfeed then shuttle must have finished its current task if (TransportSection.Route.Loads.Count == 2) { load.Stop(); } else { load.Release(); } } else if (LocationA.LocName.ConvType() == ConveyorTypes.InfeedRack) { Cycle?unloadCycle = null; //if (RelevantElevatorTask(Elevator.CurrentTask)) if (RelevantElevatorTask(LocationA, LocationB)) { unloadCycle = Elevator.CurrentTask.UnloadCycle; } Elevator.ParentMultiShuttle.ArrivedAtInfeedRackConvPosA(new RackConveyorArrivalEventArgs(LocationA.LocName, (Case_Load)load, Elevator, this, unloadCycle)); TryClearElevatorTask(Elevator.CurrentTask); if (TransportSection.Route.Loads.Count > 1) { load.Stop(); } if (Elevator.ElevatorConveyor.TransportSection.Route.Loads.Count > 0) //release the elevator load from A { Elevator.ElevatorConveyor.UnLoading = true; Elevator.ElevatorConveyor.LocationA.Release(); //Elevator.ReleaseLocationAFFS(Elevator.ElevatorConveyor.LocationA.ActiveLoad, "RackConveyor 309"); } //if ((Elevator.CurrentTask != null && Elevator.CurrentTask.UnloadCycle == Cycle.Single && (Elevator.CurrentTask.BarcodeLoadA == ((Case_Load)load).SSCCBarcode || Elevator.CurrentTask.BarcodeLoadB == ((Case_Load)load).SSCCBarcode)) && Elevator.ElevatorConveyor.Route.Loads.Count == 0 ) // { // Elevator.CurrentTask = null; // Elevator task is now complete //} } }
private void Lower2_OnEnter(ActionPoint sender, Core.Loads.Load load) { if ((string)load.UserData != "PICKED") { if (!upper2.Active) { load.Stop(); load.Translate(() => load.Switch(upper2, true), new Microsoft.DirectX.Vector3(0, 0.5f, 0), 1.5f); } else { Log.Write("There is a problem in the picking station, tell Barry he would love to fix it"); Pause(); } } else //load has been picked and either lowered or picked at the first station { if (lastUpper2 == load) { lowering2 = null; } if (NextRouteStatus.Available != Experior.Dematic.Base.RouteStatuses.Available) { load.Stop(); } else { releaseLower2(); } } //if the load has arrived from the if (lower1ToLower2 == load) { lower1ToLower2 = null; if (waitingToLower1 != null) { StartLower1(); } else { InfeedCheck(); } } }
private bool StartAP_OnEnter(Core.Loads.Load load, Side side, ActionPoint ap) { Side?s = load.UserData as Side?; if (s != null) { if (s == side) { if (transferInfo.type == TransferType.TwoWay) { load.Yaw = -(float)(Math.PI / 180 * (90)); } load.Switch(ap, true); return(true); } } return(false); }
private void Start() { busy = true; //Find a random box int idx = Core.Environment.Random.Next(0, Core.Loads.Load.Items.Count - 1); Core.Loads.Load load = Core.Loads.Load.Items[idx]; float x = load.Position.X - loadMover.Position.X; float y = load.Position.Y - loadMover.Position.Y + load.Height / 2 + loadMover.Height / 2; float z = load.Position.Z - loadMover.Position.Z; float time = MaxTime(x, y, z); yMoverTimer.Start(new Microsoft.DirectX.Vector3(0, y, 0), time * 2); zMoverTimer.Start(new Microsoft.DirectX.Vector3(0, 0, z), time * 2); xMoverTimer.Start(new Microsoft.DirectX.Vector3(x, 0, 0), time * 2); Core.Timer.Action(() => Pickup(load), time * 2 + 1); }
void apStraight_OnEnter(ActionPoint sender, Core.Loads.Load load) { if (OnDivertPointArrivedRoutingScript != null) { OnDivertPointArrivedRoutingScript(this, new BeltSorterDivertArgs(this, load, DivertRoute.None)); } if (OnDivertPointArrivedControl != null) { OnDivertPointArrivedControl(this, new BeltSorterDivertArgs(this, load, DivertRoute.None)); } if (Controller == null) { if (DefaultRoute == DivertRoute.Divert) { bool keepOrienation = beltSorterDivertInfo.type == DivertType.Angled ? false : true; load.Switch(apDivert, keepOrienation); } } }
private void End_OnEnter(ActionPoint sender, Core.Loads.Load load) { lower2ToEnd = null; load.UserDeletable = true; load.UserData = null; loadCount--; if (waitingToLower2 != null) { StartLower2(); } else { if (lower1.Active && (string)lower1.ActiveLoad.UserData == "PICKED") { releaseLower1(); } } InfeedCheck(); }
public void rackConvLocA_Enter(ActionPoint sender, Core.Loads.Load load) { if (LocationA.LocName.ConvType() == ConveyorTypes.OutfeedRack) { Elevator.ParentMultiShuttle.ArrivedAtOutfeedRackConvPosA(new RackConveyorArrivalEventArgs(LocationA.LocName, (Case_Load)load, Elevator, this, null)); Elevator.ParentMultiShuttle.shuttlecars[Level].CurrentTask = null; //If outfeed then shuttle must have finished its current task if (TransportSection.Route.Loads.Count == 2) { load.Stop(); } else { load.Release(); } } else if (LocationA.LocName.ConvType() == ConveyorTypes.InfeedRack) { Cycle?unloadCycle = null; if (RelevantElevatorTask(LocationA, LocationB)) { unloadCycle = Elevator.CurrentTask.UnloadCycle; } TryClearElevatorTask(Elevator.CurrentTask); Elevator.ParentMultiShuttle.ArrivedAtInfeedRackConvPosA(new RackConveyorArrivalEventArgs(LocationA.LocName, (Case_Load)load, Elevator, this, unloadCycle)); if (TransportSection.Route.Loads.Count > 1) { load.Stop(); } if (Elevator.ElevatorConveyor.TransportSection.Route.Loads.Count > 0) //release the elevator load from A { Elevator.ElevatorConveyor.UnLoading = true; Elevator.ElevatorConveyor.LocationA.Release(); } } }
void apStraight_OnEnter(ActionPoint sender, Core.Loads.Load load) { //Switch to divert point load.Switch(apDivert, true); }
void lhsEnd_OnEnter(ActionPoint sender, Core.Loads.Load load) { load.Switch(rhsEnd); }
void rightToLeftEndAP_OnEnter(ActionPoint sender, Core.Loads.Load load) { load.Switch(lhsEndAP, true); //load.Yaw = 0; DivertedLeft(load); }
void leftToRightEndAP_OnEnter(ActionPoint sender, Core.Loads.Load load) { load.Switch(rhsEndAP, true); //load.Yaw = 0; DivertedRight(load); }
private void Upper1_OnEnter(ActionPoint sender, Core.Loads.Load load) { load.UserData = "PICKED"; ArrivedAtPosition1(new LiftArrivalArgs(load)); }
void Leaving_OnEnter(ActionPoint sender, Core.Loads.Load load) { load.Switch(Elevator.ElevatorConveyor.Entering); }
void Route_OnArrived(Core.Loads.Load load) { //throw new NotImplementedException(); }
/// <summary> /// Controls switching the load back to the correct StraightThrough conveyor /// </summary> void endAP_OnEnter(ActionPoint sender, Core.Loads.Load load) { ThreeWayRoutes? exitRoute = null; StraightThrough thisConv = load.UserData as StraightThrough; if (thisConv != null) { exitRoute = thisConv.convPosition; } //if (threeWaySwitch.ControlType == ControlTypes.Local) //{ // if (straightThrough.convPosition == ThreeWayRoutes.Right) // { // if (threeWaySwitch.RightDefaultDirection == ThreeWayRoutes.Left) // { // load.Switch(threeWaySwitch.LeftConv.endAP); // } // else if (threeWaySwitch.RightDefaultDirection == ThreeWayRoutes.Center) // { // load.Switch(threeWaySwitch.CenterConv.endAP); // } // } // else if (straightThrough.convPosition == ThreeWayRoutes.Left) // { // if (threeWaySwitch.LeftDefaultDirection == ThreeWayRoutes.Right) // { // load.Switch(threeWaySwitch.RightConv.endAP); // } // else if (threeWaySwitch.LeftDefaultDirection == ThreeWayRoutes.Center) // { // load.Switch(threeWaySwitch.CenterConv.endAP); // } // } // else if (straightThrough.convPosition == ThreeWayRoutes.Center) // { // if (threeWaySwitch.CenterDefaultDirection == ThreeWayRoutes.Right) // { // load.Switch(threeWaySwitch.RightConv.endAP); // } // else if (threeWaySwitch.CenterDefaultDirection == ThreeWayRoutes.Left) // { // load.Switch(threeWaySwitch.LeftConv.endAP); // } // } //} //else if (threeWaySwitch.ControlType == ControlTypes.Controller) //{ if (straightThrough.convPosition == ThreeWayRoutes.Right) { if (exitRoute == ThreeWayRoutes.Left) { load.Switch(threeWaySwitch.LeftConv.endAP); } else if (exitRoute == ThreeWayRoutes.Center) { load.Switch(threeWaySwitch.CenterConv.endAP); } } else if (straightThrough.convPosition == ThreeWayRoutes.Left) { if (exitRoute == ThreeWayRoutes.Right) { load.Switch(threeWaySwitch.RightConv.endAP); } else if (exitRoute == ThreeWayRoutes.Center) { load.Switch(threeWaySwitch.CenterConv.endAP); } } else if (straightThrough.convPosition == ThreeWayRoutes.Center) { if (exitRoute == ThreeWayRoutes.Right) { load.Switch(threeWaySwitch.RightConv.endAP); } else if (exitRoute == ThreeWayRoutes.Left) { load.Switch(threeWaySwitch.LeftConv.endAP); } } //} }