Skip to content

Commit

Permalink
Merge pull request #1 from collin80/master
Browse files Browse the repository at this point in the history
Pull upstream changes
  • Loading branch information
tcfx44 authored Jul 3, 2024
2 parents bc39109 + 53c0dae commit 105c7a0
Show file tree
Hide file tree
Showing 150 changed files with 10,461 additions and 3,194 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ on:
jobs:
buildlinux:
name: Linux x64
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Prepare Environment
run: |
sudo apt-get install libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-randr0
sudo apt-get install libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-randr0 libxkbcommon-x11-0
- name: Prepare Qt Libraries
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v3

- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Compile
run: |
Expand All @@ -29,18 +29,18 @@ jobs:
- name: Package
run: |
make INSTALL_ROOT=appdir install
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/5/linuxdeployqt-5-x86_64.AppImage"
chmod a+x linuxdeployqt-5-x86_64.AppImage
./linuxdeployqt-5-x86_64.AppImage appdir/usr/share/applications/SavvyCAN.desktop -appimage -extra-plugins=iconengines,platformthemes/libqgtk3.so,canbus
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/SavvyCAN.desktop -appimage -extra-plugins=iconengines,platformthemes/libqgtk3.so,canbus
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: SavvyCAN-Linux_x64.AppImage
path: SavvyCAN-x86_64.AppImage
path: SavvyCAN-*x86_64.AppImage

buildmacos:
name: macOS x64
runs-on: macos-10.15
runs-on: macos-12

steps:
- name: Prepare macOS Environment
Expand All @@ -49,7 +49,7 @@ jobs:
brew link qt5 --force
- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Compile
run: |
Expand All @@ -62,7 +62,7 @@ jobs:
cp -R help/* SavvyCAN.app/Contents/MacOS/help
macdeployqt SavvyCAN.app -dmg
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: SavvyCAN-macOS_x64.dmg
path: SavvyCAN.dmg
Expand All @@ -73,10 +73,10 @@ jobs:

steps:
- name: Prepare Qt Libraries
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v3

- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Compile
shell: cmd
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
mkdir package/canbus
copy "${Env:Qt5_Dir}/plugins/canbus/*.*" package/canbus/
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: SavvyCAN-Windows_x64
path: package
Expand All @@ -124,21 +124,21 @@ jobs:
needs: [buildwindows, buildmacos, buildlinux]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3

- name: Display structure of downloaded files
run: zip -r SavvyCAN_CIBuild.zip SavvyCAN-Windows_x64
run: zip -r SavvyCAN-Windows_x64_CIBuild.zip SavvyCAN-Windows_x64
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "continuous"
prerelease: true
title: "Development Build"
files: |
SavvyCAN-Linux_x64.AppImage/SavvyCAN-x86_64.AppImage
SavvyCAN_CIBuild.zip
SavvyCAN-Linux_x64.AppImage/SavvyCAN-*x86_64.AppImage
SavvyCAN-Windows_x64_CIBuild.zip
SavvyCAN-macOS_x64.dmg/SavvyCAN.dmg
notify:
Expand All @@ -155,6 +155,8 @@ jobs:
)
release_msg="${release_msg//$'\n'/'-'}"
release_msg="${release_msg//$'\r'/'-'}"
release_msg="${release_msg//$'('/'-'}"
release_msg="${release_msg//$')'/'-'}"
echo $release_msg
echo "::set-output name=msg::$release_msg"
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,19 @@ build/
*.out
*.app
*.user
SavvyCAN

# Generated files
**/moc_*
**/ui_*.h
**/qrc_*.cpp
SavvyCAN.pro.user.*
.qmake.stash
Makefile

# Editor files
*.code-workspace
SavvyCAN.pro.qtds
.xcode
SavvyCAN.xcodeproj
.vscode
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SavvyCAN
Qt based cross platform canbus tool
(C) 2015-2021 EVTV and Collin Kidder
Qt based cross platform canbus tool
(C) 2015-2024 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
Expand All @@ -10,16 +10,13 @@ Please use the "Discussions" tab here on GitHub to ask questions and interact wi

Requires a resolution of at least 1024x768. Fully multi-monitor capable. Works on 4K monitors as well.

You are highly recommended to use the
You are highly recommended to use the
[CANDue board from EVTV](http://store.evtv.me/proddetail.php?prod=ArduinoDueCANBUS&cat=23).

The CANDue board must be running the GVRET firmware which can also be found
within the collin80 repos.

It is now possible to use any Qt SerialBus driver (socketcan, Vector, PeakCAN, TinyCAN).
There may, however, be some loss of some functionality as
some functions of SavvyCAN are designed for use directly with the
EVTVDue and CANDue 2.0 boards.

It should, however, be noted that use of a capture device is not required to make use
of this program. It can load and save in several formats:
Expand All @@ -43,15 +40,16 @@ from the Qt installer.

Uses QCustomPlot available at:

http://www.qcustomplot.com/
http://www.qcustomplot.com/

However, this source code is integrated into the source for SavvyCAN and one isn't required
However, this source code is integrated into the source for SavvyCAN and one isn't required
to download it separately.

This project requires 5.14.0 or higher because of a dependency on QtSerialBus and other new additions to Qt.
This project requires 5.14.0 or higher because of a dependency on QtSerialBus and other new additions to Qt.

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.
NOTE: As the code in this master branch sits, it does compile with QT6. Support for QT6 is approximately "beta" quality. Most all functions should work, please send issues if found.

It appears that the current binary build for MacOS requires at least MacOS 10.15

## Instructions for compiling:

Expand All @@ -75,6 +73,8 @@ Now run SavvyCAN
./SavvyCAN
```

On linux systems you can run `./install.sh` to create a desktop shortcut.

### Compiling in debug mode for additional information

```sh
Expand All @@ -100,7 +100,7 @@ when you installed Qt.

### What to do if `qmake` fails with error `Project ERROR: Unknown module(s) in QT: qml serialbus help` on Ubuntu? :

`sudo apt install libqt5serialbus5-dev qtdeclarative5-dev qttools5-dev`
`sudo apt install libqt5serialbus5-dev libqt5serialport5-dev qtdeclarative5-dev qttools5-dev`

### Used Items Requiring Attribution

Expand All @@ -115,4 +115,3 @@ signal by juli from the Noun Project
signal by yudi from the Noun Project

Death by Adrien Coquet from the Noun Project

24 changes: 22 additions & 2 deletions SavvyCAN.pro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ QT = core gui printsupport qml serialbus serialport widgets help network opengl

CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT

CONFIG += c++11
CONFIG += c++17
CONFIG += NO_UNIT_TESTS

DEFINES += QCUSTOMPLOT_USE_OPENGL
Expand All @@ -20,7 +20,13 @@ QMAKE_INFO_PLIST = Info.plist.template
ICON = icons/SavvyIcon.icns

SOURCES += main.cpp\
canbridgewindow.cpp \
connections/canlogserver.cpp \
connections/canserver.cpp \
connections/lawicel_serial.cpp \
connections/mqtt_bus.cpp \
dbc/dbcnodeduplicateeditor.cpp \
framesenderobject.cpp \
mqtt/qmqtt_client.cpp \
mqtt/qmqtt_client_p.cpp \
mqtt/qmqtt_frame.cpp \
Expand All @@ -38,6 +44,7 @@ SOURCES += main.cpp\
mainwindow.cpp \
canframemodel.cpp \
simplecrypt.cpp \
triggerdialog.cpp \
utility.cpp \
qcustomplot.cpp \
frameplaybackwindow.cpp \
Expand Down Expand Up @@ -67,6 +74,7 @@ SOURCES += main.cpp\
dbc/dbcmaineditor.cpp \
dbc/dbcnodeeditor.cpp \
dbc/dbcsignaleditor.cpp \
dbc/dbcnoderebaseeditor.cpp \
re/discretestatewindow.cpp \
re/filecomparatorwindow.cpp \
re/flowviewwindow.cpp \
Expand Down Expand Up @@ -97,9 +105,16 @@ SOURCES += main.cpp\

HEADERS += mainwindow.h \
can_structs.h \
canbridgewindow.h \
canframemodel.h \
connections/canlogserver.h \
connections/canserver.h \
connections/lawicel_serial.h \
connections/socketcand.h \
connections/mqtt_bus.h \
dbc/dbcnodeduplicateeditor.h \
dbc/dbcnoderebaseeditor.h \
framesenderobject.h \
mqtt/qmqtt.h \
mqtt/qmqtt_client.h \
mqtt/qmqtt_client_p.h \
Expand All @@ -122,6 +137,7 @@ HEADERS += mainwindow.h \
qcpaxistickerhex.h \
re/dbccomparatorwindow.h \
simplecrypt.h \
triggerdialog.h \
utility.h \
qcustomplot.h \
frameplaybackwindow.h \
Expand Down Expand Up @@ -183,11 +199,15 @@ HEADERS += mainwindow.h \
pcaplite.h

FORMS += ui/candatagrid.ui \
triggerdialog.ui \
ui/canbridgewindow.ui \
ui/dbcnodeduplicateeditor.ui \
ui/dbccomparatorwindow.ui \
ui/dbcmessageeditor.ui \
ui/connectionwindow.ui \
ui/dbcloadsavewindow.ui \
ui/dbcmaineditor.ui \
ui/dbcnoderebaseeditor.ui \
ui/dbcsignaleditor.ui \
ui/dbcnodeeditor.ui \
ui/discretestatewindow.ui \
Expand All @@ -210,7 +230,7 @@ FORMS += ui/candatagrid.ui \
ui/udsscanwindow.ui \
ui/bisectwindow.ui \
ui/signalviewerwindow.ui \
helpwindow.ui \
ui/helpwindow.ui \
ui/newconnectiondialog.ui \
ui/temporalgraphwindow.ui

Expand Down
61 changes: 58 additions & 3 deletions bisectwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ BisectWindow::BisectWindow(const QVector<CANFrame> *frames, QWidget *parent) :
connect(ui->slidePercentage, &QSlider::sliderReleased, this, &BisectWindow::updatePercentText);
connect(ui->editFrameNumber, &QLineEdit::editingFinished, this, &BisectWindow::updateFrameNumSlider);
connect(ui->editPercentage, &QLineEdit::editingFinished, this, &BisectWindow::updatePercentSlider);
connect(ui->rbFrameNumber, &QRadioButton::toggled, this, &BisectWindow::updateSectionsText);
connect(ui->rbPercentage, &QRadioButton::toggled, this, &BisectWindow::updateSectionsText);
connect(ui->rbBusNum, &QRadioButton::toggled, this, &BisectWindow::updateSectionsText);
connect(ui->rbIDRange, &QRadioButton::toggled, this, &BisectWindow::updateSectionsText);

installEventFilter(this);

updateSectionsText();
}

BisectWindow::~BisectWindow()
Expand Down Expand Up @@ -61,6 +68,31 @@ bool BisectWindow::eventFilter(QObject *obj, QEvent *event)
return false;
}

void BisectWindow::updateSectionsText()
{
if (ui->rbBusNum->isChecked())
{
ui->rbLowerSection->setText("Only this bus");
ui->rbUpperSection->setText("Not this bus");
}
if (ui->rbFrameNumber->isChecked())
{
ui->rbLowerSection->setText("Up to this frame number");
ui->rbUpperSection->setText("After this frame number");
}
if (ui->rbIDRange->isChecked())
{
ui->rbLowerSection->setText("Inside the ID range");
ui->rbUpperSection->setText("Outside the ID range");
}
if (ui->rbPercentage->isChecked())
{
ui->rbLowerSection->setText("Up to this percentage into the file");
ui->rbUpperSection->setText("After this percentage into the file");
}

}

void BisectWindow::refreshIDList()
{
int id;
Expand Down Expand Up @@ -112,11 +144,12 @@ void BisectWindow::handleCalculateButton()
{
splitFrames.clear();
bool saveLower = ui->rbLowerSection->isChecked();
int targetFrameNum;
int targetFrameNum = 0;
if (ui->rbFrameNumber->isChecked() || ui->rbPercentage->isChecked())
{
if (ui->rbFrameNumber->isChecked()) targetFrameNum = ui->slideFrameNumber->value();
else targetFrameNum = modelFrames->count() * ui->slidePercentage->value() / 10000;
else targetFrameNum = modelFrames->count() * (ui->slidePercentage->value() / 10000.0);
qDebug() << "Target frame num " << targetFrameNum;
if (saveLower)
{
for (int i = 0; i < targetFrameNum; i++) splitFrames.append(modelFrames->at(i));
Expand All @@ -132,7 +165,29 @@ void BisectWindow::handleCalculateButton()
uint32_t upperID = Utility::ParseStringToNum2(ui->cbIDUpper->currentText());
for (int i = 0; i < modelFrames->count(); i++)
{
if (modelFrames->at(i).frameId() >= lowerID && modelFrames->at(i).frameId() <= upperID) splitFrames.append(modelFrames->at(i));
if (modelFrames->at(i).frameId() >= lowerID && modelFrames->at(i).frameId() <= upperID)
{
if (saveLower) splitFrames.append(modelFrames->at(i));
}
else
{
if (!saveLower) splitFrames.append(modelFrames->at(i));
}
}
}
else if (ui->rbBusNum->isChecked())
{
int targetBus = Utility::ParseStringToNum(ui->editBusNum->text());
for (int i = 0; i < modelFrames->count(); i++)
{
if (modelFrames->at(i).bus == targetBus)
{
if (saveLower) splitFrames.append(modelFrames->at(i));
}
else
{
if (!saveLower) splitFrames.append(modelFrames->at(i));
}
}
}
refreshFrameNumbers();
Expand Down
Loading

0 comments on commit 105c7a0

Please sign in to comment.