From 5500538fc58231f0d80beb8191f25bc70e1b96eb Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 7 Nov 2019 10:59:35 -0500 Subject: [PATCH] toolhead: Rename register_move_handler() to register_step_generator() Rename the function so it is more clear what the step generation code path is. Signed-off-by: Kevin O'Connor --- klippy/kinematics/cartesian.py | 4 ++-- klippy/kinematics/corexy.py | 2 +- klippy/kinematics/delta.py | 2 +- klippy/kinematics/extruder.py | 4 ++-- klippy/kinematics/polar.py | 2 +- klippy/kinematics/winch.py | 2 +- klippy/toolhead.py | 10 +++++----- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/klippy/kinematics/cartesian.py b/klippy/kinematics/cartesian.py index bc083377..b2176d5b 100644 --- a/klippy/kinematics/cartesian.py +++ b/klippy/kinematics/cartesian.py @@ -16,7 +16,7 @@ class CartKinematics: rail.setup_itersolve('cartesian_stepper_alloc', axis) for s in self.get_steppers(): s.set_trapq(toolhead.get_trapq()) - toolhead.register_move_handler(s.generate_steps) + toolhead.register_step_generator(s.generate_steps) # Setup boundary checks max_velocity, max_accel = toolhead.get_max_velocity() self.max_z_velocity = config.getfloat( @@ -40,7 +40,7 @@ class CartKinematics: dc_rail = stepper.LookupMultiRail(dc_config) dc_rail.setup_itersolve('cartesian_stepper_alloc', dc_axis) for s in dc_rail.get_steppers(): - toolhead.register_move_handler(s.generate_steps) + toolhead.register_step_generator(s.generate_steps) dc_rail.set_max_jerk(max_halt_velocity, max_accel) self.dual_carriage_rails = [ self.rails[self.dual_carriage_axis], dc_rail] diff --git a/klippy/kinematics/corexy.py b/klippy/kinematics/corexy.py index b8ba08e2..9f9df91b 100644 --- a/klippy/kinematics/corexy.py +++ b/klippy/kinematics/corexy.py @@ -19,7 +19,7 @@ class CoreXYKinematics: self.rails[2].setup_itersolve('cartesian_stepper_alloc', 'z') for s in self.get_steppers(): s.set_trapq(toolhead.get_trapq()) - toolhead.register_move_handler(s.generate_steps) + toolhead.register_step_generator(s.generate_steps) # Setup boundary checks max_velocity, max_accel = toolhead.get_max_velocity() self.max_z_velocity = config.getfloat( diff --git a/klippy/kinematics/delta.py b/klippy/kinematics/delta.py index a46153fd..3bd01e8f 100644 --- a/klippy/kinematics/delta.py +++ b/klippy/kinematics/delta.py @@ -53,7 +53,7 @@ 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_move_handler(s.generate_steps) + toolhead.register_step_generator(s.generate_steps) # Setup boundary checks self.need_home = True self.limit_xy2 = -1. diff --git a/klippy/kinematics/extruder.py b/klippy/kinematics/extruder.py index c31a956c..194f50ed 100644 --- a/klippy/kinematics/extruder.py +++ b/klippy/kinematics/extruder.py @@ -58,8 +58,8 @@ class PrinterExtruder: self.trapq_free_moves = ffi_lib.trapq_free_moves self.stepper.setup_itersolve('extruder_stepper_alloc') self.stepper.set_trapq(self.trapq) - toolhead.register_move_handler(self.stepper.generate_steps) - toolhead.register_move_handler(self._free_moves) + toolhead.register_step_generator(self.stepper.generate_steps) + toolhead.register_step_generator(self._free_moves) # Setup SET_PRESSURE_ADVANCE command gcode = self.printer.lookup_object('gcode') if self.name in ('extruder', 'extruder0'): diff --git a/klippy/kinematics/polar.py b/klippy/kinematics/polar.py index 7f80848e..927e8401 100644 --- a/klippy/kinematics/polar.py +++ b/klippy/kinematics/polar.py @@ -20,7 +20,7 @@ class PolarKinematics: for s in r.get_steppers() ] for s in self.get_steppers(): s.set_trapq(toolhead.get_trapq()) - toolhead.register_move_handler(s.generate_steps) + toolhead.register_step_generator(s.generate_steps) # Setup boundary checks max_velocity, max_accel = toolhead.get_max_velocity() self.max_z_velocity = config.getfloat( diff --git a/klippy/kinematics/winch.py b/klippy/kinematics/winch.py index 101fc292..c48648c9 100644 --- a/klippy/kinematics/winch.py +++ b/klippy/kinematics/winch.py @@ -21,7 +21,7 @@ class WinchKinematics: self.anchors.append(a) s.setup_itersolve('winch_stepper_alloc', *a) s.set_trapq(toolhead.get_trapq()) - toolhead.register_move_handler(s.generate_steps) + toolhead.register_step_generator(s.generate_steps) # Setup stepper max halt velocity max_velocity, max_accel = toolhead.get_max_velocity() max_halt_velocity = toolhead.get_max_axis_halt() diff --git a/klippy/toolhead.py b/klippy/toolhead.py index 8fdcf1e9..22effb99 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -240,7 +240,7 @@ class ToolHead: self.trapq = ffi_main.gc(ffi_lib.trapq_alloc(), ffi_lib.trapq_free) self.trapq_append = ffi_lib.trapq_append self.trapq_free_moves = ffi_lib.trapq_free_moves - self.move_handlers = [] + self.step_generators = [] # Create kinematics class self.extruder = kinematics.extruder.DummyExtruder() self.move_queue.set_extruder(self.extruder) @@ -273,8 +273,8 @@ class ToolHead: while 1: flush_to_time = min(self.print_time + batch_time, next_print_time) self.print_time = flush_to_time - for mh in self.move_handlers: - mh(flush_to_time) + for sg in self.step_generators: + sg(flush_to_time) self.trapq_free_moves(self.trapq, flush_to_time) if lazy: flush_to_time -= self.move_flush_time @@ -498,8 +498,8 @@ class ToolHead: return self.kin def get_trapq(self): return self.trapq - def register_move_handler(self, handler): - self.move_handlers.append(handler) + def register_step_generator(self, handler): + self.step_generators.append(handler) def get_max_velocity(self): return self.max_velocity, self.max_accel def get_max_axis_halt(self):