kinematics: Add get_status() method to kinematics

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
This commit is contained in:
Florian Heilmann 2019-08-06 18:19:29 +00:00 committed by KevinOConnor
parent 09f323a038
commit f958542ebb
6 changed files with 19 additions and 0 deletions

View File

@ -124,6 +124,10 @@ class CartKinematics:
for i, rail in enumerate(self.rails): for i, rail in enumerate(self.rails):
if move.axes_d[i]: if move.axes_d[i]:
rail.step_itersolve(move.cmove) 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 # Dual carriage support
def _activate_carriage(self, carriage): def _activate_carriage(self, carriage):
toolhead = self.printer.lookup_object('toolhead') toolhead = self.printer.lookup_object('toolhead')

View File

@ -111,6 +111,10 @@ class CoreXYKinematics:
rail_y.step_itersolve(cmove) rail_y.step_itersolve(cmove)
if axes_d[2]: if axes_d[2]:
rail_z.step_itersolve(cmove) 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): def load_kinematics(toolhead, config):
return CoreXYKinematics(toolhead, config) return CoreXYKinematics(toolhead, config)

View File

@ -150,6 +150,9 @@ class DeltaKinematics:
self._check_motor_enable(print_time) self._check_motor_enable(print_time)
for rail in self.rails: for rail in self.rails:
rail.step_itersolve(move.cmove) rail.step_itersolve(move.cmove)
def get_status(self):
return {'homed_axes': '' if self.need_home else 'XYZ'}
# Helper function for DELTA_CALIBRATE script # Helper function for DELTA_CALIBRATE script
def get_calibrate_params(self): def get_calibrate_params(self):
out = { 'radius': self.radius } out = { 'radius': self.radius }

View File

@ -21,6 +21,8 @@ class NoneKinematics:
pass pass
def move(self, print_time, move): def move(self, print_time, move):
pass pass
def get_status(self):
return {'homed_axes': ''}
def load_kinematics(toolhead, config): def load_kinematics(toolhead, config):
return NoneKinematics(toolhead, config) return NoneKinematics(toolhead, config)

View File

@ -130,6 +130,9 @@ class PolarKinematics:
stepper_bed.set_commanded_position(angle - 2. * math.pi) stepper_bed.set_commanded_position(angle - 2. * math.pi)
if axes_d[2]: if axes_d[2]:
self.rails[1].step_itersolve(cmove) 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): def load_kinematics(toolhead, config):
return PolarKinematics(toolhead, config) return PolarKinematics(toolhead, config)

View File

@ -57,6 +57,9 @@ class WinchKinematics:
self._check_motor_enable(print_time) self._check_motor_enable(print_time)
for s in self.steppers: for s in self.steppers:
s.step_itersolve(move.cmove) 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): def load_kinematics(toolhead, config):
return WinchKinematics(toolhead, config) return WinchKinematics(toolhead, config)