cartesian: Enforce endstop min and max boundaries

Verify that each move command is within range of the configured
minimum and maximum for each axis.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-09-30 16:00:32 -04:00
parent 275b386856
commit b53da365a1
4 changed files with 32 additions and 3 deletions

View file

@ -90,3 +90,11 @@ class QueryEndstops:
msg = "TRIGGERED"
msgs.append("%s:%s" % (name, msg))
return " ".join(msgs)
class EndstopError(Exception):
def __init__(self, pos, msg="Move out of range"):
self.pos = pos
self.msg = msg
def __str__(self):
return "%s: %.3f %.3f %.3f [%.3f]" % (
self.msg, self.pos[0], self.pos[1], self.pos[2], self.pos[3])