From 148f37b7495911aae04441fe9f2b32155167d5d0 Mon Sep 17 00:00:00 2001 From: Alexey Esaulenko Date: Sat, 21 Jun 2025 17:21:00 +0400 Subject: [PATCH 1/5] Fix reading PCAN-View frames with empty data field --- framefileio.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/framefileio.cpp b/framefileio.cpp index 24090d8..dddc874 100644 --- a/framefileio.cpp +++ b/framefileio.cpp @@ -1454,8 +1454,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) QByteArray bytes(numBytes, 0); thisFrame.isReceived = true; thisFrame.bus = 0; - if ((thisFrame.frameId() > 0x10000000) || - (tokens[3].length() >= 8)) + if ((thisFrame.frameId() > 0x10000000) || (tokens[3].length() >= 8)) { thisFrame.setExtendedFrameFormat(true); } @@ -1464,7 +1463,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) thisFrame.setExtendedFrameFormat(false); } - if (tokens[5] == "R") + if (tokens.value(5) == "R") // might be empty! { thisFrame.setFrameType(QCanBusFrame::RemoteRequestFrame); } @@ -1507,8 +1506,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) //qDebug() << thisFrame.payload().length(); thisFrame.isReceived = true; thisFrame.bus = tokens[2].toInt(); - if ((thisFrame.frameId() > 0x10000000) || - (tokens[4].length() >= 8)) + if ((thisFrame.frameId() > 0x10000000) || (tokens[4].length() >= 8)) { thisFrame.setExtendedFrameFormat(true); } @@ -1516,7 +1514,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) { thisFrame.setExtendedFrameFormat(false); } - if (tokens[7] == "R") + if (tokens.value(7) == "R") { thisFrame.setFrameType(QCanBusFrame::RemoteRequestFrame); } @@ -1550,8 +1548,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) //qDebug() << thisFrame.payload().length(); thisFrame.isReceived = true; thisFrame.bus = 0; - if ((thisFrame.frameId() > 0x10000000) || - (tokens[3].length() >= 8)) + if ((thisFrame.frameId() > 0x10000000) || (tokens[3].length() >= 8)) { thisFrame.setExtendedFrameFormat(true); } @@ -1559,7 +1556,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) { thisFrame.setExtendedFrameFormat(false); } - if (tokens[6] == "R") + if (tokens.value(6) == "R") { thisFrame.setFrameType(QCanBusFrame::RemoteRequestFrame); } @@ -1603,8 +1600,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) //qDebug() << thisFrame.payload().length(); thisFrame.isReceived = true; thisFrame.bus = tokens[3].toInt(); - if ((thisFrame.frameId() > 0x10000000) || - (tokens[4].length() >= 8)) + if ((thisFrame.frameId() > 0x10000000) || (tokens[4].length() >= 8)) { thisFrame.setExtendedFrameFormat(true); } @@ -1646,10 +1642,7 @@ bool FrameFileIO::isCanalyzerASC(QString filename) { QFile *inFile = new QFile(filename); QByteArray line; - //int lineCounter = 0; - //bool inHeader = true; bool isMatch = true; - QList tokens; if (!inFile->open(QIODevice::ReadOnly | QIODevice::Text)) { @@ -2576,7 +2569,6 @@ bool FrameFileIO::loadLogFile(QString filename, QVector* frames) QFile *inFile = new QFile(filename); CANFrame thisFrame; QByteArray line; - uint64_t timeStamp = Utility::GetTimeMS(); int lineCounter = 0; bool foundErrors = false; @@ -2604,7 +2596,7 @@ bool FrameFileIO::loadLogFile(QString filename, QVector* frames) if (tokens.length() >= 6) { QList timeToks = tokens[0].split(':'); - timeStamp = (timeToks[0].toUInt() * (1000ul * 1000ul * 60ul * 60ul)) + (timeToks[1].toUInt() * (1000ul * 1000ul * 60ul)) + uint64_t timeStamp = (timeToks[0].toUInt() * (1000ul * 1000ul * 60ul * 60ul)) + (timeToks[1].toUInt() * (1000ul * 1000ul * 60ul)) + (timeToks[2].toUInt() * (1000ul * 1000ul)) + (timeToks[3].toUInt() * 100ul); thisFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, timeStamp)); if (tokens[1].at(0) == 'R') thisFrame.isReceived = true; From 118f36e00508ef74594b4ec1a666ca66afc7614e Mon Sep 17 00:00:00 2001 From: Alexey Esaulenko Date: Wed, 25 Jun 2025 21:41:55 +0400 Subject: [PATCH 2/5] DBC parser: cached attributes cannot be read after attributes.append(...) --- dbc/dbchandler.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/dbc/dbchandler.cpp b/dbc/dbchandler.cpp index deeb55d..9c45374 100644 --- a/dbc/dbchandler.cpp +++ b/dbc/dbchandler.cpp @@ -1131,8 +1131,7 @@ bool DBCFile::loadFile(QString fileName) } //upon loading the file add our custom foreground and background color attributes if they don't exist already - DBC_ATTRIBUTE *bgAttr = findAttributeByName("GenMsgBackgroundColor"); - if (!bgAttr) + if (!findAttributeByName("GenMsgBackgroundColor")) { attr.attrType = ATTR_TYPE_MESSAGE; attr.defaultValue = QApplication::palette().color(QPalette::Base).name(); @@ -1142,11 +1141,9 @@ bool DBCFile::loadFile(QString fileName) attr.name = "GenMsgBackgroundColor"; attr.valType = ATTR_STRING; dbc_attributes.append(attr); - bgAttr = findAttributeByName("GenMsgBackgroundColor"); } - DBC_ATTRIBUTE *fgAttr = findAttributeByName("GenMsgForegroundColor"); - if (!fgAttr) + if (!findAttributeByName("GenMsgForegroundColor")) { attr.attrType = ATTR_TYPE_MESSAGE; attr.defaultValue = QApplication::palette().color(QPalette::WindowText).name(); @@ -1156,7 +1153,6 @@ bool DBCFile::loadFile(QString fileName) attr.name = "GenMsgForegroundColor"; attr.valType = ATTR_STRING; dbc_attributes.append(attr); - fgAttr = findAttributeByName("GenMsgForegroundColor"); } DBC_ATTRIBUTE *mc_attr = findAttributeByName("matchingcriteria"); @@ -1179,19 +1175,16 @@ bool DBCFile::loadFile(QString fileName) messageHandler->setFilterLabeling(false); } - QColor DefaultBG = QColor(bgAttr->defaultValue.toString()); - QColor DefaultFG = QColor(fgAttr->defaultValue.toString()); - - DBC_ATTRIBUTE_VALUE *thisBG; - DBC_ATTRIBUTE_VALUE *thisFG; + QColor DefaultBG = QColor(findAttributeByName("GenMsgBackgroundColor")->defaultValue.toString()); + QColor DefaultFG = QColor(findAttributeByName("GenMsgForegroundColor")->defaultValue.toString()); for (int x = 0; x < messageHandler->getCount(); x++) { DBC_MESSAGE *msg = messageHandler->findMsgByIdx(x); msg->bgColor = DefaultBG; msg->fgColor = DefaultFG; - thisBG = msg->findAttrValByName("GenMsgBackgroundColor"); - thisFG = msg->findAttrValByName("GenMsgForegroundColor"); + DBC_ATTRIBUTE_VALUE *thisBG = msg->findAttrValByName("GenMsgBackgroundColor"); + DBC_ATTRIBUTE_VALUE *thisFG = msg->findAttrValByName("GenMsgForegroundColor"); if (thisBG) msg->bgColor = QColor(thisBG->value.toString()); if (thisFG) msg->fgColor = QColor(thisFG->value.toString()); for (int y = 0; y < msg->sigHandler->getCount(); y++) From a15359ba768ddedf407c27eeef67e3c1e1ccfeac Mon Sep 17 00:00:00 2001 From: Initdd Date: Sat, 19 Jul 2025 12:47:09 +0100 Subject: [PATCH 3/5] fix: Add support for boolean attribute values in DBC file saving --- dbc/dbchandler.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dbc/dbchandler.cpp b/dbc/dbchandler.cpp index deeb55d..c71481e 100644 --- a/dbc/dbchandler.cpp +++ b/dbc/dbchandler.cpp @@ -1426,6 +1426,9 @@ bool DBCFile::saveFile(QString fileName) case QVariant::Type::String: attrValOutput.append("\"" + val.value.toString() + "\";\n"); break; + case QVariant::Type::Bool: + attrValOutput.append(QString::number(val.value.toBool() ? 1 : 0) + ";\n"); + break; default: attrValOutput.append(val.value.toString() + ";\n"); break; @@ -1471,6 +1474,9 @@ bool DBCFile::saveFile(QString fileName) case QVariant::Type::String: attrValOutput.append("\"" + val.value.toString() + "\";\n"); break; + case QVariant::Type::Bool: + attrValOutput.append(QString::number(val.value.toBool() ? 1 : 0) + ";\n"); + break; default: attrValOutput.append(val.value.toString() + ";\n"); break; @@ -1549,6 +1555,9 @@ bool DBCFile::saveFile(QString fileName) case QVariant::Type::String: attrValOutput.append("\"" + val.value.toString() + "\";\n"); break; + case QVariant::Type::Bool: + attrValOutput.append(QString::number(val.value.toBool() ? 1 : 0) + ";\n"); + break; default: attrValOutput.append(val.value.toString() + ";\n"); break; From 571584f208bf866cdb724e7c6237ee86edcedac8 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Mon, 28 Jul 2025 21:35:43 -0400 Subject: [PATCH 4/5] Update build.yml Update Windows build to 2022 because 2019 is disabled now --- .github/workflows/build.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5961338..d68dc0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,8 +44,8 @@ jobs: steps: - name: Prepare macOS Environment run: | - brew install qt5 - brew link qt5 --force + brew install qt@5 + brew link qt@5 --force - name: Clone uses: actions/checkout@v3 @@ -74,8 +74,8 @@ jobs: steps: - name: Prepare macOS Environment run: | - brew install qt5 - brew link qt5 --force + brew install qt@5 + brew link qt@5 --force - name: Clone uses: actions/checkout@v3 @@ -99,7 +99,7 @@ jobs: buildwindows: name: Windows x64 - runs-on: windows-2019 + runs-on: windows-2022 steps: - name: Prepare Qt Libraries @@ -111,8 +111,7 @@ jobs: - name: Compile shell: cmd run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" qmake CONFIG+=release SavvyCAN.pro nmake /C @@ -189,7 +188,7 @@ jobs: release_msg="${release_msg//$'('/'-'}" release_msg="${release_msg//$')'/'-'}" echo $release_msg - echo "::set-output name=msg::$release_msg" + echo "{msg}={$release_msg}" >> $GITHUB_OUTPUT - name: Notify Discord run: | From affa893f1ddac29b4b1985b089d4601f235e5e32 Mon Sep 17 00:00:00 2001 From: "b.lebreton" Date: Mon, 25 Aug 2025 09:32:31 +0200 Subject: [PATCH 5/5] Add support for extended can in canlogserver --- connections/canlogserver.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/connections/canlogserver.cpp b/connections/canlogserver.cpp index 78a2bc5..2fc210f 100644 --- a/connections/canlogserver.cpp +++ b/connections/canlogserver.cpp @@ -69,16 +69,16 @@ void CanLogServer::readNetworkData() QString qstrId = lstMsg[0]; // Extract payload QString qstrPayload = lstMsg[1]; - // Support only normal can message. Extended CAN not supported. - if(qstrId.size() <= 4){ + // Check ID size + if(qstrId.size() <= 4 || qstrId.size() == 8){ // Prepare the frame CANFrame* frame_p = getQueue().get(); // Check for frame existence if(frame_p){ // Set frame ID frame_p->setFrameId(qstrId.toInt(nullptr, 16)); - // Extended frame NOT SUPPORTED - frame_p->setExtendedFrameFormat(0); + // Extended frame + frame_p->setExtendedFrameFormat(frame_p->frameId() > 0x7FF); // Set bus id frame_p->bus = qstrCanId.toInt(); // Set frame type