Exemplo n.º 1
0
 private void StackLoads()
 {
     loadStacks++;
     stackedLoad = GetStackedLoad();
     currentLoad = (EuroPallet)TransportSection.Route.Loads.First();
     if (stackedLoad != null)
     {
         loadStacks = stackedLoad.Grouped.Items.Count + 2;
     }
     // Check whether the load entering is already a stack or loaded
     // If so allow it to pass through
     if (currentLoad.Status == PalletStatus.Stacked || currentLoad.Status == PalletStatus.Loaded)
     {
         loadStacks = stackerInfo.StackLimit;
     }
     if (loadStacks < stackerInfo.StackLimit)
     {
         // Add short delay before switching the load from the current conveyor into the stack conveyor
         stackLoadsDelayTimer.OnElapsed += MoveLoadToStack_OnElapsed;
         stackLoadsDelayTimer.Start();
     }
     else
     {
         MoveLoadBackToConveyor();
     }
 }
Exemplo n.º 2
0
 private void DestackLoads()
 {
     // Check whether the load entering is loaded and if so allow it to pass through
     currentLoad = GetCurrentLoad();
     currentLoad.UserDeletable = true;
     if (currentLoad.Status != PalletStatus.Loaded)
     {
         var currentStackedLoads = currentLoad.Grouped.Items;
         currentLoad.DetachStackedPallets();
         currentLoad.Status = PalletStatus.Empty;
         stackedLoad        = GetStackedLoad();
         if (stackedLoad == null)
         {
             // Take first from stack and add to stacker conveyor
             if (currentStackedLoads.Count > 0)
             {
                 currentStackedLoads[0].Switch(stackConveyor.TransportSection.Route, currentLoad.Distance, true);
                 stackedLoad = GetStackedLoad();
                 // Then group the rest with the load just added
                 for (int i = 1; i < currentStackedLoads.Count; i++)
                 {
                     currentStackedLoads[i].Switch(stackConveyor.TransportSection.Route, currentLoad.Distance, true);
                     var stackY = (PalletHeight + 0.005f) * i;
                     stackedLoad.Group(currentStackedLoads[i], new Vector3(0, stackY, 0));
                 }
             }
         }
     }
     //// Add short delay before releasing first load from the stack
     releaseLoadTimer.OnElapsed += ReleaseLoad_OnElapsed;
     releaseLoadTimer.Start();
 }
Exemplo n.º 3
0
 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;
         }
     }
 }
Exemplo n.º 4
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;
                    }
                }
            }
        }
Exemplo n.º 5
0
 private void MoveLoadBackToConveyor()
 {
     currentLoad = GetCurrentLoad();
     stackedLoad = GetStackedLoad();
     if (stackedLoad != null)
     {
         var stackedLoads      = stackedLoad.Grouped.Items;
         var stackedLoadsCount = stackedLoads.Count;
         stackedLoad.UnGroup();
         // First move the stacked load itself
         stackedLoad.Switch(TransportSection.Route, stackedLoad.Distance - 0.001f, true);
         if (currentLoad != null)
         {
             currentLoad.Group(stackedLoad, new Vector3(0, PalletHeight + 0.005f, 0));
         }
         // Second move all the loads that were previously grouped to it
         for (int i = 0; i < stackedLoadsCount; i++)
         {
             stackedLoads[i].Switch(TransportSection.Route, true);
             if (currentLoad != null)
             {
                 currentLoad.Group(stackedLoads[i], new Vector3(0, (PalletHeight + 0.005f) * (i + 2), 0));
             }
             else
             {
                 stackedLoad.Group(stackedLoads[i], new Vector3(0, (PalletHeight + 0.005f) * (i + 1), 0));
             }
         }
     }
     // Add short delay before releasing the load
     releaseLoadDelayTimer.OnElapsed += ReleaseLoad_OnElapsed;
     releaseLoadDelayTimer.Start();
 }
Exemplo n.º 6
0
        private EuroPallet GetStackedLoad()
        {
            EuroPallet pallet = null;

            if (stackConveyor.TransportSection.Route.Loads.Count > 0)
            {
                pallet = (EuroPallet)stackConveyor.TransportSection.Route.Loads.First();
            }
            return(pallet);
        }
Exemplo n.º 7
0
        private EuroPallet GetCurrentLoad()
        {
            EuroPallet pallet = null;

            if (TransportSection.Route.Loads.Count > 0)
            {
                pallet = (EuroPallet)TransportSection.Route.Loads.First();
            }
            return(pallet);
        }
Exemplo n.º 8
0
 public override void Reset()
 {
     base.Reset();
     releaseLoadTimer.Reset();
     repositionLoadsTimer.Reset();
     ResetConveyorLoads(stackConveyor, true);
     ResetConveyorLoads(this, true);
     loadActive = false;
     ThisRouteStatus.Available = RouteStatuses.Request;
     previousLoadWaitingStatus = null;
     currentLoad = null;
     stackedLoad = null;
 }
Exemplo n.º 9
0
 public override void Reset()
 {
     base.Reset();
     releaseLoadDelayTimer.Reset();
     stackLoadsDelayTimer.Reset();
     ResetConveyorLoads(stackConveyor, true);
     ResetConveyorLoads(this, true);
     loadStacks = 0;
     loadActive = false;
     ThisRouteStatus.Available = RouteStatuses.Request;
     currentLoad = null;
     stackedLoad = null;
 }
Exemplo n.º 10
0
        private void DeleteTuTelegramReceived(string[] telegramFields)
        {
            Case_Load caseLoad = Case_Load.GetCaseFromIdentification(telegramFields.GetFieldValue(TelegramFields.tuIdent));

            if (caseLoad == null)
            {
                EuroPallet pallet = EuroPallet.GetPalletFromIdentification(telegramFields.GetFieldValue(TelegramFields.tuIdent));
                if (pallet != null)
                {
                    if (pallet.Grouped.Items.Count > 0)
                    {
                        pallet.ResetEuroPallet(true);
                    }
                    pallet.Dispose();
                }
            }
            else
            {
                caseLoad.Dispose();
            }
        }
Exemplo n.º 11
0
        public EuroPallet GetEuroPallet(Route route, float position, PalletStatus status)
        {
            EuroPallet palletLoad = CreateEuroPallet(PalletLoadHeight, PalletLoadWidth, PalletLoadLength, PalletLoadWeight, DefaultLoadColor.ToString(), status);

            if (route != null)
            {
                ((ATCEuroPallet)palletLoad).SetYaw(((Pallet.Assemblies.PalletStraight)route.Parent.Parent).ConveyorType);
                ((ATCEuroPallet)palletLoad).PresetStateCode = "OK";

                if (position == 0)
                {
                    if (palletLoad.Yaw == 0)
                    {
                        position = position + (palletLoad.Length / 2);
                    }
                    else
                    {
                        position = position + (palletLoad.Width / 2);
                    }
                }
                route.Add(palletLoad, position);
            }
            return(palletLoad);
        }