aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/toolhead.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/toolhead.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/toolhead.py')
-rw-r--r--klippy/toolhead.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py
index 91bcd87f..bc0356dc 100644
--- a/klippy/toolhead.py
+++ b/klippy/toolhead.py
@@ -259,16 +259,15 @@ class ToolHead:
self.extruder.check_move(move)
self.commanded_pos[:] = newpos
self.move_queue.add_move(move)
- def home(self, axes):
- homing = self.kin.home(self, axes)
- def axes_update(axes):
+ def home(self, homing_state):
+ self.kin.home(homing_state)
+ def axes_update(homing_state):
pos = self.get_position()
homepos = self.kin.get_homed_position()
- for axis in axes:
+ for axis in homing_state.get_axes():
pos[axis] = homepos[axis]
self.set_position(pos)
- homing.plan_axes_update(axes_update)
- return homing
+ homing_state.plan_axes_update(axes_update)
def dwell(self, delay):
self.get_last_move_time()
self.update_move_time(delay)