diff --git a/ophyd_devices/sim/sim_monitor.py b/ophyd_devices/sim/sim_monitor.py index 8326403..f26c5bc 100644 --- a/ophyd_devices/sim/sim_monitor.py +++ b/ophyd_devices/sim/sim_monitor.py @@ -83,6 +83,7 @@ class SimMonitorAsyncPrepare(CustomDetectorMixin): self._random_send_interval = None self._counter = 0 self.prep_random_interval() + self.parent.current_trigger.subscribe(self._progress_update, run=False) def clear_buffer(self): """Clear the data buffer.""" @@ -99,7 +100,6 @@ class SimMonitorAsyncPrepare(CustomDetectorMixin): """Prepare the device for staging.""" self.clear_buffer() self.prep_random_interval() - self.parent.current_trigger.subscribe(self._progress_update, run=False) def on_complete(self): """Prepare the device for completion.""" @@ -135,7 +135,7 @@ class SimMonitorAsyncPrepare(CustomDetectorMixin): if self._counter % self._random_send_interval == 0: self._send_data_to_bec() - def _progress_update(self, value: int): + def _progress_update(self, value: int, **kwargs): """Update the progress of the device.""" max_value = self.parent.scaninfo.num_points self.parent._run_subs( diff --git a/ophyd_devices/sim/sim_signals.py b/ophyd_devices/sim/sim_signals.py index 7364173..554ff2b 100644 --- a/ophyd_devices/sim/sim_signals.py +++ b/ophyd_devices/sim/sim_signals.py @@ -34,6 +34,8 @@ class SetableSignal(Signal): precision (float) : Precision of the signal, default PRECISION. """ + SUB_VALUE = "value" + def __init__( self, name: str, @@ -84,6 +86,7 @@ class SetableSignal(Signal): """ self._update_sim_state(value) self._value = value + self._run_subs(sub_type=self.SUB_VALUE, value=value) def describe(self): """Describe the readback signal.