diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-11-17 17:24:03 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-11-18 14:04:09 -0500 |
commit | 9e1059afb46c9df439211d21590da987b32e2963 (patch) | |
tree | efaede08f7dd8ade191cd7c4c4ddf0e7b5576086 /klippy/cartesian.py | |
parent | 7ef8c0442a719ef80b9ef4109ab7e8fa57157854 (diff) | |
download | kutter-9e1059afb46c9df439211d21590da987b32e2963.tar.gz kutter-9e1059afb46c9df439211d21590da987b32e2963.tar.xz kutter-9e1059afb46c9df439211d21590da987b32e2963.zip |
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 <kevin@koconnor.net>
Diffstat (limited to 'klippy/cartesian.py')
-rw-r--r-- | klippy/cartesian.py | 10 |
1 files changed, 5 insertions, 5 deletions
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: |