using proper method

This commit is contained in:
alessandro negrin
2025-03-29 17:10:50 +01:00
parent 2f70a608e3
commit 4905794926
7 changed files with 74 additions and 12 deletions
+65 -3
View File
@@ -7,7 +7,68 @@ on:
branches:
- "master"
jobs:
jobs:
buildlinux:
name: Linux x64
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 libxkbcommon-x11-0
- name: Prepare Qt Libraries
uses: jurplel/install-qt-action@v3
- name: Clone
uses: actions/checkout@v3
- name: Compile
run: |
qmake CONFIG+=release PREFIX=/usr SavvyCAN.pro
make -j`grep -c ^processor /proc/cpuinfo`
- name: Package
run: |
make INSTALL_ROOT=appdir install
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@v4
with:
name: SavvyCAN-Linux_x64.AppImage
path: SavvyCAN-*x86_64.AppImage
buildmacos:
name: macOS x64
runs-on: macos-12
steps:
- name: Prepare macOS Environment
run: |
brew install qt5
brew link qt5 --force
- name: Clone
uses: actions/checkout@v3
- name: Compile
run: |
qmake CONFIG+=release CONFIG+=sdk_no_version_check SavvyCAN.pro
make -j`sysctl kern.aioprocmax | awk '{print $2}'`
- name: Package
run: |
mkdir -p SavvyCAN.app/Contents/MacOS/help
cp -R help/* SavvyCAN.app/Contents/MacOS/help
macdeployqt SavvyCAN.app -dmg
- uses: actions/upload-artifact@v4
with:
name: SavvyCAN-macOS_x64.dmg
path: SavvyCAN.dmg
buildwindows:
name: Windows x64
runs-on: windows-2019
@@ -62,7 +123,7 @@ jobs:
pre-release:
name: "pre-release"
runs-on: "ubuntu-latest"
needs: [buildwindows]
needs: [buildwindows, buildmacos, buildlinux]
steps:
- uses: actions/checkout@v3
@@ -78,5 +139,6 @@ jobs:
prerelease: true
title: "Development Build"
files: |
SavvyCAN-Linux_x64.AppImage/SavvyCAN-*x86_64.AppImage
SavvyCAN-Windows_x64_CIBuild.zip
SavvyCAN-macOS_x64.dmg/SavvyCAN.dmg
+1 -1
View File
@@ -222,7 +222,7 @@ bool CANConManager::sendFrame(const CANFrame& pFrame)
workingFrame.isReceived = false;
if (useSystemTime)
{
workingFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
workingFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
}
else
{
+1 -1
View File
@@ -214,7 +214,7 @@ void CANserver::readNetworkData()
frame_p->setFrameType(QCanBusFrame::DataFrame);
frame_p->isReceived = true;
frame_p->setTimeStamp(QCanBusFrame::TimeStamp(0, QDateTime::currentMSecsSinceEpoch() * 1000ul));
frame_p->setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
frame_p->setPayload(datagram.mid(dataByteLocation, length));
+2 -2
View File
@@ -685,7 +685,7 @@ void GVRetSerial::procRXChar(unsigned char c)
buildTimestamp += timeBasis;
if (useSystemTime)
{
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
} else {
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, buildTimestamp));
}
@@ -771,7 +771,7 @@ void GVRetSerial::procRXChar(unsigned char c)
buildTimestamp += timeBasis;
if (useSystemTime)
{
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
} else {
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, buildTimestamp));
}
+3 -3
View File
@@ -493,7 +493,7 @@ void LAWICELSerial::readSerialData()
if (useSystemTime)
{
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
}
else
{
@@ -502,13 +502,13 @@ void LAWICELSerial::readSerialData()
{
//Four bytes after the end of the data bytes.
buildTimestamp = mBuildLine.mid(5 + mBuildLine.mid(4, 1).toInt() * 2, 4).toInt(nullptr, 16) * 1000l;
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, buildTimestamp));
}
else
{
//Default to system time if timestamps are disabled.
buildTimestamp = QDateTime::currentMSecsSinceEpoch() * 1000l;
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
}
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, buildTimestamp));
}
switch (mBuildLine[0].toLatin1())
+1 -1
View File
@@ -302,7 +302,7 @@ void MQTT_BUS::clientMessageReceived(const QMQTT::Message& message)
frame_p->isReceived = true;
if (useSystemTime)
{
frame_p->setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
frame_p->setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
}
else frame_p->setTimeStamp(QCanBusFrame::TimeStamp(0, timeStamp));
+1 -1
View File
@@ -211,7 +211,7 @@ void SerialBusConnection::framesReceived()
frame_p->isReceived = !recFrame.hasLocalEcho();
if (useSystemTime) {
frame_p->setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
frame_p->setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
}
else frame_p->setTimeStamp(QCanBusFrame::TimeStamp(0, (recFrame.timeStamp().seconds() * 1000000ul + recFrame.timeStamp().microSeconds()) - timeBasis));