Skip to content

Commit

Permalink
Testing workspace action to build 6.2 based version
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Sep 20, 2024
1 parent 7f166be commit fb2ca87
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 161 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
uses: jurplel/install-qt-action@v4
with:
version: 6.2.*
target: 'desktop'
dir: ${{ github.workspace }}/qt/
modules: 'qtcharts qtconnectivity qtserialbus qtserialport qtwebsockets'

# https://github.com/actions/checkout
- uses: actions/checkout@v4
Expand Down Expand Up @@ -66,16 +68,16 @@ jobs:
- name: Install paho manually
run: cd paho && mkdir build && cd build && sudo cmake -DPAHO_WITH_SSL=true .. && sudo make install

- name: Install qt5 components manually
run: sudo apt install qttools5-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtdeclarative5-dev libqt5charts5-dev libqt5serialbus5-dev libqt5serialport5-dev
# - name: Install qt5 components manually
# run: sudo apt install qttools5-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtdeclarative5-dev libqt5charts5-dev libqt5serialbus5-dev libqt5serialport5-dev

- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2

- name: Create Build Environment
run: |
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DVSCP_ROOT=${{github.workspace}}/vscp/ -DVSCP_PATH=${{github.workspace}}/vscp/ -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Qt/6.7.2/gcc_64 ..
cmake -DCMAKE_INSTALL_PREFIX=/usr -DVSCP_ROOT=${{github.workspace}}/vscp/ -DVSCP_PATH=${{github.workspace}}/vscp/ -DCMAKE_PREFIX_PATH=${{ QT_ROOT_DIR }} ..
- name: Build
working-directory: ${{github.workspace}}/build
Expand Down
8 changes: 4 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"taskName": "build",
"type": "shell",
"command": "cd build; make -j8 -Wall",
"command": "cd build; make -j4 -Wall",
"args": [],
"group": "build",
"problemMatcher": "$gcc",
Expand Down Expand Up @@ -47,7 +47,7 @@
{
"taskName": "Clean & build all 5.15.2",
"type": "shell",
"command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/5.15.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j8 -Wall",
"command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/5.15.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j4 -Wall",
"args": [],
"group": {
"kind": "build",
Expand All @@ -72,7 +72,7 @@
{
"taskName": "Clean & build all 6.6.2",
"type": "shell",
"command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/6.6.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j8",
"command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/6.6.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j4",
"args": [],
"group": "build",
"problemMatcher": {
Expand All @@ -95,7 +95,7 @@
{
"taskName": "Clean & build all 6.7.2",
"type": "shell",
"command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/6.7.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j8",
"command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/6.7.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j4",
"args": [],
"group": "build",
"problemMatcher": {
Expand Down
138 changes: 5 additions & 133 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ message(STATUS "VSCP path = $ENV{VSCP_ROOT}")
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-DWIN32_LEAN_AND_MEANS)
#add_definitions(-DOPENSSL_API_1_1)
add_definitions(-D_POSIX_C_SOURCE)
add_definitions(-DVCPKG_TARGET_TRIPLET=x64-windows)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
Expand All @@ -72,8 +71,7 @@ elseif(UNIX)
endif()

if (MSVC)
# # use precompiled headers
# set (CMAKE_AUTOMOC_MOC_OPTIONS "-bpch.h" "-fpch.h")
# use precompiled headers
set (CMAKE_AUTOMOC_MOC_OPTIONS "-bpch.h ")
endif()

Expand All @@ -87,7 +85,6 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)

# qt
#xxxfind_package(Qt5 5.15 COMPONENTS Widgets LinguistTools REQUIRED Core Network Sql Charts Quick SerialBus SerialPort)
find_package(Qt6 REQUIRED COMPONENTS Widgets Qml Core Network Sql Charts Quick SerialBus SerialPort)
qt_standard_project_setup()

Expand Down Expand Up @@ -196,102 +193,6 @@ if(NOT SSL_VER_POS EQUAL -1)
message(STATUS "Open ssl version is 3.3")
endif()

# set(UI )
#qt5_wrap_ui(UI src/mainwindow.ui
# src/cdlgmainsettings.ui
# src/cdlgconnsettingscanal.ui
# src/cdlgconnsettingstcpip.ui
# src/cdlgconnsettingssocketcan.ui
# src/cdlgconnsettingsmqtt.ui
# src/cdlgconnsettingsws1.ui
# src/cdlgconnsettingsws2.ui
# src/cdlgconnsettingsudp.ui
# src/cdlgconnsettingsmulticast.ui
# src/cdlgnewconnection.ui
# src/cdlglevel1filter.ui
# src/cdlglevel1filterwizard.ui
# src/cdlglevel2filter.ui
# src/cdlgsocketcanflags.ui
# src/cdlgmqttpublish.ui
# src/cdlgmqttsubscribe.ui
# src/cdlgknownguid.ui
# src/cdlgeditguid.ui
# src/cdlgcanfilter.ui
# src/cdlgtls.ui
# src/cdlglog.ui
# src/cdlgsensorindex.ui
# src/cdlgeditsensorindex.ui
# src/cdlgtxedit.ui
# src/cdlgsessionfilter.ui
# src/cdlgeditsessionfilter.ui
# src/cdlgselectclass.ui
# src/cdlgselectguid.ui
# src/cdlgselectobid.ui
# src/cdlgselectdata.ui
# src/cdlgselectdatasize.ui
# src/cdlgselectmeasurementvalue.ui
# src/cdlgselectpriority.ui
# src/cdlgselectmeasurementvalue.ui
# src/cdlgselecttimestamp.ui
# src/cdlgselectunit.ui
# src/cdlgselectsensorindex.ui
# src/cdlgselectdatacoding.ui
# src/cdlgselectdate.ui
# src/cdlgselectconstraint.ui
# src/cfrmnodeconfig.ui
# src/cfrmnodescan.ui
# src/cdlgactionparam.ui
# src/cdlgdatepicker.ui
# src/cfrmmdf.ui
# src/cdlgmdfmodule.ui
# src/cdlgmdffilepicture.ui
# src/cdlgmdfmodule.ui
# src/cdlgmdfevent.ui
# src/cdlgmdffilesetup.ui
# src/cdlgmdfregister.ui
# src/cdlgmdfbootloader.ui
# src/cdlgmdffiledriver.ui
# src/cdlgmdffile.ui
# src/cdlgmdfremotevar.ui
# src/cdlgmdfdescription.ui
# src/cdlgmdfinfourl.ui
# src/cdlgmdffilefirmware.ui
# src/cdlgmdffilevideo.ui
# src/cdlgmdffilemanual.ui
# src/cdlgmdfvaluelist.ui
# src/cdlgeditmap.ui
# src/cdlgmdfmanufacturer.ui
# src/cdlgmdfcontact.ui
# src/cdlgmdfcontactlist.ui

# src/cdlgmdfregister.ui
# src/cdlgmdfregisterlist.ui

# src/cdlgmdfbit.ui
# src/cdlgmdfbitlist.ui
# src/cdlgmdfvalue.ui
# src/cdlgmdfvaluelist.ui

# src/cdlgmdfregistermapping.ui

# src/cdlgmdfremotevar.ui
# src/cdlgmdfremotevarlist.ui

# src/cdlgmdfdm.ui
# src/cdlgmdfdmaction.ui
# str/cdlgmdfdmactionparam.ui

# src/cdlgmdfevents.ui
# src/cdlgmdfeventdata.ui

# src/cdlgtxtsearch.ui

# src/cdlgselectmqtttopics.ui

# src/cdlgbootfirmware.ui

# src/cdlgselectbootalgorithm.ui
#)

qt_add_executable(${PROJECT_NAME}
src/vscpworks.qrc
Expand Down Expand Up @@ -715,11 +616,6 @@ if (MSVC)
./third_party/maddy/include/
./third_party/crypto-algorithms/
${PThreads4W_INCLUDE_DIR}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Core_INCLUDE_DIRS}
${Qt5SerialBus_INCLUDE_DIRS}
${Qt5SerialPort_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}
${OPENSSL_INCLUDE_DIR}
${MOSQUITTO_INCLUDE_DIRS}
Expand All @@ -744,10 +640,6 @@ else()
./third_party/mustache/
./third_party/maddy/include/
./third_party/crypto-algorithms/s
${Qt5Core_INCLUDE_DIRS}
${Qt5SerialBus_INCLUDE_DIRS}
${Qt5SerialPort_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}
${OPENSSL_INCLUDE_DIR}
${MOSQUITTO_INCLUDE_DIRS}
Expand All @@ -765,26 +657,16 @@ if (MSVC)
message(STATUS "Mosquitto lib: ${MOSQUITTO_LIB_DIR} --- ${VCPKG_ROOT}/installed/x64-windows/lib/mosquitto.lib")
link_directories(${MOSQUITTO_LIB_DIR})

#find_path(LIBWEBSOCKETS_LIBRARY_DIR ${LIBWEBSOCKETS_LIBRARIES} HINTS "${VCPKG_ROOT}/installed/x64-windows/lib")
#find_path(LIBWEBSOCKETS_LIBRARY_DIR libwebsockets.lib websockets.lib websockets_shared.lib HINTS "${VCPKG_ROOT}/installed/x64-windows/lib")
message(STATUS "lib websockets lib: ${LIBWEBSOCKETS_LIBRARY_DIR} --- ${VCPKG_ROOT}/installed/x64-windows/lib/${LIBWEBSOCKETS_LIBRARIES}")
link_directories(${LIBWEBSOCKETS_LIBRARY_DIR})

target_link_libraries(${PROJECT_NAME} PRIVATE
Qt5::Widgets
Qt5::Core
Qt5::Network
Qt5::Quick
Qt5::Sql
Qt5::Charts
PThreads4W::PThreads4W
OpenSSL::SSL
OpenSSL::Crypto
OpenSSL::SSL OpenSSL::Crypto
# eclipse-paho-mqtt-c::paho-mqtt3a eclipse-paho-mqtt-c::paho-mqtt3c eclipse-paho-mqtt-c::paho-mqtt3as eclipse-paho-mqtt-c::paho-mqtt3cs
${MOSQUITTO_LIBRARIES}
${LIBWEBSOCKETS_LIBRARIES}
#"${VCPKG_ROOT}/installed/x64-windows/lib/mosquitto.lib"
expat::expat
CURL::libcurl
dlfcn-win32::dl
Expand All @@ -795,12 +677,6 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
Qt6::Qml
Qt6::Sql
Qt6::Charts
# ${Qt5Widgets_LIBRARIES}
# ${Qt5Core_LIBRARIES}
# Qt5::Network
# Qt5::Quick
# Qt5::Sql
# Qt5::Charts
m
dl
Threads::Threads
Expand All @@ -815,16 +691,12 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
)
endif()

# https://www3.sra.co.jp/qt/relation/doc/qtdoc/cmake-manual.html
#qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
#qt5_add_resources(src/vscpworks.qrc qdarkstyle/theme/style.qrc)


if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-DWIN32_LEAN_AND_MEANS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(LIBS_SYSTEM ws2_32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-DWIN32_LEAN_AND_MEANS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(LIBS_SYSTEM ws2_32)
elseif(UNIX)
set(LIBS_SYSTEM c stdc++)
endif()
Expand Down
9 changes: 3 additions & 6 deletions src/cdlgconnsettingssocketcan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,21 +522,18 @@ void CDlgConnSettingsSocketCan::onTestConnection(void)
QString errorstr = tr("Failed to connect to interface. [%1] rv=%2").arg(getDevice().arg(rv));
QMessageBox::question(this,
tr(APPNAME),
errorstr.arg(rv),
QMessageBox::Ok);
errorstr.arg(rv));
}
else {
QMessageBox::question(this,
tr(APPNAME),
tr("Successful connect"),
QMessageBox::Ok);
tr("Successful connect"));
}

if (VSCP_ERROR_SUCCESS != (rv = m_clientSocketcan.disconnect())) {
QMessageBox::question(this,
tr(APPNAME),
tr("Failed to disconnect from interface."),
QMessageBox::Ok);
tr("Failed to disconnect from interface."));
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/cfrmnodeconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,13 +690,13 @@ CFrmNodeConfig::CFrmNodeConfig(QWidget* parent, QJsonObject* pconn)

// Edit selected DM row
QAction* actEditDM = new QAction(tr("Edit DM row"), this);
actEditDM->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E));
actEditDM->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_E));
connect(actEditDM, &QAction::triggered, this, &CFrmNodeConfig::editDMRow);
ui->treeWidgetDecisionMatrix->addAction(actEditDM);

// Toggle active state for selected DM row
QAction* actToggleDM = new QAction(tr("Toggle active state for DM row"), this);
actToggleDM->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_T));
actToggleDM->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_T));
connect(actToggleDM, &QAction::triggered, this, &CFrmNodeConfig::toggleDMRow);
ui->treeWidgetDecisionMatrix->addAction(actToggleDM);

Expand Down
8 changes: 4 additions & 4 deletions src/cfrmsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,25 +490,25 @@ CFrmSession::createMenu()
m_toggleRxClassMarkAct = m_editMenu->addAction(tr("Toggle RX Class mark"),
this,
&CFrmSession::setVscpClassMark);
m_toggleRxClassMarkAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_C));
m_toggleRxClassMarkAct->setShortcut(QKeySequence(Qt::ALT | Qt::Key_C));
m_toggleRxClassMarkAct->setStatusTip(tr("Mark the receive row with special background color"));

m_toggleRxTypeMarkAct = m_editMenu->addAction(tr("Toggle RX Type mark"),
this,
&CFrmSession::setVscpTypeMark);
m_toggleRxTypeMarkAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_T));
m_toggleRxTypeMarkAct->setShortcut(QKeySequence(Qt::ALT | Qt::Key_T));
m_toggleRxTypeMarkAct->setStatusTip(tr("Mark the receive row with special background color"));

m_addExCommentAct = m_editMenu->addAction(tr("Add/Edit RX comment"),
this,
&CFrmSession::addEventNote);
m_toggleRxTypeMarkAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_T));
m_toggleRxTypeMarkAct->setShortcut(QKeySequence(Qt::ALT | Qt::Key_T));
m_toggleRxTypeMarkAct->setStatusTip(tr("Add a comment to selected RX row(s)"));

m_deleteRxCommentAct = m_editMenu->addAction(tr("Remove RX comment"),
this,
&CFrmSession::removeEventNote);
m_deleteRxCommentAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_T));
m_deleteRxCommentAct->setShortcut(QKeySequence(Qt::ALT | Qt::Key_T));
m_deleteRxCommentAct->setStatusTip(tr("Remove a comment from selected RX row(s)"));

m_menuBar->addMenu(m_editMenu);
Expand Down
12 changes: 3 additions & 9 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2450,9 +2450,7 @@ MainWindow::newNodeConfiguration()
int ret = QMessageBox::warning(this,
tr("VSVP Works+"),
tr("No connection selected.\n"
"Please select a connection first."),
QMessageBox::Ok,
QMessageBox::Information);
"Please select a connection first."));
return;
}

Expand Down Expand Up @@ -2496,9 +2494,7 @@ MainWindow::newNodeScan()
int ret = QMessageBox::warning(this,
tr("VSVP Works+"),
tr("No connection selected.\n"
"Please select a connection first."),
QMessageBox::Ok,
QMessageBox::Information);
"Please select a connection first."));
return;
}

Expand Down Expand Up @@ -2543,9 +2539,7 @@ MainWindow::newNodeBootload()
int ret = QMessageBox::warning(this,
tr("VSVP Works+"),
tr("No connection selected.\n"
"Please select a connection first."),
QMessageBox::Ok,
QMessageBox::Information);
"Please select a connection first."));
return;
}

Expand Down

0 comments on commit fb2ca87

Please sign in to comment.