From 1f3a160f47175c44722a3ce1e58e90c359b99c99 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 3 Sep 2020 16:22:54 -0400 Subject: toolhead: Add a move.move_error() helper Move the EndstopMoveError() code from homing.py to a new method in the toolhead Move class. Signed-off-by: Kevin O'Connor --- klippy/kinematics/polar.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'klippy/kinematics/polar.py') diff --git a/klippy/kinematics/polar.py b/klippy/kinematics/polar.py index 904ccf55..93ab59d2 100644 --- a/klippy/kinematics/polar.py +++ b/klippy/kinematics/polar.py @@ -94,18 +94,17 @@ class PolarKinematics: xy2 = end_pos[0]**2 + end_pos[1]**2 if xy2 > self.limit_xy2: if self.limit_xy2 < 0.: - raise homing.EndstopMoveError(end_pos, "Must home axis first") - raise homing.EndstopMoveError(end_pos) + raise move.move_error("Must home axis first") + raise move.move_error() if move.axes_d[2]: if end_pos[2] < self.limit_z[0] or end_pos[2] > self.limit_z[1]: if self.limit_z[0] > self.limit_z[1]: - raise homing.EndstopMoveError( - end_pos, "Must home axis first") - raise homing.EndstopMoveError(end_pos) + raise move.move_error("Must home axis first") + raise move.move_error() # Move with Z - update velocity and accel for slower Z axis z_ratio = move.move_d / abs(move.axes_d[2]) - move.limit_speed( - self.max_z_velocity * z_ratio, self.max_z_accel * z_ratio) + move.limit_speed(self.max_z_velocity * z_ratio, + self.max_z_accel * z_ratio) def get_status(self, eventtime): xy_home = "xy" if self.limit_xy2 >= 0. else "" z_home = "z" if self.limit_z[0] <= self.limit_z[1] else "" -- cgit v1.2.3-70-g09d2