fix: initialize setpoint to 0.0 and update from readback after connection
CI for csaxs_bec / test (push) Failing after 1m55s
CI for csaxs_bec / test (pull_request) Failing after 1m55s

This commit is contained in:
2026-04-09 15:21:46 +02:00
parent 0f0ec8e864
commit 5422d78bae
8 changed files with 64 additions and 6 deletions
+4 -1
View File
@@ -381,7 +381,10 @@ class GalilReadbackSignal(GalilSignalRO):
class GalilSetpointSignal(GalilSignalBase):
setpoint = 0
def __init__(self, signal_name, **kwargs):
super().__init__(signal_name, **kwargs)
self.setpoint = 0.0
def _socket_get(self) -> float:
"""Get command for receiving the setpoint / target value.
@@ -262,6 +262,14 @@ class LamniGalilMotor(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."""
@@ -326,6 +326,14 @@ class OMNYGalilMotor(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."""
+12 -1
View File
@@ -388,7 +388,10 @@ class GalilReadbackSignal(GalilSignalRO):
class GalilSetpointSignal(GalilSignalBase):
setpoint = 0
def __init__(self, signal_name, **kwargs):
super().__init__(signal_name, **kwargs)
self.setpoint = 0.0
def _socket_get(self) -> float:
"""Get command for receiving the setpoint / target value.
@@ -532,6 +535,14 @@ class SGalilMotor(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."""
+8 -1
View File
@@ -490,7 +490,6 @@ class RtFlomniReadbackSignal(RtReadbackSignal):
class RtFlomniSetpointSignal(RtSetpointSignal):
setpoint = 0
@retry_once
@threadlocked
@@ -605,6 +604,14 @@ class RtFlomniMotor(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."""
+12 -1
View File
@@ -554,7 +554,10 @@ class RtLamniReadbackSignal(RtLamniSignalRO):
class RtLamniSetpointSignal(RtLamniSignalBase):
setpoint = 0
def __init__(self, signal_name, **kwargs):
super().__init__(signal_name, **kwargs)
self.setpoint = 0.0
def _socket_get(self) -> float:
"""Get command for receiving the setpoint / target value.
@@ -676,6 +679,14 @@ class RtLamniMotor(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."""
+8 -1
View File
@@ -1020,7 +1020,6 @@ class RtOMNYReadbackSignal(RtReadbackSignal):
class RtOMNYSetpointSignal(RtSetpointSignal):
setpoint = 0
@retry_once
@threadlocked
@@ -1121,6 +1120,14 @@ class RtOMNYMotor(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."""
+4 -1
View File
@@ -81,7 +81,10 @@ class RtReadbackSignal(RtSignalRO):
class RtSetpointSignal(RtSignalBase):
setpoint = 0
def __init__(self, signal_name, **kwargs):
super().__init__(signal_name, **kwargs)
self.setpoint = 0.0
def _socket_get(self) -> float:
"""Get command for receiving the setpoint / target value.