aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/toolhead.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-09-27 19:21:26 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-09-27 19:21:26 -0400
commit6469cce2bca855d52f44dd596941423a674af8df (patch)
tree6e86f2425e669401053f3bbca302c29cc4d5e6fd /klippy/toolhead.py
parent4c40b50fb5dfbdfe49c6cc242cdea29b9d0d3f85 (diff)
downloadkutter-6469cce2bca855d52f44dd596941423a674af8df.tar.gz
kutter-6469cce2bca855d52f44dd596941423a674af8df.tar.xz
kutter-6469cce2bca855d52f44dd596941423a674af8df.zip
toolhead: Make sure reset_print_time() doesn't go backwards in time
Update the homing code to pass in the start of the homing operation to toolhead.reset_print_time(). This prevents an error when batch processing gcode files that contain multiple homing operations. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/toolhead.py')
-rw-r--r--klippy/toolhead.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py
index 33814674..676364dd 100644
--- a/klippy/toolhead.py
+++ b/klippy/toolhead.py
@@ -257,9 +257,10 @@ class ToolHead:
def get_last_move_time(self):
self._flush_lookahead()
return self.get_next_move_time()
- def reset_print_time(self):
+ def reset_print_time(self, min_print_time=0.):
self._flush_lookahead(must_sync=True)
- self.print_time = self.mcu.estimated_print_time(self.reactor.monotonic())
+ self.print_time = max(min_print_time, self.mcu.estimated_print_time(
+ self.reactor.monotonic()))
def _check_stall(self):
eventtime = self.reactor.monotonic()
if self.sync_print_time: