From 577b35f287ec997a41ce27fae2db9bbc669a2d9d Mon Sep 17 00:00:00 2001 From: appel_c Date: Thu, 8 Aug 2024 17:08:38 +0200 Subject: [PATCH] fix: small bugfix to ensure motor_is_moving updates at the end of a move --- ophyd_devices/sim/sim_positioner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ophyd_devices/sim/sim_positioner.py b/ophyd_devices/sim/sim_positioner.py index 34691f3..cc4fb2a 100644 --- a/ophyd_devices/sim/sim_positioner.py +++ b/ophyd_devices/sim/sim_positioner.py @@ -169,7 +169,6 @@ class SimPositioner(Device, PositionerBase): self._update_state(ii) if self._stopped: raise DeviceStopError(f"{self.parent.name} was stopped") - self._update_state(target) st.set_finished() # pylint: disable=broad-except except Exception as exc: @@ -180,6 +179,7 @@ class SimPositioner(Device, PositionerBase): st.set_exception(exc=exc) finally: self._set_sim_state(self.motor_is_moving.name, 0) + self._update_state(target) def move(self, value: float, **kwargs) -> DeviceStatus: """Change the setpoint of the simulated device, and simultaneously initiate a motion.""" @@ -196,9 +196,9 @@ class SimPositioner(Device, PositionerBase): ) self.move_thread.start() else: - self._update_state(value) self._done_moving() self._set_sim_state(self.motor_is_moving.name, 0) + self._update_state(value) st.set_finished() return st