-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
226 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.. note:: | ||
|
||
Ophyd async is included on a provisional basis until the v1.0 release and | ||
may change API on minor release numbers before then | ||
|
||
Compound Devices Together | ||
========================= | ||
|
||
Assembly | ||
-------- | ||
|
||
Compound assemblies can be used to group Devices into larger logical Devices: | ||
|
||
.. literalinclude:: ../../../src/ophyd_async/epics/demo/__init__.py | ||
:pyobject: SampleStage | ||
|
||
This applies prefixes on construction: | ||
|
||
- SampleStage is passed a prefix like ``DEVICE:`` | ||
- SampleStage.x will append its prefix ``X:`` to get ``DEVICE:X:`` | ||
- SampleStage.x.velocity will append its suffix ``Velocity`` to get | ||
``DEVICE:X:Velocity`` | ||
|
||
If SampleStage is further nested in another Device another layer of prefix nesting would occur | ||
|
||
.. note:: | ||
|
||
SampleStage does not pass any signals into its superclass init. This means | ||
that its ``read()`` method will return an empty dictionary. This means you | ||
can ``rd sample_stage.x``, but not ``rd sample_stage``. | ||
|
||
|
||
Grouping by Index | ||
----------------- | ||
|
||
Sometimes, it makes sense to group devices by number, say an array of sensors: | ||
|
||
.. literalinclude:: ../../../src/ophyd_async/epics/demo/__init__.py | ||
:pyobject: SensorGroup | ||
|
||
:class:`~ophyd-async.core.DeviceVector` allows writing maintainable, arbitrary-length device groups instead of fixed classes for each possible grouping. A :class:`~ophyd-async.core.DeviceVector` can be accessed via indices, for example: ``my_sensor_group.sensors[2]``. Here ``sensors`` is a dictionary with integer indices rather than a list so that the most semantically sensible indices may be used, the sensor group above may be 1-indexed, for example, because the sensors' datasheet calls them "sensor 1", "sensor 2" etc. | ||
|
||
.. note:: | ||
The :class:`~ophyd-async.core.DeviceVector` adds an extra level of nesting to the device tree compared to static components like ``sensor_1``, ``sensor_2`` etc. so the behavior is not completely equivalent. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.