Ejemplo n.º 1
0
        public Shuttle(ShuttleInfo info) : base(info)
        {
            shuttleInfo = info;
            //trackRail = new TrackRail(info.multiShuttleinfo, info.level, info.parent)
            trackRail = new TrackRail(new TrackRailInfo()
            {
                level = info.level, parentMultiShuttle = info.parentMultishuttle, shuttlecarSpeed = info.parentMultishuttle.ShuttleCarSpeed
            })
            {
                Name        = "S" + info.level.ToString().PadLeft(2, '0'),
                ThisShuttle = this
            };

            ParentMultiShuttle = info.parentMultishuttle;
            Add((Core.Parts.RigidPart)trackRail);

            shuttleConveyor = new StraightTransportSection(Core.Environment.Scene.DefaultColor, 0.1f, 0.1f)
            {
                Height = 0.05f
            };
            Add(shuttleConveyor, new Vector3(trackRail.Length / 2, 0, 0));
            //shuttleConveyor.LocalYaw = (float)Math.PI / 2;

            shuttleAP          = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length / 2);
            shuttleAP.OnEnter += shuttleAP_OnEnter;
            shuttleAP2         = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length / 2);
            shuttleAP_Zpos     = (info.multiShuttleinfo.RackConveyorWidth / 2) + (info.multiShuttleinfo.carwidth / 2);
            trackRail.Car.OnPositionChanged += Car_OnPositionChanged;
            ShuttleTasks.CollectionChanged  += ShuttleTasks_CollectionChanged;

            ShuttleTasks.Clear();
            shuttleConveyor.Route.Motor.Stop();
        }
Ejemplo n.º 2
0
        public TrackVehicle(TrackVehicleInfo info) : base(info)
        {
            ControlAssembly = info.controlAssembly;

            trackVehicleInfo = info;
            Length           = 0.05f;
            Width            = 0.5f;
            Height           = 0.05f;
            Color            = Color.Yellow;

            shuttleConveyor = new StraightTransportSection(Core.Environment.Scene.DefaultColor, 0.1f, 0.1f)
            {
                Height = 0.05f
            };

            shuttleAP          = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length / 2);
            shuttleAP2         = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length / 2);
            shuttleAP.OnEnter += ShuttleAP_OnEnter;
            shuttleConveyor.Route.Motor.Stop();
            shuttleConveyor.Visible = false;
            Track  = info.trackRail;
            DestAP = Track.Route.InsertActionPoint(info.moveToDistance);
            Track.Route.Add(this, info.moveToDistance);

            DestAP.Visible  = false;
            DestAP.OnEnter += MoveTo_OnEnter;
            Deletable       = false;
            UserDeletable   = false;
            Embedded        = true;
            Stop();
            Load.Items.Add(this);

            Core.Environment.Scene.OnLoaded += Scene_OnLoaded;
        }
Ejemplo n.º 3
0
 private void SetTransportLocalYaw(StraightTransportSection carTransport, TransferCarSide side, Motor.Directions direction, TransferCarJob.PickDropInfo.PickDropTypes jobType)
 {
     if (jobType == TransferCarJob.PickDropInfo.PickDropTypes.Pick)
     {
         if (direction == Motor.Directions.Forward)
         {
             if (side == TransferCarSide.Right)
             {
                 carTransport.LocalYaw = (float)Math.PI / 2;
             }
             else
             {
                 carTransport.LocalYaw = -(float)Math.PI / 2;
             }
         }
         else
         {
             if (side == TransferCarSide.Right)
             {
                 carTransport.LocalYaw = -(float)Math.PI / 2;
             }
             else
             {
                 carTransport.LocalYaw = (float)Math.PI / 2;
             }
         }
     }
     else
     {
         if (direction == Motor.Directions.Forward)
         {
             if (side == TransferCarSide.Left)
             {
                 carTransport.LocalYaw = (float)Math.PI / 2;
             }
             else
             {
                 carTransport.LocalYaw = -(float)Math.PI / 2;
             }
         }
         else
         {
             if (side == TransferCarSide.Left)
             {
                 carTransport.LocalYaw = -(float)Math.PI / 2;
             }
             else
             {
                 carTransport.LocalYaw = (float)Math.PI / 2;
             }
         }
     }
 }
Ejemplo n.º 4
0
        public static event OnLiftRaisedEvent OnLiftRaisedStatic;        // This is the event that can be subscribed to in the routing script

        public Lift(LiftInfo info) : base(info)
        {
            liftInfo    = info;
            info.height = info.height * 2; // assembley is placed at height/2 so that it comes out at height ?!!??

            // Rail
            lift = new StraightTransportSection(Color.Gray, LiftHeight, 0.1f, 0.02f);
            Add(lift);
            lift.Route.Motor.Speed = 1; // m/s ?
            lift.LocalRoll         = -(float)Math.PI / 2.0f;

            // Load Vehicle
            liftLoad           = Core.Loads.Load.CreateBox(0.1f, 0.1f, 0.1f, Color.Red);
            liftLoad.Embedded  = true;
            liftLoad.Deletable = false;
            lift.Route.Add(liftLoad);
            liftLoad.OnPositionChanged += Liftload_OnPositionChanged;
            liftLoad.Stop();
            liftLoad.Visible = false;

            // Action point for lift rail
            liftStopPoint          = lift.Route.InsertActionPoint(LiftHeight);
            liftStopPoint.Visible  = false;
            liftStopPoint.OnEnter += LiftStopPoint_OnEnter;

            // Conveyor
            LiftStraightInfo straightInfo = new LiftStraightInfo
            {
                ConveyorType = PalletConveyorType.Roller,
                thickness    = 0.05f,
                spacing      = 0.1f,
                width        = liftInfo.ConveyorWidth,
                length       = liftInfo.ConveyorLength,
                height       = 0.7f,
                speed        = 0.3f,
                color        = liftInfo.color,
            };

            LiftConveyor = new LiftStraight(straightInfo);
            LiftConveyor.LineReleasePhotocell.OnPhotocellStatusChanged += LineReleasePhotocell_OnPhotocellStatusChanged;
            LiftConveyor.EndFixPoint.OnSnapped += EndFixPoint_OnSnapped;
            Add(LiftConveyor);

            var zposition = LiftConveyor.Width / 2.0f + 0.02f;

            lift.LocalPosition = new Vector3(0, LiftHeight / 2.0f, zposition);

            Reset();
        }
Ejemplo n.º 5
0
        public Shuttle(ShuttleInfo info) : base(info)
        {
            shuttleInfo = info;
            trackRail   = new TrackRail(info.multiShuttleinfo, info.level, info.parent)
            {
                Name        = "S" + info.level.ToString().PadLeft(2, '0'),
                ThisShuttle = this
            };

            ParentMultiShuttle = info.parent;
            AddPart(trackRail);

            shuttleConveyor = new StraightTransportSection(Core.Environment.Scene.DefaultColor, ParentMultiShuttle.DepthDistPos2 * 2, 0.5f)
            {
                Height = 0.05f
            };
            Add(shuttleConveyor, new Vector3(trackRail.Length / 2, 0, 0));
            shuttleConveyor.LocalYaw = (float)Math.PI / 2;

            transferIn          = shuttleConveyor.Route.InsertActionPoint(ParentMultiShuttle.DepthDistPos2 - ((info.multiShuttleinfo.RackConveyorWidth / 2) + (info.multiShuttleinfo.carwidth / 2)));
            transferIn.OnEnter += transferIn_OnEnter;

            transferOut          = shuttleConveyor.Route.InsertActionPoint(ParentMultiShuttle.DepthDistPos2 + ((info.multiShuttleinfo.RackConveyorWidth / 2) + (info.multiShuttleinfo.carwidth / 2)));
            transferOut.OnEnter += transferOut_OnEnter;

            shuttleAP          = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length / 2);
            shuttleAP.OnEnter += shuttleAP_OnEnter;

            enterPointDepth1          = shuttleConveyor.Route.InsertActionPoint(ParentMultiShuttle.DepthDistPos2 - ParentMultiShuttle.DepthDistPos1);
            enterPointDepth1.OnEnter += enterPointDepth1_OnEnter;

            enterPointDepth2 = shuttleConveyor.Route.InsertActionPoint(0);

            exitPointDepth1          = shuttleConveyor.Route.InsertActionPoint(ParentMultiShuttle.DepthDistPos2 + ParentMultiShuttle.DepthDistPos1);
            exitPointDepth1.OnEnter += exitPointDepth1_OnEnter;

            exitPointDepth2          = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length);
            exitPointDepth2.OnEnter += exitPointDepth2_OnEnter;

            trackRail.Car.OnPositionChanged += Car_OnPositionChanged;

            ShuttleTasks.Clear();
            ShuttleTasks.CollectionChanged += ShuttleTasks_CollectionChanged;

            // MoveShuttle(ParentMultiShuttle.workarround);
        }
Ejemplo n.º 6
0
 private void SetTransportMotorAndRoute(StraightTransportSection carTransport, Motor.Directions direction, Route next, TransferCarJob.PickDropInfo.PickDropTypes jobType, ActionPoint leaving)
 {
     if (direction == Motor.Directions.Forward)
     {
         if (carTransport.Route.Motor.Direction != direction)
         {
             carTransport.Route.Motor.SwitchDirection();
         }
         if (next.Motor.Direction != direction)
         {
             next.Motor.SwitchDirection();
         }
         if (jobType == TransferCarJob.PickDropInfo.PickDropTypes.Drop)
         {
             carTransport.Route.NextRoute = next;
         }
         else
         {
             next.NextRoute = carTransport.Route;
         }
         leaving.Distance = carTransport.Length;
         carTransport.Route.Motor.Start();
     }
     else
     {
         if (carTransport.Route.Motor.Direction != direction)
         {
             carTransport.Route.Motor.SwitchDirection();
         }
         if (next.Motor.Direction != direction)
         {
             next.Motor.SwitchDirection();
         }
         if (jobType == TransferCarJob.PickDropInfo.PickDropTypes.Drop)
         {
             carTransport.Route.PreviousRoute = next;
         }
         else
         {
             next.PreviousRoute = carTransport.Route;
         }
         leaving.Distance = 0;
         carTransport.Route.Motor.Start();
     }
 }
Ejemplo n.º 7
0
        public TransferCar(TransferCarInfo info) : base(info)
        {
            transport = new StraightTransportSection(Color.Blue, info.length, 0, 0.1f);
            Add(transport);
            transport.LocalYaw      = (float)Math.PI;
            transport.LocalPosition = new Vector3(transport.Length / 2, 0, 0);
            transport.Visible       = false;

            destination = new ActionPoint();
            transport.Route.InsertActionPoint(destination);
            destination.Distance = transport.Length / 2;
            destination.StopMode = ActionPoint.StoppingMode.Stop;
            destination.OnEnter += DestinationOnEnter;

            car1Transport = new StraightTransportSection(carColor, 1.8f, carHeight, 1.0f);
            Add(car1Transport);
            car1Transport.LocalYaw          = (float)Math.PI / 2;
            car1Transport.Route.Motor.Speed = conveyorSpeed;


            //Z-Position of the rails were modified
            rail1 = new Cube(Color.Gray, transport.Length, 0.1f, 0.1f);
            Add(rail1);
            rail1.LocalPosition = new Vector3(transport.Length / 2, 0, 0.540f);
            rail2 = new Cube(Color.Gray, transport.Length, 0.1f, 0.1f);
            Add(rail2);
            rail2.LocalPosition = new Vector3(transport.Length / 2, 0, -0.540f);

            car = Load.CreateBox(0.1f, 0.1f, 0.1f, Color.Red);
            transport.Route.Add(car);
            car.Deletable = false;
            car.Embedded  = true;
            car.Stop();
            car.OnPositionChanged += Car_OnPositionChanged;
            car.Distance           = destination.Distance;
            car.Visible            = false;

            car1OnBoard          = car1Transport.Route.InsertActionPoint(car1Transport.Length / 2);
            car1OnBoard.OnEnter += Car1OnBoard_OnEnter;

            car1Leaving          = car1Transport.Route.InsertActionPoint(car1Transport.Length);
            car1Leaving.Edge     = ActionPoint.Edges.Trailing;
            car1Leaving.OnEnter += Car1Leaving_OnEnter;
        }
Ejemplo n.º 8
0
        public TCar(TCarInfo info) : base(info)
        {
            tCarInfo    = info;
            info.height = info.height * 2; // assembley is placed at height/2 so that it comes out at height ?!!??

            Core.Environment.Scene.OnLoaded += Scene_OnLoaded;

            var offCentre = TCarWidth / 2 - TCarWidth;

            // Left track used to move the load
            track = new StraightTransportSection(Color.Gray, TCarLength, 0.05f, 0.05f);
            Add(track);
            track.Route.Motor.Speed = 1; // m/s ?
            track.LocalPosition     = new Vector3(-TCarLength / 2, -0.05f, offCentre);

            // Load Vehicle
            trackLoad           = Core.Loads.Load.CreateBox(0.1f, 0.1f, 0.1f, Color.BlueViolet);
            trackLoad.Embedded  = true;
            trackLoad.Deletable = false;
            track.Route.Add(trackLoad);
            trackLoad.OnPositionChanged += TrackLoad_OnPositionChanged;
            trackLoad.Stop();
            trackLoad.Visible = false;

            // Right track (visual only)
            trackRight = new Cube(Color.Gray, TCarLength, 0.05f, 0.05f);
            Add(trackRight);
            trackRight.LocalPosition = new Vector3(-TCarLength / 2, -0.05f, -offCentre);

            // Action point for lift rail
            trackStopPoint          = track.Route.InsertActionPoint(0);
            trackStopPoint.Color    = Color.Black;
            trackStopPoint.Visible  = false;
            trackStopPoint.OnEnter += TrackStopPoint_OnEnter;

            // Conveyor
            PalletStraightInfo straightInfo = new PalletStraightInfo
            {
                ConveyorType = PalletConveyorType.Roller,
                thickness    = 0.05f,
                spacing      = 0.1f,
                width        = ConveyorWidth,
                length       = TCarWidth,
                speed        = 0.3f,
                color        = tCarInfo.color,
            };

            conveyor = new PalletStraight(straightInfo);
            conveyor.LineReleasePhotocell.OnPhotocellStatusChanged += LineReleasePhotocell_OnPhotocellStatusChanged;
            conveyor.ThisRouteStatus.OnRouteStatusChanged          += ThisRouteStatus_OnRouteStatusChanged;
            conveyor.Entering.Name         = "EnterPoint";
            conveyor.Leaving.Name          = "ExitPoint";
            conveyor.StartFixPoint.Visible = false;
            conveyor.EndFixPoint.Visible   = false;
            Add(conveyor);
            conveyor.LocalPosition = new Vector3(-conveyor.Width / 2, 0, 0);
            conveyor.LocalYaw      = Trigonometry.PI(Trigonometry.Angle2Rad(90.0f));

            SetupFixPoints();

            Tasks.CollectionChanged += Tasks_CollectionChanged;

            Reset();
        }
Ejemplo n.º 9
0
        public Transfer(TransferInfo info) : base(info)
        {
            transferInfo = info;
            info.height  = info.height * 2; // assembley is placed at height/2 so that it comes out at height ?!!??

            rightLeftCrossover = new StraightTransportSection(info.color, 1, convThickness, 0.25f);
            leftRightCrossover = new StraightTransportSection(info.color, 1, convThickness, 0.25f);

            rightLeftCrossover.Route.Arrow.Visible = false;
            leftRightCrossover.Route.Arrow.Visible = false;

            if (transferInfo.type == TransferType.TwoWay)
            {
                rightLeftCrossover.Route.Motor.Speed = DivertSpeed;
                leftRightCrossover.Route.Motor.Speed = DivertSpeed;
            }
            else if (transferInfo.type == TransferType.DHDM)
            {
                rightLeftCrossover.Route.Motor.Speed = DHDMSpeed;
                leftRightCrossover.Route.Motor.Speed = DHDMSpeed;
            }

            Add(rightLeftCrossover);
            Add(leftRightCrossover);

            rhsConveyor = new StraightConveyor(NewStraightInfo(info));
            lhsConveyor = new StraightConveyor(NewStraightInfo(info));

            rhsConveyor.Name = "rhs";
            lhsConveyor.Name = "lhs";

            if (transferInfo.type == TransferType.TwoWay)
            {
                crossoverOffset = info.length / 2;
            }

            Add(rhsConveyor);
            Add(lhsConveyor);

            lhsConveyor.StartFixPoint.OnSnapped           += lhsStartFixPoint_OnSnapped;
            lhsConveyor.StartFixPoint.OnUnSnapped         += lhsStartFixPoint_OnUnSnapped;
            lhsConveyor.OnNextRouteStatusAvailableChanged += lhsConveyor_OnNextRouteStatusAvailableChanged;
            lhsConveyor.EndFixPoint.OnSnapped             += lhsEndFixPoint_OnSnapped;

            rhsConveyor.StartFixPoint.OnSnapped           += rhsStartFixPoint_OnSnapped;
            rhsConveyor.StartFixPoint.OnUnSnapped         += rhsStartFixPoint_OnUnSnapped;
            rhsConveyor.OnNextRouteStatusAvailableChanged += rhsConveyor_OnNextRouteStatusAvailableChanged;
            rhsConveyor.EndFixPoint.OnSnapped             += rhsEndFixPoint_OnSnapped;

            lhsConveyor.RouteAvailable = RouteStatuses.Request; //We are setting this to request because the DHDM controls the release of loads from the previous conveyor onto it.
            rhsConveyor.RouteAvailable = RouteStatuses.Request; //same here

            rhsStartAP = rhsConveyor.TransportSection.Route.InsertActionPoint(crossoverOffset);
            lhsStartAP = lhsConveyor.TransportSection.Route.InsertActionPoint(crossoverOffset);
            rhsEndAP   = rhsConveyor.TransportSection.Route.InsertActionPoint(DHDMLength - crossoverOffset);
            lhsEndAP   = lhsConveyor.TransportSection.Route.InsertActionPoint(DHDMLength - crossoverOffset);

            rightToLeftStartAP = rightLeftCrossover.Route.InsertActionPoint(0);
            leftToRightStartAP = leftRightCrossover.Route.InsertActionPoint(0);
            rightToLeftEndAP   = rightLeftCrossover.Route.InsertActionPoint(0); //Should be placed at the end this is done in UpdateCrossoverSectionAngles when we know the correct length of the crossover sections
            leftToRightEndAP   = leftRightCrossover.Route.InsertActionPoint(0); //Should be placed at the end this is done in UpdateCrossoverSectionAngles when we know the correct length of the crossover sections

            rhsStartAP.OnEnter += rhsStartAP_OnEnter;
            lhsStartAP.OnEnter += lhsStartAP_OnEnter;
            rhsEndAP.OnEnter   += rhsEndAP_OnEnter;
            lhsEndAP.OnEnter   += lhsEndAP_OnEnter;

            rightToLeftEndAP.OnEnter += rightToLeftEndAP_OnEnter;
            leftToRightEndAP.OnEnter += leftToRightEndAP_OnEnter;

            DHDMWidth                    = info.width; //This will adjust the crossover conveyors so that the corossover angles are correct
            DHDMLength                   = info.length;
            InternalConvWidth            = info.internalConvWidth;
            ReleaseDelayTimer            = new Core.Timer(ReleaseDelayTimeStraight); //loads will be only be released when the timer elapses the timer will start when a load transfers
            ReleaseDelayTimer.OnElapsed += ReleaseDelayTimer_Elapsed;
            ReleaseDelayTimer.AutoReset  = false;

            Core.Environment.Scene.OnLoaded += Scene_OnLoaded;
            ControllerProperties             = StandardCase.SetMHEControl(info, this);
        }
Ejemplo n.º 10
0
        public PalletCrane(PalletCraneInfo info)
            : base(info)
        {
            palletCraneInfo = info;

            if (info.PickStations == null)
            {
                info.PickStations = new ExpandablePropertyList <StationConfiguration>();
            }
            if (!info.PickStations.Any())
            {
                info.PickStations.Add(new StationConfiguration {
                    LevelHeight = 1, StationType = PalletCraneStationTypes.PickStation, Side = PalletCraneStationSides.Right, Length = 1.61f, thickness = 0.05f, Width = 0.978f, Speed = 0.7f, ConveyorType = PalletConveyorType.Roller
                });
            }
            if (info.DropStations == null)
            {
                info.DropStations = new ExpandablePropertyList <StationConfiguration>();
            }
            if (!info.DropStations.Any())
            {
                info.DropStations.Add(new StationConfiguration {
                    LevelHeight = 1, StationType = PalletCraneStationTypes.DropStation, Side = PalletCraneStationSides.Left, Length = 1.61f, thickness = 0.05f, Width = 0.978f, Speed = 0.7f, ConveyorType = PalletConveyorType.Roller
                });
            }

            Lift.Height = 0.05f;
            Lift.Color  = Color.DarkBlue;

            pickConveyors = new List <PalletStation>();
            foreach (var config in info.PickStations)
            {
                var pickConveyor = new PalletStation(config);
                Add(pickConveyor);
                pickConveyor.PositionAp.OnEnter        += PosPd_OnEnter;
                pickConveyor.StartFixPoint.OnSnapped   += PickConveyorStartFixPoint_OnSnapped;
                pickConveyor.StartFixPoint.OnUnSnapped += PickConveyorStartFixPoint_OnUnSnapped;
                pickConveyors.Add(pickConveyor);
            }

            dropConveyors = new List <PalletStation>();
            foreach (var config in info.DropStations)
            {
                var dropConveyor = new PalletStation(config);
                Add(dropConveyor);
                dropConveyor.ThisRouteStatus.OnRouteStatusChanged += DropConveyor_OnRouteStatusChanged;
                dropConveyors.Add(dropConveyor);
            }

            holdingConveyor = new StraightTransportSection(Color.Black, 1, 0, 0.5f);
            Add(holdingConveyor);
            holdingConveyor.Route.InsertActionPoint(holdingAp, holdingConveyor.Length / 2);
            holdingConveyor.Route.Motor.Speed = 0.7f;
            holdingConveyor.Visible           = false;

            holdingAp.OnEnter += HoldingAp_OnEnter;

            UpdatePalletCrane();

            AllCranes.Add(this);

            subMenu = new List <System.Windows.Forms.ToolStripItem>();
            subMenu.Add(new System.Windows.Forms.ToolStripMenuItem("Reset", Common.Icons.Get("fault")));
            subMenu[0].Click += DematicHBW_ClickReset;
            //subMenu.Add(new System.Windows.Forms.ToolStripMenuItem("Set compartment occupied", Common.Icons.Get("fault")));
            //subMenu[1].Click += new EventHandler(DematicHBW_ClickCompartmentOccupied);
            //subMenu.Add(new System.Windows.Forms.ToolStripMenuItem("Set compartment empty", Common.Icons.Get("fault")));
            //subMenu[2].Click += new EventHandler(DematicHBW_ClickCompartmentEmpty);
            //subMenu.Add(new System.Windows.Forms.ToolStripMenuItem("Fault PalletCrane", Common.Icons.Get("fault")));
            //subMenu[3].Click += new EventHandler(DematicHBW_ClickFault);

            Control.FinishedJob += Control_FinishedJob;
            Control.LoadDropped += Control_LoadDropped;

            LoadingSpeed   = 1;
            UnloadingSpeed = 1;

            ControllerProperties             = StandardCase.SetMHEControl(info, this);
            Core.Environment.Scene.OnLoaded += Scene_OnLoaded;
        }