diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-10-29 12:44:39 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-11-06 15:51:51 -0500 |
commit | 1acaaa98c21af0a2a2cff725365dfda0ff4b7204 (patch) | |
tree | 601ce8a29fb24f7b4b83368c120c386563d2ff1b /klippy/toolhead.py | |
parent | 797dcfcb1218194077d37dd53575c19c4af710c5 (diff) | |
download | kutter-1acaaa98c21af0a2a2cff725365dfda0ff4b7204.tar.gz kutter-1acaaa98c21af0a2a2cff725365dfda0ff4b7204.tar.xz kutter-1acaaa98c21af0a2a2cff725365dfda0ff4b7204.zip |
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 <kevin@koconnor.net>
Diffstat (limited to 'klippy/toolhead.py')
-rw-r--r-- | klippy/toolhead.py | 10 |
1 files changed, 3 insertions, 7 deletions
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 |