diff --git a/CMakeLists.txt b/CMakeLists.txt index 9630827..f4a1cee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.15...4.3) project( - EmbeddedLinuxSandbox - VERSION 0.1 + LR-EnviroCommand + VERSION 0.1.0 DESCRIPTION "LR-EnviroCommand" LANGUAGES CXX ) @@ -36,7 +36,7 @@ endif () # Setup Qt QML -find_package(Qt6 6.10 COMPONENTS Network Quick REQUIRED) +find_package(Qt6 6.10 COMPONENTS Charts Network Quick REQUIRED) qt_standard_project_setup(REQUIRES 6.10) # FetchContent added in CMake 3.11, downloads during the configure step diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 135df69..a0cc3fe 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -5,11 +5,18 @@ qt_add_executable(${target} ) qt_add_qml_module(${target} - URI app + URI "app" + VERSION 0.1.0 QML_FILES main.qml ) target_compile_features(${target} PRIVATE cxx_std_23) -target_link_libraries(${target} PRIVATE Qt6::Quick) \ No newline at end of file +target_link_libraries(${target} + PRIVATE + Qt6::Charts + Qt6::Quick + project_core + project_viewsplugin +) \ No newline at end of file diff --git a/app/main.qml b/app/main.qml index d5c3bca..bfc3545 100644 --- a/app/main.qml +++ b/app/main.qml @@ -1,21 +1,41 @@ import QtQuick import QtQuick.Controls +import QtQuick.Layouts +import ProjectViews ApplicationWindow { - width: 400 - height: 400 + id: app + width: 1280 + height: 720 visible: true + title: "LR-EnviroCommand" - Button { - id: button - text: "A Special Button" - background: Rectangle { - implicitWidth: 100 - implicitHeight: 40 - color: button.down ? "#d6d6d6" : "#f6f6f6" - border.color: "#26282a" - border.width: 1 - radius: 4 + RowLayout { + anchors.fill: parent + + Rectangle { + width: 220 + Layout.fillHeight: true + + Column { + anchors.fill: parent + anchors.margins: 20 + spacing: 16 + + Button { text: "Dashboard" } + Button { text: "Telemetry" } + Button { text: "Logs" } + Button { text: "Firmware" } + Button { text: "Remote Commands" } + Button { text: "Settings" } + } + } + + StackView { + id: stackView + Layout.fillWidth: true + Layout.fillHeight: true + initialItem: Dashboard { } } } } \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e69de29..29d18df 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(core) +add_subdirectory(views) \ No newline at end of file diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt new file mode 100644 index 0000000..687d971 --- /dev/null +++ b/src/core/CMakeLists.txt @@ -0,0 +1,10 @@ +set(target project_core) + +add_library(${target} + core.cpp + core.hpp +) + +target_compile_features(${target} PRIVATE cxx_std_23) + +# target_link_libraries(${target} PRIVATE) \ No newline at end of file diff --git a/src/core/core.cpp b/src/core/core.cpp new file mode 100644 index 0000000..03d065f --- /dev/null +++ b/src/core/core.cpp @@ -0,0 +1 @@ +#include "core.hpp" \ No newline at end of file diff --git a/src/core/core.hpp b/src/core/core.hpp new file mode 100644 index 0000000..5b849f9 --- /dev/null +++ b/src/core/core.hpp @@ -0,0 +1,14 @@ +#ifndef CORE_HPP +#define CORE_HPP + +namespace core { + +class Core { +public: + Core() = default; + ~Core() = default; +}; + +} // namespace core + +#endif diff --git a/src/views/CMakeLists.txt b/src/views/CMakeLists.txt new file mode 100644 index 0000000..2485663 --- /dev/null +++ b/src/views/CMakeLists.txt @@ -0,0 +1,10 @@ +set(target project_views) + +qt_add_library(project_views STATIC) + +qt_add_qml_module(${target} + URI "ProjectViews" + VERSION 0.1.0 + QML_FILES + Dashboard.qml +) \ No newline at end of file diff --git a/src/views/Dashboard.qml b/src/views/Dashboard.qml new file mode 100644 index 0000000..01e565d --- /dev/null +++ b/src/views/Dashboard.qml @@ -0,0 +1,109 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +Item { + Layout.fillWidth: true + Layout.fillHeight: true + + ColumnLayout { + anchors.fill: parent + anchors.margins: 20 + spacing: 16 + + RowLayout { + Layout.fillWidth: true + spacing: 20 + + ComboBox { model: ["LR-EnviroStation‑01", "LR-EnviroStation‑02"] } + Rectangle { width: 12; height: 12; radius: 6; color: "green" } + Label { text: "Online"; } + + Item { Layout.fillWidth: true } + + Button { text: "Restart Device" } + Button { text: "Sync Now" } + } + + Rectangle { + Layout.fillWidth: true + height: 120 + radius: 8 + + Column { + anchors.fill: parent + anchors.margins: 16 + spacing: 6 + + Label { text: "LR-EnviroStation‑01"; font.bold: true } + Label { text: "Location: Tucson, AZ"; } + Label { text: "Last Seen: Just now"; } + } + } + + GridLayout { + columns: 3 + Layout.fillWidth: true + rowSpacing: 16 + columnSpacing: 16 + + Rectangle { + width: 300; height: 120; radius: 8; + Column { + anchors.centerIn: parent + Label { text: "Temperature"; } + Label { text: "72°F ↑"; color: "#4da3ff"; font.pixelSize: 26 } + } + } + + Rectangle { + width: 300; height: 120; radius: 8; + Column { + anchors.centerIn: parent + Label { text: "Humidity"; } + Label { text: "18% →"; color: "#4da3ff"; font.pixelSize: 26 } + } + } + + Rectangle { + width: 300; height: 120; radius: 8; + Column { + anchors.centerIn: parent + Label { text: "Alerts"; } + Label { text: "2 Active"; color: "orange"; font.pixelSize: 26 } + } + } + } + + Rectangle { + Layout.fillWidth: true + Layout.fillHeight: true + radius: 8 + + Column { + anchors.fill: parent + anchors.margins: 16 + spacing: 8 + + Label { text: "Recent Activity"; font.bold: true } + + ListView { + Layout.fillWidth: true + Layout.fillHeight: true + model: [ + "Telemetry upload OK (12:01)", + "Wind sensor calibrated (11:58)", + "Firmware check complete (11:45)" + ] + delegate: Label { + text: modelData + leftPadding: 4 + rightPadding: 4 + topPadding: 2 + bottomPadding: 2 + } + } + } + } + } +} \ No newline at end of file diff --git a/vcpkg.json b/vcpkg.json index cf9536d..b5005d7 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,5 +1,6 @@ { "dependencies": [ - "qtdeclarative" + "qtdeclarative", + "qtcharts" ] -} \ No newline at end of file +}