From 1acaaa98c21af0a2a2cff725365dfda0ff4b7204 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 29 Oct 2019 12:44:39 -0400 Subject: trapq: Remove move_fill() Now that all callers use the trapq system to queue moves, it is no longer necessary to individually allocate and fill a 'struct move'. Signed-off-by: Kevin O'Connor --- klippy/toolhead.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'klippy/toolhead.py') diff --git a/klippy/toolhead.py b/klippy/toolhead.py index 5c93dfa6..0c4dd1bb 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -18,7 +18,6 @@ class Move: self.end_pos = tuple(end_pos) self.accel = toolhead.max_accel velocity = min(speed, toolhead.max_velocity) - self.cmove = toolhead.cmove self.is_kinematic_move = True self.axes_d = axes_d = [end_pos[i] - start_pos[i] for i in (0, 1, 2, 3)] self.move_d = move_d = math.sqrt(sum([d*d for d in axes_d[:3]])) @@ -97,13 +96,12 @@ class Move: # Generate step times for the move next_move_time = self.toolhead.get_next_move_time() if self.is_kinematic_move: - self.toolhead.move_fill( - self.cmove, next_move_time, + self.toolhead.trapq_append( + self.toolhead.trapq, next_move_time, self.accel_t, self.cruise_t, self.decel_t, self.start_pos[0], self.start_pos[1], self.start_pos[2], self.axes_d[0], self.axes_d[1], self.axes_d[2], self.start_v, self.cruise_v, self.accel) - self.toolhead.trapq_add_move(self.toolhead.trapq, self.cmove) if self.axes_d[3]: self.toolhead.extruder.move(next_move_time, self) self.toolhead.update_move_time( @@ -247,10 +245,8 @@ class ToolHead: self.drip_completion = None # Setup iterative solver ffi_main, ffi_lib = chelper.get_ffi() - self.cmove = ffi_main.gc(ffi_lib.move_alloc(), ffi_lib.free) - self.move_fill = ffi_lib.move_fill self.trapq = ffi_main.gc(ffi_lib.trapq_alloc(), ffi_lib.trapq_free) - self.trapq_add_move = ffi_lib.trapq_add_move + self.trapq_append = ffi_lib.trapq_append self.trapq_free_moves = ffi_lib.trapq_free_moves self.move_handlers = [] # Create kinematics class -- cgit v1.2.3-70-g09d2