public override void check_move(Move move) { var end_pos = move.end_pos; var xy2 = Math.Pow(end_pos.X, 2) + Math.Pow(end_pos.Y, 2); if (xy2 > this.limit_xy2) { if (this.limit_xy2 < 0.0) { throw EndstopException.EndstopMoveError(end_pos, "Must home axis first"); } throw EndstopException.EndstopMoveError(end_pos); } if (move.axes_d.Z != 0) { if (end_pos.Z < this.limit_z.X || end_pos.Z > this.limit_z.Y) { if (this.limit_z.X > this.limit_z.Y) { throw EndstopException.EndstopMoveError(end_pos, "Must home axis first"); } throw EndstopException.EndstopMoveError(end_pos); } // Move with Z - update velocity and accel for slower Z axis var z_ratio = move.move_d / Math.Abs(move.axes_d.Z); move.limit_speed(this.max_z_velocity * z_ratio, this.max_z_accel * z_ratio); } }
void _check_endstops(Move move) { var end_pos = move.end_pos; for (int i = 0; i < 3; i++) { if (move.axes_d.Get(i) != 0 && (end_pos.Get(i) < this.limits[i].X || end_pos.Get(i) > this.limits[i].Y)) { if (this.limits[i].X > this.limits[i].Y) { throw EndstopException.EndstopMoveError(end_pos, "Must home axis first"); } throw EndstopException.EndstopMoveError(end_pos); } } }
public override void check_move(Move move) { throw EndstopException.EndstopMoveError(move.end_pos, "Extrude when no extruder present"); }