qudi.core.Connector

class qudi.core.Connector(interface: str | Type, name: str | None = None, optional: bool = False)[source]

Bases: builtins.object

A connector used to connect qudi modules with each other.

__init__(interface: str | Type, name: str | None = None, optional: bool = False)[source]

Initialize a Connector instance.

Parameters:
interfaceUnion[str, Type]

Name of the interface class to connect to or the interface class itself.

namestr, optional

Name of the connector in qudi config. Will set attribute name if omitted.

optionalbool, optional

Flag indicating if the connection is mandatory (False by default).

Raises:
AssertionError

If interface is not a string or a type. If name is not None or a non-empty string. If optional is not a boolean.

Methods

__init__(interface[, name, optional])

Initialize a Connector instance.

connect(target)

Check if target is connectible by this connector and connect.

copy(**kwargs)

Create a new instance of Connector with copied values and update

disconnect()

Disconnect connector.

Attributes

is_connected

Read-only property to check if the Connector instance is connected to a target module.

__call__() Any[source]

Return reference to the module that this connector is connected to.

__init__(interface: str | Type, name: str | None = None, optional: bool = False)[source]

Initialize a Connector instance.

Parameters:
interfaceUnion[str, Type]

Name of the interface class to connect to or the interface class itself.

namestr, optional

Name of the connector in qudi config. Will set attribute name if omitted.

optionalbool, optional

Flag indicating if the connection is mandatory (False by default).

Raises:
AssertionError

If interface is not a string or a type. If name is not None or a non-empty string. If optional is not a boolean.

connect(target: Any) None[source]

Check if target is connectible by this connector and connect.

copy(**kwargs)[source]

Create a new instance of Connector with copied values and update

disconnect() None[source]

Disconnect connector.

property is_connected: bool

Read-only property to check if the Connector instance is connected to a target module.

Returns:
bool

Connection status flag. - True: Connected - False: Disconnected