summaryrefslogtreecommitdiff
path: root/ui/windows/devices_window.py
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2026-06-03 11:38:49 -0600
committerChristian Kolset <christian.kolset@gmail.com>2026-06-03 11:38:49 -0600
commit23c669b3c6fb3bc805887cef00d6c37756e5c41e (patch)
treed563ab55c83dd59083fe748347a5e4010b7fa416 /ui/windows/devices_window.py
parent3610309b1e5d83049554afe287129c99389d231d (diff)
Sync Channels window with device/channel changes
- Remove redundant Signals tab from Channels window; PipelineTab is now direct content - PipelineTab removes stale blocks when devices are removed or reconfigured - Devices>Signals tab refreshes automatically on device add/remove/configure - Channel name and unit edits in Devices>Signals propagate live to Channels pipeline block headers; missing blocks auto-added if channel is enabled Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'ui/windows/devices_window.py')
-rw-r--r--ui/windows/devices_window.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/ui/windows/devices_window.py b/ui/windows/devices_window.py
index 8f6a48b..f942552 100644
--- a/ui/windows/devices_window.py
+++ b/ui/windows/devices_window.py
@@ -118,7 +118,9 @@ class DeviceRow(QFrame):
class ChannelsTab(QWidget):
"""Shows all channels across all devices in an editable table."""
- channel_visibility_changed = pyqtSignal(str, str, bool) # dev_id, ch_id, enabled
+ channel_visibility_changed = pyqtSignal(str, str, bool) # dev_id, ch_id, enabled
+ channel_name_changed = pyqtSignal(str, str, str) # dev_id, ch_id, name
+ channel_unit_changed = pyqtSignal(str, str, str) # dev_id, ch_id, unit
# Col indices
_C_DEVICE = 0
@@ -228,8 +230,10 @@ class ChannelsTab(QWidget):
return
if col == self._C_NAME:
ch.name = self._table.item(row, self._C_NAME).text()
+ self.channel_name_changed.emit(dev_id, ch_id, ch.name)
elif col == self._C_UNIT:
ch.unit = self._table.item(row, self._C_UNIT).text()
+ self.channel_unit_changed.emit(dev_id, ch_id, ch.unit)
elif col == self._C_MIN:
try:
ch.min_value = float(self._table.item(row, self._C_MIN).text())
@@ -247,6 +251,8 @@ class DevicesWindow(QWidget):
device_removed = pyqtSignal(str)
device_reconfigured = pyqtSignal(str)
channel_visibility_changed = pyqtSignal(str, str, bool) # dev_id, ch_id, enabled
+ channel_name_changed = pyqtSignal(str, str, str) # dev_id, ch_id, name
+ channel_unit_changed = pyqtSignal(str, str, str) # dev_id, ch_id, unit
closed = pyqtSignal()
def __init__(self, registry: DeviceRegistry, engine: AcquisitionEngine, parent=None):
@@ -305,7 +311,9 @@ class DevicesWindow(QWidget):
# Tab 2: Channels
self._ch_tab = ChannelsTab(self.registry)
self._ch_tab.channel_visibility_changed.connect(self.channel_visibility_changed)
- tabs.addTab(self._ch_tab, " Channels ")
+ self._ch_tab.channel_name_changed.connect(self.channel_name_changed)
+ self._ch_tab.channel_unit_changed.connect(self.channel_unit_changed)
+ tabs.addTab(self._ch_tab, " Signals ")
tabs.currentChanged.connect(lambda i: self._ch_tab.refresh() if i == 1 else None)
def refresh(self):
@@ -318,6 +326,7 @@ class DevicesWindow(QWidget):
row.remove_clicked.connect(self._on_remove)
self._inner.insertWidget(self._inner.count() - 1, row)
self._rows[dev.info.device_id] = row
+ self._ch_tab.refresh()
def _refresh_status(self):
for row in self._rows.values():
@@ -340,7 +349,7 @@ class DevicesWindow(QWidget):
dev = self.registry.get_instance(device_id)
if dev:
DeviceConfigDialog(dev, self).exec()
- # Signal that device config may have changed (backend/simulate/port)
+ self._ch_tab.refresh()
self.device_reconfigured.emit(device_id)
def _on_remove(self, device_id: str):