Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4aa6cd8
qt does things
watsonbw Jul 22, 2026
a6ada5b
I do not know what I am doing, but I am trying to restructure the gui…
watsonbw Jul 26, 2026
6e46016
Worked on updating and renaming pages, removed the multiple plotting …
watsonbw Jul 27, 2026
c06f03d
not compiling
watsonbw Jul 27, 2026
26cad3f
Qt is here on Windows, menu bar theoretically works
watsonbw Jul 27, 2026
6b97e1e
only qt and ffmpeg are dynamically linked now, maybe updated for mac …
watsonbw Jul 27, 2026
e106b99
wifi works again and the brdige works!
watsonbw Jul 28, 2026
5cd393d
working on plotting, everything but the live update signals should be…
watsonbw Jul 28, 2026
76d546a
solving problems on pr
watsonbw Jul 28, 2026
743ad36
Plot page (almost) finished!!! Everything should be up to date with t…
watsonbw Jul 28, 2026
046edd1
time now syncs right, little weird behavior worth looking into but it…
watsonbw Jul 28, 2026
e403e27
fixed width of text on menubar
watsonbw Jul 28, 2026
6b35f45
Update format.yml
watsonbw Jul 29, 2026
084924c
Update package.yml
watsonbw Jul 29, 2026
44478f8
holy merge conflicts
watsonbw Jul 29, 2026
4bf15ef
formatted
watsonbw Jul 29, 2026
5812706
ci
watsonbw Jul 29, 2026
52cfe30
ci
watsonbw Jul 29, 2026
6abcd59
ci
watsonbw Jul 29, 2026
9473a00
ci
watsonbw Jul 29, 2026
45abe6a
ci and package
watsonbw Jul 29, 2026
3509b12
this should pass
watsonbw Jul 29, 2026
f901208
fixed MINOR performance hit in plot.cpp
watsonbw Jul 29, 2026
13a31d3
formatting and pr fixes
watsonbw Jul 29, 2026
4bbaa8c
standard colors and styling, lowkey annoying but it exists
watsonbw Jul 29, 2026
3ddf4e5
more pr fixes
watsonbw Jul 29, 2026
44a9931
home page is now being worked on
watsonbw Jul 29, 2026
f21ea06
formatting
watsonbw Jul 29, 2026
9f79f61
pr stuff
watsonbw Jul 30, 2026
40f174f
pr stuff
watsonbw Jul 30, 2026
a011d15
more pr stuff
watsonbw Jul 30, 2026
a70bdb8
forgot to format
watsonbw Jul 30, 2026
081fcd5
colors are now known on compile time, annoying to deal with in fmt::f…
watsonbw Jul 30, 2026
5b89a28
qcolor
watsonbw Jul 30, 2026
44e0b87
bruh
watsonbw Jul 30, 2026
ce576bf
formatting
watsonbw Jul 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Comment thread
watsonbw marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
run: |
brew update
brew install llvm
python3 scripts/install_qt.py
env:
HOMEBREW_NO_AUTO_UPDATE: 1

Expand All @@ -49,6 +50,12 @@ jobs:
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-ninja
mingw-w64-ucrt-x86_64-python

- name: Install Qt (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
Comment thread
watsonbw marked this conversation as resolved.
run: python3 scripts/install_qt.py

- name: Cache build directory
uses: actions/cache@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
brew update
brew install llvm@21
echo "/opt/homebrew/opt/llvm@21/bin" >> $GITHUB_PATH
python3 scripts/install_qt.py
env:
HOMEBREW_NO_AUTO_UPDATE: 1

Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
run: |
brew update
brew install llvm
python3 scripts/install_qt.py
env:
HOMEBREW_NO_AUTO_UPDATE: 1

Expand All @@ -38,8 +39,13 @@ jobs:
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-ninja
mingw-w64-ucrt-x86_64-python
zip
tar
- name: Install Qt (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
Comment thread
watsonbw marked this conversation as resolved.
run: python3 scripts/install_qt.py

- name: Build and pack macOS
if: runner.os == 'macOS'
Expand Down Expand Up @@ -78,3 +84,17 @@ jobs:
path: |
*.tar.gz
*.zip

release:
needs: package
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- uses: softprops/action-gh-release@v2
with:
files: artifacts/*
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ file(GLOB_RECURSE ALL_SOURCES "${SRC_DIR}/*.cpp")
set(INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include")
file(GLOB_RECURSE HEADERS "${INCLUDE_DIR}/*.hpp" "${INCLUDE_DIR}/*.h")

set(LIB_SOURCES ${ALL_SOURCES})
set(LIB_SOURCES ${ALL_SOURCES} ${HEADERS})
list(FILTER LIB_SOURCES EXCLUDE REGEX "main\\.cpp$")

set(TEST_DIR "${CMAKE_SOURCE_DIR}/tests")
Expand Down
8 changes: 4 additions & 4 deletions MBR_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
{ "key": "T", "name": "Timestamp", "required": true, "plot": false },
{ "key": "E", "name": "Engine RPM", "required": false, "plot": true, "unit": "RPM", "group": "rpm" },
{ "key": "W", "name": "Wheel RPM", "required": false, "plot": true, "unit": "RPM", "group": "rpm" },
{ "key": "fr", "name": "Front Right", "required": false, "plot": true, "unit": "mm", "group": "shock" },
{ "key": "fl", "name": "Front Left", "required": false, "plot": true, "unit": "mm", "group": "shock" },
{ "key": "br", "name": "Back Right", "required": false, "plot": true, "unit": "mm", "group": "shock" },
{ "key": "bl", "name": "Back Left", "required": false, "plot": true, "unit": "mm", "group": "shock" }
{ "key": "FR", "name": "Front Right", "required": false, "plot": true, "unit": "mm", "group": "shock" },
{ "key": "FL", "name": "Front Left", "required": false, "plot": true, "unit": "mm", "group": "shock" },
{ "key": "RR", "name": "Back Right", "required": false, "plot": true, "unit": "mm", "group": "shock" },
{ "key": "RL", "name": "Back Left", "required": false, "plot": true, "unit": "mm", "group": "shock" }
]
}
2 changes: 1 addition & 1 deletion cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ elseif(WIN32)
endif()

if(MINGW)
add_link_options("-static-libgcc" "-static-libstdc++" "-static")
add_link_options("-static-libgcc" "-static-libstdc++")
Comment thread
watsonbw marked this conversation as resolved.
endif()

set(CMAKE_CXX_STANDARD 23)
Expand Down
56 changes: 46 additions & 10 deletions cmake/MbrDaqSuite.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
function(create_mbrdaq_suite TARGET_NAME EXTRA_FLAGS OUT_DIR)
add_library(mbrdaq_core_${TARGET_NAME} STATIC ${LIB_SOURCES})
set_target_properties(mbrdaq_core_${TARGET_NAME} PROPERTIES
AUTOMOC ON
AUTOUIC OFF
AUTORCC OFF
)

target_link_libraries(mbrdaq_core_${TARGET_NAME} PUBLIC
imgui_setup
implot_setup
tinyfiledialogs
opencv_core
opencv_imgproc
opencv_imgcodecs
opencv_videoio
opencv_highgui
spdlog::spdlog
ixwebsocket
stb_image_setup
Expand All @@ -20,6 +19,11 @@ function(create_mbrdaq_suite TARGET_NAME EXTRA_FLAGS OUT_DIR)
magic_enum::magic_enum
unordered_dense::unordered_dense
stdx
Qt6::Core
Qt6::Widgets
Qt6::Charts
Qt6::PrintSupport
QCustomPlot
)

target_include_directories(mbrdaq_core_${TARGET_NAME} PUBLIC include)
Expand All @@ -35,11 +39,13 @@ function(create_mbrdaq_suite TARGET_NAME EXTRA_FLAGS OUT_DIR)

target_compile_options(mbrdaq_core_${TARGET_NAME} PRIVATE ${BASE_FLAGS})
target_compile_options(mbrdaq_core_${TARGET_NAME} PRIVATE ${EXTRA_FLAGS})

if(APPLE)
target_link_options(mbrdaq_core_${TARGET_NAME} PRIVATE ${EXTRA_FLAGS} "-static-libstdc++")
target_link_options(mbrdaq_core_${TARGET_NAME} PRIVATE ${EXTRA_FLAGS})
elseif(WIN32)
target_link_options(mbrdaq_core_${TARGET_NAME} PRIVATE ${EXTRA_FLAGS})
endif()

set_target_properties(mbrdaq_core_${TARGET_NAME}
PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUT_DIR})

Expand All @@ -53,6 +59,7 @@ function(create_mbrdaq_suite TARGET_NAME EXTRA_FLAGS OUT_DIR)
set_target_properties(catch2_${TARGET_NAME}
PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OUT_DIR})

# Test Executable
add_executable(mbrdaq_tests_${TARGET_NAME} ${TEST_SOURCES})
target_link_libraries(mbrdaq_tests_${TARGET_NAME}
PRIVATE catch2_${TARGET_NAME} mbrdaq_core_${TARGET_NAME})
Expand All @@ -64,6 +71,7 @@ function(create_mbrdaq_suite TARGET_NAME EXTRA_FLAGS OUT_DIR)
target_compile_options(mbrdaq_tests_${TARGET_NAME}
PRIVATE ${EXTRA_FLAGS})
target_link_options(mbrdaq_tests_${TARGET_NAME} PRIVATE ${EXTRA_FLAGS})

set_target_properties(mbrdaq_tests_${TARGET_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUT_DIR})
endfunction()
Expand All @@ -78,25 +86,53 @@ function(create_standard_target EXTRA_FLAGS TARGET_NAME)
if (NOT MINGW)
target_link_options(mbrdaq_${TARGET_NAME} PRIVATE "LINKER:/ENTRY:mainCRTStartup")
endif()
elseif(APPLE)
add_executable(mbrdaq_${TARGET_NAME} MACOSX_BUNDLE src/main.cpp)
set_target_properties(mbrdaq_${TARGET_NAME} PROPERTIES
MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}
MACOSX_BUNDLE_GUI_IDENTIFIER "com.mbr.daq.${TARGET_NAME}"
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}
)
else()
add_executable(mbrdaq_${TARGET_NAME} src/main.cpp)
endif()

target_link_libraries(mbrdaq_${TARGET_NAME} PRIVATE mbrdaq_core_${TARGET_NAME})

add_custom_target(${TARGET_NAME} DEPENDS
mbrdaq_tests_${TARGET_NAME} mbrdaq_${TARGET_NAME})

set_target_properties(mbrdaq_${TARGET_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${TARGET_NAME}
OUTPUT_NAME ${PROJECT_NAME})

# Windows still depends on a custom ffmpeg dll provided by opencv
if(WIN32)
# Ensure destination directory exists
add_custom_command(TARGET mbrdaq_${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin"
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_BINARY_DIR}/bin"
"$<TARGET_FILE_DIR:mbrdaq_${TARGET_NAME}>"
COMMENT "Copy FFMPEG to output directory"
COMMENT "Copy FFMPEG binaries to output directory"
)

if(WINDEPLOYQT_EXE)
Comment thread
trevorswan11 marked this conversation as resolved.
add_custom_command(TARGET mbrdaq_${TARGET_NAME} POST_BUILD
COMMAND ${WINDEPLOYQT_EXE}
--dir "$<TARGET_FILE_DIR:mbrdaq_${TARGET_NAME}>"
--no-translations
"$<TARGET_FILE:mbrdaq_${TARGET_NAME}>"
COMMENT "Deploy Qt runtime libraries"
)
endif()
elseif(APPLE)
if(MACDEPLOYQT_EXE)
add_custom_command(TARGET mbrdaq_${TARGET_NAME} POST_BUILD
COMMAND ${MACDEPLOYQT_EXE}
"$<TARGET_BUNDLE_DIR:mbrdaq_${TARGET_NAME}>"
COMMENT "Deploy Qt frameworks into app bundle"
)
endif()
endif()
endfunction()
135 changes: 60 additions & 75 deletions cmake/VendorSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,85 +45,10 @@ add_vendor_fetch_content(gsl vendor/gsl)
add_vendor_fetch_content(fmt vendor/fmt)

# Sokol
add_library(sokol_setup STATIC src/vendor/sokol_impl.cpp)
target_include_directories(sokol_setup SYSTEM PUBLIC
vendor/sokol
vendor/sokol/util
vendor/imgui
vendor/imgui/backends)
target_compile_options(sokol_setup PRIVATE ${WARNING_IGNORE})

if(APPLE)
target_compile_definitions(sokol_setup PUBLIC SOKOL_METAL)
set_source_files_properties(src/vendor/sokol_impl.cpp PROPERTIES LANGUAGE OBJCXX)
target_link_libraries(sokol_setup INTERFACE
"-framework Cocoa"
"-framework IOKit"
"-framework Metal"
"-framework MetalKit"
"-framework QuartzCore"
"-framework AVFoundation"
"-framework CoreMedia"
"-framework CoreVideo"
)
elseif(WIN32)
target_compile_definitions(sokol_setup PUBLIC SOKOL_D3D11)
target_link_libraries(sokol_setup INTERFACE d3d11 dxgi dwmapi)
endif()

# Dear ImGUI
add_library(imgui_setup STATIC
vendor/imgui/imgui.cpp
vendor/imgui/imgui_draw.cpp
vendor/imgui/imgui_widgets.cpp
vendor/imgui/imgui_tables.cpp
vendor/imgui/imgui_demo.cpp
)
target_include_directories(imgui_setup SYSTEM PUBLIC
vendor/imgui vendor/imgui/backends)
target_link_libraries(imgui_setup PUBLIC sokol_setup)

# ImPlot
add_library(implot_setup STATIC
vendor/implot/implot.cpp
vendor/implot/implot_items.cpp
vendor/implot/implot_demo.cpp
)
target_include_directories(implot_setup SYSTEM PUBLIC vendor/implot)
target_link_libraries(implot_setup PUBLIC imgui_setup)
target_compile_options(implot_setup PRIVATE ${WARNING_IGNORE})

# OpenCV
set(BUILD_LIST "core,imgproc,imgcodecs,videoio,highgui" CACHE STRING "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Static linking" FORCE)
set(BUILD_opencv_apps OFF CACHE BOOL "Classifier training not needed" FORCE)
set(BUILD_opencv_python2 OFF CACHE BOOL "Disable python support" FORCE)
set(BUILD_opencv_python3 OFF CACHE BOOL "Disable python support" FORCE)
set(BUILD_EXAMPLES OFF CACHE BOOL "Examples not needed" FORCE)
set(BUILD_DOCS OFF CACHE BOOL "OpenCV docs are not needed" FORCE)
set(BUILD_TESTS OFF CACHE BOOL "Testing not needed for vendoring" FORCE)
set(BUILD_PERF_TESTS OFF CACHE BOOL "Testing not needed for vendoring" FORCE)
set(BUILD_CUDA_STUBS OFF CACHE BOOL "Cuda is never needed" FORCE)
set(WITH_CUDA OFF CACHE BOOL "" FORCE)
set(BUILD_JAVA OFF CACHE BOOL "" FORCE)
set(WITH_IPP OFF CACHE BOOL "Intel IPP support not needed" FORCE)
set(WITH_ITT OFF CACHE BOOL "Intel ITT support not needed" FORCE)
set(WITH_OPENCL OFF CACHE BOOL "" FORCE)
set(WITH_WEBP OFF CACHE BOOL "" FORCE)
set(WITH_OPENEXR OFF CACHE BOOL "" FORCE)

set(OPENCV_WARNINGS_ARE_ERRORS OFF CACHE BOOL "" FORCE)
set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS ON CACHE BOOL "" FORCE)

if(APPLE)
set(WITH_FFMPEG OFF CACHE BOOL "System dependencies instead" FORCE)
set(HAVE_FFMPEG OFF CACHE BOOL "System dependencies instead" FORCE)
set(WITH_AVFOUNDATION ON CACHE BOOL "Apple framework is statically linked" FORCE)
unset(FFMPEG_LIBRARIES CACHE)
unset(FFMPEG_INCLUDE_DIRS CACHE)
endif()

add_vendor_subdirectory(vendor/opencv)

# TinyFileDialogs
add_library(tinyfiledialogs STATIC vendor/libtinyfiledialogs/tinyfiledialogs.c)
Expand Down Expand Up @@ -230,3 +155,63 @@ option(ENABLE_STDX_PROFILE "Enable profiling/tracing in stdx" OFF)
set(STDX_PROFILE ${ENABLE_STDX_PROFILE} CACHE BOOL "" FORCE)

add_vendor_subdirectory(vendor/stdx)

# Qt
if(WIN32)
list(APPEND CMAKE_PREFIX_PATH "C:/msys64/ucrt64")
Comment thread
trevorswan11 marked this conversation as resolved.
elseif(APPLE)
# Homebrew Qt6 install location differs by CPU architecture
execute_process(
COMMAND brew --prefix qt
OUTPUT_VARIABLE HOMEBREW_QT_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
if(HOMEBREW_QT_PREFIX)
list(APPEND CMAKE_PREFIX_PATH "${HOMEBREW_QT_PREFIX}")
else()
# Fallback if `brew` isn't on PATH (e.g. CI) - covers both arches
list(APPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/qt" "/usr/local/opt/qt")
endif()
endif()

find_package(Qt6 REQUIRED COMPONENTS Core Widgets Charts PrintSupport)

if(WIN32)
find_program(WINDEPLOYQT_EXE windeployqt
HINTS "${Qt6_DIR}/../../../bin" "${Qt6_DIR}/../../../share/qt6/bin"
)
message(STATUS "windeployqt found: ${WINDEPLOYQT_EXE}")
elseif(APPLE)
find_program(MACDEPLOYQT_EXE macdeployqt
HINTS "${Qt6_DIR}/../../../bin"
)
message(STATUS "macdeployqt found: ${MACDEPLOYQT_EXE}")
endif()

# QCustomPlot
include(FetchContent)

FetchContent_Declare(
Comment thread
watsonbw marked this conversation as resolved.
qcustomplot
URL https://www.qcustomplot.com/release/2.1.1/QCustomPlot-source.tar.gz
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
SOURCE_SUBDIR "no-cmake"
)

FetchContent_MakeAvailable(qcustomplot)

add_library(QCustomPlot STATIC
${qcustomplot_SOURCE_DIR}/qcustomplot.cpp
${qcustomplot_SOURCE_DIR}/qcustomplot.h
)

set_target_properties(QCustomPlot PROPERTIES
AUTOMOC ON
AUTOUIC OFF
AUTORCC OFF
)

target_include_directories(QCustomPlot PUBLIC ${qcustomplot_SOURCE_DIR})
target_compile_options(QCustomPlot PRIVATE ${WARNING_IGNORE})
target_link_libraries(QCustomPlot PUBLIC Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::PrintSupport)
8 changes: 5 additions & 3 deletions include/app/app.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <QApplication>
#include <memory>

#include <stdx/types.hh>
Expand All @@ -12,15 +13,16 @@ class gui_t;

class app_t {
public:
explicit app_t(i32 arc, char** argv);
explicit app_t(i32 argc, char** argv);
Comment thread
trevorswan11 marked this conversation as resolved.
~app_t();
MAKE_PINNED(app_t);

void run();

private:
std::unique_ptr<gui_t> gui_;
std::shared_ptr<app_context> context_;
std::unique_ptr<QApplication> qt_app_;
std::unique_ptr<gui_t> gui_;
std::shared_ptr<app_context> context_;
};

} // namespace mbr
Loading
Loading