diff --git a/superxas_bec/devices/test_script_ophyd.py b/superxas_bec/devices/test_script_ophyd.py index 0b2f783..ab36c92 100644 --- a/superxas_bec/devices/test_script_ophyd.py +++ b/superxas_bec/devices/test_script_ophyd.py @@ -32,6 +32,14 @@ def state_changed_callback(*, value, old_value, **kwargs): return False +def acquire_stoped(*, value, old_value, **kwargs): + """Callback for acquisition stop.""" + if value == 0: + print("Acquisition stopped.") + return True + return False + + if __name__ == "__main__": # Create an instance of the dummy device print("Initializing DummyDevice...") @@ -41,6 +49,9 @@ if __name__ == "__main__": device.wait_for_connection(timeout=50, all_signals=True) print(f"Device initialized in {time.time() - time_started:.2f} seconds.") + status = SubscriptionStatus(device.xmap_acquiring, acquire_stoped) + device.xmap_stop.put(1) + status.wait(timeout=5) for i in range(500): start_time = time.time()