Ejemplo n.º 1
0
        private StraightConveyorInfo NewStraightInfo(ThreeWaySwitchInfo info)
        {
            StraightConveyorInfo straightInfo = new StraightConveyorInfo();

            //straightInfo.Length = info.length;
            straightInfo.Length = info.threeWayLength;

            //straightInfo.Speed                = info.speed;
            straightInfo.thickness     = 0.05f;
            straightInfo.color         = Core.Environment.Scene.DefaultColor;
            straightInfo.conveyorWidth = CaseConveyorWidth._500mm;
            return(straightInfo);
        }
Ejemplo n.º 2
0
        public ThreeWaySwitch(ThreeWaySwitchInfo info) : base(info)
        {
            try
            {
                threeWaySwitchInfo   = info;
                ControllerProperties = StandardCase.SetMHEControl(info, this);
                info.height          = info.height * 2; // assembley is placed at height/2 so that it comes out at height ?!!??

                LeftConv = new StraightThrough(NewStraightInfo(info), this)
                {
                    convPosition = ThreeWayRoutes.Left
                };
                RightConv = new StraightThrough(NewStraightInfo(info), this)
                {
                    convPosition = ThreeWayRoutes.Right
                };
                CenterConv = new StraightThrough(NewStraightInfo(info), this)
                {
                    convPosition = ThreeWayRoutes.Center
                };

                Add(LeftConv, new Vector3(0, 0, -info.width / 2));
                Add(RightConv, new Vector3(0, 0, info.width / 2));
                Add(CenterConv, new Vector3(0, 0, info.centerOffset));

                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_OnElapsed;
                ReleaseDelayTimer.AutoReset          = false;
                TimerReleaseConvs.CollectionChanged += TimerReleaseConvs_CollectionChanged;

                ThreeWayLength         = info.threeWayLength;
                internalWidth          = info.threeWayWidth - ((float)info.internalConvWidth / 1000);
                CenterOffset           = info.centerOffset;
                LeftDefaultDirection   = info.leftDefaultDirection;
                RightDefaultDirection  = info.rightDefaultDirection;
                CenterDefaultDirection = info.centerDefaultDirection;
                InternalConvWidth      = info.internalConvWidth;
                Speed = info.speed;

                ReleaseDelayTimeStraight         = info.releaseDelayTimeStraight;
                Core.Environment.Scene.OnLoaded += Scene_OnLoaded;
            }
            catch (Exception e)
            {
                Log.Write(e.Message);
            }
        }