From 6b5d7335335424b29807d5d68278f4ba5bc2df02 Mon Sep 17 00:00:00 2001 From: Bertrand Date: Wed, 24 Feb 2021 08:21:24 +0100 Subject: [PATCH] looking for message in all DBCs in graphdialog this is not perfect, since two different DBCs can still have messages with the same name. still an improvement though --- re/newgraphdialog.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/re/newgraphdialog.cpp b/re/newgraphdialog.cpp index 87cd41d..f6c97c4 100644 --- a/re/newgraphdialog.cpp +++ b/re/newgraphdialog.cpp @@ -357,7 +357,15 @@ void NewGraphDialog::handleDataLenUpdate() void NewGraphDialog::copySignalToParamsUI() { - DBC_MESSAGE *msg = dbcHandler->getFileByIdx(0)->messageHandler->findMsgByName(ui->cbMessages->currentText()); + assocSignal = nullptr; + DBC_MESSAGE *msg = nullptr; + + for(int i = 0; i < dbcHandler->getFileCount(); i++) + { + msg = dbcHandler->getFileByIdx(i)->messageHandler->findMsgByName(ui->cbMessages->currentText()); + if (msg) break; + } + if (!msg) return; DBC_SIGNAL *sig = msg->sigHandler->findSignalByName(ui->cbSignals->currentText()); if (!sig) return;