From 355810a887f1ec8bd0f2a7447a6c9fdffa04b604 Mon Sep 17 00:00:00 2001 From: Enrico Faulhaber Date: Thu, 3 Nov 2022 11:17:10 +0100 Subject: [PATCH] MLZ/entangle: fix AnalogOutput.read_status() Change-Id: I584cd8f559b6c57f3c73105b28bc533526f6f492 --- secop_mlz/entangle.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/secop_mlz/entangle.py b/secop_mlz/entangle.py index de715ad..ff09d93 100644 --- a/secop_mlz/entangle.py +++ b/secop_mlz/entangle.py @@ -28,8 +28,7 @@ Here we support devices which fulfill the official 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 threading @@ -520,18 +519,18 @@ class AnalogOutput(PyTangoDevice, Drivable): return stable and at_target def read_status(self): - _st, _sts = super().read_status() - if _st == Readable.Status.DISABLED: - return _st, _sts + status = super().read_status() + if status[0] in (Readable.Status.DISABLED, Readable.Status.ERROR): + self.setFastPoll(False) + return status if self._isAtTarget(): self._timeout = None self._moving = False - status = super().read_status() else: if self._timeout and self._timeout < currenttime(): status = self.Status.UNSTABLE, 'timeout after waiting for stable value' - else: - status = (self.Status.BUSY, 'moving') if self._moving else (self.Status.IDLE, 'stable') + elif self._moving: + status = (self.Status.BUSY, 'moving: ' + status[1]) self.setFastPoll(self.isBusy(status)) return status