aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/toolhead.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2025-03-14 13:14:11 -0400
committerKevin O'Connor <kevin@koconnor.net>2025-05-12 20:15:03 -0400
commit01422da9510f576808cc86bfbc190a8e28c308db (patch)
treebfd1e75c0dcb71bb91cbd1fc3f53885ff1b72ad3 /klippy/toolhead.py
parentf06eeb5c7aa5b297d0b6128b8cd878a35b6ea89d (diff)
downloadkutter-01422da9510f576808cc86bfbc190a8e28c308db.tar.gz
kutter-01422da9510f576808cc86bfbc190a8e28c308db.tar.xz
kutter-01422da9510f576808cc86bfbc190a8e28c308db.zip
extruder: Remove update_move_time() call
The toolhead can obtain the underlying extruder trapq via extruder.get_trapq(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/toolhead.py')
-rw-r--r--klippy/toolhead.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py
index 2dde8491..2954812b 100644
--- a/klippy/toolhead.py
+++ b/klippy/toolhead.py
@@ -257,7 +257,9 @@ class ToolHead:
self.trapq = ffi_main.gc(ffi_lib.trapq_alloc(), ffi_lib.trapq_free)
self.trapq_append = ffi_lib.trapq_append
self.trapq_finalize_moves = ffi_lib.trapq_finalize_moves
+ # Motion flushing
self.step_generators = []
+ self.flush_trapqs = [self.trapq]
# Create kinematics class
gcode = self.printer.lookup_object('gcode')
self.Coord = gcode.Coord
@@ -303,8 +305,8 @@ class ToolHead:
if not self.can_pause:
clear_history_time = flush_time - MOVE_HISTORY_EXPIRE
free_time = sg_flush_time - self.kin_flush_delay
- self.trapq_finalize_moves(self.trapq, free_time, clear_history_time)
- self.extruder.update_move_time(free_time, clear_history_time)
+ for trapq in self.flush_trapqs:
+ self.trapq_finalize_moves(trapq, free_time, clear_history_time)
# Flush stepcompress and mcu steppersync
for m in self.all_mcus:
m.flush_moves(flush_time, clear_history_time)
@@ -498,8 +500,14 @@ class ToolHead:
break
eventtime = self.reactor.pause(eventtime + 0.100)
def set_extruder(self, extruder, extrude_pos):
+ prev_ea_trapq = self.extruder.get_trapq()
+ if prev_ea_trapq in self.flush_trapqs:
+ self.flush_trapqs.remove(prev_ea_trapq)
self.extruder = extruder
self.commanded_pos[3] = extrude_pos
+ ea_trapq = extruder.get_trapq()
+ if ea_trapq is not None:
+ self.flush_trapqs.append(ea_trapq)
def get_extruder(self):
return self.extruder
# Homing "drip move" handling