Fixes to allow New Graph Window to pick up DBC changes while the

program is running - also allow it to use more than one DBC file
This commit is contained in:
Collin Kidder
2017-08-17 20:10:43 -04:00
parent 964ad01498
commit 0ab6fdd411
2 changed files with 9 additions and 4 deletions
+2
View File
@@ -921,6 +921,8 @@ void GraphingWindow::loadDefinitions()
void GraphingWindow::showParamsDialog(int idx = -1)
{
dbcHandler = DBCHandler::getReference();
NewGraphDialog *thisDialog = new NewGraphDialog(dbcHandler);
if (idx > -1)
+7 -4
View File
@@ -90,7 +90,7 @@ void NewGraphDialog::setParams(GraphParams &params)
QPalette p = ui->colorSwatch->palette();
p.setColor(QPalette::Button, params.color);
ui->colorSwatch->setPalette(p);
loadMessages();
drawBitfield();
}
@@ -120,10 +120,13 @@ void NewGraphDialog::loadMessages()
{
ui->cbMessages->clear();
if (dbcHandler == NULL) return;
if (dbcHandler->getFileCount() == 0) dbcHandler->createBlankFile();
for (int x = 0; x < dbcHandler->getFileByIdx(0)->messageHandler->getCount(); x++)
if (dbcHandler->getFileCount() == 0) return;
for (int y = 0; y < dbcHandler->getFileCount(); y++)
{
ui->cbMessages->addItem(dbcHandler->getFileByIdx(0)->messageHandler->findMsgByIdx(x)->name);
for (int x = 0; x < dbcHandler->getFileByIdx(y)->messageHandler->getCount(); x++)
{
ui->cbMessages->addItem(dbcHandler->getFileByIdx(y)->messageHandler->findMsgByIdx(x)->name);
}
}
}