mirror of
https://github.com/andreili/klipper.git
synced 2025-08-23 19:34:06 +02:00
print_stats: Fix for filament statistics bug in print_stats.py for toolchangers (#6946)
added extruder:activate_extruder event hook to print_stats.py to update self.last_epos Signed-off-by: Ingo Donasch <ingo@donasch.net>
This commit is contained in:
parent
d25602e88d
commit
2dd73d0431
@ -15,6 +15,11 @@ class PrintStats:
|
||||
self.gcode.register_command(
|
||||
"SET_PRINT_STATS_INFO", self.cmd_SET_PRINT_STATS_INFO,
|
||||
desc=self.cmd_SET_PRINT_STATS_INFO_help)
|
||||
printer.register_event_handler("extruder:activate_extruder",
|
||||
self._handle_activate_extruder)
|
||||
def _handle_activate_extruder(self):
|
||||
gc_status = self.gcode_move.get_status()
|
||||
self.last_epos = gc_status['position'].e
|
||||
def _update_filament_usage(self, eventtime):
|
||||
gc_status = self.gcode_move.get_status(eventtime)
|
||||
cur_epos = gc_status['position'].e
|
||||
|
Loading…
x
Reference in New Issue
Block a user