예제 #1
0
        void PreviousLoadWaiting_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
        {
            if (OnMergeLoadArrived != null)
            {
                OnMergeLoadArrived(this, new BeltSorterMergeArgs(this, e._waitingLoad));
            }

            if (!e._loadWaiting)
            {
                SetMergeSectionRouteStatus(RouteStatuses.Request);
            }

            //********** TEACHING **********
            if (e._loadWaiting == true)
            {
                if (e._waitingLoad.Identification.ToUpper() == "TEACH2") //This Timer position is being taught
                {
                    TeachTimer.Reset();
                    TeachTimer.Start();

                    SetMergeSectionRouteStatus(RouteStatuses.Request);
                }
            }
            //********** TEACHING **********
        }
예제 #2
0
 void PreviousLoadWaitingStatus_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
 {
     if (e._loadWaiting) //Load is waiting to be released from previous conveyor
     {
         if (RouteAvailable == RouteStatuses.Request)
         {
             psTimeoutTimer.Stop();
             psTimeoutTimer.Reset();
             RouteAvailable = RouteStatuses.Available;
             ParentMultiShuttle.LoadTransferingToPickStation(new PickDropStationArrivalEventArgs(null, e._waitingLoad as Case_Load, Elevator, 1));
         }
     }
     else //Load has completed transfer from previous conveyor
     {
         if (RouteAvailable == RouteStatuses.Available)
         {
             if (TransportSection.Route.Loads.Count == 2) //2 loads are on the pick station
             {
                 RouteAvailable = RouteStatuses.Blocked;
             }
             else
             {
                 RouteAvailable = RouteStatuses.Request;
             }
         }
     }
 }
예제 #3
0
 void PreviousLoadWaiting_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
 {
     if (!e._loadWaiting)
     {
         feedSection.RouteAvailable = RouteStatuses.Request;
     }
     else
     {
         if (feedSection.RouteAvailable == RouteStatuses.Request && !LoadTransferringIn)
         {
             feedSection.RouteAvailable = RouteStatuses.Available;
             LoadTransferringIn         = true;
         }
     }
 }
예제 #4
0
 void PreviousLoadWaitingMerge_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
 {
     if (e._loadWaiting)
     {
         if (!ArrivalOrder.Contains(Arrived.Merge))
         {
             ArrivalOrder.Add(Arrived.Merge);
         }
         ReleaseNextLoad();
     }
     else
     {
         mergeSection.RouteAvailable = RouteStatuses.Request;
     }
 }
예제 #5
0
 void PreviousLoadWaitingStraight_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
 {
     if (e._loadWaiting)
     {
         if (!ArrivalOrder.Contains(Arrived.Straight))
         {
             ArrivalOrder.Add(Arrived.Straight);
         }
         ReleaseNextLoad();
     }
     else
     {
         RouteAvailable = RouteStatuses.Request;
     }
 }
예제 #6
0
 void lhsPreviousLoadWaitingStatus_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
 {
     if (e._loadWaiting)
     {
         convsWithALoadToRelease.Add(lhsConveyor.PreviousConveyor as StraightConveyor);
     }
     if (e._loadWaiting && !ReleaseDelayTimer.Running)
     {
         Release();
     }
     else if (!e._loadWaiting)
     {
         ((StraightConveyor)(lhsConveyor)).RouteAvailable = RouteStatuses.Request;
         lhsTransfering = false;
     }
 }
예제 #7
0
        private void PreviousLoadWaitingStatus_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
        {
            //If a load arrives and there is nothing else in destacker make it available
            if (e._loadWaiting)
            {
                bool hasExistingStack = false;
                // Check if the load on the main transport section is stacked
                if (TransportSection.Route.Loads.Count > 0)
                {
                    hasExistingStack = TransportSection.Route.Loads.First().Grouped.Items.Count > 0;
                }
                // Check if there are loads on the stack conveyor
                if (stackConveyor.TransportSection.Route.Loads.Count > 0)
                {
                    hasExistingStack = true;
                }
                if (ThisRouteStatus != null &&
                    ThisRouteStatus.Available == RouteStatuses.Request &&
                    !loadActive &&
                    !hasExistingStack)
                {
                    ThisRouteStatus.Available = RouteStatuses.Available;
                }
            }
            if (!e._loadWaiting)
            {
                //Once the load has stopped waiting, then the load will become active in the destacker
                if (ThisRouteStatus.Available == RouteStatuses.Available)
                {
                    ThisRouteStatus.Available = RouteStatuses.Request;

                    if (!e._loadDeleted)
                    {
                        loadActive = true;
                    }
                    else
                    {
                        loadActive = false;
                    }
                }
            }
        }
예제 #8
0
        private void PreviousLoadWaitingStatus_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e, StraightConveyor conv, Side arrivalConveyor, Side defaultDirection)
        {
            if (e._loadWaiting)
            {
                if (!mergeQueue.Contains(arrivalConveyor))
                {
                    mergeQueue.Add(arrivalConveyor);
                }

                if (!ReleaseDelayTimer.Running)
                {
                    TransferArrivalArgs transferArrivalArgs = new TransferArrivalArgs(arrivalConveyor, e._waitingLoad, defaultDirection);
                    if (ControlType == ControlTypes.Controller && OnArrivedAtTransferController != null)
                    {
                        OnArrivedAtTransferController(this, transferArrivalArgs);
                    }
                    else if (ControlType == ControlTypes.Project_Script && OnArrivedAtTransferRoutingScript != null)
                    {
                        OnArrivedAtTransferRoutingScript(this, transferArrivalArgs);
                    }
                    else if (ControlType == ControlTypes.Local)
                    {
                        //RouteLoad(side, conv, e._waitingLoad);
                    }
                }
            }
            else if (e._loadDeleted)
            {
                //var v = convsWithALoadToRelease.Find(x => x.ConvWithLoad.Name == conv.Name);
                //convsWithALoadToRelease.Remove(v);

                mergeQueue.Remove(defaultDirection);
            }

            if (!e._loadWaiting)
            {
                conv.RouteAvailable = RouteStatuses.Request;
                Case_Load cLoad = e._waitingLoad as Case_Load;
            }
        }
예제 #9
0
 void PreviousLoadWaiting_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
 {
     if (e._loadWaiting)
     {
         ThreeWayArrivalArgs transferArrivalArgs = new ThreeWayArrivalArgs(this.convPosition, e._waitingLoad, this.DefaultRoute);
         if (threeWaySwitch.ControlType == ControlTypes.Controller && threeWaySwitch.OnArrivedAtTransferController != null)
         {
             threeWaySwitch.OnArrivedAtTransferController(this, transferArrivalArgs);
         }
         else if (threeWaySwitch.ControlType == ControlTypes.Project_Script && OnArrivedAtTransferRoutingScript != null)
         {
             OnArrivedAtTransferRoutingScript(this, transferArrivalArgs);
         }
         else if (threeWaySwitch.ControlType == ControlTypes.Local)
         {
             RouteLoad(this, threeWaySwitch.AllRoutes.Find(x => x.convPosition == DefaultRoute), e._waitingLoad);
         }
     }
     else
     {
         this.RouteAvailable = RouteStatuses.Request;
     }
 }
예제 #10
0
        private void FixPointLoadWaitingStatus_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
        {
            Load load = e._waitingLoad;

            if (load != null && load.Route != null && e._loadWaiting)
            {
                IRouteStatus conveyor = (IRouteStatus)e._waitingLoad.Route.Parent.Parent;
                if (ControlType == ControlTypes.Local)
                {
                    // Select a destination at random (this will be replaced by controller code)
                    string          destinationName = GetRandomDestination(); // Temporary : Get random one for now
                    DematicFixPoint destinationFP   = (DematicFixPoint)FixPoints.Find(x => x.Name == destinationName);
                    DematicFixPoint sourceFP        = (DematicFixPoint)conveyor.EndFixPoint.Attached;
                    if (sourceFP != null)
                    {
                        TCarTask task = new TCarTask
                        {
                            Source      = sourceFP,
                            Destination = destinationFP,
                        };
                        Tasks.Add(task);
                    }
                }
                else if (ControlType == ControlTypes.Project_Script) // TODO: Invent event to attach routing script to
                {
                    SourceLoadArrived(load, (DematicFixPoint)conveyor.EndFixPoint.Attached);
                }
                else if (ControlType == ControlTypes.Controller)
                {
                    if (Controller != null)
                    {
                        sourceArrival?.Invoke(load, (DematicFixPoint)conveyor.EndFixPoint.Attached);
                    }
                }
            }
        }
예제 #11
0
        void PreviousLoadWaitingStatus_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
        {
            if (e._loadWaiting)
            {
                RouteWaitingLoad();
            }
            else
            {
                if (ReleaseDelayTimer.Running)
                {
                    ThisRouteStatus.Available = RouteStatuses.Blocked;
                }
                else
                {
                    ThisRouteStatus.Available = RouteStatuses.Request;
                }
            }

            if (e._loadDeleted)
            {
                ThisRouteStatus.Available = RouteStatuses.Request;
                LoadInDivert = false;
            }
        }
예제 #12
0
 void PreviousLoadWaiting_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
 {
     SetLoadWaiting(e._loadWaiting, e._loadDeleted, e._waitingLoad);
 }
예제 #13
0
 /// <summary>
 /// Triggerd each time a load arrives, has finished transfering or is deleted whilst transfering
 /// </summary>
 void rhsPreviousLoadWaitingStatus_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
 {
     PreviousLoadWaitingStatus_OnLoadWaitingChanged(sender, e, rhsConveyor, Side.Right, RHSDefaultDirection);
 }
예제 #14
0
 /// <summary>
 /// Triggerd each time a load arrives, has finished transfering or is deleted whilst transfering
 /// </summary>
 void lhsPreviousLoadWaitingStatus_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
 {
     PreviousLoadWaitingStatus_OnLoadWaitingChanged(sender, e, lhsConveyor, Side.Left, LHSDefaultDirection);
 }
예제 #15
0
        private void PreviousLoadWaitingStatusStraight_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
        {
            //If a load arrives and there is nothing else in the divert make it available
            if (e._loadWaiting)
            {
                if (previousLoadWaitingStatus == null)
                {
                    previousLoadWaitingStatus = new LoadWaitingStatus();
                }
                previousLoadWaitingStatus.LoadWaiting = true;
                previousLoadWaitingStatus.WaitingLoad = e._waitingLoad;

                // If the next load is an empty tray then we want to allow it to complete stacking operation
                // However if it's pass through load like a stack then prevent the current load from releasing onto next conveyor
                var trayLoad         = (Tray)e._waitingLoad;
                var currentLoad      = GetCurrentLoad();
                var releaseIfBlocked = true;
                if (trayLoad != null && currentLoad != null &&
                    (trayLoad.Status == TrayStatus.Loaded || trayLoad.Status == TrayStatus.Stacked)
                    )
                {
                    releaseIfBlocked = NextRouteStatus.Available == RouteStatuses.Available;
                }
                if (!delayTimer.Running && releaseIfBlocked)
                {
                    ThisRouteStatus.Available = RouteStatuses.Request;
                    currentOperation          = Operation.PreviousLoadArrived;
                    delayTimer.OnElapsed     += Process_OnElaspsed;
                    delayTimer.Start();
                }
            }
            if (!e._loadWaiting)
            {
                previousLoadWaitingStatus = null;
                if (ThisRouteStatus.Available == RouteStatuses.Available)
                {
                    ThisRouteStatus.Available = RouteStatuses.Request;

                    if (!e._loadDeleted)
                    {
                        loadActive = true;
                    }
                    else
                    {
                        loadActive = false;
                    }
                }
            }
        }
예제 #16
0
        private void PreviousLoadWaitingStatusStraight_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e)
        {
            //If a load arrives and an unexpected type then allow it to pass through
            if (e._loadWaiting)
            {
                EuroPallet previousLoad = (EuroPallet)e._waitingLoad;
                if (previousLoad.Status == PalletStatus.Stacked || previousLoad.Status == PalletStatus.Loaded)
                {
                    // Release the currently stacked load and allow previous load to pass through
                    MoveLoadBackToConveyor();
                }
                if (ThisRouteStatus != null && ThisRouteStatus.Available == RouteStatuses.Request && !loadActive)
                {
                    ThisRouteStatus.Available = RouteStatuses.Available;
                }
            }
            if (!e._loadWaiting)
            {
                //Once the load has stopped waiting, then the load will become active in the transfer
                if (ThisRouteStatus.Available == RouteStatuses.Available)
                {
                    ThisRouteStatus.Available = RouteStatuses.Request;

                    if (!e._loadDeleted)
                    {
                        loadActive = true;
                    }
                    else
                    {
                        loadActive = false;
                    }
                }
            }
        }