devctrl.gui.app.devices_workspace.ModuleDevicesRow#
- class ModuleDevicesRow(app: MainWindowBase, module: GuiModule, device_manager: DeviceManager)[source]#
Bases:
QObjectMethods
Place this row's widgets into the shared grid of the Load/Connect tab.
Load the module's roles if needed and connect its devices via the startup dialog.
Load the module's roles if needed and connect dummy devices for all of them.
Disconnect all devices of the module (roles stay loaded).
Add all of the module's device roles to the device manager (idempotent).
Each keyword argument is either the name of a Qt property or a Qt signal.
Return the device roles of this module (resolving lazy callables).
Enable or disable the action buttons (used while tasks run).
Remove all of the module's device roles from the device manager.
Refresh the status label and the button enabled states from the device manager.
Attributes
- __annotations__ = {}#
- __dict__ = mappingproxy({'__module__': 'devctrl.gui.app.devices_workspace', '__firstlineno__': 72, '__doc__': "Load/connect control row for a single module in the Devices workspace.\n\nShows the module name and its device state, the load/unload and\nconnect/disconnect buttons and the auto-load/auto-connect-on-startup\ncheckboxes. The state display refreshes automatically from the device\nmanager's signals. The row is not a widget itself: its widgets are placed\ninto the shared grid of the Load/Connect tab (see :meth:`.add_to_grid`)\nso that all rows align vertically.\n", '__init__': <function ModuleDevicesRow.__init__>, 'add_to_grid': <function ModuleDevicesRow.add_to_grid>, '_app_config': <function ModuleDevicesRow._app_config>, '_load_on_startup_setting': <function ModuleDevicesRow._load_on_startup_setting>, '_connect_on_startup_setting': <function ModuleDevicesRow._connect_on_startup_setting>, '_set_load_on_startup': <function ModuleDevicesRow._set_load_on_startup>, '_set_connect_on_startup': <function ModuleDevicesRow._set_connect_on_startup>, 'load': <function ModuleDevicesRow.load>, 'unload': <function ModuleDevicesRow.unload>, 'connect_devices': <function ModuleDevicesRow.connect_devices>, 'connect_dummies': <function ModuleDevicesRow.connect_dummies>, 'disconnect': <function ModuleDevicesRow.disconnect>, 'set_actions_enabled': <function ModuleDevicesRow.set_actions_enabled>, 'resolve_roles': <function ModuleDevicesRow.resolve_roles>, '_on_devices_changed': <function ModuleDevicesRow._on_devices_changed>, 'update_status': <function ModuleDevicesRow.update_status>, '__static_attributes__': ('_actions_enabled', 'app', 'b_connect', 'b_connect_dummies', 'b_disconnect', 'b_load', 'b_unload', 'devmg', 'module', 'w_cb_connect_on_startup', 'w_cb_load_on_startup', 'w_label_name', 'w_label_status'), '__annotations__': {}})#
- __firstlineno__ = 72#
- classmethod __getattr__(self, name: str | None) Any#
- __init__(app: MainWindowBase, module: GuiModule, device_manager: DeviceManager)[source]#
- __module__ = 'devctrl.gui.app.devices_workspace'#
- classmethod __new__(*args, **kwargs)#
- __static_attributes__ = ('_actions_enabled', 'app', 'b_connect', 'b_connect_dummies', 'b_disconnect', 'b_load', 'b_unload', 'devmg', 'module', 'w_cb_connect_on_startup', 'w_cb_load_on_startup', 'w_label_name', 'w_label_status')#
- __weakref__#
list of weak references to the object
- _connect_on_startup_setting() bool[source]#
Return the persisted auto-connect setting of this module (default False).
- _load_on_startup_setting() bool[source]#
Return the persisted auto-load setting of this module (default True).
- _on_devices_changed(key: str) None[source]#
Refresh the state display when the device manager changed.
- Parameters:
key – The changed device key (ignored).
- _set_connect_on_startup(checked: bool) None[source]#
Store the auto-connect setting of this module and persist the host settings.
- Parameters:
checked – Whether the module’s devices are connected at startup.
- _set_load_on_startup(checked: bool) None[source]#
Store the auto-load setting of this module and persist the host settings.
- Parameters:
checked – Whether the module’s roles are loaded at startup.
- add_to_grid(grid: QGridLayout, row: int) None[source]#
Place this row’s widgets into the shared grid of the Load/Connect tab.
The row occupies two grid rows: the module name and the Load-on-startup checkbox in the first, the status label and the Connect-on-startup checkbox in the second. The action buttons span both rows, vertically centered.
- Parameters:
grid – The shared grid of the Load/Connect tab.
row – First grid row of this module.
- classmethod blockSignals(self, b: bool) bool#
- classmethod childEvent(self, a0: QChildEvent | None)#
- classmethod children(self) list[QObject]#
- classmethod connectNotify(self, signal: QMetaMethod)#
- connect_devices() None[source]#
Load the module’s roles if needed and connect its devices via the startup dialog.
Opens the
DeviceStartupWidgetdialog, which connects the module’s devices from its device config file in priority order and turns on its power switches.
- connect_dummies() None[source]#
Load the module’s roles if needed and connect dummy devices for all of them.
- classmethod customEvent(self, a0: QEvent | None)#
- classmethod deleteLater(self)#
- destroyed#
- classmethod disconnectNotify(self, signal: QMetaMethod)#
- classmethod dumpObjectInfo(self)#
- classmethod dumpObjectTree(self)#
- classmethod dynamicPropertyNames(self) list[QByteArray]#
- classmethod event(self, a0: QEvent | None) bool#
- classmethod eventFilter(self, a0: QObject | None, a1: QEvent | None) bool#
- classmethod findChild(self, type: type[QObjectT], name: str | None = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObjectT#
- classmethod findChild(self, types: tuple[type[QObjectT], ...], name: str | None = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObjectT
- classmethod findChildren(self, type: type[QObjectT], name: str | None = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) list[QObjectT]#
- classmethod findChildren(self, types: tuple[type[QObjectT], ...], name: str | None = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) list[QObjectT]
- classmethod findChildren(self, type: type[QObjectT], re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) list[QObjectT]
- classmethod findChildren(self, types: tuple[type[QObjectT], ...], re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) list[QObjectT]
- classmethod inherits(self, classname: str | None) bool#
- classmethod installEventFilter(self, a0: QObject | None)#
- classmethod isQuickItemType(self) bool#
- classmethod isSignalConnected(self, signal: QMetaMethod) bool#
- classmethod isWidgetType(self) bool#
- classmethod isWindowType(self) bool#
- classmethod killTimer(self, id: int)#
- classmethod metaObject(self) QMetaObject | None#
- classmethod moveToThread(self, thread: QThread | None)#
- classmethod objectName(self) str#
- objectNameChanged#
- classmethod parent(self) QObject | None#
- classmethod property(self, name: str | None) Any#
- classmethod pyqtConfigure(...)#
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- classmethod receivers(self, signal: PYQT_SIGNAL) int#
- classmethod removeEventFilter(self, a0: QObject | None)#
- resolve_roles() list[DeviceRole][source]#
Return the device roles of this module (resolving lazy callables).
- classmethod sender(self) QObject | None#
- classmethod senderSignalIndex(self) int#
- classmethod setObjectName(self, name: QByteArray | bytes | bytearray | memoryview | str | None)#
- classmethod setParent(self, a0: QObject | None)#
- classmethod setProperty(self, name: str | None, value: Any) bool#
- set_actions_enabled(enabled: bool) None[source]#
Enable or disable the action buttons (used while tasks run).
- Parameters:
enabled – Whether the action buttons are enabled.
- classmethod signalsBlocked(self) bool#
- classmethod startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int#
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>#
- classmethod thread(self) QThread | None#
- classmethod timerEvent(self, a0: QTimerEvent | None)#
- classmethod tr(sourceText: str | None, disambiguation: str | None = None, n: int = -1) str#
- unload() None[source]#
Remove all of the module’s device roles from the device manager.
Roles shared with other modules are removed as well; those modules can re-load them (see
unload_module_devices()).