Fix for a few issues with DBC file loading and the ability to reorder DBC files.
This commit is contained in:
+7
-3
@@ -460,9 +460,13 @@ DBC_SIGNAL* DBCFile::parseSignalLine(QString line, DBC_MESSAGE *msg)
|
||||
if (!sig.receiver) sig.receiver = findNodeByIdx(0); //apply default if there was no match
|
||||
|
||||
sig.parentMessage = msg;
|
||||
msg->sigHandler->addSignal(sig);
|
||||
if (isMultiplexor) msg->multiplexorSignal = msg->sigHandler->findSignalByName(sig.name);
|
||||
return msg->sigHandler->findSignalByName(sig.name);
|
||||
if (msg)
|
||||
{
|
||||
msg->sigHandler->addSignal(sig);
|
||||
if (isMultiplexor) msg->multiplexorSignal = msg->sigHandler->findSignalByName(sig.name);
|
||||
return msg->sigHandler->findSignalByName(sig.name);
|
||||
}
|
||||
else return nullptr;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -15,6 +15,8 @@ DBCLoadSaveWindow::DBCLoadSaveWindow(const QVector<CANFrame> *frames, QWidget *p
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
inhibitCellProcessing = false;
|
||||
|
||||
QStringList header;
|
||||
header << "Filename" << "Associated Bus" << "J1939";
|
||||
ui->tableFiles->setColumnCount(3);
|
||||
@@ -159,6 +161,7 @@ void DBCLoadSaveWindow::editFile()
|
||||
|
||||
void DBCLoadSaveWindow::cellChanged(int row, int col)
|
||||
{
|
||||
if (inhibitCellProcessing) return;
|
||||
if (col == 1) //the bus column
|
||||
{
|
||||
DBCFile *file = dbcHandler->getFileByIdx(row);
|
||||
@@ -214,6 +217,7 @@ void DBCLoadSaveWindow::swapTableRows(bool up)
|
||||
const int destIdx = (up ? idx-1 : idx+1);
|
||||
Q_ASSERT(destIdx >= 0 && destIdx < ui->tableFiles->rowCount());
|
||||
|
||||
inhibitCellProcessing = true;
|
||||
// take whole rows
|
||||
QList<QTableWidgetItem*> sourceItems = takeRow(idx);
|
||||
QList<QTableWidgetItem*> destItems = takeRow(destIdx);
|
||||
@@ -221,6 +225,8 @@ void DBCLoadSaveWindow::swapTableRows(bool up)
|
||||
// set back in reverse order
|
||||
setRow(idx, destItems);
|
||||
setRow(destIdx, sourceItems);
|
||||
|
||||
inhibitCellProcessing = false;
|
||||
}
|
||||
|
||||
QList<QTableWidgetItem*> DBCLoadSaveWindow::takeRow(int row)
|
||||
|
||||
@@ -35,6 +35,7 @@ private:
|
||||
DBCFile *currentlyEditingFile;
|
||||
const QVector<CANFrame> *referenceFrames;
|
||||
DBCMainEditor *editorWindow;
|
||||
bool inhibitCellProcessing;
|
||||
|
||||
void swapTableRows(bool up);
|
||||
QList<QTableWidgetItem*> takeRow(int row);
|
||||
|
||||
Reference in New Issue
Block a user