From 77f889e4d765d82242f200f4c1187f99a67eff9e Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Mon, 18 Mar 2024 21:52:22 -0400 Subject: [PATCH] Fix signal viewer so that it handles multiplexed signals properly --- signalviewerwindow.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/signalviewerwindow.cpp b/signalviewerwindow.cpp index f21c7f9c..c31f0fb3 100644 --- a/signalviewerwindow.cpp +++ b/signalviewerwindow.cpp @@ -98,15 +98,18 @@ void SignalViewerWindow::processFrame(CANFrame &frame) if (!sig) return; if (sig->parentMessage->ID == frame.frameId()) { - if (sig->processAsText(frame, sigString, false)) //if true we could interpret the signal so update it in the list + if (sig->isSignalInMessage(frame)) //filter out multiplexed signals that aren't in this message. { - QTableWidgetItem *item = ui->tableViewer->item(i, VALUE_COL); - if (!item) + if (sig->processAsText(frame, sigString, false)) //if true we could interpret the signal so update it in the list { - item = new QTableWidgetItem(sigString); - ui->tableViewer->setItem(i, VALUE_COL, item); + QTableWidgetItem *item = ui->tableViewer->item(i, VALUE_COL); + if (!item) + { + item = new QTableWidgetItem(sigString); + ui->tableViewer->setItem(i, VALUE_COL, item); + } + else item->setText(sigString); } - else item->setText(sigString); } } }