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 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);
        }