From 6ab253366cca1b5d2d8e9dec6ea243c0853612f7 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 10 Jan 2025 11:58:26 -0500 Subject: force_move: Use strings for axes to clear in clear_homing_state() Pass a string such as "xyz" to kin.clear_homing_state(). This makes the parameter a little less cryptic. Signed-off-by: Kevin O'Connor --- klippy/extras/force_move.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'klippy/extras/force_move.py') diff --git a/klippy/extras/force_move.py b/klippy/extras/force_move.py index 0b2187fd..24783c2c 100644 --- a/klippy/extras/force_move.py +++ b/klippy/extras/force_move.py @@ -131,11 +131,10 @@ 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', '').upper() - axes = ['X', 'Y', 'Z'] - clear_axes = [axes.index(a) for a in axes if a in clear] + 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, ','.join((axes[i] for i in clear_axes))) + x, y, z, clear_axes) toolhead.set_position([x, y, z, curpos[3]], homing_axes="xyz") toolhead.get_kinematics().clear_homing_state(clear_axes) -- cgit v1.2.3-70-g09d2