stepper: Remove add_to_endstop() method
Now that the PrinterStepper and MCU_stepper classes have been merged, there is no need for the add_to_endstop() method. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
78153ca4c3
commit
a4995c61c9
|
@ -63,7 +63,7 @@ class BLTouchEndstopWrapper:
|
|||
def _build_config(self):
|
||||
kin = self.printer.lookup_object('toolhead').get_kinematics()
|
||||
for stepper in kin.get_steppers('Z'):
|
||||
stepper.add_to_endstop(self)
|
||||
self.add_stepper(stepper)
|
||||
def handle_connect(self):
|
||||
try:
|
||||
self.raise_probe()
|
||||
|
|
|
@ -242,7 +242,7 @@ class ProbeEndstopWrapper:
|
|||
def _build_config(self):
|
||||
kin = self.printer.lookup_object('toolhead').get_kinematics()
|
||||
for stepper in kin.get_steppers('Z'):
|
||||
stepper.add_to_endstop(self)
|
||||
self.add_stepper(stepper)
|
||||
def home_prepare(self):
|
||||
toolhead = self.printer.lookup_object('toolhead')
|
||||
start_pos = toolhead.get_position()
|
||||
|
|
|
@ -12,8 +12,10 @@ class CoreXYKinematics:
|
|||
self.rails = [ stepper.PrinterRail(config.getsection('stepper_x')),
|
||||
stepper.PrinterRail(config.getsection('stepper_y')),
|
||||
stepper.LookupMultiRail(config.getsection('stepper_z')) ]
|
||||
self.rails[0].add_to_endstop(self.rails[1].get_endstops()[0][0])
|
||||
self.rails[1].add_to_endstop(self.rails[0].get_endstops()[0][0])
|
||||
self.rails[0].get_endstops()[0][0].add_stepper(
|
||||
self.rails[1].get_steppers()[0])
|
||||
self.rails[1].get_endstops()[0][0].add_stepper(
|
||||
self.rails[0].get_steppers()[0])
|
||||
self.rails[0].setup_itersolve('corexy_stepper_alloc', '+')
|
||||
self.rails[1].setup_itersolve('corexy_stepper_alloc', '-')
|
||||
self.rails[2].setup_itersolve('cartesian_stepper_alloc', 'z')
|
||||
|
|
|
@ -47,8 +47,6 @@ class MCU_stepper:
|
|||
if short and self._name.startswith('stepper_'):
|
||||
return self._name[8:]
|
||||
return self._name
|
||||
def add_to_endstop(self, mcu_endstop):
|
||||
mcu_endstop.add_stepper(self)
|
||||
def _dist_to_time(self, dist, start_velocity, accel):
|
||||
# Calculate the time it takes to travel a distance with constant accel
|
||||
time_offset = start_velocity / accel
|
||||
|
@ -254,19 +252,16 @@ class PrinterRail:
|
|||
self.steppers.append(stepper)
|
||||
if self.endstops and config.get('endstop_pin', None) is None:
|
||||
# No endstop defined - use primary endstop
|
||||
stepper.add_to_endstop(self.endstops[0][0])
|
||||
self.endstops[0][0].add_stepper(stepper)
|
||||
return
|
||||
printer = config.get_printer()
|
||||
ppins = printer.lookup_object('pins')
|
||||
mcu_endstop = ppins.setup_pin('endstop', config.get('endstop_pin'))
|
||||
stepper.add_to_endstop(mcu_endstop)
|
||||
mcu_endstop.add_stepper(stepper)
|
||||
name = stepper.get_name(short=True)
|
||||
self.endstops.append((mcu_endstop, name))
|
||||
query_endstops = printer.try_load_module(config, 'query_endstops')
|
||||
query_endstops.register_endstop(mcu_endstop, name)
|
||||
def add_to_endstop(self, mcu_endstop):
|
||||
for stepper in self.steppers:
|
||||
stepper.add_to_endstop(mcu_endstop)
|
||||
def setup_itersolve(self, alloc_func, *params):
|
||||
for stepper in self.steppers:
|
||||
stepper.setup_itersolve(alloc_func, *params)
|
||||
|
|
Loading…
Reference in New Issue