navigate.model.device_startup_functions.SequenceDeviceFactory
- class navigate.model.device_startup_functions.SequenceDeviceFactory
Bases:
object
Sequence Device Factory.
This class is used to build sequence device connections.
- __init__()
Methods
__init__
()build_connection
(unique_id, ...[, ...])Builds a sequence device connection.
- classmethod build_connection(unique_id: str, build_connection_function: ~typing.Callable[[...], ~typing.Any], args: ~typing.Tuple[~typing.Any, ...], exception: ~typing.Type[Exception] = <class 'Exception'>, max_device_num: int = 2) → Any
Builds a sequence device connection.
This method establishes a connection to a sequence device using the provided connection-building function and arguments. If the connection does not exist, it will be created and stored.
- Parameters:
unique_id (str) – Unique identifier for the device
build_connection_function (Callable) – Function that builds the connection to the device.
args (Tuple) – Arguments to the build_connection_function
exception (Type[Exception]) – Exception to catch when building the connection
max_device_num (int) – Maximum number of devices to connect to. Default is 2.
- Returns:
connection – Connection to the device
- Return type:
Any
:raises exception : Exception: If the connection building process fails, the specified exception is raised.