toolhead: Simplify _advance_flush_time() sg_flush_time calculation

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2023-12-26 11:35:27 -05:00
parent fe56bf36c9
commit 644f7e0872
1 changed files with 3 additions and 2 deletions

View File

@ -283,8 +283,9 @@ class ToolHead:
def _advance_flush_time(self, flush_time): def _advance_flush_time(self, flush_time):
flush_time = max(flush_time, self.last_flush_time) flush_time = max(flush_time, self.last_flush_time)
# Generate steps via itersolve # Generate steps via itersolve
sg_flush_ceil = max(flush_time, self.print_time - self.kin_flush_delay) sg_flush_want = min(flush_time + STEPCOMPRESS_FLUSH_TIME,
sg_flush_time = min(flush_time + STEPCOMPRESS_FLUSH_TIME, sg_flush_ceil) self.print_time - self.kin_flush_delay)
sg_flush_time = max(sg_flush_want, flush_time)
for sg in self.step_generators: for sg in self.step_generators:
sg(sg_flush_time) sg(sg_flush_time)
self.last_sg_flush_time = sg_flush_time self.last_sg_flush_time = sg_flush_time