aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--klippy/extras/print_stats.py4
-rw-r--r--klippy/gcode.py5
2 files changed, 3 insertions, 6 deletions
diff --git a/klippy/extras/print_stats.py b/klippy/extras/print_stats.py
index 7d6dd718..1a3fcb22 100644
--- a/klippy/extras/print_stats.py
+++ b/klippy/extras/print_stats.py
@@ -12,7 +12,7 @@ class PrintStats:
self.reset()
def _update_filament_usage(self, eventtime):
gc_status = self.gcode.get_status(eventtime)
- cur_epos = gc_status['last_epos']
+ cur_epos = gc_status['position'].e
self.filament_used += (cur_epos - self.last_epos) \
/ gc_status['extrude_factor']
self.last_epos = cur_epos
@@ -30,7 +30,7 @@ class PrintStats:
self.last_pause_time = None
# Reset last e-position
gc_status = self.gcode.get_status(curtime)
- self.last_epos = gc_status['last_epos']
+ self.last_epos = gc_status['position'].e
self.state = "printing"
self.error_message = ""
def note_pause(self):
diff --git a/klippy/gcode.py b/klippy/gcode.py
index 8180e2e9..8db551bd 100644
--- a/klippy/gcode.py
+++ b/klippy/gcode.py
@@ -183,11 +183,8 @@ class GCodeParser:
'extrude_factor': self.extrude_factor,
'absolute_coordinates': self.absolute_coord,
'absolute_extrude': self.absolute_extrude,
- 'last_xpos': self.last_position[0],
- 'last_ypos': self.last_position[1],
- 'last_zpos': self.last_position[2],
- 'last_epos': self.last_position[3],
'homing_origin': homing.Coord(*self.homing_position),
+ 'position': homing.Coord(*self.last_position),
'gcode_position': homing.Coord(*move_position),
}
def dump_state(self):