aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/toolhead.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-08-16 22:43:03 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-08-20 21:03:22 -0400
commit2caaaea9a4bdd55846cdcf24b0efba60bcdfbd51 (patch)
treeca1d47ac706e350bc2dfdfa0c5553dbd674f6acb /klippy/toolhead.py
parentb9ac6d63069974a90a3740eaf2a3e5ae81e35470 (diff)
downloadkutter-2caaaea9a4bdd55846cdcf24b0efba60bcdfbd51.tar.gz
kutter-2caaaea9a4bdd55846cdcf24b0efba60bcdfbd51.tar.xz
kutter-2caaaea9a4bdd55846cdcf24b0efba60bcdfbd51.zip
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>
Diffstat (limited to 'klippy/toolhead.py')
-rw-r--r--klippy/toolhead.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py
index cd083a50..74b8f282 100644
--- a/klippy/toolhead.py
+++ b/klippy/toolhead.py
@@ -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)