signals#
Lightweight signaling hub used across mesofield.
Every HardwareDevice exposes a
DeviceSignals instance on self.signals so the rest of the
system (e.g. DataManager,
Procedure) can connect uniformly without caring
which backend the device uses.
Four signals form the standard contract:
started()Emitted once the device is actively acquiring / running.
finished()Emitted when the device has stopped on its own (e.g. an MDA sequence completed) or in response to
stop(). Theprimarydevice’sfinishedis what triggersProcedure._cleanup_procedure().data(payload, device_ts)Emitted for every datum that should land on
DataQueue.payloadis the raw sample (frame index, encoder click count, NIDAQ count, …) anddevice_tsis the device-side timestamp (float seconds, optional).frame(img, idx, device_ts)Optional. Emitted by camera-like producers carrying the raw frame array in addition to the lightweight
dataemission. Subscribers use this for real-time processing (seemesofield.processors). Producers without per-sample raw payloads never emit on this signal.
The implementation wraps psygnal so emission is Qt-free, weakly
referenced and thread-safe. GUI code that needs a Qt slot can use
qt_bridge() to forward a psygnal.Signal into a
pyqtSignal.
- class mesofield.signals.DeviceSignals[source]#
Bases:
objectStandard bundle of signals carried by every hardware device.
Defined as instance attributes (not class attributes) so each device owns its own emitters.
psygnal.Signalinstances are descriptors when declared on a class; we instantiate them directly here so they behave as plain emitters on the bundle.