From 5d5bcaed8639a162fda85c8cd0d340c296a054b8 Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Mon, 10 Aug 2026 16:12:05 -0600 Subject: Unify Signals/Channels around auto-naming, plot-by-channel, and shared vars Devices: auto-name from OS-reported port description (Device Manager / udev string) instead of a generic label; default Serial #Channels 1; consistent simulate-mode checkbox across backends; inline device rename. Channels: calibration/filters move out of Signals into a Channel "Operation" (adds Scale/Offset alongside the existing math kinds); single-physical-source Channels get an embedded Filters block; new Channels auto-name/auto-ID from their source and reject duplicate names/IDs on apply; "Create Channel" button on each Signal row; renamed "Sources" -> "Signals" in the Channels UI; Signals' READ/WRITE dir badge (was silently-broken IN/OUT) now reflects the real writable flag. Plot: default layout is one pane per Channel (not per device, not raw Signals) titled by channel name; "+ Add Channel" is a checkbox dialog instead of an inline dropdown; traces get up/down reorder; live unit changes (e.g. a Mark-10 gauge switching lb/kgF/N/ozF) propagate to an open pane's axis label without clobbering a manually-typed one. Control Panel: hardware assignment now picks from the same writable- Signals list instead of a separate device/channel combo with a hardcoded Arduino pin list; stale visual indicator when a control's target device/channel disconnects or disappears; documented the `vars` bridge (Control Panel On Action Script <-> Channel scripts) in both directions' help text and script templates. Co-Authored-By: Claude Sonnet 5 --- ui/windows/devices_window.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'ui/windows/devices_window.py') diff --git a/ui/windows/devices_window.py b/ui/windows/devices_window.py index eec65c8..ae88c6b 100644 --- a/ui/windows/devices_window.py +++ b/ui/windows/devices_window.py @@ -41,6 +41,7 @@ _STATUS_TEXT = { class DeviceRow(QFrame): configure_clicked = pyqtSignal(str) remove_clicked = pyqtSignal(str) + name_changed = pyqtSignal(str) def __init__(self, device): super().__init__() @@ -66,11 +67,14 @@ class DeviceRow(QFrame): info_col = QVBoxLayout() info_col.setSpacing(1) - name = QLabel(self.device.info.name) - name.setObjectName("deviceName") + self._name_edit = QLineEdit(self.device.info.name) + self._name_edit.setObjectName("deviceName") + self._name_edit.setFrame(False) + self._name_edit.setToolTip("Click to rename") + self._name_edit.editingFinished.connect(self._on_name_edited) id_lbl = QLabel(f"{self.device.info.device_id} ยท {self.device.info.device_type}") id_lbl.setObjectName("deviceSub") - info_col.addWidget(name) + info_col.addWidget(self._name_edit) info_col.addWidget(id_lbl) lay.addLayout(info_col, 1) @@ -103,6 +107,16 @@ class DeviceRow(QFrame): self._status_lbl.setText(_STATUS_TEXT.get(self.device.status, "?")) self._set_status_style() + def _on_name_edited(self): + new_name = self._name_edit.text().strip() + if not new_name: + self._name_edit.setText(self.device.info.name) + return + if new_name == self.device.info.name: + return + self.device.info.name = new_name + self.name_changed.emit(self.device.info.device_id) + def _set_dot_color(self): c = _DOT_COLOR.get(self.device.status, "#475569") self._dot.setStyleSheet(f"color:{c}; font-size:10px;") -- cgit v1.2.3