Example #1
0
        void transfer_OnArrivedAtTransferController(object sender, TransferArrivalArgs e)
        {
            IATCCaseLoadType atcLoad = e._load as IATCCaseLoadType;

            //Load has arrived at one of entry points to the transfer

            //Calculate the preferred route for the load and save
            if (!theTransfer.PreferredLoadRoutes.ContainsKey((Case_Load)e._load))
            {
                if (LeftRoutes.Contains(atcLoad.Destination))
                {
                    theTransfer.PreferredLoadRoutes.Add((Case_Load)e._load, Side.Left);
                }
                else if (RightRoutes.Contains(atcLoad.Destination))
                {
                    theTransfer.PreferredLoadRoutes.Add((Case_Load)e._load, Side.Right);
                }
            }

            //bool LoadRouted = false;
            if (!theTransfer.ReleaseDelayTimerRunning) //Timer not running can i release a load
            {
                if (LeftRoutes.Contains(atcLoad.Destination) && theTransfer.RouteAvailable(Side.Left))
                {
                    ReleaseLoad(e._fromSide, Side.Left, e._load);
                    //LoadRouted = true;
                }
                else if (RightRoutes.Contains(atcLoad.Destination) && theTransfer.RouteAvailable(Side.Right))
                {
                    ReleaseLoad(e._fromSide, Side.Right, e._load);
                    //LoadRouted = true;
                }
                else if (!LeftRoutes.Contains(atcLoad.Destination) && !RightRoutes.Contains(atcLoad.Destination) && theTransfer.RouteAvailable(e._defaultDirection))
                {
                    ReleaseLoad(e._fromSide, e._defaultDirection, (Case_Load)e._load);
                    //LoadRouted = true;
                }
            }
        }
Example #2
0
 void transfer_OnArrivedAtTransferController(object sender, TransferArrivalArgs e)
 {
     theTransfer.RouteLoad(e._fromSide, Side.Left, e._load);
 }
Example #3
0
        void transfer_OnArrivedAtTransferController(object sender, TransferArrivalArgs e)
        {
            Case_Load caseLoad = e._load as Case_Load;

            //Load has arrived at one of entry points to the transfer

            //If the timer is running then do not release the load just start the appropriate timer depending on its routing
            //If its not running then check the available routes and route the load if the route is clear (No need to start the timer in this case).
            //Experior.Core.Environment.Scene.Pause();

            //Calculate the preferred route for the load and save
            if (!theTransfer.PreferredLoadRoutes.ContainsKey(caseLoad))
            {
                if (casePLC.DivertSet(caseLoad.SSCCBarcode, LeftRoutes))
                {
                    theTransfer.PreferredLoadRoutes.Add(caseLoad, Side.Left);
                }
                else if (casePLC.DivertSet(caseLoad.SSCCBarcode, RightRoutes))
                {
                    theTransfer.PreferredLoadRoutes.Add(caseLoad, Side.Right);
                }
            }

            bool LoadRouted = false;

            if (!theTransfer.ReleaseDelayTimerRunning) //Timer not running can i release a load
            {
                if (casePLC.DivertSet(caseLoad.SSCCBarcode, LeftRoutes) && theTransfer.RouteAvailable(Side.Left))
                {
                    ReleaseLoad(e._fromSide, Side.Left, e._load);
                    LoadRouted = true;
                }
                else if (casePLC.DivertSet(caseLoad.SSCCBarcode, RightRoutes) && theTransfer.RouteAvailable(Side.Right))
                {
                    ReleaseLoad(e._fromSide, Side.Right, e._load);
                    LoadRouted = true;
                }
                else if (!casePLC.DivertSet(caseLoad.SSCCBarcode, LeftRoutes) && !casePLC.DivertSet(caseLoad.SSCCBarcode, RightRoutes) && theTransfer.RouteAvailable(e._defaultDirection))
                {
                    ReleaseLoad(e._fromSide, e._defaultDirection, caseLoad);
                    LoadRouted = true;
                }
            }

            if (!LoadRouted)
            {
                float timeout = NormalTimeout;
                if (casePLC.DivertSet(caseLoad.SSCCBarcode, PriorityRoutes))
                {
                    timeout = PriorityTimeout;
                }

                //Set the timeout elapsed true if there is no timeout required, then when the route becomes available then the load can release
                if (timeout == 0)
                {
                    //if (e._fromSide == Side.Left)
                    //    leftTimeoutElapsed = true;
                    //else if (e._fromSide == Side.Right)
                    //    rightTimeOutElapsed = true;
                }

                //Can divert to default direction if available not waiting for release dealy and no timeout is required
                if (!theTransfer.ReleaseDelayTimerRunning && timeout == 0 && theTransfer.RouteAvailable(e._defaultDirection))
                {
                    ReleaseLoad(e._fromSide, e._defaultDirection, e._load);
                    LoadRouted = true;
                }

                if (timeout != 0)
                {
                    if (e._fromSide == Side.Left) //lhs conveyor
                    {
                        if (!LeftBlockedTimer.Running)
                        {
                            LeftBlockedTimer.Timeout = timeout;
                            LeftBlockedTimer.Reset();
                            LeftBlockedTimer.Start();
                        }
                        else
                        {
                            Log.Write(string.Format("Error setting timeout on transfer left hand side, conveyor {0}, load {1}", ((Transfer)sender).Name, caseLoad.SSCCBarcode));
                            Experior.Core.Environment.Scene.Pause();
                        }
                    }
                    else //rhs conveyor
                    {
                        if (!RightBlockedTimer.Running)
                        {
                            RightBlockedTimer.Timeout = timeout;
                            RightBlockedTimer.Reset();
                            RightBlockedTimer.Start();
                        }
                        else
                        {
                            Log.Write(string.Format("Error setting timeout on transfer right hand side, conveyor {0}, load {1}", ((Transfer)sender).Name, caseLoad.SSCCBarcode));
                            Experior.Core.Environment.Scene.Pause();
                        }
                    }
                }
            }
        }