From b96bae8e6ba17153665b3647fc0c8d2a50bd7783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Kr=C3=BCger?= Date: Fri, 13 Apr 2018 15:47:21 +0200 Subject: [PATCH] MLZ: enable the 'setposition' commands in entangle The command 'setposition' wasn't sane declared so the use of one of the devices using this command lead always to a ProgrammingError during the 'describe' command via the server interface. Change-Id: I34a6b07e8f0fbd861496515a5e18d3181ad134d5 Reviewed-on: https://forge.frm2.tum.de/review/17715 Reviewed-by: Enrico Faulhaber Tested-by: Enrico Faulhaber --- secop_mlz/entangle.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/secop_mlz/entangle.py b/secop_mlz/entangle.py index 02ce5f5..0e609d1 100644 --- a/secop_mlz/entangle.py +++ b/secop_mlz/entangle.py @@ -397,6 +397,13 @@ class Sensor(AnalogInput): # note: we don't transport the formula to secop.... # we support the adjust method + CMDS = { + 'setposition' : CMD('Set the position to the given value.', + arguments=[FloatRange()], + result=None + ), + } + def do_setposition(self, value): self._dev.Adjust(value) @@ -580,6 +587,13 @@ class Actuator(AnalogOutput): poll=30), } + CMDS = { + 'setposition' : CMD('Set the position to the given value.', + arguments=[FloatRange()], + result=None + ), + } + def read_speed(self, maxage=0): return self._dev.speed @@ -593,8 +607,8 @@ class Actuator(AnalogOutput): self.write_speed(value / 60.) return self.read_speed(0) * 60 -# def do_setposition(self, value=FloatRange()): -# self._dev.Adjust(value) + def do_setposition(self, value=FloatRange()): + self._dev.Adjust(value) class Motor(Actuator):