void LineReleasePhotocell_OnPhotocellStatusChanged(object sender, PhotocellStatusChangedEventArgs e) { if (e._PhotocellStatus == PhotocellState.Blocked) { e._Load.UserDeletable = false; LiftConveyor.ThisRouteStatus.Available = RouteStatuses.Blocked; lift.Route.Motor.Stop(); if (!Raised) { RaiseLift(); } } else if (e._PhotocellStatus == PhotocellState.Clear) { if (e._Load != null) { e._Load.UserDeletable = true; } LiftConveyor.SetLoadWaiting(false, false, e._Load); //If the load was deleted then, it does not need to wait to transfer to the next conveyor if (e._LoadDeleted) { LiftConveyor.ThisRouteStatus.Available = RouteStatuses.Available; } } }
private void LineReleasePhotocell_OnPhotocellStatusChanged(object sender, PhotocellStatusChangedEventArgs e) { if (e._PhotocellStatus == PhotocellState.Blocked) { e._Load.UserDeletable = false; } else if (e._PhotocellStatus == PhotocellState.Clear) { if (e._Load != null) { e._Load.UserDeletable = true; } conveyor.ThisRouteStatus.Available = RouteStatuses.Request; } }
void LineReleasePhotocell_OnPhotocellStatusChanged(object sender, PhotocellStatusChangedEventArgs e) { if (e._PhotocellStatus == PhotocellState.Blocked || e._PhotocellStatus == PhotocellState.LoadBlocked) { //[BG] Mod to allow the Routing script to control the release of the loads from a belt conveyor if (!conveyor.ScriptRelease) { if (conveyor.LoadWaitingDelay != 0) { StartLoadWaitingTimer(e._Load); } else { SetLoadWaiting(e._Load); } } if (conveyor.NextRouteStatus == null || conveyor.NextRouteStatus.Available != RouteStatuses.Available || ReleaseTimer.Running || LoadWaitingTimer.Running) { conveyor.RouteAvailable = RouteStatuses.Blocked; //This will also stop the motor } else { //Load has been released and i should start the delay timer if there is one StartReleaseTimer(); } } else if (e._PhotocellStatus == PhotocellState.Clear || e._PhotocellStatus == PhotocellState.LoadClear) { conveyor.RouteAvailable = RouteStatuses.Available; if (e._Load != null) { conveyor.SetLoadWaiting(false, e._Load.StartDisposing, e._Load); } else { conveyor.SetLoadWaiting(false, false, e._Load); } } }
void LineReleasePhotocell_OnPhotocellStatusChanged(object sender, PhotocellStatusChangedEventArgs e) { if (e._Load != null) //a reset will cause the load to be null and the status to change { if (e._PhotocellStatus == PhotocellState.Blocked && e._Load.Identification.ToUpper() == "TEACH1") { //TimeFromInduct.AutoReset = true; TimeFromInduct.Reset(); TimeFromInduct.Start(); } else if (e._Load.Identification.ToUpper() == "TEACH3" && photoCellCreator == null) { if (TeachTimes.Any()) { //Sort the dictionary as we have no control in the order that thet were created this is used in the creation of photocells var sortedTeachTimes = from entry in TeachTimes orderby entry.Value ascending select entry; eSortedTeachTimes = sortedTeachTimes.GetEnumerator(); } if (eSortedTeachTimes != null && eSortedTeachTimes.MoveNext()) { photoCellCreator = e._Load; KeyValuePair <string, float> photoCellInfo = (KeyValuePair <string, float>)eSortedTeachTimes.Current; photoCellPlacment = new Timer(photoCellInfo.Value); previousTime = photoCellInfo.Value; photoCellPlacment.Start(); photoCellPlacment.OnElapsed += photoCellPlacment_OnElapsed; } } else { if (e._PhotocellStatus == PhotocellState.Blocked) { RouteAvailable = RouteStatuses.Blocked; //e._Load.Stop(); windowedLoad = e._Load; } } } }
public virtual void LineReleasePhotocell_OnPhotocellStatusChanged(object sender, PhotocellStatusChangedEventArgs e) { if (e._PhotocellStatus == PhotocellState.Blocked) { if (ControlType == ControlTypes.Controller && Controller != null) { ThisRouteStatus.Available = RouteStatuses.Blocked; } else { SetLoadWaiting(true, false, e._Load); //Always set this conveyor blocked whenever the load arrives at the photocell, this tells the //previous conveyor that it has arrived and therefore the next load can be released into it if (NextRouteStatus != null && NextRouteStatus.Available == RouteStatuses.Available && ThisRouteStatus.Available != RouteStatuses.Request) { ThisRouteStatus.Available = RouteStatuses.Blocked; ThisRouteStatus.Available = RouteStatuses.Request; //This means the load can just travel into the next location } else { ThisRouteStatus.Available = RouteStatuses.Blocked; } } // Always fire the event - it will not do anything however unless it has been subscribed too LoadArrived(new LoadArrivedEventArgs(e._Load)); } else if (e._PhotocellStatus == PhotocellState.Clear) { SetLoadWaiting(false, false, e._Load); ThisRouteStatus.Available = RouteStatuses.Request; //If the load was deleted then, it does not need to wait to transfer to the next conveyor if (e._LoadDeleted) { ThisRouteStatus.Available = RouteStatuses.Available; } if (e._Load != null) { LoadLeft(new LoadArrivedEventArgs(e._Load)); } } }
public override void LineReleasePhotocell_OnPhotocellStatusChanged(object sender, PhotocellStatusChangedEventArgs e) { if (e._PhotocellStatus == PhotocellState.Blocked) { e._Load.UserDeletable = false; ThisRouteStatus.Available = RouteStatuses.Blocked; DestackLoads(); SetLoadWaiting(true, false, e._Load); } else if (e._PhotocellStatus == PhotocellState.Clear) { if (e._Load != null) { e._Load.UserDeletable = true; } stackedLoad = GetStackedLoad(); if (stackedLoad != null) { // Add short delay before making next available load available ThisRouteStatus.Available = RouteStatuses.Blocked; repositionLoadsTimer.OnElapsed += RepositionLoads_OnElapsed; repositionLoadsTimer.Start(); } else { SetLoadWaiting(false, false, e._Load); ThisRouteStatus.Available = RouteStatuses.Available; } } }
public virtual void LineReleasePhotocell_OnPhotocellStatusChanged(object sender, PhotocellStatusChangedEventArgs e) { if (e._PhotocellStatus == PhotocellState.Blocked) { SetLoadWaiting(true, false, e._Load); //Always set this conveyor blocked whenever the load arrives at the photocell, this tells the //previous conveyor that it has arrived and therefore the next load can be released into it if (NextRouteStatus != null && NextRouteStatus.Available == RouteStatuses.Available && ThisRouteStatus.Available != RouteStatuses.Request) { ThisRouteStatus.Available = RouteStatuses.Blocked; ThisRouteStatus.Available = RouteStatuses.Request; } else { ThisRouteStatus.Available = RouteStatuses.Blocked; } } else if (e._PhotocellStatus == PhotocellState.Clear) { SetLoadWaiting(false, false, e._Load); ThisRouteStatus.Available = RouteStatuses.Request; //If the load was deleted then, it does not need to wait to transfer to the next conveyor if (e._LoadDeleted) { ThisRouteStatus.Available = RouteStatuses.Available; } } }
public override void LineReleasePhotocell_OnPhotocellStatusChanged(object sender, PhotocellStatusChangedEventArgs e) { if (e._PhotocellStatus == PhotocellState.Blocked) { e._Load.UserDeletable = false; ThisRouteStatus.Available = RouteStatuses.Blocked; RouteAvailable = RouteStatuses.Blocked; //Stop the motor if (!delayTimer.Running || currentOperation == Operation.NextRouteStatusChanged) { delayTimer.OnElapsed -= Process_OnElaspsed; delayTimer.Stop(); delayTimer.Reset(); currentOperation = Operation.PhotocellBlocked; delayTimer.OnElapsed += Process_OnElaspsed; delayTimer.Start(); } } else if (e._PhotocellStatus == PhotocellState.Clear) { if (e._Load != null) { e._Load.UserDeletable = true; } SetLoadWaiting(false, false, e._Load); if (!delayTimer.Running) { ThisRouteStatus.Available = RouteStatuses.Request; currentOperation = Operation.PhotocellClear; delayTimer.OnElapsed += Process_OnElaspsed; delayTimer.Start(); } } }
public override void LineReleasePhotocell_OnPhotocellStatusChanged(object sender, PhotocellStatusChangedEventArgs e) { if (e._PhotocellStatus == PhotocellState.Blocked) { e._Load.UserDeletable = false; ThisRouteStatus.Available = RouteStatuses.Blocked; RouteAvailable = RouteStatuses.Blocked; //Stop the motor StackLoads(); } else if (e._PhotocellStatus == PhotocellState.Clear) { if (e._Load != null) { e._Load.UserDeletable = true; } SetLoadWaiting(false, false, e._Load); ThisRouteStatus.Available = RouteStatuses.Available; } }