From 60888e6a86f089b5ad8e756e471e2abe967e4369 Mon Sep 17 00:00:00 2001 From: diekleinekuh Date: Tue, 14 Feb 2023 18:59:00 +0100 Subject: [PATCH] Use selected can bus in uds scanner. Before it always used the first bus no matter what. --- re/udsscanwindow.cpp | 9 +++++++++ re/udsscanwindow.h | 1 + 2 files changed, 10 insertions(+) diff --git a/re/udsscanwindow.cpp b/re/udsscanwindow.cpp index 933a46b..7f5c7ef 100644 --- a/re/udsscanwindow.cpp +++ b/re/udsscanwindow.cpp @@ -77,6 +77,9 @@ UDSScanWindow::UDSScanWindow(const QVector *frames, QWidget *parent) : //not handling show no reply, max reply delay, reply offset, increment int numBuses = CANConManager::getInstance()->getNumBuses(); for (int n = 0; n < numBuses; n++) ui->cbBuses->addItem(QString::number(n)); + + connect(ui->cbBuses, &QComboBox::currentTextChanged, this, &UDSScanWindow::setBusToScan); + installEventFilter(this); addNewScan(); @@ -334,6 +337,12 @@ void UDSScanWindow::setSessType() if (currEditEntry) currEditEntry->sessType = ui->cbSessType->currentIndex(); } +void UDSScanWindow::setBusToScan() +{ + if (inhibitUpdates) return; + if (currEditEntry) currEditEntry->busToScan = ui->cbBuses->currentIndex(); +} + void UDSScanWindow::setNoReplyVal() { if (inhibitUpdates) return; diff --git a/re/udsscanwindow.h b/re/udsscanwindow.h index ed50e01..d145f3e 100644 --- a/re/udsscanwindow.h +++ b/re/udsscanwindow.h @@ -81,6 +81,7 @@ private slots: void setIncrementVal(); void setReplyOffset(); void setSessType(); + void setBusToScan(); private: Ui::UDSScanWindow *ui;