From 45c966b5c242f4d95f0713e295abc9a445a63ad3 Mon Sep 17 00:00:00 2001 From: Robin K Date: Tue, 26 Sep 2023 10:33:40 +0200 Subject: [PATCH] Add comma check to trc loader --- framefileio.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framefileio.cpp b/framefileio.cpp index 0bb687f..1922431 100644 --- a/framefileio.cpp +++ b/framefileio.cpp @@ -1054,7 +1054,7 @@ bool FrameFileIO::isCANHackerFile(QString filename) // CANHacker trace format // Time ID DLC Data Comment -// 00.000 00004000 8 36 47 19 43 01 00 00 80 +// 00[.|,]000 00004000 8 36 47 19 43 01 00 00 80 bool FrameFileIO::loadCANHackerFile(QString filename, QVector* frames) { QFile *inFile = new QFile(filename); @@ -1089,6 +1089,11 @@ bool FrameFileIO::loadCANHackerFile(QString filename, QVector* frames) if (tokens.length() > 3) { int idxOfDecimal = tokens[0].indexOf('.'); + // If no dot is found, try comma + if(idxOfDecimal == -1) + { + idxOfDecimal = tokens[0].indexOf(','); + } if (idxOfDecimal > -1) { //int decimalPlaces = tokens[0].length() - tokens[0].indexOf('.') - 1; //the result of the above is the # of digits after the decimal.