You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The area detectors behave sort of differently during startup. As I understand it, given the number of PVs usually associated with these devices, ophyd intentionally tries to do a lazy startup of them. However, the devices will try to connect to any EpicsSignal that is handled during __init__ calls. For example, something like self._acquisition_signal = self.cam.acquire will require the self.cam.acquire connection, and will use the default PV connection timeout for it.
So, the way that we load the devices and wait for connection (using device.wait_for_connection(timeout)) doesn't really apply for area detectors because 1) wait_for_connection doesn't really test much in these devices, and 2) it already waits for the __init__ PVs during the load.
The text was updated successfully, but these errors were encountered:
I think Ophyd-async solved this by getting rid of lazy signals. Also, no signals get connected during __init__.
Instead, after creating the detector device, you need to await the detector device's connect() method, which establishes all the CA connections, etc.
detector=SimDetector(prefix="25idSimDet:", name="sim_detector") # <- No connections yetawaitdetector.connect(). # <- Establish CA connections, etc.
I suspect the initial reason for doing the lazy signals was to speed up the loading of devices. In ophyd-async, this is done either by using asyncio.gather to connect multiple devices, or (even better) using theophyd_async.core.init_devices context manager:
withinit_devices():
sim_detector=SimDetector("25idSimDet:")
mono_camera=AravisDetector("25idGigEA:")
# Devices get connected concurrently when exiting the context manager
The area detectors behave sort of differently during startup. As I understand it, given the number of PVs usually associated with these devices, ophyd intentionally tries to do a lazy startup of them. However, the devices will try to connect to any EpicsSignal that is handled during
__init__
calls. For example, something likeself._acquisition_signal = self.cam.acquire
will require theself.cam.acquire
connection, and will use the default PV connection timeout for it.So, the way that we load the devices and wait for connection (using
device.wait_for_connection(timeout)
) doesn't really apply for area detectors because 1) wait_for_connection doesn't really test much in these devices, and 2) it already waits for the__init__
PVs during the load.The text was updated successfully, but these errors were encountered: