From 4115a77342239bfbef3be2463e3ba6b5c3616167 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 16 Aug 2020 22:02:23 -0400 Subject: 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 --- klippy/kinematics/cartesian.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'klippy/kinematics/cartesian.py') diff --git a/klippy/kinematics/cartesian.py b/klippy/kinematics/cartesian.py index df57edce..3dfd8fc5 100644 --- a/klippy/kinematics/cartesian.py +++ b/klippy/kinematics/cartesian.py @@ -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) -- cgit v1.2.3-70-g09d2