mirror of
https://github.com/Klipper3d/klipper.git
synced 2026-01-04 13:57:45 -07: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
1 changed files with 5 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue