Skip to content

Commit

Permalink
Fix error in loading of PCAN V1.3 files.
Browse files Browse the repository at this point in the history
  • Loading branch information
collin80 committed May 7, 2023
1 parent 0c20e1d commit 01953e6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions framefileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1402,10 +1402,13 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector<CANFrame>* 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();
Expand Down Expand Up @@ -1466,7 +1469,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector<CANFrame>* frames)
if (tokens.length() > 6)
{
thisFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, static_cast<uint64_t>(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();
Expand Down

0 comments on commit 01953e6

Please sign in to comment.