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

@ -118,7 +118,7 @@ class DeltaKinematics:
# Normal XY move
return
if self.need_home:
raise homing.EndstopMoveError(end_pos, "Must home first")
raise move.move_error("Must home first")
end_z = end_pos[2]
limit_xy2 = self.max_xy2
if end_z > self.limit_z:
@ -127,7 +127,7 @@ class DeltaKinematics:
# Move out of range - verify not a homing move
if (end_pos[:2] != self.home_position[:2]
or end_z < self.min_z or end_z > self.home_position[2]):
raise homing.EndstopMoveError(end_pos)
raise move.move_error()
limit_xy2 = -1.
if move.axes_d[2]:
move.limit_speed(self.max_z_velocity, move.accel)