diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2026-04-27 16:53:14 -0600 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2026-04-27 16:53:14 -0600 |
| commit | 2b9943ba0d28449a590acfa8a41555b174b6ba84 (patch) | |
| tree | e8bef8c9bc61dd7e2f9c8a9b177058a4b09546db /ui/config_dialog.py | |
| parent | 67cfa0a514c7de4605ed7360e15a81aa781e510e (diff) | |
Improved arduino interface. Now allowing the user to configure pins on the fly.
Diffstat (limited to 'ui/config_dialog.py')
| -rw-r--r-- | ui/config_dialog.py | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/ui/config_dialog.py b/ui/config_dialog.py index 4976b36..bafac24 100644 --- a/ui/config_dialog.py +++ b/ui/config_dialog.py @@ -4,8 +4,8 @@ ui/config_dialog.py — Device configuration dialog (tabbed). from PyQt6.QtWidgets import ( QDialog, QVBoxLayout, QHBoxLayout, QTabWidget, - QWidget, QFormLayout, QGroupBox, QScrollArea, - QLabel, QLineEdit, QDoubleSpinBox, QCheckBox, + QWidget, QFormLayout, QScrollArea, + QLabel, QLineEdit, QPushButton, ) from PyQt6.QtCore import Qt @@ -37,10 +37,7 @@ class DeviceConfigDialog(QDialog): scroll.setWidget(cfg_widget) tabs.addTab(scroll, "Hardware / Backend") - # ── Tab 2: Channel settings ─────────────────────────────────── - tabs.addTab(self._channel_tab(), "Channels") - - # ── Tab 3: Device info ──────────────────────────────────────── + # ── Tab 2: Device info ──────────────────────────────────────── tabs.addTab(self._info_tab(), "Info") layout.addWidget(tabs) @@ -53,43 +50,6 @@ class DeviceConfigDialog(QDialog): btn_row.addWidget(close_btn) layout.addLayout(btn_row) - def _channel_tab(self): - w = QScrollArea() - w.setWidgetResizable(True) - container = QWidget() - layout = QVBoxLayout(container) - - for ch in self.device.info.channels: - grp = QGroupBox(f"{ch.channel_id} — {ch.name}") - form = QFormLayout(grp) - - name_e = QLineEdit(ch.name) - unit_e = QLineEdit(ch.unit) - en_chk = QCheckBox() - en_chk.setChecked(ch.enabled) - - form.addRow("Name:", name_e) - form.addRow("Unit:", unit_e) - form.addRow("Enabled:", en_chk) - - apply = QPushButton("Apply") - apply.setObjectName("applyButton") - - def _make_apply(c, ne, ue, ec): - def _do(): - c.name = ne.text() - c.unit = ue.text() - c.enabled = ec.isChecked() - return _do - - apply.clicked.connect(_make_apply(ch, name_e, unit_e, en_chk)) - form.addRow(apply) - layout.addWidget(grp) - - layout.addStretch() - w.setWidget(container) - return w - def _info_tab(self): w = QWidget() form = QFormLayout(w) |
