Exemplo n.º 1
0
        public CurveConveyor(CurveConveyorInfo info) : base(info)
        {
            curveInfo = info;
            Core.Environment.Scene.OnLoaded  += Scene_OnLoaded;
            TransportSection.Route.OnArrived += Route_OnArrived;

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

            arrow = new DematicArrow(this, Width);
            UpdateArrowPosition();

            ThisRouteStatus.OnRouteStatusChanged += ThisRouteStatus_OnAvailableChanged;

            if (curveInfo.deviceInfos == null)
            {
                curveInfo.deviceInfos = new List <DeviceInfo>();
            }

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

            // constructDevice = new ConstructDevice(Name);
        }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
0
        public BaseStraight(BaseStraightInfo 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;
                Experior.Dematic.Base.EuroPallet.PalletLoadDisposed += Pallet_Load_PalletLoadDisposed;

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

                if (StraightInfo.ConveyorType == PalletConveyorType.Chain)
                {
                    var chainLength = TransportSection.Route.Length;
                    var chainHeight = TransportSection.Height;
                    var offCentre   = Width / 2 - ChainWidth;

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

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

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

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

                    ChainLeft = new Cube(Color.Yellow, chainLength, chainHeight, ChainWidth);
                    Add(ChainLeft);
                    ChainLeft.LocalPosition = new Vector3(0, 0, offCentre);

                    ChainRight = new Cube(Color.Yellow, chainLength, chainHeight, ChainWidth);
                    Add(ChainRight);
                    ChainRight.LocalPosition = new Vector3(0, 0, -offCentre);

                    TransportSection.Visible = false;
                }
                else
                {
                    StartLine1 = new Cube(Color.Black, Width + 0.005f, 0.055f, 0.004f);
                    Add(StartLine1);
                    StartLine1.LocalPosition = new Vector3(Length / 2 + 0.002f, 0, 0);
                    StartLine1.Yaw           = (float)Math.PI / 2;

                    EndLine1 = new Cube(Color.Black, Width + 0.005f, 0.055f, 0.004f);
                    Add(EndLine1);
                    EndLine1.LocalPosition = new Vector3(-Length / 2 - 0.002f, 0, 0);
                    EndLine1.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;

                ThisRouteStatus.Available             = RouteStatuses.Available;
                TransportSection.Route.OnLoadRemoved += Route_OnLoadRemoved;
            }
            catch (Exception ex)
            {
                Core.Environment.Log.Write(ex.Message);
            }
        }