aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/gcode.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-07-25 23:47:30 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-07-25 23:47:30 -0400
commit92f81d51f4a88dd6f32a2507e8c3d754c62f4b03 (patch)
tree0d6ad81b8f8e2152e0e7c6a85f773b7f3df0a69d /klippy/gcode.py
parente9c03f2e4a1807de2730de370ea374c4edeea438 (diff)
downloadkutter-92f81d51f4a88dd6f32a2507e8c3d754c62f4b03.tar.gz
kutter-92f81d51f4a88dd6f32a2507e8c3d754c62f4b03.tar.xz
kutter-92f81d51f4a88dd6f32a2507e8c3d754c62f4b03.zip
homing: Move low-level coordinate manipulation to kinematic class
Rework the code so that the kinematic class (currently just cartesian.py) has more control over the homing process. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r--klippy/gcode.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py
index fd377c1c..ad05b0d5 100644
--- a/klippy/gcode.py
+++ b/klippy/gcode.py
@@ -227,19 +227,19 @@ class GCodeParser:
pass
def cmd_G28(self, params):
# Move to origin
- axis = []
- for a in 'XYZ':
- if a in params:
- axis.append(self.axis2pos[a])
- if not axis:
- axis = [0, 1, 2]
- busy_handler = self.toolhead.home(axis)
- def axis_update(axis):
+ axes = []
+ for axis in 'XYZ':
+ if axis in params:
+ axes.append(self.axis2pos[axis])
+ if not axes:
+ axes = [0, 1, 2]
+ busy_handler = self.toolhead.home(axes)
+ def axes_update(axes):
newpos = self.toolhead.get_position()
- for a in axis:
- self.last_position[a] = newpos[a]
- self.base_position[a] = -self.homing_add[a]
- busy_handler.plan_axis_update(axis_update)
+ for axis in 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)
def cmd_G90(self, params):
# Use absolute coordinates