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:
@@ -6,9 +6,10 @@
|
||||
import math, logging
|
||||
|
||||
class PrinterStepper:
|
||||
def __init__(self, printer, config):
|
||||
def __init__(self, printer, config, name):
|
||||
self.printer = printer
|
||||
self.config = config
|
||||
self.name = name
|
||||
self.mcu_stepper = self.mcu_enable = self.mcu_endstop = None
|
||||
|
||||
self.step_dist = config.getfloat('step_distance')
|
||||
@@ -76,10 +77,11 @@ class PrinterStepper:
|
||||
mcu_time = self.mcu_endstop.print_to_mcu_time(move_time)
|
||||
self.mcu_endstop.home(mcu_time, step_time)
|
||||
return self.mcu_endstop
|
||||
def query_endstop(self):
|
||||
def query_endstop(self, print_time):
|
||||
if self.mcu_endstop is None:
|
||||
return None
|
||||
self.mcu_endstop.query_endstop()
|
||||
mcu_time = self.mcu_endstop.print_to_mcu_time(print_time)
|
||||
self.mcu_endstop.query_endstop(mcu_time)
|
||||
return self.mcu_endstop
|
||||
def get_homed_offset(self):
|
||||
if not self.homing_stepper_phases or self.need_motor_enable:
|
||||
|
||||
Reference in New Issue
Block a user