aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/kinematics
diff options
context:
space:
mode:
authorFlorian Heilmann <Florian.Heilmann@gmx.net>2019-08-06 18:19:29 +0000
committerKevinOConnor <kevin@koconnor.net>2019-08-09 20:49:17 -0400
commitf958542ebb70ec1138aac2e9acf3b80f2e32aa19 (patch)
tree4de9f0015e7b8f5d18714e2b8ab3818867bd0242 /klippy/kinematics
parent09f323a038e2d99a40c0291f3cc5d4ac85473321 (diff)
downloadkutter-f958542ebb70ec1138aac2e9acf3b80f2e32aa19.tar.gz
kutter-f958542ebb70ec1138aac2e9acf3b80f2e32aa19.tar.xz
kutter-f958542ebb70ec1138aac2e9acf3b80f2e32aa19.zip
kinematics: Add get_status() method to kinematics
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
Diffstat (limited to 'klippy/kinematics')
-rw-r--r--klippy/kinematics/cartesian.py4
-rw-r--r--klippy/kinematics/corexy.py4
-rw-r--r--klippy/kinematics/delta.py3
-rw-r--r--klippy/kinematics/none.py2
-rw-r--r--klippy/kinematics/polar.py3
-rw-r--r--klippy/kinematics/winch.py3
6 files changed, 19 insertions, 0 deletions
diff --git a/klippy/kinematics/cartesian.py b/klippy/kinematics/cartesian.py
index 0aa00f18..a08c3770 100644
--- a/klippy/kinematics/cartesian.py
+++ b/klippy/kinematics/cartesian.py
@@ -124,6 +124,10 @@ class CartKinematics:
for i, rail in enumerate(self.rails):
if move.axes_d[i]:
rail.step_itersolve(move.cmove)
+ def get_status(self):
+ return {'homed_axes': "".join([a
+ for a, (l, h) in zip("XYZ", self.limits) if l <= h])
+ }
# Dual carriage support
def _activate_carriage(self, carriage):
toolhead = self.printer.lookup_object('toolhead')
diff --git a/klippy/kinematics/corexy.py b/klippy/kinematics/corexy.py
index 03580e3e..2470787e 100644
--- a/klippy/kinematics/corexy.py
+++ b/klippy/kinematics/corexy.py
@@ -111,6 +111,10 @@ class CoreXYKinematics:
rail_y.step_itersolve(cmove)
if axes_d[2]:
rail_z.step_itersolve(cmove)
+ def get_status(self):
+ return {'homed_axes': "".join([a
+ for a, (l, h) in zip("XYZ", self.limits) if l <= h])
+ }
def load_kinematics(toolhead, config):
return CoreXYKinematics(toolhead, config)
diff --git a/klippy/kinematics/delta.py b/klippy/kinematics/delta.py
index a84f6852..277d1147 100644
--- a/klippy/kinematics/delta.py
+++ b/klippy/kinematics/delta.py
@@ -150,6 +150,9 @@ class DeltaKinematics:
self._check_motor_enable(print_time)
for rail in self.rails:
rail.step_itersolve(move.cmove)
+ def get_status(self):
+ return {'homed_axes': '' if self.need_home else 'XYZ'}
+
# Helper function for DELTA_CALIBRATE script
def get_calibrate_params(self):
out = { 'radius': self.radius }
diff --git a/klippy/kinematics/none.py b/klippy/kinematics/none.py
index d634ed9d..56cb8310 100644
--- a/klippy/kinematics/none.py
+++ b/klippy/kinematics/none.py
@@ -21,6 +21,8 @@ class NoneKinematics:
pass
def move(self, print_time, move):
pass
+ def get_status(self):
+ return {'homed_axes': ''}
def load_kinematics(toolhead, config):
return NoneKinematics(toolhead, config)
diff --git a/klippy/kinematics/polar.py b/klippy/kinematics/polar.py
index 790ce467..230e67f6 100644
--- a/klippy/kinematics/polar.py
+++ b/klippy/kinematics/polar.py
@@ -130,6 +130,9 @@ class PolarKinematics:
stepper_bed.set_commanded_position(angle - 2. * math.pi)
if axes_d[2]:
self.rails[1].step_itersolve(cmove)
+ def get_status(self):
+ return {'homed_axes': (("XY" if self.limit_xy2 >= 0. else "") +
+ ("Z" if self.limit_z[0] <= self.limit_z[1] else ""))}
def load_kinematics(toolhead, config):
return PolarKinematics(toolhead, config)
diff --git a/klippy/kinematics/winch.py b/klippy/kinematics/winch.py
index 56b7658c..132d0964 100644
--- a/klippy/kinematics/winch.py
+++ b/klippy/kinematics/winch.py
@@ -57,6 +57,9 @@ class WinchKinematics:
self._check_motor_enable(print_time)
for s in self.steppers:
s.step_itersolve(move.cmove)
+ def get_status(self):
+ # XXX - homed_checks and rail limits not implemented
+ return {'homed_axes': 'XYZ'}
def load_kinematics(toolhead, config):
return WinchKinematics(toolhead, config)