Ejemplo n.º 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;
        }
Ejemplo n.º 2
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;
        }