@@ -15,7 +15,7 @@ DBCLoadSaveWindow::DBCLoadSaveWindow(const QVector<CANFrame> *frames, QWidget *p
|
|||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
inhibitCellProcessing = false;
|
inhibitCellProcessing = true;
|
||||||
|
|
||||||
QStringList header;
|
QStringList header;
|
||||||
header << "Filename" << "Associated Bus" << "Matching criteria" << "Label filters";
|
header << "Filename" << "Associated Bus" << "Matching criteria" << "Label filters";
|
||||||
@@ -69,6 +69,8 @@ DBCLoadSaveWindow::DBCLoadSaveWindow(const QVector<CANFrame> *frames, QWidget *p
|
|||||||
editorWindow = new DBCMainEditor(frames, this);
|
editorWindow = new DBCMainEditor(frames, this);
|
||||||
currentlyEditingFile = nullptr;
|
currentlyEditingFile = nullptr;
|
||||||
|
|
||||||
|
inhibitCellProcessing = false;
|
||||||
|
|
||||||
installEventFilter(this);
|
installEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,12 +102,16 @@ void DBCLoadSaveWindow::updateSettings()
|
|||||||
DBCFile * file = dbcHandler->getFileByIdx(i);
|
DBCFile * file = dbcHandler->getFileByIdx(i);
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
|
qDebug() << "Save DBC settings #" << i << " File: " << file->getFullFilename()
|
||||||
|
<< "Bus: " << file->getAssocBus() << "MC: " << file->messageHandler->getMatchingCriteria()
|
||||||
|
<< "Filter Labeling: " << (file->messageHandler->filterLabeling() ? "enabled" : "disabled");
|
||||||
settings.setValue("DBC/Filename_" + QString(i), file->getFullFilename());
|
settings.setValue("DBC/Filename_" + QString(i), file->getFullFilename());
|
||||||
settings.setValue("DBC/AssocBus_" + QString(i), file->getAssocBus());
|
settings.setValue("DBC/AssocBus_" + QString(i), file->getAssocBus());
|
||||||
settings.setValue("DBC/MatchingCriteria_" + QString(i), file->messageHandler->getMatchingCriteria());
|
settings.setValue("DBC/MatchingCriteria_" + QString(i), file->messageHandler->getMatchingCriteria());
|
||||||
settings.setValue("DBC/FilterLabeling_" + QString(i), file->messageHandler->filterLabeling());
|
settings.setValue("DBC/FilterLabeling_" + QString(i), file->messageHandler->filterLabeling());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
emit updatedDBCSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DBCLoadSaveWindow::eventFilter(QObject *obj, QEvent *event)
|
bool DBCLoadSaveWindow::eventFilter(QObject *obj, QEvent *event)
|
||||||
@@ -146,6 +152,7 @@ void DBCLoadSaveWindow::loadFile()
|
|||||||
{
|
{
|
||||||
DBCFile *file = dbcHandler->loadDBCFile(-1);
|
DBCFile *file = dbcHandler->loadDBCFile(-1);
|
||||||
if(file) {
|
if(file) {
|
||||||
|
inhibitCellProcessing=true;
|
||||||
int idx = ui->tableFiles->rowCount();
|
int idx = ui->tableFiles->rowCount();
|
||||||
ui->tableFiles->insertRow(ui->tableFiles->rowCount());
|
ui->tableFiles->insertRow(ui->tableFiles->rowCount());
|
||||||
ui->tableFiles->setItem(idx, 0, new QTableWidgetItem(file->getFullFilename()));
|
ui->tableFiles->setItem(idx, 0, new QTableWidgetItem(file->getFullFilename()));
|
||||||
@@ -169,6 +176,7 @@ void DBCLoadSaveWindow::loadFile()
|
|||||||
{
|
{
|
||||||
item->setCheckState(Qt::Unchecked);
|
item->setCheckState(Qt::Unchecked);
|
||||||
}
|
}
|
||||||
|
inhibitCellProcessing=false;
|
||||||
|
|
||||||
updateSettings();
|
updateSettings();
|
||||||
}
|
}
|
||||||
@@ -237,6 +245,7 @@ void DBCLoadSaveWindow::editFile()
|
|||||||
|
|
||||||
void DBCLoadSaveWindow::matchingCriteriaChanged(int index)
|
void DBCLoadSaveWindow::matchingCriteriaChanged(int index)
|
||||||
{
|
{
|
||||||
|
if (inhibitCellProcessing) return;
|
||||||
// We don't know which combobox changed, so we just update all of them
|
// We don't know which combobox changed, so we just update all of them
|
||||||
for (int row=0; row<ui->tableFiles->rowCount(); row++)
|
for (int row=0; row<ui->tableFiles->rowCount(); row++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ private slots:
|
|||||||
void matchingCriteriaChanged(int index);
|
void matchingCriteriaChanged(int index);
|
||||||
void newFile();
|
void newFile();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void updatedDBCSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DBCLoadSaveWindow *ui;
|
Ui::DBCLoadSaveWindow *ui;
|
||||||
DBCHandler *dbcHandler;
|
DBCHandler *dbcHandler;
|
||||||
|
|||||||
@@ -1029,11 +1029,19 @@ void MainWindow::showFlowViewWindow()
|
|||||||
flowViewWindow->show();
|
flowViewWindow->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::DBCSettingsUpdated()
|
||||||
|
{
|
||||||
|
updateFilterList();
|
||||||
|
model->sendRefresh();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::showDBCFileWindow()
|
void MainWindow::showDBCFileWindow()
|
||||||
{
|
{
|
||||||
if (!dbcFileWindow)
|
if (!dbcFileWindow)
|
||||||
{
|
{
|
||||||
dbcFileWindow = new DBCLoadSaveWindow(model->getListReference());
|
dbcFileWindow = new DBCLoadSaveWindow(model->getListReference());
|
||||||
|
connect(dbcFileWindow, &DBCLoadSaveWindow::updatedDBCSettings, this, &MainWindow::DBCSettingsUpdated);
|
||||||
}
|
}
|
||||||
dbcFileWindow->show();
|
dbcFileWindow->show();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ private slots:
|
|||||||
void filterSetAll();
|
void filterSetAll();
|
||||||
void filterClearAll();
|
void filterClearAll();
|
||||||
void headerClicked (int logicalIndex);
|
void headerClicked (int logicalIndex);
|
||||||
|
void DBCSettingsUpdated();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void gotFrames(int);
|
void gotFrames(int);
|
||||||
|
|||||||
Reference in New Issue
Block a user