Exemplo n.º 1
0
 /// <summary>
 /// Creates a PS or a DS locaion name from an ATC location
 /// </summary>
 /// <param name="locationName"></param>
 /// <param name="PorD"></param>
 /// <returns></returns>
 private string FormatPickDropLocation(string locationName, ConveyorTypes PorD)
 {
     return(string.Format("MSAI{0}C{1}{2}{3}S10", locationName.AisleNumber().ToString().PadLeft(2, '0'),
                          (char)ExtensionMethods.Side(locationName),
                          locationName.Level(),
                          (char)PorD));
 }
Exemplo n.º 2
0
 private string FormatRackConvLocation(string locationName, ConveyorTypes IorO)
 {
     return(string.Format("MSAI{0}L{1}{2}R{3}10", locationName.AisleNumber().ToString().PadLeft(2, '0'),
                          (char)ExtensionMethods.Side(locationName),
                          locationName.Level(),
                          (char)IorO));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Calculates the distance along the rail that the shuttle will travel. i.e. the position that the Shuttle.trackRail.MoveTo ActionPoint is set when executing this task
        /// </summary>
        /// <param name="rackXLocation">The number of the location</param>
        /// <returns> The distance along the rail that the shuttle will travel</returns>
        private float SetShuttlePosition(float rackXLocation, ConveyorTypes convType = ConveyorTypes.NA)
        {
            if (rackXLocation > 0) // Position is within the rack (or it is a drive through)
            {
                if (ParentMS.FREX)
                {
                    if (rackXLocation > ParentMS.FrexPositions)                                                                                                     //In the normal rack positions
                    {
                        float frontDistance = (ParentMS.FrexPositions * ParentMS.LocationLength) + (ParentMS.RackConveyorLength + ParentMS.ElevatorConveyorLength); //The rail length for the front positions
                        //totalFrontLocs is the number of positions associated with the frontDistance, note that PSDSlocations are only notional positions as they are not avaiable for the shuttle and they would be a different size compared with ParentMultiShuttle.LocationLength.
                        //however the PS/DS/elevator space is still a bay
                        float totalFrontLocs = ParentMS.FrexPositions + ParentMS.PSDSlocations;
                        return(((rackXLocation - totalFrontLocs) * ParentMS.LocationLength) + frontDistance - (ParentMS.LocationLength / 2));
                    }
                    else // in the Front Rack EXtension
                    {
                        return((rackXLocation * ParentMS.LocationLength) - (ParentMS.LocationLength / 2));
                    }
                }
                else
                {
                    if (!ParentMS.MultiShuttleinfo.DriveThrough)
                    {
                        return(((rackXLocation * ParentMS.LocationLength) + ParentMS.RailLengthOffset) - (ParentMS.LocationLength / 2));
                    }
                    else //Drive through DMS
                    {
                        if (ParentMS.driveThroughLocations.Count > 0)
                        {
                            //Calculate and check valid Locations
                            if (ParentMS.driveThroughLocations.Contains((int)rackXLocation))
                            {
                                Log.Write(string.Format("{0} {1}: Cannot send shuttle to xLocation {2}, this location is excluded for drive through. See 'Unused DriveThrough' property", ParentMS.Name, Name, rackXLocation.ToString()), Color.Red);
                                return(-1); //Will not move the shuttle
                            }

                            int lowest       = ParentMS.driveThroughLocations.Min();
                            int highest      = ParentMS.driveThroughLocations.Max();
                            int numLocations = ParentMS.RackLocations - ParentMS.driveThroughLocations.Count;

                            if ((int)rackXLocation < lowest)
                            {
                                if (ParentMS.SwitchEnds) //X Location 1 is at the other end
                                {
                                    return(ParentMS.Raillength - (((rackXLocation - 1) * ParentMS.LocationLength) + ParentMS.ShuttleCarLength / 2));
                                }
                                else
                                {
                                    return(((rackXLocation - 1) * ParentMS.LocationLength) + ParentMS.ShuttleCarLength / 2);
                                }
                            }
                            else
                            {
                                float gapLength = ParentMS.ElevatorGap;
                                if (ParentMS.ElevatorGap == 0)
                                {
                                    gapLength = ParentMS.RackConveyorLength * 2 + ParentMS.ElevatorConveyorLength;
                                }

                                if (ParentMS.SwitchEnds) //X Location 1 is at the other end
                                {
                                    return(ParentMS.Raillength - ((((rackXLocation - 1 - ParentMS.driveThroughLocations.Count) * ParentMS.LocationLength) + ParentMS.ShuttleCarLength / 2) + gapLength));
                                }
                                else
                                {
                                    return((((rackXLocation - 1 - ParentMS.driveThroughLocations.Count) * ParentMS.LocationLength) + ParentMS.ShuttleCarLength / 2) + gapLength);
                                }
                            }
                        }
                        else
                        {
                            if ((rackXLocation * ParentMS.LocationLength) > ((ParentMS.Raillength / 2) - ParentMS.ElevatorOffset - ((ParentMS.elevators.First().ElevatorConveyor.Length / 2) + ParentMS.RackConveyorLength)))
                            {
                                //Position is before the gap
                                return(((ParentMS.RackConveyorLength * 2 + (ParentMS.ElevatorConveyorLength)) + (rackXLocation * ParentMS.LocationLength)) - (ParentMS.LocationLength / 2));
                            }
                            else
                            {
                                return((rackXLocation * ParentMS.LocationLength) - (ParentMS.LocationLength / 2));
                            }
                        }
                    }
                }
            }
            else //Must be a rack conveyor instead or a drivethrough
            {
                if (ParentMS.MultiShuttleinfo.DriveThrough && convType == ConveyorTypes.OutfeedRack)
                {
                    return(OutfeedRackShuttleLocation);
                }
                else
                {
                    return(InfeedRackShuttleLocation);
                }
            }
        }