From 2b9943ba0d28449a590acfa8a41555b174b6ba84 Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Mon, 27 Apr 2026 16:53:14 -0600 Subject: Improved arduino interface. Now allowing the user to configure pins on the fly. --- ui/windows/settings_window.py | 44 ++----------------------------------------- 1 file changed, 2 insertions(+), 42 deletions(-) (limited to 'ui/windows/settings_window.py') diff --git a/ui/windows/settings_window.py b/ui/windows/settings_window.py index 88093ff..9d7b7bc 100644 --- a/ui/windows/settings_window.py +++ b/ui/windows/settings_window.py @@ -7,14 +7,13 @@ Tabs: General — theme (dark/light/system), font sizes, polling rate Acquisition — sample rate, buffer size, CSV log directory Display — default time window, legend, grid defaults - Controls — configure output widget assignments per channel """ from PyQt6.QtWidgets import ( QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, - QTabWidget, QFrame, QFormLayout, QGroupBox, QComboBox, + QTabWidget, QFrame, QFormLayout, QComboBox, QSpinBox, QDoubleSpinBox, QCheckBox, QLineEdit, - QFileDialog, QScrollArea, QSizePolicy, + QFileDialog, QScrollArea, ) from PyQt6.QtCore import Qt, pyqtSignal from PyQt6.QtGui import QCloseEvent, QFont @@ -73,7 +72,6 @@ class SettingsWindow(QWidget): tabs.addTab(self._general_tab(), " General ") tabs.addTab(self._acquisition_tab(), " Acquisition ") tabs.addTab(self._display_tab(), " Display ") - tabs.addTab(self._controls_tab(), " Controls ") # Bottom bar btm = QWidget(); btm.setObjectName("cfgBottomBar") @@ -159,44 +157,6 @@ class SettingsWindow(QWidget): root = QVBoxLayout(w); root.setContentsMargins(0,0,0,0); root.addWidget(scroll) return w - def _controls_tab(self): - """Output channel assignments — which device channel each control widget drives.""" - w = QWidget() - scroll = QScrollArea(); scroll.setWidgetResizable(True) - scroll.setObjectName("deviceScroll") - cont = QWidget(); lay = QVBoxLayout(cont) - lay.setContentsMargins(14,12,14,12); lay.setSpacing(8) - - info = QLabel( - "Configure which physical output channels are driven by each control widget.\n" - "Add output widget mappings below. Changes take effect on next app start." - ) - info.setObjectName("traceSource"); info.setWordWrap(True) - lay.addWidget(info) - - grp = QGroupBox("Output Assignments") - g_lay = QFormLayout(grp); g_lay.setSpacing(6) - - # Collect digital output channels - out_channels = ["— none —"] - for dev in self.registry.all_instances(): - for ch in dev.info.channels: - if ch.channel_id.startswith("do") or "out" in ch.channel_id.lower(): - out_channels.append(f"{dev.info.device_id} / {ch.channel_id} ({ch.name})") - - self._out_combos = {} - for label in ["Pump Power", "Heater", "Motor Enable", "PWM Ch 1"]: - cb = QComboBox(); cb.setObjectName("channelPickerCb") - cb.addItems(out_channels) - g_lay.addRow(f"{label}:", cb) - self._out_combos[label] = cb - - lay.addWidget(grp) - lay.addStretch() - scroll.setWidget(cont) - root = QVBoxLayout(w); root.setContentsMargins(0,0,0,0); root.addWidget(scroll) - return w - # ── Actions ─────────────────────────────────────────────────────────── def _browse_log(self): -- cgit v1.2.3