diff options
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/extras/force_move.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/klippy/extras/force_move.py b/klippy/extras/force_move.py index 24783c2c..ad27f95c 100644 --- a/klippy/extras/force_move.py +++ b/klippy/extras/force_move.py @@ -131,12 +131,19 @@ class ForceMove: x = gcmd.get_float('X', curpos[0]) y = gcmd.get_float('Y', curpos[1]) z = gcmd.get_float('Z', curpos[2]) - clear = gcmd.get('CLEAR', '').lower() - clear_axes = "".join([a for a in "xyz" if a in clear]) - logging.info("SET_KINEMATIC_POSITION pos=%.3f,%.3f,%.3f clear=%s", - x, y, z, clear_axes) - toolhead.set_position([x, y, z, curpos[3]], homing_axes="xyz") - toolhead.get_kinematics().clear_homing_state(clear_axes) + set_homed = gcmd.get('SET_HOMED', 'xyz').lower() + set_homed_axes = "".join([a for a in "xyz" if a in set_homed]) + if gcmd.get('CLEAR_HOMED', None) is None: + # "CLEAR" is an alias for "CLEAR_HOMED"; should deprecate + clear_homed = gcmd.get('CLEAR', '').lower() + else: + clear_homed = gcmd.get('CLEAR_HOMED', '') + clear_homed_axes = "".join([a for a in "xyz" if a in clear_homed]) + logging.info("SET_KINEMATIC_POSITION pos=%.3f,%.3f,%.3f" + " set_homed=%s clear_homed=%s", + x, y, z, set_homed_axes, clear_homed_axes) + toolhead.set_position([x, y, z, curpos[3]], homing_axes=set_homed_axes) + toolhead.get_kinematics().clear_homing_state(clear_homed_axes) def load_config(config): return ForceMove(config) |