From 1fd3f21436a53375a59035486cf3d2e1a6035bbb Mon Sep 17 00:00:00 2001 From: "Wolfgang Draxinger (root@gar-ex-erdastep)" Date: Fri, 9 Dec 2011 22:29:15 +0100 Subject: rpyc too laggy --- MotionControl/Axis.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'MotionControl/Axis.py') diff --git a/MotionControl/Axis.py b/MotionControl/Axis.py index 4d669c5..d137d54 100644 --- a/MotionControl/Axis.py +++ b/MotionControl/Axis.py @@ -1,8 +1,9 @@ # -*- coding: utf8 -*- class Axis(object): - def __init__(self, inverted = False, scale={}): + def __init__(self, limits=None, inverted = False, scale={}): from blinker import Signal + self.limits = limits self.inverted = inverted self.scale = scale self.position = None @@ -71,6 +72,11 @@ class Axis(object): raise NotImplementedError() def goto_absolute(self, target, speed = None): + if self.limits and (target < min(self.limits) or target > max(self.limits)): + raise ValueError() + self.do_goto_absolute(target, speed) + + def do_goto_absolute(self, target, speed): raise NotImplementedError() def goto_relative(self, offset, speed = None): -- cgit v1.2.3