motion_queuing: Add new module to help with motion queues and flushing
Create a new module to assist with host management of motion queues. Register all MCU_stepper objects with this module and use the module for step generation. All steppers will now automatically generate steps whenever toolhead._advance_flush_time() is invoked. It is no longer necessary for callers to individually call stepper.generate_steps(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -36,7 +36,6 @@ class CartKinematics:
|
||||
'safe_distance', None, minval=0.))
|
||||
for s in self.get_steppers():
|
||||
s.set_trapq(toolhead.get_trapq())
|
||||
toolhead.register_step_generator(s.generate_steps)
|
||||
# Setup boundary checks
|
||||
max_velocity, max_accel = toolhead.get_max_velocity()
|
||||
self.max_z_velocity = config.getfloat('max_z_velocity', max_velocity,
|
||||
|
||||
@@ -20,7 +20,6 @@ class CoreXYKinematics:
|
||||
self.rails[2].setup_itersolve('cartesian_stepper_alloc', b'z')
|
||||
for s in self.get_steppers():
|
||||
s.set_trapq(toolhead.get_trapq())
|
||||
toolhead.register_step_generator(s.generate_steps)
|
||||
# Setup boundary checks
|
||||
max_velocity, max_accel = toolhead.get_max_velocity()
|
||||
self.max_z_velocity = config.getfloat(
|
||||
|
||||
@@ -20,7 +20,6 @@ class CoreXZKinematics:
|
||||
self.rails[2].setup_itersolve('corexz_stepper_alloc', b'-')
|
||||
for s in self.get_steppers():
|
||||
s.set_trapq(toolhead.get_trapq())
|
||||
toolhead.register_step_generator(s.generate_steps)
|
||||
# Setup boundary checks
|
||||
max_velocity, max_accel = toolhead.get_max_velocity()
|
||||
self.max_z_velocity = config.getfloat(
|
||||
|
||||
@@ -52,7 +52,6 @@ class DeltaKinematics:
|
||||
r.setup_itersolve('delta_stepper_alloc', a, t[0], t[1])
|
||||
for s in self.get_steppers():
|
||||
s.set_trapq(toolhead.get_trapq())
|
||||
toolhead.register_step_generator(s.generate_steps)
|
||||
# Setup boundary checks
|
||||
self.need_home = True
|
||||
self.limit_xy2 = -1.
|
||||
|
||||
@@ -40,7 +40,6 @@ class DeltesianKinematics:
|
||||
self.rails[2].setup_itersolve('cartesian_stepper_alloc', b'y')
|
||||
for s in self.get_steppers():
|
||||
s.set_trapq(toolhead.get_trapq())
|
||||
toolhead.register_step_generator(s.generate_steps)
|
||||
self.limits = [(1.0, -1.0)] * 3
|
||||
# X axis limits
|
||||
min_angle = config.getfloat('min_angle', MIN_ANGLE,
|
||||
|
||||
@@ -39,8 +39,6 @@ class ExtruderStepper:
|
||||
self.name, self.cmd_SYNC_EXTRUDER_MOTION,
|
||||
desc=self.cmd_SYNC_EXTRUDER_MOTION_help)
|
||||
def _handle_connect(self):
|
||||
toolhead = self.printer.lookup_object('toolhead')
|
||||
toolhead.register_step_generator(self.stepper.generate_steps)
|
||||
self._set_pressure_advance(self.config_pa, self.config_smooth_time)
|
||||
def get_status(self, eventtime):
|
||||
return {'pressure_advance': self.pressure_advance,
|
||||
|
||||
@@ -108,7 +108,6 @@ class GenericCartesianKinematics:
|
||||
self._load_kinematics(config)
|
||||
for s in self.get_steppers():
|
||||
s.set_trapq(toolhead.get_trapq())
|
||||
toolhead.register_step_generator(s.generate_steps)
|
||||
self.dc_module = None
|
||||
if self.dc_carriages:
|
||||
pcs = [dc.get_dual_carriage() for dc in self.dc_carriages]
|
||||
|
||||
@@ -39,7 +39,6 @@ class HybridCoreXYKinematics:
|
||||
'safe_distance', None, minval=0.))
|
||||
for s in self.get_steppers():
|
||||
s.set_trapq(toolhead.get_trapq())
|
||||
toolhead.register_step_generator(s.generate_steps)
|
||||
# Setup boundary checks
|
||||
max_velocity, max_accel = toolhead.get_max_velocity()
|
||||
self.max_z_velocity = config.getfloat(
|
||||
|
||||
@@ -39,7 +39,6 @@ class HybridCoreXZKinematics:
|
||||
'safe_distance', None, minval=0.))
|
||||
for s in self.get_steppers():
|
||||
s.set_trapq(toolhead.get_trapq())
|
||||
toolhead.register_step_generator(s.generate_steps)
|
||||
# Setup boundary checks
|
||||
max_velocity, max_accel = toolhead.get_max_velocity()
|
||||
self.max_z_velocity = config.getfloat(
|
||||
|
||||
@@ -21,7 +21,6 @@ class PolarKinematics:
|
||||
for s in r.get_steppers() ]
|
||||
for s in self.get_steppers():
|
||||
s.set_trapq(toolhead.get_trapq())
|
||||
toolhead.register_step_generator(s.generate_steps)
|
||||
# Setup boundary checks
|
||||
max_velocity, max_accel = toolhead.get_max_velocity()
|
||||
self.max_z_velocity = config.getfloat(
|
||||
|
||||
@@ -52,7 +52,6 @@ class RotaryDeltaKinematics:
|
||||
math.radians(a), ua, la)
|
||||
for s in self.get_steppers():
|
||||
s.set_trapq(toolhead.get_trapq())
|
||||
toolhead.register_step_generator(s.generate_steps)
|
||||
# Setup boundary checks
|
||||
self.need_home = True
|
||||
self.limit_xy2 = -1.
|
||||
|
||||
@@ -21,7 +21,6 @@ class WinchKinematics:
|
||||
self.anchors.append(a)
|
||||
s.setup_itersolve('winch_stepper_alloc', *a)
|
||||
s.set_trapq(toolhead.get_trapq())
|
||||
toolhead.register_step_generator(s.generate_steps)
|
||||
# Setup boundary checks
|
||||
acoords = list(zip(*self.anchors))
|
||||
self.axes_min = toolhead.Coord(*[min(a) for a in acoords], e=0.)
|
||||
|
||||
Reference in New Issue
Block a user