mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-14 18:28:00 -06:00
homing: Create Homing class from gcode
Create the Homing class in the gcode handler instead of in the kinematic classes. This will make it easier to pass error messages back to the user. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
9e1059afb4
commit
781cf608d7
5 changed files with 20 additions and 19 deletions
|
@ -250,14 +250,15 @@ class GCodeParser:
|
|||
axes.append(self.axis2pos[axis])
|
||||
if not axes:
|
||||
axes = [0, 1, 2]
|
||||
busy_handler = self.toolhead.home(axes)
|
||||
def axes_update(axes):
|
||||
homing_state = homing.Homing(self.toolhead, axes)
|
||||
self.toolhead.home(homing_state)
|
||||
def axes_update(homing_state):
|
||||
newpos = self.toolhead.get_position()
|
||||
for axis in axes:
|
||||
for axis in homing_state.get_axes():
|
||||
self.last_position[axis] = newpos[axis]
|
||||
self.base_position[axis] = -self.homing_add[axis]
|
||||
busy_handler.plan_axes_update(axes_update)
|
||||
self.set_busy(busy_handler)
|
||||
homing_state.plan_axes_update(axes_update)
|
||||
self.set_busy(homing_state)
|
||||
def cmd_G90(self, params):
|
||||
# Use absolute coordinates
|
||||
self.absolutecoord = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue