aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/print_stats.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-08-05 11:43:45 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-08-20 21:03:22 -0400
commit4c5e93d51dca2393946a67646499fef5fdd034b0 (patch)
tree5450c95a3aa8fe5554dad97df2adf9b2b05c1a64 /klippy/extras/print_stats.py
parentcd7c1b8e68d8234524149c62e8ea2ad0bda07d2f (diff)
downloadkutter-4c5e93d51dca2393946a67646499fef5fdd034b0.tar.gz
kutter-4c5e93d51dca2393946a67646499fef5fdd034b0.tar.xz
kutter-4c5e93d51dca2393946a67646499fef5fdd034b0.zip
gcode: Split G0/G1 command handling to new gcode_move class
Split up the main GCodeParser class into GCodeDispatch and GCodeMove classes. The GCodeMove class is now available using the "gcode_move" printer object name. This split simplifies the gcode.py code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/print_stats.py')
-rw-r--r--klippy/extras/print_stats.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/klippy/extras/print_stats.py b/klippy/extras/print_stats.py
index 1a3fcb22..67bb2f33 100644
--- a/klippy/extras/print_stats.py
+++ b/klippy/extras/print_stats.py
@@ -7,11 +7,11 @@
class PrintStats:
def __init__(self, config):
printer = config.get_printer()
- self.gcode = printer.lookup_object('gcode')
+ self.gcode_move = printer.lookup_object('gcode_move')
self.reactor = printer.get_reactor()
self.reset()
def _update_filament_usage(self, eventtime):
- gc_status = self.gcode.get_status(eventtime)
+ gc_status = self.gcode_move.get_status(eventtime)
cur_epos = gc_status['position'].e
self.filament_used += (cur_epos - self.last_epos) \
/ gc_status['extrude_factor']
@@ -29,7 +29,7 @@ class PrintStats:
self.prev_pause_duration += pause_duration
self.last_pause_time = None
# Reset last e-position
- gc_status = self.gcode.get_status(curtime)
+ gc_status = self.gcode_move.get_status(curtime)
self.last_epos = gc_status['position'].e
self.state = "printing"
self.error_message = ""