From d38aed07730ffe6746b69d0dc7933c960535c4b1 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 5 Nov 2019 20:42:32 -0500 Subject: [PATCH] cartesian: Report dual_carriage_rails from get_steppers() Signed-off-by: Kevin O'Connor --- klippy/kinematics/cartesian.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/klippy/kinematics/cartesian.py b/klippy/kinematics/cartesian.py index 671914d5..7eded6e9 100644 --- a/klippy/kinematics/cartesian.py +++ b/klippy/kinematics/cartesian.py @@ -10,6 +10,8 @@ class CartKinematics: def __init__(self, toolhead, config): self.printer = config.get_printer() # Setup axis rails + self.dual_carriage_axis = None + self.dual_carriage_rails = [] self.rails = [stepper.LookupMultiRail(config.getsection('stepper_' + n)) for n in 'xyz'] for rail, axis in zip(self.rails, 'xyz'): @@ -33,8 +35,6 @@ class CartKinematics: self.rails[2].set_max_jerk( min(max_halt_velocity, self.max_z_velocity), max_accel) # Check for dual carriage support - self.dual_carriage_axis = None - self.dual_carriage_rails = [] if config.has_section('dual_carriage'): dc_config = config.getsection('dual_carriage') dc_axis = dc_config.getchoice('axis', {'x': 'x', 'y': 'y'}) @@ -52,7 +52,11 @@ class CartKinematics: def get_steppers(self, flags=""): if flags == "Z": return self.rails[2].get_steppers() - return [s for rail in self.rails for s in rail.get_steppers()] + rails = self.rails + if self.dual_carriage_axis is not None: + dca = self.dual_carriage_axis + rails = rails[:dca] + self.dual_carriage_rails + rails[dca+1:] + return [s for rail in rails for s in rail.get_steppers()] def calc_tag_position(self): return [rail.get_tag_position() for rail in self.rails] def set_position(self, newpos, homing_axes):