Fix to correct a few places where 2 buses were hard coded as the

limit. There is no hard and fast limit to the number of buses you can
have now.
This commit is contained in:
Collin Kidder
2019-02-19 21:19:51 -05:00
parent 6c633f8720
commit d4f52311f7
3 changed files with 11 additions and 5 deletions
+3 -1
View File
@@ -2,6 +2,7 @@
#include "ui_dbcloadsavewindow.h"
#include <QCheckBox>
#include "helpwindow.h"
#include "connections/canconmanager.h"
DBCLoadSaveWindow::DBCLoadSaveWindow(const QVector<CANFrame> *frames, QWidget *parent) :
QDialog(parent),
@@ -162,7 +163,8 @@ void DBCLoadSaveWindow::cellChanged(int row, int col)
{
DBCFile *file = dbcHandler->getFileByIdx(row);
int bus = ui->tableFiles->item(row, col)->text().toInt();
if (bus > -2 && bus < 2)
int numBuses = CANConManager::getInstance()->getNumBuses();
if (bus > -2 && bus < numBuses)
{
file->setAssocBus(bus);
}