secop_ophyd.signals.command#
Command backend and connector for SECoP commands.
Module Contents#
Classes#
CommandConnector that can mock commands with struct, array or tuple arguments (see _UnconvertedMockCommandBackend). |
|
Backend for a SECoP command. |
API#
- class secop_ophyd.signals.command.SECoPCommandConnector(backend: ophyd_async.core._command.CommandBackend[ophyd_async.core._utils.P, ophyd_async.core._utils.T])[source]#
Bases:
ophyd_async.core._command.CommandConnectorCommandConnector that can mock commands with struct, array or tuple arguments (see _UnconvertedMockCommandBackend).
Initialization
- async connect_mock(device: ophyd_async.core.Device, mock: ophyd_async.core.LazyMock)[source]#
- class secop_ophyd.signals.command.SECoPCommandBackend(signature: inspect.Signature | None = None)[source]#
Bases:
ophyd_async.core.CommandBackend[typing.Any,typing.Any]Backend for a SECoP command.
Converts the argument/result between SECoP wire format and numpy/python values and calls AsyncSecopClient.exec_command to execute the command.
Supports deferred initialization (matching the SECoPBackend pattern used for Parameters/Properties): constructed empty by the DeviceFiller when a command is declared via a Command/TriggerableCommand class annotation, then bound to a concrete SECoP command via init_command_from_introspection once the SEC node has been introspected.
Initialization
Initialize SECoPCommandBackend (optionally with a signature derived from a Command[[ArgT], ResT] class annotation).
- signature: inspect.Signature = None#
- init_command_from_introspection(cmd_datatype: frappy.datatypes.CommandType, path: secop_ophyd.util.Path, secclient: secop_ophyd.AsyncFrappyClient.AsyncSecopClient, wait_for_idle_fn: collections.abc.Callable[[], collections.abc.Awaitable[None]] | None = None) None[source]#
Bind this backend to a concrete SECoP command.
- Parameters:
cmd_datatype – SECoP command datatype, holding the argument and
result datatypes (either of which may be None) :type cmd_datatype: CommandType :param path: Path to the command in the secclient module dict :type path: Path :param secclient: SECoP client providing communication to the SEC Node :type secclient: AsyncSecopClient :param wait_for_idle_fn: Owning module’s wait_for_idle coroutine (bound method), if it has one (i.e. it has a status signal); used to support the wait_for_idle kwarg on execute(). :type wait_for_idle_fn: Callable[[], Awaitable[None]] | None