Lima: reading/setting image ROI fail if the detector is not ON
lima.image.roi
is supposed to be a BLISS knowledge.
If you ask for a flip when the detector is OFF, you get the values
DEMO_SESSION [4]: lima_simulator.image.flip
Out [4]: [False, False]
But it's not the case with image.roi
.
DEMO_SESSION [2]: lima_simulator.image.roi
!!! === AttributeError: image_width === !!! ( for more details type cmd 'last_error' )
DEMO_SESSION [3]: last_error
Out [3]: 11/07/2023 19:53:48 Traceback (most recent call last):
File "/nobackup/lvalls1/valls/workspace/daiquiri-tomo.git/bliss.git/bliss/common/tango.py", line 202, in __getattr__
self.__wrapped__.ping()
File "/nobackup/lvalls1/valls/Software/miniconda3/envs/tomodemo-bliss-env/lib/python3.7/site-packages/tango/green.py", line 195, in greener
return executor.run(fn, args, kwargs, wait=wait, timeout=timeout)
File "/nobackup/lvalls1/valls/Software/miniconda3/envs/tomodemo-bliss-env/lib/python3.7/site-packages/tango/green.py", line 114, in run
return self.access(accessor, timeout=timeout)
File "/nobackup/lvalls1/valls/Software/miniconda3/envs/tomodemo-bliss-env/lib/python3.7/site-packages/tango/gevent_executor.py", line 155, in access
return accessor.get(timeout=timeout)
File "src/gevent/event.py", line 329, in gevent._gevent_cevent.AsyncResult.get
File "src/gevent/event.py", line 359, in gevent._gevent_cevent.AsyncResult.get
File "src/gevent/event.py", line 347, in gevent._gevent_cevent.AsyncResult.get
File "src/gevent/event.py", line 327, in gevent._gevent_cevent.AsyncResult._raise_exception
File "/nobackup/lvalls1/valls/Software/miniconda3/envs/tomodemo-bliss-env/lib/python3.7/site-packages/gevent/_compat.py", line 65, in reraise
raise value.with_traceback(tb)
File "/nobackup/lvalls1/valls/Software/miniconda3/envs/tomodemo-bliss-env/lib/python3.7/site-packages/tango/gevent_executor.py", line 68, in wrapper
return func(*args, **kwargs)
File "/nobackup/lvalls1/valls/Software/miniconda3/envs/tomodemo-bliss-env/lib/python3.7/site-packages/tango/device_proxy.py", line 1502, in __DeviceProxy__ping
return self._ping(*args, **kwargs)
PyTango.DevFailed: DevFailed[
DevError[
desc = Failed to connect to device id00/limaccds/simulator1
The connection request was delayed.
The last connection request was done less than 1000 ms ago
origin = Connection::reconnect
reason = API_CantConnectToDevice
severity = ERR]
]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/nobackup/lvalls1/valls/workspace/daiquiri-tomo.git/bliss.git/bliss/controllers/lima/image.py", line 374, in roi
self._update_roi()
File "/nobackup/lvalls1/valls/workspace/daiquiri-tomo.git/bliss.git/bliss/controllers/lima/image.py", line 416, in _update_roi
detector_size = self._get_detector_max_size()
File "/nobackup/lvalls1/valls/workspace/daiquiri-tomo.git/bliss.git/bliss/controllers/lima/image.py", line 444, in _get_detector_max_size
self._max_width, self._max_height = self._read_detector_max_size()
File "/nobackup/lvalls1/valls/workspace/daiquiri-tomo.git/bliss.git/bliss/controllers/lima/image.py", line 436, in _read_detector_max_size
w = self._proxy.image_width
File "/nobackup/lvalls1/valls/workspace/daiquiri-tomo.git/bliss.git/bliss/common/tango.py", line 204, in __getattr__
raise e from cause
File "/nobackup/lvalls1/valls/workspace/daiquiri-tomo.git/bliss.git/bliss/common/tango.py", line 194, in __getattr__
attr = getattr(self.__wrapped__, name)
File "/nobackup/lvalls1/valls/Software/miniconda3/envs/tomodemo-bliss-env/lib/python3.7/site-packages/tango/device_proxy.py", line 320, in __DeviceProxy__getat
tr
raise AttributeError(name)
AttributeError: image_width
It would be good to have a consistent behavior.
In this case i suggest to return None