From d3feb284a1dfb71d39fcbf978abe559b814ccdbc Mon Sep 17 00:00:00 2001 From: Brice Gaulupeau Date: Thu, 10 Dec 2020 08:12:22 +0100 Subject: [PATCH 1/4] Fix PCAN loading issues Uses numBytes instead of thisFrame.payload().length() as the payload is not yet defined Scan the first 25 lines intead of 10 as version 1 has a long header --- framefileio.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framefileio.cpp b/framefileio.cpp index 20e7fb0..d086013 100644 --- a/framefileio.cpp +++ b/framefileio.cpp @@ -1258,7 +1258,7 @@ bool FrameFileIO::isPCANFile(QString filename) { while (!inFile->atEnd()) { lineCounter++; - if (lineCounter > 10) + if (lineCounter > 25) { break; } @@ -1375,7 +1375,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) if (line.at(41) == 'R') { thisFrame.setFrameType(QCanBusFrame::RemoteRequestFrame); } else { - QList tokens = line.mid(41, thisFrame.payload().length() * 3).split(' '); + QList tokens = line.mid(41, numBytes * 3).split(' '); thisFrame.setFrameType(QCanBusFrame::DataFrame); for (int d = 0; d < numBytes; d++) { @@ -1398,7 +1398,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) { int numBytes = line.mid(37,2).trimmed().toInt(); QByteArray bytes(numBytes, 0); - qDebug() << thisFrame.payload().length(); + //qDebug() << thisFrame.payload().length(); thisFrame.isReceived = true; thisFrame.bus = 0; if (line.at(25) == ' ') { @@ -1409,7 +1409,7 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector* frames) if (line.at(40) == 'R') { thisFrame.setFrameType(QCanBusFrame::RemoteRequestFrame); } else { - QList tokens = line.mid(40, thisFrame.payload().length() * 3).split(' '); + QList tokens = line.mid(40, numBytes * 3).split(' '); thisFrame.setFrameType(QCanBusFrame::DataFrame); for (int d = 0; d < numBytes; d++) { From f9a490ba0ceaafdcf874743af28d61cbe8f52a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Aagaard=20S=C3=B8rensen?= Date: Tue, 9 Feb 2021 14:23:11 +0100 Subject: [PATCH 2/4] Enable support for local plugins --- main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.cpp b/main.cpp index 3373145..847a380 100644 --- a/main.cpp +++ b/main.cpp @@ -5,6 +5,9 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); + //Add a local path for Qt extensions, to allow for per-application extensions. + a.addLibraryPath("plugins"); + //These things are used by QSettings to set up setting storage a.setOrganizationName("EVTV"); a.setApplicationName("SavvyCAN"); From d7dcc0513bfc417add03580b6e4482f990a7b571 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Sun, 14 Feb 2021 10:56:10 -0500 Subject: [PATCH 3/4] Update README.md --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4566633..2bd059c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ # SavvyCAN Qt based cross platform canbus tool -(C) 2015-2018 EVTV and Collin Kidder +(C) 2015-2021 EVTV and Collin Kidder A Qt5 based cross platform tool which can be used to load, save, and capture canbus frames. This tool is designed to help with visualization, reverse engineering, debugging, and capturing of canbus frames. -Really requires at a resolution of at least 1024x768. Fully multi-monitor capable. Works on 4K monitors as well. +Please use the "Discussions" tab here on GitHub to ask questions and interact with the community. + +Requires at a resolution of at least 1024x768. Fully multi-monitor capable. Works on 4K monitors as well. You are highly recommended to use the [CANDue board from EVTV](http://store.evtv.me/proddetail.php?prod=ArduinoDueCANBUS&cat=23). @@ -46,12 +48,15 @@ http://www.qcustomplot.com/ However, this source code is integrated into the source for SavvyCAN and one isn't required to download it separately. -This project requires 5.8.0 or higher because of a dependency on QSerialBus. However, you will get -even more SerialBus goodness if you use QT 5.11 or 5.12 +This project requires 5.10.0 or higher because of a dependency on QtSerialBus. However, you will get +even more SerialBus goodness if you use QT 5.11 or higher. + +NOTE: QT6 currently lacks support for QtSerialBus and many other QT sub-features. At this time you cannot +use QT6 to compile SavvyCAN. Support for QT6 should be possible around QT6.2. ## Instructions for compiling: -[Download the newest stable version of Qt directly from qt.io](https://www.qt.io/download/) (You need 5.8.x or newer) +[Download the newest stable version of Qt directly from qt.io](https://www.qt.io/download/) (You need 5.10.x or newer) ```sh cd ~ @@ -60,7 +65,7 @@ git clone https://github.com/collin80/SavvyCAN.git cd SavvyCAN -~/Qt/5.8/gcc_64/bin/qmake +~/Qt/5.10/gcc_64/bin/qmake make ``` From 0cfa6ce37931ed198b2714d0a3c13dd06613d392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Aagaard=20S=C3=B8rensen?= Date: Mon, 15 Feb 2021 10:27:43 +0100 Subject: [PATCH 4/4] Enable support for Tx via QCanBus by utilizing information stored in hasLocalEcho. --- connections/serialbusconnection.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/connections/serialbusconnection.cpp b/connections/serialbusconnection.cpp index f628cb6..5da0d19 100644 --- a/connections/serialbusconnection.cpp +++ b/connections/serialbusconnection.cpp @@ -222,16 +222,18 @@ void SerialBusConnection::framesReceived() } frame_p->extended = true; */ + frame_p->isReceived = true; } else { frame_p->setExtendedFrameFormat(recFrame.hasExtendedFrameFormat()); frame_p->setFrameId(recFrame.frameId()); frame_p->setTimeStamp(recFrame.timeStamp()); frame_p->setFrameType(recFrame.frameType()); frame_p->setError(recFrame.error()); - frame_p->isReceived = true; + + /* If recorded frame has a local echo, it is a Tx message, and thus should not be marked as Rx */ + frame_p->isReceived = !recFrame.hasLocalEcho(); } - - frame_p->isReceived = true; + if (useSystemTime) { frame_p->setTimeStamp(QCanBusFrame::TimeStamp(0, QDateTime::currentMSecsSinceEpoch() * 1000ul)); }