Skip to content
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ build*
# --------
*.dll
*.exe

7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[submodule "deps/qtmqtt"]
path = deps/qtmqtt
url = https://github.com/qt/qtmqtt
ignore = dirty
[submodule "deps/protobuf"]
path = deps/protobuf
url = https://github.com/protocolbuffers/protobuf
71 changes: 34 additions & 37 deletions NERODevelopment/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
cmake_minimum_required(VERSION 3.21.1)

option(LINK_INSIGHT "Link Qt Insight Tracker library" ON)
option(BUILD_QDS_COMPONENTS "Build design studio components" ON)

project(NEROApp LANGUAGES CXX)

set(CMAKE_AUTOMOC ON)

# Find Qt6 first before version checks
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Network Mqtt Protobuf)

if (Qt6_VERSION VERSION_GREATER_EQUAL 6.5)
qt_standard_project_setup()
endif()
qt_standard_project_setup(REQUIRES 6.8)

# Consolidate all sources in one place
set(PROJECT_SOURCES
# Headers - Constants
src/constants/fault_statuses.h

# Headers - Controllers
src/controllers/chargingcontroller.h
src/controllers/homecontroller.h
src/controllers/offviewcontroller.h
src/controllers/efficiencycontroller.h
src/controllers/headercontroller.h
src/controllers/offviewcontroller.h
src/controllers/buttoncontroller.h
src/controllers/navigationcontroller.h
src/controllers/flappybirdcontroller.h
src/controllers/speedcontroller.h
src/controllers/snakecontroller.h
src/controllers/tankcontroller.h

# Headers - Models
src/models/mock_model.h
src/models/model.h
src/models/raspberry_model.h
src/models/mqtt_client.h

# Headers - Debug Mode
src/modes/debug_mode/debug_utils.h

# Headers - Utils
src/utils/data_type_names.h
src/utils/server_data.h
src/utils/attributestatus.h
src/utils/descriptioninfo.h

# Implementation - Controllers
src/controllers/efficiencycontroller.cpp
src/controllers/chargingcontroller.cpp
src/controllers/homecontroller.cpp
Expand All @@ -45,46 +49,43 @@ set(PROJECT_SOURCES
src/controllers/buttoncontroller.cpp
src/controllers/navigationcontroller.cpp
src/controllers/flappybirdcontroller.cpp
src/controllers/speedcontroller.cpp
src/controllers/snakecontroller.cpp
src/controllers/tankcontroller.cpp

# Implementation - Models
src/models/mock_model.cpp
src/models/model.cpp
src/models/raspberry_model.cpp
src/models/mqtt_client.cpp

# Implementation - Debug Mode
src/modes/debug_mode/debug_utils.cpp

# Implementation - Utils
src/utils/server_data.cpp
src/utils/descriptioninfo.cpp

# Main
src/main.cpp

src/controllers/speedcontroller.h
src/controllers/speedcontroller.cpp
)

find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Network Mqtt Protobuf)

qt_add_executable(NEROApp ${PROJECT_SOURCES}
src/controllers/snakecontroller.h
src/controllers/snakecontroller.cpp
src/controllers/tankcontroller.cpp
src/controllers/tankcontroller.h)

qt_add_resources(NEROApp "configuration"
PREFIX "/"
FILES
qtquickcontrols2.conf
# rss
application.qrc
)

set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
# Create executable with all sources consolidated
qt_add_executable(NEROApp ${PROJECT_SOURCES})

# Add protobuf
qt_add_protobuf(NEROApp
PROTO_FILES
src/proto/serverdata/serverdata.proto
)

target_include_directories(${PROJECT_NAME} PUBLIC include)
include_directories("src/**")


# Link libraries
target_link_libraries(NEROApp PRIVATE
Qt6::Core
Qt6::Gui
Expand All @@ -95,21 +96,17 @@ target_link_libraries(NEROApp PRIVATE
Qt6::Protobuf
)

if (BUILD_QDS_COMPONENTS)
include(${CMAKE_CURRENT_SOURCE_DIR}/qmlcomponents)
endif()
set(CMAKE_OBJECT_PATH_MAX 500)

# include the qml config
include(${CMAKE_CURRENT_SOURCE_DIR}/qmlmodules)
include(${CMAKE_CURRENT_SOURCE_DIR}/qmlcomponents)
include(${CMAKE_CURRENT_SOURCE_DIR}/insight)

if (LINK_INSIGHT)
include(${CMAKE_CURRENT_SOURCE_DIR}/insight)
endif ()

# Installation
include(GNUInstallDirs)
install(TARGETS NEROApp
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)


116 changes: 116 additions & 0 deletions NERODevelopment/NERO.qmlproject.qtds
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtDesignStudio 4.7.2, 2025-09-29T01:58:51. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{dc75e71e-c532-40d3-9c38-160afa0018ea}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="qlonglong">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.LineEndingBehavior">0</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">2</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.8.2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.8.2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{63f87550-2541-4163-9631-08b7fea781da}</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">-1</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">0</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">QML Runtime</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QmlProjectManager.QmlRunConfiguration.Qml</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
<value type="QString" key="QmlProjectManager.QmlRunConfiguration.LastUsedLanguage">en</value>
<value type="QString" key="QmlProjectManager.QmlRunConfiguration.MainScript">CurrentFile</value>
<value type="bool" key="QmlProjectManager.QmlRunConfiguration.UseMultiLanguage">true</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="qlonglong">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>
5 changes: 5 additions & 0 deletions NERODevelopment/application.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/">
<file>qtquickcontrols2.conf</file>
</qresource>
</RCC>
2 changes: 1 addition & 1 deletion NERODevelopment/content/DescriptionModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Rectangle {
Image {
id: modalImage
anchors.fill: parent // This makes the image fill the rectangle
source: "qrc:/content/images/neroLogo.png" // Set the image source here
source: "/qt/qml/content/images/neroLogo.png" // Set the image source here
fillMode: Image.PreserveAspectCrop

layer.enabled: true
Expand Down
12 changes: 6 additions & 6 deletions NERODevelopment/content/FlappyBird.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Item {
property int xWall1: 200
property int xWall2: 400
property int xWall3: 600
property string pipeSrc: "qrc:/content/images/pipe.png"
property string backgroundSrc: "qrc:/content/images/bg.png"
property string birdSrc: "qrc:/content/images/flappy-bird.png"
property string pipeSrc: "/qt/qml/content/images/pipe.png"
property string backgroundSrc: "/qt/qml/content/images/bg.png"
property string birdSrc: "/qt/qml/content/images/flappy-bird.png"
property bool gameOver: true
property int score: 0
property bool jump: false
Expand All @@ -32,9 +32,9 @@ Item {
property double speed: 3
property int frameRate: 25
property bool didJump: flappyBirdController.didJump
property string birdFrame1: "qrc:/content/images/yellowbird-downflap.png"
property string birdFrame2: "qrc:/content/images/yellowbird-midflap.png"
property string birdFrame3: "qrc:/content/images/yellowbird-upflap.png"
property string birdFrame1: "/qt/qml/content/images/yellowbird-downflap.png"
property string birdFrame2: "/qt/qml/content/images/yellowbird-midflap.png"
property string birdFrame3: "/qt/qml/content/images/yellowbird-upflap.png"

property int currentBirdFrame: 0
property bool startFalling: false
Expand Down
2 changes: 1 addition & 1 deletion NERODevelopment/content/HomeIcon.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Rectangle {

property bool highlighted: false
property string text: "Off"
property string source: "qrc:/content/images/zzz.png"
property string source: "/qt/qml/content/images/zzz.png"

ColumnLayout {
id: imageContainer
Expand Down
2 changes: 1 addition & 1 deletion NERODevelopment/content/MicrophoneComponent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Item {
height: parent.height
width: parent.width
visible: isTalking
source: "qrc:/content/images/microphone.svg"
source: "/qt/qml/content/images/microphone.svg"
fillMode: Image.PreserveAspectFit
}

Expand Down
12 changes: 6 additions & 6 deletions NERODevelopment/content/NavigationController.qml
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,31 @@ Item {
width: navigation.boxSize
highlighted: selectedPageIndex === pitDrivePageIndex
text: "PIT - DRIVE"
source: "qrc:/content/images/flag.png"
source: "/qt/qml/content/images/flag.png"
}

HomeIcon {
height: navigation.boxSize
width: navigation.boxSize
highlighted: selectedPageIndex === pitReversePageIndex
text: "PIT - REVERSE"
source: "qrc:/content/images/reverse.png"
source: "/qt/qml/content/images/reverse.png"
}

HomeIcon {
height: navigation.boxSize
width: navigation.boxSize
highlighted: selectedPageIndex === speedPageIndex
text: "PERFORMANCE"
source: "qrc:/content/images/hare.png"
source: "/qt/qml/content/images/hare.png"
}

HomeIcon {
height: navigation.boxSize
width: navigation.boxSize
highlighted: selectedPageIndex === efficiencyPageIndex
text: "EFFICIENCY"
source: "qrc:/content/images/turtle.png"
source: "/qt/qml/content/images/turtle.png"
}
}

Expand All @@ -139,7 +139,7 @@ Item {
width: navigation.boxSize
highlighted: selectedPageIndex === gamePageIndex
text: "GAMES"
source: "qrc:/content/images/game.png"
source: "/qt/qml/content/images/game.png"
visible: !gamePageOpen
}

Expand All @@ -165,7 +165,7 @@ Item {
width: navigation.boxSize
highlighted: selectedPageIndex === exitPageIndex
text: "EXIT"
source: "qrc:/content/images/exit.png"
source: "/qt/qml/content/images/exit.png"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion NERODevelopment/content/OffScreen2.qml
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ Rectangle {
anchors.right: cpBrbInterlocksTsmsContainer.left
anchors.rightMargin: parent.width / 30
anchors.leftMargin: parent.width / 30
source: "qrc:/content/images/neroLogo.png"
source: "/qt/qml/content/images/neroLogo.png"
fillMode: Image.PreserveAspectFit
}

Expand Down
Loading