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/cartesian.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'klippy/cartesian.py') diff --git a/klippy/cartesian.py b/klippy/cartesian.py index b7b4a9ab..c1cddc7d 100644 --- a/klippy/cartesian.py +++ b/klippy/cartesian.py @@ -31,10 +31,9 @@ class CartKinematics: def get_homed_position(self): return [s.position_endstop + s.get_homed_offset()*s.step_dist for s in self.steppers] - def home(self, toolhead, axes): + def home(self, homing_state): # Each axis is homed independently and in order - homing_state = homing.Homing(toolhead, axes) - for axis in axes: + for axis in homing_state.get_axes(): s = self.steppers[axis] self.limits[axis] = (s.position_min, s.position_max) # Determine moves @@ -60,7 +59,6 @@ class CartKinematics: # Home again coord[axis] = r2pos homing_state.plan_home(list(coord), homepos, [s], s.homing_speed/2.0) - return homing_state def motor_off(self, move_time): self.limits = [(1.0, -1.0)] * 3 for stepper in self.steppers: -- cgit v1.2.3-70-g09d2