Skip to content

Commit

Permalink
klippy: assess review feedback for CLEAR
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Marttinen <[email protected]>
  • Loading branch information
twelho committed Jan 9, 2025
1 parent 8b1dd20 commit f4eeb6b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
7 changes: 2 additions & 5 deletions klippy/extras/force_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,8 @@ def cmd_SET_KINEMATIC_POSITION(self, gcmd):
clear_axes = [axes.index(a) for a in axes 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)))
toolhead.set_position(
[x, y, z, curpos[3]],
homing_axes=(0, 1, 2),
clear_axes=clear_axes
)
toolhead.set_position([x, y, z, curpos[3]], homing_axes=(0, 1, 2))
toolhead.get_kinematics().clear_homing_state(clear_axes)

def load_config(config):
return ForceMove(config)
2 changes: 1 addition & 1 deletion klippy/extras/manual_stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def flush_step_generation(self):
self.sync_print_time()
def get_position(self):
return [self.rail.get_commanded_position(), 0., 0., 0.]
def set_position(self, newpos, homing_axes=()):
def set_position(self, newpos):
self.do_set_position(newpos[0])
def get_last_move_time(self):
self.sync_print_time()
Expand Down
3 changes: 1 addition & 2 deletions klippy/extras/safe_z_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ def cmd_G28(self, gcmd):
toolhead.set_position(pos, homing_axes=[2])
toolhead.manual_move([None, None, self.z_hop],
self.z_hop_speed)
if hasattr(toolhead.get_kinematics(), "clear_homing_state"):
toolhead.get_kinematics().clear_homing_state((2,))
toolhead.get_kinematics().clear_homing_state((2,))
elif pos[2] < self.z_hop:
# If the Z axis is homed, and below z_hop, lift it to z_hop
toolhead.manual_move([None, None, self.z_hop],
Expand Down
3 changes: 1 addition & 2 deletions klippy/toolhead.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,13 @@ def _flush_handler(self, eventtime):
# Movement commands
def get_position(self):
return list(self.commanded_pos)
def set_position(self, newpos, homing_axes=(), clear_axes=()):
def set_position(self, newpos, homing_axes=()):
self.flush_step_generation()
ffi_main, ffi_lib = chelper.get_ffi()
ffi_lib.trapq_set_position(self.trapq, self.print_time,
newpos[0], newpos[1], newpos[2])
self.commanded_pos[:] = newpos
self.kin.set_position(newpos, homing_axes)
self.kin.clear_homing_state(clear_axes)
self.printer.send_event("toolhead:set_position")
def limit_next_junction_speed(self, speed):
last_move = self.lookahead.get_last()
Expand Down

0 comments on commit f4eeb6b

Please sign in to comment.