示例#1
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();
        }
示例#2
0
 public LiftStraight(LiftStraightInfo info) : base(info)
 {
 }