diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2026-04-24 11:51:26 -0600 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2026-04-24 11:51:26 -0600 |
| commit | 67cfa0a514c7de4605ed7360e15a81aa781e510e (patch) | |
| tree | 297dfeca4adff1e65df4c9f2e5d7fb49a8b44ba0 /ui | |
| parent | 4244e5d97da0273fed70f734a4cfe822bd15c9cb (diff) | |
Added difference serial protocols
Diffstat (limited to 'ui')
16 files changed, 20 insertions, 15 deletions
diff --git a/ui/__pycache__/__init__.cpython-312.pyc b/ui/__pycache__/__init__.cpython-312.pyc Binary files differindex 8dc1c2f..42ac581 100644 --- a/ui/__pycache__/__init__.cpython-312.pyc +++ b/ui/__pycache__/__init__.cpython-312.pyc diff --git a/ui/__pycache__/__init__.cpython-314.pyc b/ui/__pycache__/__init__.cpython-314.pyc Binary files differindex 15d71d0..ef40b13 100644 --- a/ui/__pycache__/__init__.cpython-314.pyc +++ b/ui/__pycache__/__init__.cpython-314.pyc diff --git a/ui/__pycache__/add_device_dialog.cpython-312.pyc b/ui/__pycache__/add_device_dialog.cpython-312.pyc Binary files differindex 2da95a6..990c229 100644 --- a/ui/__pycache__/add_device_dialog.cpython-312.pyc +++ b/ui/__pycache__/add_device_dialog.cpython-312.pyc diff --git a/ui/__pycache__/add_device_dialog.cpython-314.pyc b/ui/__pycache__/add_device_dialog.cpython-314.pyc Binary files differnew file mode 100644 index 0000000..f5852ba --- /dev/null +++ b/ui/__pycache__/add_device_dialog.cpython-314.pyc diff --git a/ui/__pycache__/config_dialog.cpython-312.pyc b/ui/__pycache__/config_dialog.cpython-312.pyc Binary files differindex cbc9cf0..5a051dc 100644 --- a/ui/__pycache__/config_dialog.cpython-312.pyc +++ b/ui/__pycache__/config_dialog.cpython-312.pyc diff --git a/ui/__pycache__/control_editor.cpython-312.pyc b/ui/__pycache__/control_editor.cpython-312.pyc Binary files differindex 3a53377..e76411d 100644 --- a/ui/__pycache__/control_editor.cpython-312.pyc +++ b/ui/__pycache__/control_editor.cpython-312.pyc diff --git a/ui/__pycache__/control_panel.cpython-312.pyc b/ui/__pycache__/control_panel.cpython-312.pyc Binary files differindex 1c101a8..45f1eb9 100644 --- a/ui/__pycache__/control_panel.cpython-312.pyc +++ b/ui/__pycache__/control_panel.cpython-312.pyc diff --git a/ui/__pycache__/main_window.cpython-312.pyc b/ui/__pycache__/main_window.cpython-312.pyc Binary files differindex 054aa5b..3aefd67 100644 --- a/ui/__pycache__/main_window.cpython-312.pyc +++ b/ui/__pycache__/main_window.cpython-312.pyc diff --git a/ui/__pycache__/profile_manager_ui.cpython-312.pyc b/ui/__pycache__/profile_manager_ui.cpython-312.pyc Binary files differindex 97cbe3a..93491f7 100644 --- a/ui/__pycache__/profile_manager_ui.cpython-312.pyc +++ b/ui/__pycache__/profile_manager_ui.cpython-312.pyc diff --git a/ui/__pycache__/strip_chart.cpython-312.pyc b/ui/__pycache__/strip_chart.cpython-312.pyc Binary files differindex ff41c1a..a3e25c0 100644 --- a/ui/__pycache__/strip_chart.cpython-312.pyc +++ b/ui/__pycache__/strip_chart.cpython-312.pyc diff --git a/ui/add_device_dialog.py b/ui/add_device_dialog.py index 7e8e935..4df71a3 100644 --- a/ui/add_device_dialog.py +++ b/ui/add_device_dialog.py @@ -23,7 +23,7 @@ from PyQt6.QtGui import QFont from devices.device_registry import DeviceRegistry from devices.analog_input import AnalogInputDevice from devices.digital_io import DigitalIODevice -from devices.serial_device import SerialDevice +from devices.serial_device import SerialDevice, _FORMAT_LABELS # ── Port scanner thread ─────────────────────────────────────────────────────── @@ -339,7 +339,7 @@ class DigitalIOPanel(QWidget): class SerialPanel(QWidget): - """Config fields for SerialDevice with live port scanner.""" + """Config fields for SerialDevice — port, baud, protocol/format, simulate.""" def __init__(self): super().__init__() @@ -354,33 +354,34 @@ class SerialPanel(QWidget): form.addRow("Port:", self.port_edit) self.baud_cb = QComboBox() - self.baud_cb.addItems(["9600", "19200", "38400", "57600", "115200", "230400", "460800"]) + self.baud_cb.addItems(["1200", "2400", "4800", "9600", "19200", "38400", + "57600", "115200", "230400", "460800"]) self.baud_cb.setCurrentText("115200") form.addRow("Baud Rate:", self.baud_cb) - self.ch_spin = QSpinBox() - self.ch_spin.setRange(1, 32) - self.ch_spin.setValue(4) - form.addRow("Channels:", self.ch_spin) - self.fmt_cb = QComboBox() - self.fmt_cb.addItems(["key:val", "csv", "json"]) - form.addRow("Parse Format:", self.fmt_cb) + self.fmt_cb.addItems(list(_FORMAT_LABELS.keys())) + form.addRow("Protocol / Format:", self.fmt_cb) self.sim_chk = QCheckBox("Simulation mode") self.sim_chk.setChecked(False) form.addRow(self.sim_chk) + note = QLabel("Protocol-specific settings (queries, registers, motors) available in device config dialog.") + note.setObjectName("traceSource") + note.setWordWrap(True) + lay.addLayout(form) + lay.addWidget(note) lay.addWidget(PortScanGroup(self.port_edit)) def build_device(self, device_id: str) -> SerialDevice: + fmt = _FORMAT_LABELS.get(self.fmt_cb.currentText(), "key:val") return SerialDevice( device_id=device_id, port=self.port_edit.text().strip() or "COM3", baud_rate=int(self.baud_cb.currentText()), - num_channels=self.ch_spin.value(), - parse_format=self.fmt_cb.currentText(), + parse_format=fmt, simulate=self.sim_chk.isChecked(), ) @@ -388,8 +389,8 @@ class SerialPanel(QWidget): # ── Main dialog ─────────────────────────────────────────────────────────────── _PANELS = { - "Analog Input": AnalogInputPanel, - "Digital I/O": DigitalIOPanel, + "Analog Input": AnalogInputPanel, + "Digital I/O": DigitalIOPanel, "Serial / UART": SerialPanel, } @@ -480,7 +481,11 @@ class AddDeviceDialog(QDialog): # Auto-generate ID if blank if not dev_id: - prefixes = {"Analog Input": "ai", "Digital I/O": "dio", "Serial / UART": "ser"} + prefixes = { + "Analog Input": "ai", + "Digital I/O": "dio", + "Serial / UART": "ser", + } prefix = prefixes.get(type_name, "dev") existing = {d.info.device_id for d in self.registry.all_instances()} for i in range(100): diff --git a/ui/windows/__pycache__/__init__.cpython-312.pyc b/ui/windows/__pycache__/__init__.cpython-312.pyc Binary files differindex 66495c5..1454fd8 100644 --- a/ui/windows/__pycache__/__init__.cpython-312.pyc +++ b/ui/windows/__pycache__/__init__.cpython-312.pyc diff --git a/ui/windows/__pycache__/devices_window.cpython-312.pyc b/ui/windows/__pycache__/devices_window.cpython-312.pyc Binary files differindex 601221d..fb52b79 100644 --- a/ui/windows/__pycache__/devices_window.cpython-312.pyc +++ b/ui/windows/__pycache__/devices_window.cpython-312.pyc diff --git a/ui/windows/__pycache__/plot_window.cpython-312.pyc b/ui/windows/__pycache__/plot_window.cpython-312.pyc Binary files differindex c72d74b..7499763 100644 --- a/ui/windows/__pycache__/plot_window.cpython-312.pyc +++ b/ui/windows/__pycache__/plot_window.cpython-312.pyc diff --git a/ui/windows/__pycache__/settings_window.cpython-312.pyc b/ui/windows/__pycache__/settings_window.cpython-312.pyc Binary files differindex d596487..47d5611 100644 --- a/ui/windows/__pycache__/settings_window.cpython-312.pyc +++ b/ui/windows/__pycache__/settings_window.cpython-312.pyc diff --git a/ui/windows/__pycache__/signals_window.cpython-312.pyc b/ui/windows/__pycache__/signals_window.cpython-312.pyc Binary files differindex 8b0db88..ec57533 100644 --- a/ui/windows/__pycache__/signals_window.cpython-312.pyc +++ b/ui/windows/__pycache__/signals_window.cpython-312.pyc |
