Ejemplo n.º 1
0
        internal void AddLinearMove(MoveType moveType, AxisAbilited axisAbilited, double?x, double?y, double?z, double?feed = null, CncCompensationState cncCompensationState = CncCompensationState.NoChange)
        {
            var moveAction = new LinearMoveAction(axisAbilited, moveType)
            {
                Feed = feed, CncCompensationState = cncCompensationState
            };

            switch (axisAbilited)
            {
            case AxisAbilited.Z:
            {
                moveAction.Z = z;
            } break;

            case AxisAbilited.Xy:
            {
                _x = moveAction.X = x;
                _y = moveAction.Y = y;
            } break;

            default:
            {
                _x           = moveAction.X = x;
                _y           = moveAction.Y = y;
                moveAction.Z = z;
            } break;
            }

            this.Add(moveAction);
        }
Ejemplo n.º 2
0
        internal void AddLinearMove(MoveType moveType, AxisAbilited axisAbilited, double x, double y, double?z, Matrix3D rotationMatrix, double?feed = null, CncCompensationState cncCompensationState = CncCompensationState.NoChange)
        {
            var rotatedPnt = Geometry.GeometryHelper.MultiplyPoint(new Geometry.Point3D(x, y, 0), rotationMatrix);

            var moveAction = new LinearMoveAction(axisAbilited, moveType)
            {
                Feed = feed, CncCompensationState = cncCompensationState
            };

            switch (axisAbilited)
            {
            case AxisAbilited.Z:
            {
                moveAction.Z = z;
            } break;

            case AxisAbilited.Xy:
            {
                _x = moveAction.X = rotatedPnt.X;
                _y = moveAction.Y = rotatedPnt.Y;
            } break;

            default:
            {
                throw new NotImplementedException();
            } break;
            }

            this.Add(moveAction);
        }
Ejemplo n.º 3
0
        public void AddArcMove(AxisAbilited axisAbilited, double?x, double?y, double?z, double radius, bool clockWise, Point2D center, double?feed = null, CncCompensationState cncCompensationState = CncCompensationState.NoChange)
        {
            var moveType = clockWise ? MoveType.Cw : MoveType.Ccw;

            var moveAction = new ArcMoveAction(axisAbilited, moveType)
            {
                Radius = radius, ClockWise = clockWise, Center = center, CncCompensationState = cncCompensationState
            };

            moveAction.Z = z;

            _x = moveAction.X = x;
            _y = moveAction.Y = y;

            this.Add(moveAction);
        }
Ejemplo n.º 4
0
        public void AddArcMove(AxisAbilited axisAbilited, double x, double y, double?z, double radius, bool clockWise, Point2D center, Matrix3D rotationMatrix, double?feed = null, CncCompensationState cncCompensationState = CncCompensationState.NoChange)
        {
            var moveType = clockWise ? MoveType.Cw : MoveType.Ccw;

            var rotatedEndPnt = Geometry.GeometryHelper.MultiplyPoint(new Geometry.Point3D(x, y, 0), rotationMatrix);

            var rotatedCenterArc = Geometry.GeometryHelper.MultiplyPoint(new Geometry.Point3D(center.X, center.Y, 0), rotationMatrix);

            var moveAction = new ArcMoveAction(axisAbilited, moveType)
            {
                Radius = radius, ClockWise = clockWise, Center = new Point2D(rotatedCenterArc.X, rotatedCenterArc.Y), CncCompensationState = cncCompensationState
            };

            moveAction.Z = z;

            _x = moveAction.X = rotatedEndPnt.X;
            _y = moveAction.Y = rotatedEndPnt.Y;

            this.Add(moveAction);
        }
Ejemplo n.º 5
0
 public ArcMoveAction(AxisAbilited abilited, MoveType moveType)
     : base(abilited, moveType)
 {
 }
Ejemplo n.º 6
0
 public LinearMoveAction(AxisAbilited abilited, MoveType moveType)
     : base(null)
 {
     AxisAbilited = abilited;
     MoveType     = moveType;
 }