| 330 | } |
| 331 | |
| 332 | DBC_MESSAGE* DBCFile::parseMessageLine(QString line) |
| 333 | { |
| 334 | QRegularExpression regex; |
| 335 | QRegularExpressionMatch match; |
| 336 | |
| 337 | DBC_MESSAGE *msgPtr; |
| 338 | |
| 339 | qDebug() << "Found a BO line"; |
| 340 | regex.setPattern("^BO\\_ (\\w+) (\\w+) *: (\\w+) (\\w+)"); |
| 341 | match = regex.match(line); |
| 342 | //captured 1 = the ID in decimal |
| 343 | //captured 2 = The message name |
| 344 | //captured 3 = the message length |
| 345 | //captured 4 = the NODE responsible for this message |
| 346 | if (match.hasMatch()) |
| 347 | { |
| 348 | DBC_MESSAGE msg; |
| 349 | msg.ID = match.captured(1).toULong() & 0x7FFFFFFFul; //the ID is always stored in decimal format |
| 350 | msg.name = match.captured(2); |
| 351 | msg.len = match.captured(3).toUInt(); |
| 352 | msg.sender = findNodeByName(match.captured(4)); |
| 353 | if (!msg.sender) msg.sender = findNodeByIdx(0); |
| 354 | messageHandler->addMessage(msg); |
| 355 | msgPtr = messageHandler->findMsgByID(msg.ID); |
| 356 | } |
| 357 | else msgPtr = nullptr; |
| 358 | return msgPtr; |
| 359 | } |
| 360 | |
| 361 | DBC_SIGNAL* DBCFile::parseSignalLine(QString line, DBC_MESSAGE *msg) |
| 362 | { |
nothing calls this directly
no test coverage detected