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>
This commit is contained in:
Kevin O'Connor 2025-03-14 13:14:11 -04:00
parent f06eeb5c7a
commit 01422da951
2 changed files with 12 additions and 8 deletions

View file

@ -1,6 +1,6 @@
# Code for handling printer nozzle extruders
#
# Copyright (C) 2016-2022 Kevin O'Connor <kevin@koconnor.net>
# Copyright (C) 2016-2025 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import math, logging
@ -185,8 +185,6 @@ class PrinterExtruder:
gcode.register_mux_command("ACTIVATE_EXTRUDER", "EXTRUDER",
self.name, self.cmd_ACTIVATE_EXTRUDER,
desc=self.cmd_ACTIVATE_EXTRUDER_help)
def update_move_time(self, flush_time, clear_history_time):
self.trapq_finalize_moves(self.trapq, flush_time, clear_history_time)
def get_status(self, eventtime):
sts = self.heater.get_status(eventtime)
sts['can_extrude'] = self.heater.can_extrude
@ -287,8 +285,6 @@ class PrinterExtruder:
class DummyExtruder:
def __init__(self, printer):
self.printer = printer
def update_move_time(self, flush_time, clear_history_time):
pass
def check_move(self, move):
raise move.move_error("Extrude when no extruder present")
def find_past_position(self, print_time):
@ -300,7 +296,7 @@ class DummyExtruder:
def get_heater(self):
raise self.printer.command_error("Extruder not configured")
def get_trapq(self):
raise self.printer.command_error("Extruder not configured")
return None
def add_printer_objects(config):
printer = config.get_printer()

View file

@ -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