From 971312486ede71496a2f0670dd8368b1569e1043 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Sun, 7 May 2023 17:56:00 -0400 Subject: [PATCH] Fix error in loading of PCAN V1.3 files. --- framefileio.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/framefileio.cpp b/framefileio.cpp index ff62cd9..e0da8fd 100644 --- a/framefileio.cpp +++ b/framefileio.cpp @@ -1402,10 +1402,13 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) lineCounter = 0; } line = inFile->readLine(); - if (line.startsWith(";$FILEVERSION=2.0")) fileVersion = 20; - if (line.startsWith(";$FILEVERSION=1.3")) fileVersion = 13; - if (line.startsWith(";$FILEVERSION=1.1")) fileVersion = 11; - if (line.startsWith(';')) continue; + if (line.startsWith(';')) + { + if (line.contains("$FILEVERSION=2.0")) fileVersion = 20; + if (line.contains("$FILEVERSION=1.3")) fileVersion = 13; + if (line.contains("$FILEVERSION=1.1")) fileVersion = 11; + continue; + } if (line.length() > 41) { line = line.simplified(); @@ -1466,7 +1469,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) if (tokens.length() > 6) { thisFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, static_cast(tokens[1].toDouble() * 1000.0))); - thisFrame.setFrameId(tokens[3].toUInt(nullptr, 16)); + thisFrame.setFrameId(tokens[4].toUInt(nullptr, 16)); if (thisFrame.frameId() < 0x1FFFFFFF) { int numBytes = tokens[6].toInt();