aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/toolhead.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-08-16 22:02:23 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-08-20 21:03:22 -0400
commit4115a77342239bfbef3be2463e3ba6b5c3616167 (patch)
treebfe930fb3fca2db45b3a78e5ed4943dde29fe2ab /klippy/toolhead.py
parent560d48dbc9bbea51c317ebeef92f9262d31923f1 (diff)
downloadkutter-4115a77342239bfbef3be2463e3ba6b5c3616167.tar.gz
kutter-4115a77342239bfbef3be2463e3ba6b5c3616167.tar.xz
kutter-4115a77342239bfbef3be2463e3ba6b5c3616167.zip
gcode: Automatically call reset_last_position() on a toolhead set_position()
Generate a "toolhead:set_position" event on a call to toolhead.set_position() and use that event to automatically call gcode.reset_last_position(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/toolhead.py')
-rw-r--r--klippy/toolhead.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py
index 68c4dfdc..cd083a50 100644
--- a/klippy/toolhead.py
+++ b/klippy/toolhead.py
@@ -400,6 +400,7 @@ class ToolHead:
self.trapq_free_moves(self.trapq, self.reactor.NEVER)
self.commanded_pos[:] = newpos
self.kin.set_position(newpos, homing_axes)
+ self.printer.send_event("toolhead:set_position")
def move(self, newpos, speed):
move = Move(self, self.commanded_pos, newpos, speed)
if not move.move_d: