Merge branch 'collin80:master' into fix_addframebadalloc
This commit is contained in:
@@ -13,6 +13,9 @@ CANConnection* CanConFactory::create(type pType, QString pPortName, QString pDri
|
||||
case SERIALBUS:
|
||||
return new SerialBusConnection(pPortName, pDriverName);
|
||||
case GVRET_SERIAL:
|
||||
if(pPortName.contains("."))
|
||||
return new GVRetSerial(pPortName, true);
|
||||
else
|
||||
return new GVRetSerial(pPortName, false);
|
||||
case REMOTE:
|
||||
return new GVRetSerial(pPortName, true); //it's a special case of GVRET connected over TCP/IP so it uses the same class
|
||||
|
||||
+17
-1
@@ -192,6 +192,7 @@ bool DBCMessageHandler::removeMessage(DBC_MESSAGE *msg)
|
||||
{
|
||||
messages.removeAt(i);
|
||||
qDebug() << "Removed message at idx " << i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -336,7 +337,22 @@ DBC_NODE* DBCFile::findNodeByName(QString name)
|
||||
if (dbc_nodes.length() == 0) return nullptr;
|
||||
for (int i = 0; i < dbc_nodes.length(); i++)
|
||||
{
|
||||
if (dbc_nodes[i].name.compare(name, Qt::CaseInsensitive) == 0)
|
||||
if (name.compare(dbc_nodes[i].name, Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
return &dbc_nodes[i];
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DBC_NODE* DBCFile::findNodeByNameAndComment(QString fullname)
|
||||
{
|
||||
QString nameAndComment;
|
||||
if (dbc_nodes.length() == 0) return nullptr;
|
||||
for (int i = 0; i < dbc_nodes.length(); i++)
|
||||
{
|
||||
nameAndComment = dbc_nodes[i].name + " - " + dbc_nodes[i].comment;
|
||||
if (fullname.compare(nameAndComment, Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
return &dbc_nodes[i];
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ public:
|
||||
DBCFile(const DBCFile& cpy);
|
||||
DBCFile& operator=(const DBCFile& cpy);
|
||||
DBC_NODE *findNodeByName(QString name);
|
||||
DBC_NODE *findNodeByNameAndComment(QString fullname);
|
||||
DBC_NODE *findNodeByIdx(int idx);
|
||||
DBC_ATTRIBUTE *findAttributeByName(QString name, DBC_ATTRIBUTE_TYPE type = ATTR_TYPE_ANY);
|
||||
DBC_ATTRIBUTE *findAttributeByIdx(int idx);
|
||||
|
||||
@@ -631,7 +631,7 @@ void DBCMainEditor::deleteCurrentTreeItem()
|
||||
{
|
||||
QTreeWidgetItem *currItem = ui->treeDBC->currentItem();
|
||||
int typ = currItem->data(0, Qt::UserRole).toInt();
|
||||
QString idString;
|
||||
QString idString, columnText;
|
||||
int msgID;
|
||||
DBC_MESSAGE *msg;
|
||||
DBC_NODE *node;
|
||||
@@ -642,7 +642,8 @@ void DBCMainEditor::deleteCurrentTreeItem()
|
||||
switch (typ)
|
||||
{
|
||||
case 1: //deleting a node cascades deletion down to messages and signals
|
||||
node = dbcFile->findNodeByName(currItem->text(0));
|
||||
columnText = currItem->text(0);
|
||||
node = dbcFile->findNodeByNameAndComment(columnText);
|
||||
if (!node) return;
|
||||
for (int x = 0; x < dbcFile->messageHandler->getCount(); x++)
|
||||
{
|
||||
|
||||
@@ -898,7 +898,7 @@ void FrameSenderWindow::processCellChange(int line, int col)
|
||||
case 6: //Data bytes
|
||||
for (int i = 0; i < 8; i++) sendingData[line].payload().data()[i] = 0;
|
||||
|
||||
tokens = ui->tableSender->item(line, 6)->text().split(" ");
|
||||
tokens = ui->tableSender->item(line, 6)->text().split(" ", QString::SkipEmptyParts);
|
||||
arr.clear();
|
||||
arr.reserve(tokens.count());
|
||||
for (int j = 0; j < tokens.count(); j++)
|
||||
|
||||
Reference in New Issue
Block a user