diff --git a/klippy/extras/motion_queuing.py b/klippy/extras/motion_queuing.py index 20473503c..e1a0d7fcc 100644 --- a/klippy/extras/motion_queuing.py +++ b/klippy/extras/motion_queuing.py @@ -54,6 +54,8 @@ class PrinterMotionQueuing: self.do_kick_flush_timer = True self.last_flush_time = self.last_step_gen_time = 0. self.need_flush_time = self.need_step_gen_time = 0. + # "Drip" timing (for homing and probing moves) + self.drip_start_times = [] # Register handlers printer.register_event_handler("klippy:shutdown", self._handle_shutdown) # C trapq tracking @@ -245,7 +247,9 @@ class PrinterMotionQueuing: if self.do_kick_flush_timer: self.do_kick_flush_timer = False self.reactor.update_timer(self.flush_timer, self.reactor.NOW) + # "Drip" timing (for homing and probing moves) def drip_update_time(self, start_time, end_time, drip_completion): + self.drip_start_times.append(start_time) self._await_flush_time(start_time) # Disable background flushing from timer self.reactor.update_timer(self.flush_timer, self.reactor.NEVER) @@ -269,6 +273,11 @@ class PrinterMotionQueuing: # Restore background flushing self.reactor.update_timer(self.flush_timer, self.reactor.NOW) self._advance_flush_time(flush_time + self.kin_flush_delay) + self.drip_start_times.remove(start_time) + def check_drip_timing(self): + if not self.drip_start_times: + return None + return min(self.drip_start_times) def load_config(config): return PrinterMotionQueuing(config) diff --git a/klippy/extras/motion_report.py b/klippy/extras/motion_report.py index c142fb393..0595bbb94 100644 --- a/klippy/extras/motion_report.py +++ b/klippy/extras/motion_report.py @@ -71,6 +71,7 @@ class DumpTrapQ: self.name = name self.trapq = trapq self.last_batch_msg = (0., 0.) + self.motion_queuing = printer.lookup_object("motion_queuing") self.batch_bulk = bulk_sensor.BatchBulkHelper(printer, self._process_batch) api_resp = {'header': ('time', 'duration', 'start_velocity', @@ -121,6 +122,12 @@ class DumpTrapQ: d = [(m.print_time, m.move_t, m.start_v, m.accel, (m.start_x, m.start_y, m.start_z), (m.x_r, m.y_r, m.z_r)) for m in data] + if d: + start_drip_time = self.motion_queuing.check_drip_timing() + if start_drip_time is not None: + # If homing, delay sending trapq entries that may change + while d and d[-1][0] + d[-1][1] >= start_drip_time: + d.pop() if d and d[0] == self.last_batch_msg: d.pop(0) if not d: