fix(smaract): ensure setpoint is in sync after restart
CI for csaxs_bec / test (push) Failing after 1m57s
CI for csaxs_bec / test (pull_request) Failing after 1m56s

This commit is contained in:
2026-04-09 13:39:42 +02:00
parent a93b737be1
commit 2ad321ada8
+12 -1
View File
@@ -43,7 +43,10 @@ class SmaractReadbackSignal(SmaractSignalRO):
class SmaractSetpointSignal(SmaractSignalBase):
setpoint = 0
def __init__(self, signal_name, **kwargs):
super().__init__(signal_name, **kwargs)
self.setpoint = 0
@threadlocked
def _socket_get(self):
@@ -156,6 +159,14 @@ class SmaractMotor(Device, PositionerBase):
def wait_for_connection(self, timeout: float = 30.0) -> bool:
self.controller.on(timeout=timeout)
self._update_setpoint_from_readback()
def _update_setpoint_from_readback(self):
"""
The setpoint is only stored locally. After a restart,
we need to update it to match the current readback value.
"""
self.user_setpoint.setpoint = self.readback.get()
def destroy(self):
"""Make sure to turn off the controller socket on destroy."""