From 9e1059afb46c9df439211d21590da987b32e2963 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 17 Nov 2016 17:24:03 -0500 Subject: homing: Create QueryEndstops class from gcode Create the QueryEndstops in the gcode handler instead of in the kinematic classes. This simplifies the gcode handler as it can directly register its response callback. Also, store the stepper name in the stepper class. Also, propagate the print_time of the query request to the mcu_endstop class. Signed-off-by: Kevin O'Connor --- klippy/cartesian.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'klippy/cartesian.py') diff --git a/klippy/cartesian.py b/klippy/cartesian.py index e386704c..b7b4a9ab 100644 --- a/klippy/cartesian.py +++ b/klippy/cartesian.py @@ -10,9 +10,9 @@ StepList = (0, 1, 2) class CartKinematics: def __init__(self, printer, config): - steppers = ['stepper_x', 'stepper_y', 'stepper_z'] - self.steppers = [stepper.PrinterStepper(printer, config.getsection(n)) - for n in steppers] + self.steppers = [stepper.PrinterStepper( + printer, config.getsection('stepper_' + n), n) + for n in ['x', 'y', 'z']] self.need_motor_enable = True self.limits = [(1.0, -1.0)] * 3 self.stepper_pos = [0, 0, 0] @@ -73,8 +73,8 @@ class CartKinematics: self.steppers[i].motor_enable(move_time, 1) need_motor_enable |= self.steppers[i].need_motor_enable self.need_motor_enable = need_motor_enable - def query_endstops(self, move_time): - return homing.QueryEndstops(["x", "y", "z"], self.steppers) + def query_endstops(self, query_state): + query_state.set_steppers(self.steppers) def check_endstops(self, move): end_pos = move.end_pos for i in StepList: -- cgit v1.2.3-70-g09d2