mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-12 17:27:54 -06:00
toolhead: Add a manual_move() helper function
Add a helper function for submitting relative movements. This function will also automatically ensure gcode.reset_last_position() is called. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
b9ac6d6306
commit
2caaaea9a4
6 changed files with 34 additions and 55 deletions
|
@ -413,6 +413,13 @@ class ToolHead:
|
|||
self.move_queue.add_move(move)
|
||||
if self.print_time > self.need_check_stall:
|
||||
self._check_stall()
|
||||
def manual_move(self, coord, speed):
|
||||
curpos = list(self.commanded_pos)
|
||||
for i in range(len(coord)):
|
||||
if coord[i] is not None:
|
||||
curpos[i] = coord[i]
|
||||
self.move(curpos, speed)
|
||||
self.printer.send_event("toolhead:manual_move")
|
||||
def dwell(self, delay):
|
||||
next_print_time = self.get_last_move_time() + max(0., delay)
|
||||
self._update_move_time(next_print_time)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue