private void NextJob() { if (currentJob != null) return; car1Done = true; if (jobQueue.Count > 0) { currentJob = jobQueue[0]; jobQueue.RemoveAt(0); if (Environment.Debug.Level == Environment.Debug.Levels.Level1) Log.Write(Name + ": Starting job: " + currentJob); switch (currentJob.JobType) { case TransferCarJob.JobTypes.Goto: GotoJob(); break; case TransferCarJob.JobTypes.PickDrop: PickJob(); DropJob(); break; } } else { if (Environment.Debug.Level == Environment.Debug.Levels.Level1) Log.Write(Name + ": Finished job queue."); } }
public void AddJob(TransferCarJob job) { jobQueue.Add(job); if (currentJob == null) { NextJob(); } }
private void DestinationOnEnter(ActionPoint sender, Load load) { if (currentJob?.JobType != TransferCarJob.JobTypes.Goto) return; finishedmoving = true; currentJob = null; NextJob(); }
public override void Reset() { currentJob = null; finishedmoving = false; jobQueue.Clear(); car1Done = false; destination.Distance = transport.Length / 2; car.Distance = destination.Distance; car.Stop(); base.Reset(); }
private void GotoJob() { car1Transport.Route.NextRoute = null; car1Transport.Route.PreviousRoute = null; GotoJobReleasingMoveLoad(); if (finishedmoving) { currentJob = null; NextJob(); } }
private void Car1Leaving_OnEnter(ActionPoint sender, Load load) { if (currentJob?.JobType != TransferCarJob.JobTypes.PickDrop) return; car1Done = true; if (car1Done) { currentJob = null; NextJob(); } }
private void Car1OnBoard_OnEnter(ActionPoint sender, Load load) { sender.Parent.Motor.Stop(); if (currentJob?.JobType != TransferCarJob.JobTypes.PickDrop) return; car1Done = true; if (car1Done) { currentJob = null; NextJob(); } }
private void PickJob() { if (currentJob == null) return; foreach (var pick in currentJob.PickDropInfos.Where(p => p.JobType == TransferCarJob.PickDropInfo.PickDropTypes.Pick)) { if (!pick.ActionPoint.Active) { Log.Write($"Error when picking: No load at {pick.ActionPoint.Name}"); jobQueue.Clear(); currentJob = null; return; } car1Done = false; SetTransportLocalYaw(car1Transport, pick.TransferSide, pick.DestinationMotorDirection, pick.JobType); SetTransportMotorAndRoute(car1Transport, pick.DestinationMotorDirection, pick.ActionPoint.Parent, pick.JobType, car1Leaving); pick.ActionPoint.Release(); } }