Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion Arduino
Submodule Arduino deleted from 997966
21 changes: 11 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,27 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(zenohc_DIR "/usr/local/lib/cmake/zenohc")
set(zenohcxx_DIR "/usr/local/lib/cmake/zenohcxx")
find_package(Qt6 COMPONENTS Core Quick DBus SerialBus REQUIRED)
find_package(Qt6 COMPONENTS Core Quick DBus REQUIRED)
find_package(zenohc REQUIRED)
find_package(zenohcxx REQUIRED)

set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wl,-rpath-link, ${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}")
# Enable automatic MOC, UIC, and RCC processing
# Enable Qt's Automatic MOC, UIC, and RCC
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

qt_add_resources(QT_RESOURCES ./src/resources.qrc)
# Add Resource File (QML and Other Resources)
qt_add_resources(QT_RESOURCES ./ui/resources.qrc)

add_executable(speedometer ${QT_RESOURCES}
./src/main.cpp
./src/CANBusHandler.cpp
./include/CANBusHandler.hpp
# Define Executable Target
add_executable(speedometer
${QT_RESOURCES} # Add Resource File
./src/main.cpp # Main C++ File
./src/CANBusHandler.cpp # CANBusHandler Implementation
./include/CANBusHandler.hpp # CANBusHandler Header
)

target_link_libraries(speedometer zenohcxx::zenohc -lm -ldl Qt6::Core Qt6::DBus Qt6::Quick Qt6::SerialBus)
target_link_libraries(speedometer zenohcxx::zenohc -lm -ldl Qt6::Core Qt6::DBus Qt6::Quick)

add_executable(zenoh
./middelWare/src/main.cpp
Expand Down
Binary file added assets/icons/back_fog_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/front_fog_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/green-battery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/high_beam_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/low_beam_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/parking_lights_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/turn_left_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/turn_right_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 0 additions & 74 deletions src/Main.qml

This file was deleted.

5 changes: 0 additions & 5 deletions src/resources.qrc

This file was deleted.

65 changes: 65 additions & 0 deletions ui/FootbarInfo.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import QtQuick 2.15

Row {
width: parent.width
height: 50
spacing: 30
padding: 10

Column {

Row {
spacing: 5
Text {
font.family: "Open Sans"
text: canBusHandler.battery
font.pixelSize: app.letterSize
color: "white"
}
Text {
font.family: "Open Sans"
text: "%"
font.pixelSize: app.letterSize
color: "gray"
}
}
}

Column {

Row {
spacing: 5
Text {
font.family: "Open Sans"
text: "256"
font.pixelSize: app.letterSize
color: "white"
}
Text {
font.family: "Open Sans"
text: "mi"
font.pixelSize: app.letterSize
color: "gray"
}
}
}
Column {

Row {
spacing: 5
Text {
font.family: "Open Sans"
text: "22Β°"
font.pixelSize: app.letterSize
color: "white"
}
Text {
font.family: "Open Sans"
text: "G"
font.pixelSize: app.letterSize
color: "gray"
}
}
}

}
29 changes: 29 additions & 0 deletions ui/GearShiftInfo.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import QtQuick 2.15

Column {
spacing: 10
Text {
font.family: "Open Sans"
text: "P"
font.pixelSize: app.letterSize
color: "gray"
}
Text {
font.family: "Open Sans"
text: "R"
font.pixelSize: app.letterSize
color: "gray"
}
Text {
font.family: "Open Sans"
text: "N"
font.pixelSize: app.letterSize
color: "gray"
}
Text {
font.family: "Open Sans"
text: "D"
font.pixelSize: app.letterSize
color: "blue"
}
}
46 changes: 46 additions & 0 deletions ui/LightInfo.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import QtQuick 2.15

Row {
spacing: 10
padding: 10

Image {
id: lowBeamSignal
source: "qrc:/assets/icons/low_beam_on.png"
width: app.iconWidth
height: app.iconHeight
visible: true
}

Image {
id: highBeamSignal
source: "qrc:/assets/icons/high_beam_on.png"
width: app.iconWidth
height: app.iconHeight
visible: true
}

Image {
id: frontFogSignal
source: "qrc:/assets/icons/front_fog_on.png"
width: app.iconWidth
height: app.iconHeight
visible: true
}

Image {
id: parkingLightsSignal
source: "qrc:/assets/icons/parking_lights_on.png"
width: app.iconWidth
height: app.iconHeight
visible: true
}

Image {
id: backFogSignal
source: "qrc:/assets/icons/back_fog_on.png"
width: app.iconWidth
height: app.iconHeight
visible: true
}
}
74 changes: 74 additions & 0 deletions ui/Main.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import QtQuick 2.15
import QtQuick.Controls 2.15

ApplicationWindow {
id: app
visible: true
width: Screen.width
height: Screen.height
// flags: Qt.FramelessWindowHint

property int letterSize: 25
property int iconWidth: 40
property int iconHeight: 40
property bool carClusterVisible: true

property bool showSplash: true

font.family: "Roboto"
font.pixelSize: 30
font.bold: false

// Car CLuster
Rectangle {
anchors.fill: parent
visible: app.carClusterVisible

// Background Gradient
Canvas {
anchors.fill: parent
onPaint: {
var ctx = getContext("2d");
ctx.fillStyle = "#000000";
ctx.fillRect(0, 0, width, height);
}
}

Row {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 100
spacing: 10

TurnSignals {
isLeft: true
isBlinking: true
}
SpeedDisplay {}
TurnSignals {
isLeft: false
isBlinking: false
}
}

GearShiftInfo {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 20
}

LightInfo {
anchors.top: parent.top
anchors.topMargin: 30
anchors.left: parent.left
anchors.leftMargin: 70
}

FootbarInfo {
anchors.bottom: parent.bottom
anchors.bottomMargin: 60
anchors.left: parent.left
anchors.leftMargin: 70
}
}
}
21 changes: 21 additions & 0 deletions ui/SpeedDisplay.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import QtQuick 2.15

Column {
spacing: 5

Text {
font.family: "Open Sans"
text: canBusHandler.speed
font.pixelSize: 110
color: "white"
opacity: 1.0
}

Text {
anchors.horizontalCenter: parent.horizontalCenter
font.family: "Open Sans"
text: "DM/S"
font.pixelSize: app.letterSize
color: "gray"
}
}
32 changes: 32 additions & 0 deletions ui/TurnSignals.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import QtQuick 2.15

Row {
id: root
spacing: 10

property bool isLeft: true
property bool isBlinking: false

Image {
anchors.verticalCenter: parent.verticalCenter
id: turnSignal
source: isLeft ? "qrc:/assets/icons/turn_left_on.png" : "qrc:/assets/icons/turn_right_on.png"
width: 70
height: 70
opacity: 0.0

Timer {
id: blinkTimer
interval: 500
running: root.isBlinking
repeat: true
onTriggered: {
if (turnSignal.isBlinking) {
turnSignal.opacity = turnSignal.opacity === 1.0 ? 0.0 : 1.0;
} else {
turnSignal.opacity = 0.0;
}
}
}
}
}
Loading
Loading