FormDeviceConfigurationEditor

class caqtus.gui.condetrol.device_configuration_editors.FormDeviceConfigurationEditor(
device_configuration: T,
parent: QWidget | None = None,
)

Bases: DeviceConfigurationEditor, Generic

Displays a list of fields to edit the configuration of a device.

Widgets of this class initially only present a single field to edit the remote server name.

Other device specific fields can be added by calling the insert_row() method.

append_row(
label: str,
widget: QWidget,
)

Append a widget field at the end of the form.

insert_row(
label: str,
widget: QWidget,
row: int,
)

Insert a widget field at the specified row.

get_configuration() T

Return a new configuration with fields updated from the UI.

Returns:

A copy of the configuration that was passed to the constructor with the remote server field updated to the value set in the UI.

Subclasses should override this method to update other fields as well.

set_remote_server(
remote_server: DeviceServerName | None,
) None

Set the remote server name in the editor.

read_remote_server() DeviceServerName | None

Read the remote server name from the editor.