From e2f483aea3a9eb885a410b264916ffb711daccfa Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 19 Jul 2021 11:12:58 -0400 Subject: [PATCH] trapq: Rename trapq_free_moves() to trapq_finalize_moves() Signed-off-by: Kevin O'Connor --- klippy/chelper/__init__.py | 2 +- klippy/chelper/trapq.c | 4 ++-- klippy/chelper/trapq.h | 2 +- klippy/extras/force_move.py | 4 ++-- klippy/extras/manual_stepper.py | 4 ++-- klippy/kinematics/extruder.py | 4 ++-- klippy/toolhead.py | 8 ++++---- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/klippy/chelper/__init__.py b/klippy/chelper/__init__.py index e8760b54..09897927 100644 --- a/klippy/chelper/__init__.py +++ b/klippy/chelper/__init__.py @@ -75,7 +75,7 @@ defs_trapq = """ , double start_v, double cruise_v, double accel); struct trapq *trapq_alloc(void); void trapq_free(struct trapq *tq); - void trapq_free_moves(struct trapq *tq, double print_time); + void trapq_finalize_moves(struct trapq *tq, double print_time); """ defs_kin_cartesian = """ diff --git a/klippy/chelper/trapq.c b/klippy/chelper/trapq.c index 7dc5a62a..177db8d8 100644 --- a/klippy/chelper/trapq.c +++ b/klippy/chelper/trapq.c @@ -157,9 +157,9 @@ trapq_add_move(struct trapq *tq, struct move *m) tail_sentinel->print_time = 0.; } -// Free any moves older than `print_time` from the trapezoid velocity queue +// Expire any moves older than `print_time` from the trapezoid velocity queue void __visible -trapq_free_moves(struct trapq *tq, double print_time) +trapq_finalize_moves(struct trapq *tq, double print_time) { struct move *head_sentinel = list_first_entry(&tq->moves, struct move,node); struct move *tail_sentinel = list_last_entry(&tq->moves, struct move, node); diff --git a/klippy/chelper/trapq.h b/klippy/chelper/trapq.h index 94590061..a930a2e1 100644 --- a/klippy/chelper/trapq.h +++ b/klippy/chelper/trapq.h @@ -36,6 +36,6 @@ struct trapq *trapq_alloc(void); void trapq_free(struct trapq *tq); void trapq_check_sentinels(struct trapq *tq); void trapq_add_move(struct trapq *tq, struct move *m); -void trapq_free_moves(struct trapq *tq, double print_time); +void trapq_finalize_moves(struct trapq *tq, double print_time); #endif // trapq.h diff --git a/klippy/extras/force_move.py b/klippy/extras/force_move.py index d4c3932a..ec13f6ed 100644 --- a/klippy/extras/force_move.py +++ b/klippy/extras/force_move.py @@ -36,7 +36,7 @@ class ForceMove: ffi_main, ffi_lib = chelper.get_ffi() 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.trapq_finalize_moves = ffi_lib.trapq_finalize_moves self.stepper_kinematics = ffi_main.gc( ffi_lib.cartesian_stepper_alloc('x'), ffi_lib.free) # Register commands @@ -87,7 +87,7 @@ class ForceMove: 0., 0., 0., axis_r, 0., 0., 0., cruise_v, accel) print_time = print_time + accel_t + cruise_t + accel_t stepper.generate_steps(print_time) - self.trapq_free_moves(self.trapq, print_time + 99999.9) + self.trapq_finalize_moves(self.trapq, print_time + 99999.9) stepper.set_trapq(prev_trapq) stepper.set_stepper_kinematics(prev_sk) toolhead.note_kinematic_activity(print_time) diff --git a/klippy/extras/manual_stepper.py b/klippy/extras/manual_stepper.py index 2f36b6d1..021bf048 100644 --- a/klippy/extras/manual_stepper.py +++ b/klippy/extras/manual_stepper.py @@ -25,7 +25,7 @@ class ManualStepper: ffi_main, ffi_lib = chelper.get_ffi() 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.trapq_finalize_moves = ffi_lib.trapq_finalize_moves self.rail.setup_itersolve('cartesian_stepper_alloc', 'x') self.rail.set_trapq(self.trapq) # Register commands @@ -67,7 +67,7 @@ class ManualStepper: 0., cruise_v, accel) self.next_cmd_time = self.next_cmd_time + accel_t + cruise_t + accel_t self.rail.generate_steps(self.next_cmd_time) - self.trapq_free_moves(self.trapq, self.next_cmd_time + 99999.9) + self.trapq_finalize_moves(self.trapq, self.next_cmd_time + 99999.9) toolhead = self.printer.lookup_object('toolhead') toolhead.note_kinematic_activity(self.next_cmd_time) if sync: diff --git a/klippy/kinematics/extruder.py b/klippy/kinematics/extruder.py index a232d0b7..cbcb84ec 100644 --- a/klippy/kinematics/extruder.py +++ b/klippy/kinematics/extruder.py @@ -48,7 +48,7 @@ class PrinterExtruder: ffi_main, ffi_lib = chelper.get_ffi() 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.trapq_finalize_moves = ffi_lib.trapq_finalize_moves self.sk_extruder = ffi_main.gc(ffi_lib.extruder_stepper_alloc(), ffi_lib.free) self.stepper.set_stepper_kinematics(self.sk_extruder) @@ -75,7 +75,7 @@ class PrinterExtruder: self.name, self.cmd_SET_E_STEP_DISTANCE, desc=self.cmd_SET_E_STEP_DISTANCE_help) def update_move_time(self, flush_time): - self.trapq_free_moves(self.trapq, flush_time) + self.trapq_finalize_moves(self.trapq, flush_time) def _set_pressure_advance(self, pressure_advance, smooth_time): old_smooth_time = self.pressure_advance_smooth_time if not self.pressure_advance: diff --git a/klippy/toolhead.py b/klippy/toolhead.py index abb4eb5f..3097c7dc 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -244,7 +244,7 @@ class ToolHead: ffi_main, ffi_lib = chelper.get_ffi() 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.trapq_finalize_moves = ffi_lib.trapq_finalize_moves self.step_generators = [] # Create kinematics class gcode = self.printer.lookup_object('gcode') @@ -285,7 +285,7 @@ class ToolHead: for sg in self.step_generators: sg(sg_flush_time) free_time = max(lkft, sg_flush_time - kin_flush_delay) - self.trapq_free_moves(self.trapq, free_time) + self.trapq_finalize_moves(self.trapq, free_time) self.extruder.update_move_time(free_time) mcu_flush_time = max(lkft, sg_flush_time - self.move_flush_time) for m in self.all_mcus: @@ -401,7 +401,7 @@ class ToolHead: return list(self.commanded_pos) def set_position(self, newpos, homing_axes=()): self.flush_step_generation() - self.trapq_free_moves(self.trapq, self.reactor.NEVER) + self.trapq_finalize_moves(self.trapq, self.reactor.NEVER) self.commanded_pos[:] = newpos self.kin.set_position(newpos, homing_axes) self.printer.send_event("toolhead:set_position") @@ -477,7 +477,7 @@ class ToolHead: self.move_queue.flush() except DripModeEndSignal as e: self.move_queue.reset() - self.trapq_free_moves(self.trapq, self.reactor.NEVER) + self.trapq_finalize_moves(self.trapq, self.reactor.NEVER) # Exit "Drip" state self.flush_step_generation() # Misc commands