From 8fd263ca691cb4f91b5a721901687b2f3cc8340d Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 3 Oct 2025 17:29:30 -0400 Subject: [PATCH] toolhead: Add a lookahead.is_empty() helper function Signed-off-by: Kevin O'Connor --- klippy/toolhead.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/klippy/toolhead.py b/klippy/toolhead.py index 386f0620e..f56f0f114 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -126,6 +126,8 @@ class LookAheadQueue: self.junction_flush = LOOKAHEAD_FLUSH_TIME def set_flush_time(self, flush_time): self.junction_flush = flush_time + def is_empty(self): + return not self.queue def get_last(self): if self.queue: return self.queue[-1] @@ -476,8 +478,7 @@ class ToolHead: self.print_time, max(buffer_time, 0.), self.print_stall) def check_busy(self, eventtime): est_print_time = self.mcu.estimated_print_time(eventtime) - lookahead_empty = not self.lookahead.queue - return self.print_time, est_print_time, lookahead_empty + return self.print_time, est_print_time, self.lookahead.is_empty() def get_status(self, eventtime): print_time = self.print_time estimated_print_time = self.mcu.estimated_print_time(eventtime)