From 781cf608d778798c976d3cb4edb6ea6b028b66e1 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 18 Nov 2016 11:27:16 -0500 Subject: homing: Create Homing class from gcode Create the Homing class in the gcode handler instead of in the kinematic classes. This will make it easier to pass error messages back to the user. Signed-off-by: Kevin O'Connor --- klippy/gcode.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'klippy/gcode.py') diff --git a/klippy/gcode.py b/klippy/gcode.py index 97f88563..5262676a 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -250,14 +250,15 @@ class GCodeParser: axes.append(self.axis2pos[axis]) if not axes: axes = [0, 1, 2] - busy_handler = self.toolhead.home(axes) - def axes_update(axes): + homing_state = homing.Homing(self.toolhead, axes) + self.toolhead.home(homing_state) + def axes_update(homing_state): newpos = self.toolhead.get_position() - for axis in axes: + for axis in homing_state.get_axes(): self.last_position[axis] = newpos[axis] self.base_position[axis] = -self.homing_add[axis] - busy_handler.plan_axes_update(axes_update) - self.set_busy(busy_handler) + homing_state.plan_axes_update(axes_update) + self.set_busy(homing_state) def cmd_G90(self, params): # Use absolute coordinates self.absolutecoord = True -- cgit v1.2.3-70-g09d2