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 <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-09-03 16:22:54 -04:00
parent d0ed6e5705
commit 1f3a160f47
9 changed files with 21 additions and 26 deletions

View file

@ -100,9 +100,8 @@ class CartKinematics:
and (end_pos[i] < self.limits[i][0]
or end_pos[i] > self.limits[i][1])):
if self.limits[i][0] > self.limits[i][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()
def check_move(self, move):
limits = self.limits
xpos, ypos = move.end_pos[:2]