From 0e9ef2921d68bdf929c188d07c866e84dbc067ae Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 22 Feb 2023 20:22:43 +1100 Subject: [PATCH 1/2] dbc signal editor: Allow undo of clicks on bitfield --- dbc/dbcsignaleditor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dbc/dbcsignaleditor.cpp b/dbc/dbcsignaleditor.cpp index f915dfb..20089fd 100644 --- a/dbc/dbcsignaleditor.cpp +++ b/dbc/dbcsignaleditor.cpp @@ -778,6 +778,8 @@ void DBCSignalEditor::fillValueTable(DBC_SIGNAL *sig) void DBCSignalEditor::bitfieldLeftClicked(int bit) { if (currentSignal == nullptr) return; + + pushToUndoBuffer(); currentSignal->startBit = bit; if (currentSignal->valType == SP_FLOAT) { @@ -812,6 +814,9 @@ void DBCSignalEditor::bitfieldRightClicked(int bit) //which is quite luckily also the index into the signal handler table int sigNum = ui->bitfield->getUsedSignalNum(bit); if (sigNum < 0) return; + + pushToUndoBuffer(); // undo to resume editing the previous signal + currentSignal = dbcMessage->sigHandler->findSignalByIdx(sigNum); if (currentSignal) From 7ed9ebba21bf66dd61277689c3eed34ca9a0c2ae Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 22 Feb 2023 21:32:58 +1100 Subject: [PATCH 2/2] main window: Fix error on "add to a graphing window" if !filter labels Right-clicking and trying to graph a signal from a DBC with "Label filters" unset would result in an error "Cannot find ID 0xNNN in DBC files(). Not adding graph". Filter labels unset is the default state when adding a new DBC file. --- mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 27a3ea3..b5f6d3f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -588,7 +588,7 @@ void MainWindow::setupSendToLatestGraphWindow() GraphParams param; QString signalName = getSignalNameFromPosition(contextMenuPosition); param.ID = getMessageIDFromPosition(contextMenuPosition); - DBC_MESSAGE *msg = dbcHandler->findMessageForFilter(param.ID, nullptr); + DBC_MESSAGE *msg = dbcHandler->findMessage(param.ID); if(msg) { DBC_SIGNAL *sig = msg->sigHandler->findSignalByName(signalName);