Major mondification to how DBC files are handled in-program. Now it is

much more object oriented and encapsulated. The biggest addition is
that it is now possible to support multiple DBC files being loaded at
once with each file associated to one or both buses. Note that
currently the program still does not support multiple DBC files but
the groundwork is there.
This commit is contained in:
Collin Kidder
2016-01-17 13:30:42 -05:00
parent d831f985f5
commit cd5f851f35
11 changed files with 760 additions and 485 deletions
+7 -7
View File
@@ -150,9 +150,9 @@ void NewGraphDialog::loadMessages()
{
ui->cbMessages->clear();
if (dbcHandler == NULL) return;
for (int x = 0; x < dbcHandler->dbc_messages.count(); x++)
for (int x = 0; x < dbcHandler->getFileByIdx(0)->messageHandler->getCount(); x++)
{
ui->cbMessages->addItem(dbcHandler->dbc_messages[x].name);
ui->cbMessages->addItem(dbcHandler->getFileByIdx(0)->messageHandler->findMsgByIdx(x)->name);
}
}
@@ -163,13 +163,13 @@ void NewGraphDialog::loadSignals(int idx)
//in the data structure so it should have been possible to just
//look it up based on index but by name is probably safer and this operation
//is not time critical at all.
DBC_MESSAGE *msg = dbcHandler->findMsgByName(ui->cbMessages->currentText());
DBC_MESSAGE *msg = dbcHandler->getFileByIdx(0)->messageHandler->findMsgByName(ui->cbMessages->currentText());
if (msg == NULL) return;
ui->cbSignals->clear();
for (int x = 0; x < msg->msgSignals.count(); x++)
for (int x = 0; x < msg->sigHandler->getCount(); x++)
{
ui->cbSignals->addItem(msg->msgSignals[x].name);
ui->cbSignals->addItem(msg->sigHandler->findSignalByIdx(x)->name);
}
}
@@ -177,11 +177,11 @@ void NewGraphDialog::fillFormFromSignal(int idx)
{
Q_UNUSED(idx);
GraphParams params;
DBC_MESSAGE *msg = dbcHandler->findMsgByName(ui->cbMessages->currentText());
DBC_MESSAGE *msg = dbcHandler->getFileByIdx(0)->messageHandler->findMsgByName(ui->cbMessages->currentText());
if (msg == NULL) return;
DBC_SIGNAL *sig = dbcHandler->findSignalByName(msg, ui->cbSignals->currentText());
DBC_SIGNAL *sig = msg->sigHandler->findSignalByName(ui->cbSignals->currentText());
if (sig == NULL) return;