mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2025-07-09 02:08:04 +02:00
fix: add run._subs SUB_VALUE to settable signal put method
This commit is contained in:
@ -83,6 +83,7 @@ class SimMonitorAsyncPrepare(CustomDetectorMixin):
|
|||||||
self._random_send_interval = None
|
self._random_send_interval = None
|
||||||
self._counter = 0
|
self._counter = 0
|
||||||
self.prep_random_interval()
|
self.prep_random_interval()
|
||||||
|
self.parent.current_trigger.subscribe(self._progress_update, run=False)
|
||||||
|
|
||||||
def clear_buffer(self):
|
def clear_buffer(self):
|
||||||
"""Clear the data buffer."""
|
"""Clear the data buffer."""
|
||||||
@ -99,7 +100,6 @@ class SimMonitorAsyncPrepare(CustomDetectorMixin):
|
|||||||
"""Prepare the device for staging."""
|
"""Prepare the device for staging."""
|
||||||
self.clear_buffer()
|
self.clear_buffer()
|
||||||
self.prep_random_interval()
|
self.prep_random_interval()
|
||||||
self.parent.current_trigger.subscribe(self._progress_update, run=False)
|
|
||||||
|
|
||||||
def on_complete(self):
|
def on_complete(self):
|
||||||
"""Prepare the device for completion."""
|
"""Prepare the device for completion."""
|
||||||
@ -135,7 +135,7 @@ class SimMonitorAsyncPrepare(CustomDetectorMixin):
|
|||||||
if self._counter % self._random_send_interval == 0:
|
if self._counter % self._random_send_interval == 0:
|
||||||
self._send_data_to_bec()
|
self._send_data_to_bec()
|
||||||
|
|
||||||
def _progress_update(self, value: int):
|
def _progress_update(self, value: int, **kwargs):
|
||||||
"""Update the progress of the device."""
|
"""Update the progress of the device."""
|
||||||
max_value = self.parent.scaninfo.num_points
|
max_value = self.parent.scaninfo.num_points
|
||||||
self.parent._run_subs(
|
self.parent._run_subs(
|
||||||
|
@ -34,6 +34,8 @@ class SetableSignal(Signal):
|
|||||||
precision (float) : Precision of the signal, default PRECISION.
|
precision (float) : Precision of the signal, default PRECISION.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
SUB_VALUE = "value"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
name: str,
|
name: str,
|
||||||
@ -84,6 +86,7 @@ class SetableSignal(Signal):
|
|||||||
"""
|
"""
|
||||||
self._update_sim_state(value)
|
self._update_sim_state(value)
|
||||||
self._value = value
|
self._value = value
|
||||||
|
self._run_subs(sub_type=self.SUB_VALUE, value=value)
|
||||||
|
|
||||||
def describe(self):
|
def describe(self):
|
||||||
"""Describe the readback signal.
|
"""Describe the readback signal.
|
||||||
|
Reference in New Issue
Block a user