Exemple #1
0
        public Elevator(MultiShuttleElevatorInfo info) : base(info)
        {
            multishuttleElevatorInfo = info;
            Embedded           = true;
            ParentMultiShuttle = info.Multishuttle;
            Side        = info.Side;
            AisleNumber = ParentMultiShuttle.AisleNumber;

            ElevatorConveyor = new ElevatorConveyor(new ElevatorConveyorInfo
            {
                length    = info.multishuttleinfo.ElevatorConveyorLength,
                width     = info.multishuttleinfo.ElevatorConveyorWidth,
                thickness = 0.05f,
                color     = Core.Environment.Scene.DefaultColor,
                Elevator  = this
            }
                                                    );

            AddAssembly(ElevatorConveyor);
            ElevatorConveyor.Route.Motor.Speed = info.multishuttleinfo.ConveyorSpeed;
            ElevatorConveyor.LocalYaw          = -(float)Math.PI;

            lift = new TrackRail(info.multishuttleinfo, 1, info.Multishuttle, this);// UserData = this };
            lift.Car.OnPositionChanged += Car_PositionChanged;
            AddPart(lift);
            lift.LocalRoll         = -(float)Math.PI / 2;
            lift.Route.Motor.Speed = multishuttleElevatorInfo.multishuttleinfo.elevatorSpeed;
            lift.Car.Visible       = false;
            ElevatorTasks.Clear();
            ElevatorTasks.CollectionChanged += ElevatorTasks_CollectionChanged;
        }
Exemple #2
0
 /// <summary>
 /// Depending on the side that you are loading of offloading to turn the whole conveyor arround rather than reverse the motor.
 /// If Loading FROM the Left then conveyor needs to travel from left to right.
 /// if UnLoading TO the left then conveyor needs to travel from left to right.
 /// If Loading FROM the Right then conveyor needs to travel from right to left.
 /// if UnLoading TO the Right then conveyor needs to travel from right to left.
 /// </summary>
 /// <param name="side">Left or right</param>
 /// <param name="taskType">loading or unloading</param>
 private void ChangeShuttleConvDirection(RackSide side, ShuttleConvDirRef taskType)
 {
     if (taskType == ShuttleConvDirRef.Loading)
     {
         if (side == RackSide.Right)
         {
             shuttleConveyor.LocalYaw = shuttleConvFromRHS;
         }
         else if (side == RackSide.Left)
         {
             shuttleConveyor.LocalYaw = shuttleConvFromLHS;
         }
     }
     else if (taskType == ShuttleConvDirRef.Unloading)
     {
         if (side == RackSide.Left)
         {
             shuttleConveyor.LocalYaw = shuttleConvFromRHS;
         }
         else if (side == RackSide.Right)
         {
             shuttleConveyor.LocalYaw = shuttleConvFromLHS;
         }
     }
 }
Exemple #3
0
        public Elevator(ElevatorInfo info) : base(info)
        {
            multishuttleElevatorInfo = info;
            Embedded           = true;
            ParentMultiShuttle = info.Multishuttle;
            Side        = info.Side;
            AisleNumber = ParentMultiShuttle.AisleNumber;
            GroupName   = info.groupName;

            ElevatorConveyor = new ElevatorConveyor(new ElevatorConveyorInfo
            {
                length    = info.multishuttleinfo.ElevatorConveyorLength,
                width     = info.multishuttleinfo.ElevatorConveyorWidth,
                thickness = 0.05f,
                color     = Core.Environment.Scene.DefaultColor,
                Elevator  = this
            }
                                                    );

            Add(ElevatorConveyor);
            ElevatorConveyor.Visible           = false;
            ElevatorConveyor.Route.Motor.Speed = info.multishuttleinfo.ConveyorSpeed;
            ElevatorConveyor.LocalYaw          = -(float)Math.PI;

            Lift = new TrackRail(new TrackRailInfo()
            {
                parentMultiShuttle = ParentMultiShuttle, level = 0, shuttlecarSpeed = ParentMultiShuttle.ShuttleCarSpeed, controlAssembly = this
            });
            Vehicle = new TrackVehicle(new TrackVehicleInfo()
            {
                trackRail = Lift, moveToDistance = 0, controlAssembly = this
            });

            Vehicle.Length = info.multishuttleinfo.ElevatorConveyorLength;
            Vehicle.Width  = info.multishuttleinfo.ElevatorConveyorWidth;
            Vehicle.Color  = Color.Silver;

            Vehicle.OnVehicleArrived  += ElevatorOnArrived;
            Vehicle.OnPositionChanged += Car_PositionChanged;
            Add((Core.Parts.RigidPart)Lift, new Vector3(-0.025f, 0, 0));
            Lift.LocalRoll         = -(float)Math.PI / 2;
            Lift.Route.Motor.Speed = multishuttleElevatorInfo.multishuttleinfo.elevatorSpeed;
            Lift.Route.Motor.Stop();
            Vehicle.Roll    = (float)Math.PI / 2;
            Vehicle.Movable = false;
            ElevatorTasks.Clear();
            ElevatorTasks.CollectionChanged += ElevatorTasks_CollectionChanged;

            taskMonitor            = new Timer(5);
            taskMonitor.AutoReset  = true;
            taskMonitor.OnElapsed += TaskMonitor_OnElapsed;
            taskMonitor.Start();
            Core.Environment.Scene.OnResetCompleted += Scene_OnResetCompleted;
        }
Exemple #4
0
        /// <summary>
        /// Alternates between left and right sides
        /// </summary>
        /// <returns></returns>
        private RackSide GetRackSide()
        {
            if (rSide == RackSide.Left)
            {
                rSide = RackSide.Right;
                return(RackSide.Right);
            }

            rSide = RackSide.Left;
            return(RackSide.Left);
        }
Exemple #5
0
        public void ConfigureRackConveyor(Elevator elevator, float zCoord, int level, RackSide side) //TODO remove xoffet
        {
            Level = level;

            if (ParentMultiShuttle.MultiShuttleinfo.DriveThrough)
            {
                Side = side;
            }
            else
            {
                Elevator = elevator;
            }

            TransportSection.Route.InsertActionPoint(LocationA, Length / 2 - Length / 4);
            TransportSection.Route.InsertActionPoint(LocationB, Length / 2 + Length / 4);

            //LocationA.Visible = true;
            //LocationB.Visible = true;
            LocationA.LocName = string.Format("{0}{1}{2}{3}{4}", ParentMultiShuttle.AisleNumber.ToString().PadLeft(2, '0'), (char)side, level.ToString().PadLeft(2, '0'), (char)RackConveyorType, "A");
            LocationB.LocName = string.Format("{0}{1}{2}{3}{4}", ParentMultiShuttle.AisleNumber.ToString().PadLeft(2, '0'), (char)side, level.ToString().PadLeft(2, '0'), (char)RackConveyorType, "B");

            ParentMultiShuttle.ConveyorLocations.Add(LocationA);
            ParentMultiShuttle.ConveyorLocations.Add(LocationB);
            //Position the rack conveyors based on the position of the shuttles
            if (ParentMultiShuttle.MultiShuttleinfo.DriveThrough)
            {
                float lengthSide = Length;
                if (rackConveyorType == MultiShuttleDirections.Infeed)
                {
                    lengthSide = Length * -1;
                }
                LocalPosition = ParentMultiShuttle.shuttlecars[level].LocalPosition + new Vector3(lengthSide + ParentMultiShuttle.ElevatorOffset /*+ xoffset*/, 0, zCoord);
            }
            else  //outfeed wll always travel in the same direction so point the conveyor in the correct direction and not reverse the conveyor
            {
                Height        = ParentMultiShuttle.shuttlecars[level].LocalPosition.Y;
                LocalPosition = ParentMultiShuttle.shuttlecars[level].LocalPosition + new Vector3(ParentMultiShuttle.MultiShuttleinfo.raillength / 2 - ParentMultiShuttle.shuttlecars[level].Vehicle.DestAP.Distance + LocationA.Distance, 0, zCoord);
            }

            if (RackConveyorType == MultiShuttleDirections.Outfeed && !ParentMultiShuttle.MultiShuttleinfo.DriveThrough)
            {
                LocalYaw = (float)Math.PI;
            }
            ParentMultiShuttle.RackConveyors.Add(this);
            LocationA.OnEnter += rackConvLocA_Enter;
            LocationB.OnEnter += rackConvLocB_Enter;
        }