MLZ/entangle: fix AnalogOutput.read_status()

Change-Id: I584cd8f559b6c57f3c73105b28bc533526f6f492
This commit is contained in:
Enrico Faulhaber 2022-11-03 11:17:10 +01:00 committed by Bjoern Pedersen
parent aa98604f88
commit 355810a887

View File

@ -28,8 +28,7 @@ Here we support devices which fulfill the official
MLZ TANGO interface for the respective device classes. MLZ TANGO interface for the respective device classes.
""" """
# pylint: disable=too-many-lines # pylint: disable=too-many-lines, consider-using-f-string
import re import re
import threading import threading
@ -520,18 +519,18 @@ class AnalogOutput(PyTangoDevice, Drivable):
return stable and at_target return stable and at_target
def read_status(self): def read_status(self):
_st, _sts = super().read_status() status = super().read_status()
if _st == Readable.Status.DISABLED: if status[0] in (Readable.Status.DISABLED, Readable.Status.ERROR):
return _st, _sts self.setFastPoll(False)
return status
if self._isAtTarget(): if self._isAtTarget():
self._timeout = None self._timeout = None
self._moving = False self._moving = False
status = super().read_status()
else: else:
if self._timeout and self._timeout < currenttime(): if self._timeout and self._timeout < currenttime():
status = self.Status.UNSTABLE, 'timeout after waiting for stable value' status = self.Status.UNSTABLE, 'timeout after waiting for stable value'
else: elif self._moving:
status = (self.Status.BUSY, 'moving') if self._moving else (self.Status.IDLE, 'stable') status = (self.Status.BUSY, 'moving: ' + status[1])
self.setFastPoll(self.isBusy(status)) self.setFastPoll(self.isBusy(status))
return status return status