homing: Directly interact with the kinematic class when homing

Move the homing logic out of toolhead.py and into homing.py.  This
simplifies the toolhead logic and centralizes the homing code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-12-06 09:59:00 -05:00
parent 1d6af72de5
commit 8d9ca6f2dd
3 changed files with 13 additions and 10 deletions

View file

@ -354,11 +354,11 @@ class GCodeParser:
axes.append(self.axis2pos[axis])
if not axes:
axes = [0, 1, 2]
homing_state = homing.Homing(self.toolhead, axes)
homing_state = homing.Homing(self.toolhead)
if self.is_fileinput:
homing_state.set_no_verify_retract()
try:
self.toolhead.home(homing_state)
homing_state.home_axes(axes)
except homing.EndstopError as e:
raise error(str(e))
newpos = self.toolhead.get_position()