Skip to content

Commit bea1cde

Browse files
authored
Merge pull request #4 from aslansq/windows
windows os support
2 parents 503c779 + 6c02f42 commit bea1cde

22 files changed

Lines changed: 754 additions & 330 deletions

.github/workflows/cmake-single-platform.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
1818
# You can convert this to a matrix build if you need cross-platform coverage.
1919
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-22.04
2121

2222
steps:
2323
- uses: actions/checkout@v4
2424

2525
- name: Env
26-
run: sudo apt install qt5-qmake qtbase5-dev libqt5xmlpatterns5-dev libpopt-dev -y
26+
run: sudo apt update && sudo apt install libpopt-dev qt6-xmlpatterns-dev qml-qt6 qt6-base-dev -y
2727

2828
- name : Peak CAN drivers
2929
run: cd ${{github.workspace}}/drivers/peak-linux-driver-8.20.0 && make clean all && sudo make install

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ build/
44
uds_py/output/
55
output/
66
.vscode/
7+
uds_tracer.pro.user

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
![all_builds](https://github.com/aslansq/uds_tracer/actions/workflows/cmake-single-platform.yml/badge.svg)
2-
31
This tool is designed for listening to CAN traffic and identifying UDS (Unified Diagnostic Services) packages. It provides a graphical interface to help users analyze and validate the data efficiently. It supports CAN Standard (CAN Std), CAN Flexible Data-rate (CAN FD), and replaying recorded data for detailed analysis.
42

53
### Supported Devices
@@ -16,18 +14,21 @@ For detailed usage instructions and advanced features, refer to the [Wiki page](
1614

1715
To use this tool, ensure the following dependencies are installed:
1816

19-
- **Qt Framework**: Required for the graphical user interface. Install the Qt5 version for your platform.
17+
- **Qt Framework**: Required for the graphical user interface. Install the Qt6 version for your platform.
2018
- **PEAK-System Drivers**: Necessary for communication with PEAK-System USB CAN interfaces. Download and install the drivers from the [PEAK-System website](https://www.peak-system.com/).
21-
- **Python 3**: Required for generating UDS (Unified Diagnostic Services) messages. Ensure Python 3 is installed and accessible in your system's PATH.
2219

2320
### Compilation
2421

25-
To compile the tool, navigate to the main directory and run the `build.sh` script:
26-
22+
#### Linux
2723
```bash
2824
./build.sh
2925
```
3026

27+
#### Windows
28+
```bash
29+
build.bat
30+
```
31+
3132
### Source Code Documentation
3233

3334
1. To properly view the system's architecture and documentation, use Doxygen to generate the documentation. Follow these steps:
@@ -37,4 +38,9 @@ doxygen doxyfile
3738
```
3839
2. Open the generated `index.html` file located in the `doc/output/html` directory in your web browser to explore the documentation.
3940

41+
### ChangeLog
42+
43+
#### v0.2.0 - 2025.06.23
44+
- Migration to Qt6
45+
- Support for Windows OS
4046

build.bat

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
4+
set THIS_DIR=%~dp0
5+
cd !THIS_DIR!
6+
7+
goto output
8+
9+
if exist build (
10+
rmdir /s /q build
11+
)
12+
13+
mkdir build
14+
cd build
15+
qmake ../*.pro
16+
if !errorlevel! equ 0 (
17+
echo Success qmake
18+
) else (
19+
echo Failure qmake
20+
goto ungracefulExit
21+
)
22+
23+
mingw32-make
24+
if !errorlevel! equ 0 (
25+
echo Success mingw32-make
26+
) else (
27+
echo Failure mingw32-make
28+
goto ungracefulExit
29+
)
30+
31+
:output
32+
cd !THIS_DIR!
33+
if exist output (
34+
rmdir /s /q output
35+
)
36+
mkdir output
37+
copy build\release\uds_tracer.exe output\
38+
cd output
39+
windeployqt uds_tracer.exe
40+
41+
cd !THIS_DIR!
42+
echo Build completed successfully.
43+
exit /b 0
44+
45+
46+
:ungracefulExit
47+
set /P ans="Press enter key to continue."
48+
exit /b 1

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cd "$thisDirPath" || ungracefulExit "Failed to change directory to $thisDirPath"
1717
rm -rf build
1818
mkdir -p build
1919
cd build || ungracefulExit "Failed to change gui build directory"
20-
qmake ../*.pro || ungracefulExit "Failed to run qmake for gui"
20+
qmake6 ../*.pro || ungracefulExit "Failed to run qmake for gui"
2121
make || ungracefulExit "Failed to build gui"
2222

2323
################################################################################

cantabform/canfdform.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ CanFdForm::CanFdForm(QWidget *parent) :
2323
ui->arbitSjwLineEdit->setPlaceholderText(this->config.getArbitSjw());
2424
ui->dataSjwLineEdit->setPlaceholderText(this->config.getDataSjw());
2525

26+
#ifdef Q_OS_WIN32
27+
ui->devLineEdit->setValidator(this->validatorPtr);
28+
ui->devPushButton->setVisible(false);
29+
#endif
2630
ui->clkFreqLineEdit->setValidator(this->validatorPtr);
2731
ui->arbitBaudLineEdit->setValidator(this->validatorPtr);
2832
ui->dataBaudLineEdit->setValidator(this->validatorPtr);

cantabform/canstdform.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,18 @@ CanStdForm::CanStdForm(QWidget *parent) :
2828
for(const Baud &baudRef : this->availableBaudrates) {
2929
ui->baudComboBox->addItem(baudRef.name);
3030
}
31+
this->validatorPtr = new QIntValidator(this);
32+
#ifdef Q_OS_WIN32
33+
ui->devLineEdit->setValidator(this->validatorPtr);
34+
ui->devPushButton->setVisible(false);
35+
#endif
3136
ui->baudComboBox->setCurrentIndex(getIndexOfAvailableBaud(this->config.getBaud().toInt()));
3237
}
3338

3439
CanStdForm::~CanStdForm()
3540
{
3641
delete ui;
42+
delete this->validatorPtr;
3743
}
3844

3945
const ConfigStd &CanStdForm::getConfig(void)

cantabform/canstdform.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define CANSTDFORM_H
33

44
#include <QWidget>
5+
#include <QIntValidator>
56
#include "config.h"
67

78
namespace Ui {
@@ -42,6 +43,7 @@ private slots:
4243
};
4344

4445
Ui::CanStdForm *ui;
46+
QIntValidator *validatorPtr;
4547
ConfigStd config;
4648
QVector<Baud> availableBaudrates;
4749
int getIndexOfAvailableBaud(uint64_t baudrate);
660 KB
Binary file not shown.

0 commit comments

Comments
 (0)