Commit 437146e9 authored by Jose Tiago Macara Coutinho's avatar Jose Tiago Macara Coutinho
Browse files

tango shutter: fix bug in manual mode

self.manual was an object attribute and method at the same time
parent 5fab899e
......@@ -11,11 +11,12 @@ import time
class tango_shutter:
def __init__(self, name, config):
tango_uri = config.get("uri")
self.name = name
self.__control = DeviceProxy(tango_uri)
try:
self.manual = config.get("attr_mode")
self._manual = config.get("attr_mode")
except:
self.manual = False
self._manual = False
def get_status(self):
print self.__control._status()
......@@ -46,7 +47,7 @@ class tango_shutter:
print self.__control._status()
def automatic(self):
if self.manual:
if self._manual:
state = self.get_state()
if state == 'CLOSE' or state == 'OPEN':
try:
......@@ -58,7 +59,7 @@ class tango_shutter:
print self.__control._status()
def manual(self):
if self.manual:
if self._manual:
state = self.get_state()
if state == 'CLOSE' or state == 'RUNNING':
try:
......@@ -78,7 +79,7 @@ class tango_shutter:
def _wait_mode(self, timeout=3):
tt = time.time()
stat = self.__control.read_attribute(self.manual).value
stat = self.__control.read_attribute(self._manual).value
while stat is False or time.time() - tt < timeout:
time.sleep(1)
stat = self.__control.read_attribute(self.manual).value
stat = self.__control.read_attribute(self._manual).value
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment