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>
This commit is contained in:
Kevin O'Connor
2020-08-16 22:02:23 -04:00
parent 560d48dbc9
commit 4115a77342
8 changed files with 3 additions and 9 deletions

View File

@@ -136,10 +136,8 @@ class CartKinematics:
self.limits[dc_axis] = dc_rail.get_range()
cmd_SET_DUAL_CARRIAGE_help = "Set which carriage is active"
def cmd_SET_DUAL_CARRIAGE(self, gcmd):
gcode = self.printer.lookup_object('gcode')
carriage = gcmd.get_int('CARRIAGE', minval=0, maxval=1)
self._activate_carriage(carriage)
gcode.reset_last_position()
def load_kinematics(toolhead, config):
return CartKinematics(toolhead, config)