Note
Ophyd async is included on a provisional basis until the v1.0 release and may change API on minor release numbers before then
ophyd_async.core.StandardReadable#
- class ophyd_async.core.StandardReadable(name: str = '')[source]#
Bases:
Device
,AsyncReadable
,AsyncConfigurable
,AsyncStageable
,HasHints
Device that owns its children and provides useful default behavior.
When its name is set it renames child Devices
Signals can be registered for read() and read_configuration()
These signals will be subscribed for read() between stage() and unstage()
Methods
Context manager to wrap adding Devices
Add the given devices to the lists of known Devices
Connect self and all child Devices.
Set
self.name=name
and eachself.child.name=name+"-child"
.- param read:
Signals to make up
read()
Attributes
- set_readable_signals(read: Sequence[SignalR] = (), config: Sequence[SignalR] = (), read_uncached: Sequence[SignalR] = ())[source]#
- Parameters:
read – Signals to make up
read()
conf – Signals to make up
read_configuration()
read_uncached – Signals to make up
read()
that won’t be cached
- add_children_as_readables(wrapper: Callable[[AsyncReadable | AsyncConfigurable | AsyncStageable | HasHints], AsyncReadable | AsyncConfigurable | AsyncStageable | HasHints] | Type[ConfigSignal] | Type[HintedSignal] | None = None) Generator[None, None, None] [source]#
Context manager to wrap adding Devices
Add Devices to this class instance inside the Context Manager to automatically add them to the correct fields, based on the Device’s interfaces.
The provided wrapper class will be applied to all Devices and can be used to specify their behaviour.
- Parameters:
wrapper – Wrapper class to apply to all Devices created inside the context manager.
- add_readables(devices: Sequence[Device], wrapper: Callable[[AsyncReadable | AsyncConfigurable | AsyncStageable | HasHints], AsyncReadable | AsyncConfigurable | AsyncStageable | HasHints] | Type[ConfigSignal] | Type[HintedSignal] | None = None) None [source]#
Add the given devices to the lists of known Devices
Add the provided Devices to the relevant fields, based on the Signal’s interfaces.
The provided wrapper class will be applied to all Devices and can be used to specify their behaviour.
- Parameters:
devices – The devices to be added
wrapper – Wrapper class to apply to all Devices created inside the context manager.
- async connect(mock: bool = False, timeout: float = 10.0, force_reconnect: bool = False)#
Connect self and all child Devices.
Contains a timeout that gets propagated to child.connect methods.
- Parameters:
mock – If True then use
MockSignalBackend
for all Signalstimeout – Time to wait before failing with a TimeoutError.
- property log#