Ejemplo n.º 1
0
        public LoadFeeder(LoadFeederInfo info, BaseTrack conv) : base(info, conv)
        {
            loadFeederInfo = info;// as LoadFeederInfo;

            FeederCube             = new Experior.Core.Parts.Cube(Color.LightGray, 0.651f, 0.351f, 0.451f);
            FeederCube.Rigid       = false;
            FeederCube.Selectable  = true;
            FeederCube.OnSelected += EaterCube_OnSelected;

            StartArrow             = new Core.Parts.Arrow(0.35f);
            StartArrow.Color       = Color.Green;
            StartArrow.Selectable  = true;
            StartArrow.OnSelected += EaterCube_OnSelected;

            Add((RigidPart)FeederCube);
            Add((RigidPart)StartArrow);

            FeederCube.LocalPosition = new Vector3(0, 0.15f, 0);
            StartArrow.LocalPosition = new Vector3(0, 0.315f, 0);
            conv.TransportSection.Route.InsertActionPoint(FeederActionPoint);

            FeederActionPoint.Distance = info.distance;
            FeederActionPoint.OnEnter += FeederActionPoint_OnEnter;
            FeederActionPoint.Visible  = false;

            if (loadFeederInfo.feedInterval != 0)
            {
                feedTimer            = new Core.Timer(loadFeederInfo.feedInterval);
                feedTimer.AutoReset  = true;
                feedTimer.OnElapsed += feedTimer_OnElapsed;
            }

            Enabled = loadFeederInfo.enabled;
        }
Ejemplo n.º 2
0
        public LoadEater(LoadEaterInfo info, BaseTrack conv) : base(info, conv)
        {
            loadEaterInfo = info;// as LoadEaterInfo;

            EaterCube             = new Experior.Core.Parts.Cube(Color.LightGray, 0.651f, 0.351f, 0.451f);
            EaterCube.Selectable  = true;
            EaterCube.OnSelected += EaterCube_OnSelected;

            StopCube             = new Core.Parts.Cube(Color.Red, 0.35f, 0.35f, 0.35f);
            StopCube.Selectable  = true;
            StopCube.OnSelected += EaterCube_OnSelected;



            Add((RigidPart)EaterCube);
            Add((RigidPart)StopCube);

            EaterCube.LocalPosition = new Vector3(0, 0.15f, 0);
            StopCube.LocalPosition  = new Vector3(0, 0.17f, 0);
            conv.TransportSection.Route.InsertActionPoint(EaterActionPoint);

            EaterActionPoint.Distance = info.distance;
            EaterActionPoint.OnEnter += EaterActionPoint_OnEnter;
            EaterActionPoint.Visible  = false;
        }
Ejemplo n.º 3
0
        public StraightConveyor(StraightConveyorInfo info) : base(info)
        {
            try
            {
                straightinfo = info;
                TransportSection.Route.DragDropLoad = false;
                Entering          = TransportSection.Route.InsertActionPoint(0);
                Leaving           = TransportSection.Route.InsertActionPoint(TransportSection.Route.Length);
                Entering.OnEnter += entering_OnEnter;
                // Leaving.OnEnter += leaving_OnEnter;
                Core.Environment.Scene.OnLoaded += Scene_OnLoaded;

                Intersectable = false;

                if (TransportSection.Route.Arrow != null)
                {
                    TransportSection.Route.Arrow.Visible = false;
                }

                //Length does not update when dragging so disabled for now (Update on length is required to ensure that photocells are positioned correctly)
                StartFixPoint.Dragable = false;
                EndFixPoint.Dragable   = false;

                arrow = new DematicArrow(this, Width);

                startLine = new Cube(Color.Black, Width + 0.005f, 0.055f, 0.004f);
                Add(startLine);
                startLine.LocalPosition = new Vector3(Length / 2 + 0.002f, 0, 0);
                startLine.Yaw           = (float)Math.PI / 2;

                endLine = new Cube(Color.Black, Width + 0.005f, 0.055f, 0.004f);
                Add(endLine);
                endLine.LocalPosition = new Vector3(-Length / 2 - 0.002f, 0, 0);
                endLine.Yaw           = (float)Math.PI / 2;

                EndFixPoint.OnUnSnapped += EndFixPoint_OnUnSnapped;
                EndFixPoint.OnSnapped   += EndFixPoint_OnSnapped;

                StartFixPoint.OnUnSnapped += StartFixPoint_OnUnSnapped;
                StartFixPoint.OnSnapped   += StartFixPoint_OnSnapped;

                ThisRouteStatus.OnRouteStatusChanged            += ThisRouteStatus_OnAvailableChanged;
                TransportSection.Route.Motor.OnDirectionChanged += Motor_OnDirectionChanged;
            }
            catch (Exception ex)
            {
                Core.Environment.Log.Write(ex.Message);
            }
        }