aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/gcode.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-11-18 11:27:16 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-11-18 14:04:09 -0500
commit781cf608d778798c976d3cb4edb6ea6b028b66e1 (patch)
treee445d528351148788e634c907740fe944a2a0fa1 /klippy/gcode.py
parent9e1059afb46c9df439211d21590da987b32e2963 (diff)
downloadkutter-781cf608d778798c976d3cb4edb6ea6b028b66e1.tar.gz
kutter-781cf608d778798c976d3cb4edb6ea6b028b66e1.tar.xz
kutter-781cf608d778798c976d3cb4edb6ea6b028b66e1.zip
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>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r--klippy/gcode.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py
index 97f88563..5262676a 100644
--- a/klippy/gcode.py
+++ b/klippy/gcode.py
@@ -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