mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-08-05 21:14:05 -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
|
@ -46,13 +46,7 @@ class BedScrews:
|
|||
self.cmd_BED_SCREWS_ADJUST,
|
||||
desc=self.cmd_BED_SCREWS_ADJUST_help)
|
||||
def move(self, coord, speed):
|
||||
toolhead = self.printer.lookup_object('toolhead')
|
||||
curpos = toolhead.get_position()
|
||||
for i in range(len(coord)):
|
||||
if coord[i] is not None:
|
||||
curpos[i] = coord[i]
|
||||
toolhead.move(curpos, speed)
|
||||
self.gcode.reset_last_position()
|
||||
self.printer.lookup_object('toolhead').manual_move(coord, speed)
|
||||
def move_to_screw(self, state, screw):
|
||||
# Move up, over, and then down
|
||||
self.move((None, None, self.horizontal_move_z), self.lift_speed)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue