Example #1
0
        /// <summary>
        /// For step or outline movement
        /// </summary>
        /// <returns></returns>
        private List <LineSegment> GetEmptySegments()
        {
            var    items         = base.GetDataCollection();
            double accelebration = GlobalModel.Params.LayerConfig.ProcessAcceleratedSpeed;

            return(MovementUtil.GetLineSegments(items, this.layerPara.CutSpeed, accelebration));
        }
Example #2
0
        public void MoveTo(PointF point, double speed, double acceleration, CancellationToken token, Action <MotorInfoMap <double>, MotorInfoMap <double> > infoHandler)
        {
            var posInfo = this.Motor.CurrentPosInfo;
            var p1      = new PointF((float)posInfo[AxisTypes.AxisX], (float)posInfo[AxisTypes.AxisY]);
            var p2      = point;
            var lines   = MovementUtil.GetLineSegments(p1, p2, speed, acceleration);

            this.Motor.MoveAsync(lines, token, infoHandler).Wait();
        }
Example #3
0
        public override void Intialize(out List <LineSegment> segments, double speed, CancellationToken token)
        {
            var    items         = base.GetDataCollection();
            double accelebration = GlobalModel.Params.LayerConfig.EmptyMoveAcceleratedSpeed;

            if (double.IsNaN(speed))
            {
                speed = GlobalModel.Params.LayerConfig.EmptyMoveSpeed;
            }
            segments = MovementUtil.GetLineSegments(items, speed, accelebration);
        }
Example #4
0
        public override void Intialize(out List <LineSegment> segments, double speed, CancellationToken token)
        {
            var    items         = base.GetDataCollection();
            double accelebration = GlobalModel.Params.LayerConfig.ProcessAcceleratedSpeed;

            if (double.IsNaN(speed))
            {
                speed = this.layerPara.CoolingSpeed;
            }
            segments = MovementUtil.GetLineSegments(items, speed, accelebration);

            //Fllow logic, case: EmptyMove
        }
Example #5
0
        public override void Intialize(out List <LineSegment> segments, double speed, CancellationToken token)
        {
            var    items         = base.GetDataCollection();
            double accelebration = GlobalModel.Params.LayerConfig.ProcessAcceleratedSpeed;

            if (double.IsNaN(speed))
            {
                speed = this.layerPara.CutSpeed;
            }
            segments = MovementUtil.GetLineSegments(items, speed, accelebration);

            if (SystemContext.Hardware?.IsLaserOn == true)
            {
                int delay = (int)this.layerPara.LaserOpenDelay;
                token.WaitHandle.WaitOne(delay);
            }

            //Fllow logic, case: EmptyMove
        }
Example #6
0
        private List <LineSegment> GetCuttingSegments()
        {
            double startLen    = 0;
            double startSpeed  = 0;
            double stopLen     = 0;
            double stopSpeed   = 0;
            double normalSpeed = this.layerPara.CutSpeed;

            if (this.layerPara.IsSlowStart)
            {
                startSpeed = this.layerPara.SlowStartSpeed;
                if (startSpeed > 0)
                {
                    startLen = this.layerPara.SlowStartDistance;
                }
            }
            if (this.layerPara.IsSlowStop)
            {
                stopSpeed = this.layerPara.SlowStopSpeed;
                if (stopSpeed > 0)
                {
                    stopLen = this.layerPara.SlowStopDistance;
                }
            }

            var    items         = base.GetDataCollection();
            var    segments      = new List <LineSegment>();
            var    spiltter      = new DataSplitter(items, startLen, stopLen);
            double accelebration = GlobalModel.Params.LayerConfig.ProcessAcceleratedSpeed;

            if (spiltter.IsValid)
            {
                var part1 = spiltter.GetStartData();
                if (part1.Any())
                {
                    var tmp = MovementUtil.GetLineSegments(part1, startSpeed, accelebration);
                    if (tmp.Any())
                    {
                        segments.AddRange(tmp);
                    }
                }
                var part2 = spiltter.GetMiddleData();
                if (part2.Any())
                {
                    segments.AddRange(MovementUtil.GetLineSegments(part2, normalSpeed, accelebration));
                }
                var part3 = spiltter.GetEndData();
                if (part3.Any())
                {
                    var tmp = MovementUtil.GetLineSegments(part3, stopSpeed, accelebration);
                    if (tmp.Any())
                    {
                        segments.AddRange(tmp);
                    }
                }
            }
            else
            {
                segments.AddRange(MovementUtil.GetLineSegments(items, normalSpeed, accelebration));
            }

            return(segments);
        }