diff options
author | Wolfgang Draxinger (root@gar-ex-erdastep) <Wolfgang.Draxinger@physik.uni-muenchen.de> | 2011-12-09 22:29:15 +0100 |
---|---|---|
committer | Wolfgang Draxinger (root@gar-ex-erdastep) <Wolfgang.Draxinger@physik.uni-muenchen.de> | 2011-12-09 22:29:15 +0100 |
commit | 1fd3f21436a53375a59035486cf3d2e1a6035bbb (patch) | |
tree | 598acab8cfb2883571f875c29abc0bc197433d92 /MotionControl/Service.py | |
parent | 4b19fc744937e53c8689733f25dedf80fa8fd396 (diff) | |
download | PyMotionControl-1fd3f21436a53375a59035486cf3d2e1a6035bbb.tar.gz PyMotionControl-1fd3f21436a53375a59035486cf3d2e1a6035bbb.tar.bz2 |
rpyc too laggy
Diffstat (limited to 'MotionControl/Service.py')
-rw-r--r-- | MotionControl/Service.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/MotionControl/Service.py b/MotionControl/Service.py new file mode 100644 index 0000000..241d141 --- /dev/null +++ b/MotionControl/Service.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +import rpyc + +class Service(rpyc.Service): + stage = None + def on_connect(self): + Service.stage.onPositionChanged.connect(self.onPosition) + + for i,p in enumerate(Service.stage.position): + self.onPosition(None, i, p) + + def on_disconnect(self): + Service.stage.onPositionChanged.disconnect(self.onPosition) + + def onPosition(self, sender, axis, position): + rpyc.async(self._conn.root.onPosition)(axis, position) + + def exposed_set_destination(self, destination): + Service.stage.set_destination(destination) + def exposed_cycle_start(self): + Service.stage.cycle_start() + def exposed_abort(self): + Service.stage.abort() + + def exposed_reference(self): + Service.stage.reference() + + def exposed_getAxisLimits(self, axis): + return Service.stage.axes[axis].limits + |