mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-18 20:28:10 -06:00
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>
This commit is contained in:
parent
7ef8c0442a
commit
9e1059afb4
8 changed files with 37 additions and 36 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue