diff --git a/.vscode/settings.json b/.vscode/settings.json index 840b58b..41eaeac 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,9 @@ "qobject": "cpp", "array": "cpp", "string": "cpp", - "string_view": "cpp" + "string_view": "cpp", + "typeinfo": "cpp", + "locale": "cpp" }, "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools" } \ No newline at end of file diff --git a/agent/CMakeLists.txt b/agent/CMakeLists.txt index 57e0ab2..09aa71b 100644 --- a/agent/CMakeLists.txt +++ b/agent/CMakeLists.txt @@ -38,8 +38,7 @@ add_executable(sbcbmc-agent target_include_directories(sbcbmc-agent PRIVATE "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/include/" - "${CMAKE_SOURCE_DIR}/plugins/thermal/include/" - "${CMAKE_SOURCE_DIR}/plugins/thermal/" + "${CMAKE_CURRENT_BINARY_DIR}/include/" ${LibUSB_INCLUDE_DIRS} ) diff --git a/agent/include/daemon.h b/agent/include/daemon.h index cd6c9e5..9723735 100644 --- a/agent/include/daemon.h +++ b/agent/include/daemon.h @@ -7,12 +7,12 @@ #include "pluginbase.h" -class daemon : public QObject +class sbc_agent : public QObject { Q_OBJECT public: - daemon(QObject *parent = nullptr); - ~daemon(); + sbc_agent(QObject *parent = nullptr); + ~sbc_agent(); private: QHash m_Plugins; QRemoteObjectHost *m_rohost; diff --git a/agent/source/daemon.cpp b/agent/source/daemon.cpp index 6fafd58..bc6e801 100644 --- a/agent/source/daemon.cpp +++ b/agent/source/daemon.cpp @@ -2,7 +2,7 @@ #include "dcdc-usb-200.h" #include "thermal.h" -daemon::daemon(QObject *parent) : +sbc_agent::sbc_agent(QObject *parent) : QObject(parent) { this->m_roregistryhost = new QRemoteObjectRegistryHost(QUrl("tcp://0.0.0.0:1999"), this); @@ -22,7 +22,7 @@ daemon::daemon(QObject *parent) : } } -daemon::~daemon() +sbc_agent::~sbc_agent() { } \ No newline at end of file diff --git a/agent/source/main.cpp b/agent/source/main.cpp index cbc1093..b225907 100644 --- a/agent/source/main.cpp +++ b/agent/source/main.cpp @@ -27,8 +27,7 @@ int main(int argc, char *argv[]) { parser.process(a); - daemon carserver; - carserver; + sbc_agent sbcagent; a.exec(); } \ No newline at end of file diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index e026827..c0fb529 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -18,6 +18,7 @@ find_package(Qt5 COMPONENTS RemoteObjects REQUIRED) find_package(Qt5 COMPONENTS Qml REQUIRED) find_package(Qt5 COMPONENTS Quick REQUIRED) find_package(Qt5 COMPONENTS QuickControls2 REQUIRED) +find_package(Qt5 COMPONENTS Charts REQUIRED) find_package(PkgConfig REQUIRED) @@ -45,6 +46,9 @@ add_executable(sbcbmc-client ${HEADERS} ${REPSOURCES} sbcbmc-client.qrc + qml/qml.qrc + imagine-assets/imagine-assets.qrc + icons/icons.qrc ) target_include_directories(sbcbmc-client PRIVATE @@ -55,4 +59,4 @@ target_include_directories(sbcbmc-client PRIVATE ${LibUSB_INCLUDE_DIRS} ) -target_link_libraries(sbcbmc-client Qt5::Core Qt5::RemoteObjects Qt5::Qml Qt5::Quick) \ No newline at end of file +target_link_libraries(sbcbmc-client Qt5::Core Qt5::RemoteObjects Qt5::Qml Qt5::Quick Qt5::Charts) \ No newline at end of file diff --git a/client/icons/automotive/44x44/air-con.png b/client/icons/automotive/44x44/air-con.png new file mode 100644 index 0000000..70175f6 Binary files /dev/null and b/client/icons/automotive/44x44/air-con.png differ diff --git a/client/icons/automotive/44x44/command.png b/client/icons/automotive/44x44/command.png new file mode 100644 index 0000000..8f712c7 Binary files /dev/null and b/client/icons/automotive/44x44/command.png differ diff --git a/client/icons/automotive/44x44/message.png b/client/icons/automotive/44x44/message.png new file mode 100644 index 0000000..7773ca6 Binary files /dev/null and b/client/icons/automotive/44x44/message.png differ diff --git a/client/icons/automotive/44x44/music.png b/client/icons/automotive/44x44/music.png new file mode 100644 index 0000000..dc73322 Binary files /dev/null and b/client/icons/automotive/44x44/music.png differ diff --git a/client/icons/automotive/44x44/seats.png b/client/icons/automotive/44x44/seats.png new file mode 100644 index 0000000..2f9eaa6 Binary files /dev/null and b/client/icons/automotive/44x44/seats.png differ diff --git a/client/icons/automotive/44x44/settings.png b/client/icons/automotive/44x44/settings.png new file mode 100644 index 0000000..b65598b Binary files /dev/null and b/client/icons/automotive/44x44/settings.png differ diff --git a/client/icons/automotive/44x44/statistics.png b/client/icons/automotive/44x44/statistics.png new file mode 100644 index 0000000..9797029 Binary files /dev/null and b/client/icons/automotive/44x44/statistics.png differ diff --git a/client/icons/automotive/44x44/windows.png b/client/icons/automotive/44x44/windows.png new file mode 100644 index 0000000..8ed8cec Binary files /dev/null and b/client/icons/automotive/44x44/windows.png differ diff --git a/client/icons/automotive/44x44@2/air-con.png b/client/icons/automotive/44x44@2/air-con.png new file mode 100644 index 0000000..8822979 Binary files /dev/null and b/client/icons/automotive/44x44@2/air-con.png differ diff --git a/client/icons/automotive/44x44@2/command.png b/client/icons/automotive/44x44@2/command.png new file mode 100644 index 0000000..918e2b6 Binary files /dev/null and b/client/icons/automotive/44x44@2/command.png differ diff --git a/client/icons/automotive/44x44@2/message.png b/client/icons/automotive/44x44@2/message.png new file mode 100644 index 0000000..1debfdf Binary files /dev/null and b/client/icons/automotive/44x44@2/message.png differ diff --git a/client/icons/automotive/44x44@2/music.png b/client/icons/automotive/44x44@2/music.png new file mode 100644 index 0000000..01a3ece Binary files /dev/null and b/client/icons/automotive/44x44@2/music.png differ diff --git a/client/icons/automotive/44x44@2/navigation.png b/client/icons/automotive/44x44@2/navigation.png new file mode 100644 index 0000000..3a18fb5 Binary files /dev/null and b/client/icons/automotive/44x44@2/navigation.png differ diff --git a/client/icons/automotive/44x44@2/seats.png b/client/icons/automotive/44x44@2/seats.png new file mode 100644 index 0000000..7d67f1b Binary files /dev/null and b/client/icons/automotive/44x44@2/seats.png differ diff --git a/client/icons/automotive/44x44@2/settings.png b/client/icons/automotive/44x44@2/settings.png new file mode 100644 index 0000000..3ce2a1f Binary files /dev/null and b/client/icons/automotive/44x44@2/settings.png differ diff --git a/client/icons/automotive/44x44@2/statistics.png b/client/icons/automotive/44x44@2/statistics.png new file mode 100644 index 0000000..afc2cc0 Binary files /dev/null and b/client/icons/automotive/44x44@2/statistics.png differ diff --git a/client/icons/automotive/44x44@2/windows.png b/client/icons/automotive/44x44@2/windows.png new file mode 100644 index 0000000..59bac58 Binary files /dev/null and b/client/icons/automotive/44x44@2/windows.png differ diff --git a/client/icons/automotive/icons.svg b/client/icons/automotive/icons.svg new file mode 100644 index 0000000..daf4633 --- /dev/null +++ b/client/icons/automotive/icons.svg @@ -0,0 +1,526 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ! + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/icons/automotive/index.theme b/client/icons/automotive/index.theme new file mode 100644 index 0000000..cd84146 --- /dev/null +++ b/client/icons/automotive/index.theme @@ -0,0 +1,14 @@ +[Icon Theme] +Name=Automotive +Comment=Icon theme for the Qt Quick Controls 2 Automotive Imagine Style Example + +Directories=44x44,44x44@2 + +[44x44] +Size=44 +Type=Fixed + +[44x44@2] +Size=44 +Scale=2 +Type=Fixed diff --git a/client/icons/car.png b/client/icons/car.png new file mode 100644 index 0000000..4bfc9a4 Binary files /dev/null and b/client/icons/car.png differ diff --git a/client/icons/car@2x.png b/client/icons/car@2x.png new file mode 100644 index 0000000..966bc47 Binary files /dev/null and b/client/icons/car@2x.png differ diff --git a/client/icons/icons.qrc b/client/icons/icons.qrc new file mode 100644 index 0000000..5cb7978 --- /dev/null +++ b/client/icons/icons.qrc @@ -0,0 +1,29 @@ + + + car.png + car@2x.png + warning.png + warning@2x.png + weather.png + weather@2x.png + automotive/icons.svg + automotive/index.theme + automotive/44x44/air-con.png + automotive/44x44/command.png + automotive/44x44/message.png + automotive/44x44/music.png + automotive/44x44/seats.png + automotive/44x44/settings.png + automotive/44x44/statistics.png + automotive/44x44/windows.png + automotive/44x44@2/air-con.png + automotive/44x44@2/command.png + automotive/44x44@2/message.png + automotive/44x44@2/music.png + automotive/44x44@2/navigation.png + automotive/44x44@2/seats.png + automotive/44x44@2/settings.png + automotive/44x44@2/statistics.png + automotive/44x44@2/windows.png + + diff --git a/client/icons/warning.png b/client/icons/warning.png new file mode 100644 index 0000000..590a61e Binary files /dev/null and b/client/icons/warning.png differ diff --git a/client/icons/warning@2x.png b/client/icons/warning@2x.png new file mode 100644 index 0000000..487fbaf Binary files /dev/null and b/client/icons/warning@2x.png differ diff --git a/client/icons/weather.png b/client/icons/weather.png new file mode 100644 index 0000000..b1479de Binary files /dev/null and b/client/icons/weather.png differ diff --git a/client/icons/weather@2x.png b/client/icons/weather@2x.png new file mode 100644 index 0000000..8b4333a Binary files /dev/null and b/client/icons/weather@2x.png differ diff --git a/client/imagine-assets/applicationwindow-background.png b/client/imagine-assets/applicationwindow-background.png new file mode 100644 index 0000000..aac403d Binary files /dev/null and b/client/imagine-assets/applicationwindow-background.png differ diff --git a/client/imagine-assets/applicationwindow-background@2x.png b/client/imagine-assets/applicationwindow-background@2x.png new file mode 100644 index 0000000..a8ef3dd Binary files /dev/null and b/client/imagine-assets/applicationwindow-background@2x.png differ diff --git a/client/imagine-assets/button-background-checked-hovered.9.png b/client/imagine-assets/button-background-checked-hovered.9.png new file mode 100644 index 0000000..f92dd66 Binary files /dev/null and b/client/imagine-assets/button-background-checked-hovered.9.png differ diff --git a/client/imagine-assets/button-background-checked-hovered@2x.9.png b/client/imagine-assets/button-background-checked-hovered@2x.9.png new file mode 100644 index 0000000..b64640e Binary files /dev/null and b/client/imagine-assets/button-background-checked-hovered@2x.9.png differ diff --git a/client/imagine-assets/button-background-checked.9.png b/client/imagine-assets/button-background-checked.9.png new file mode 100644 index 0000000..5a70d1d Binary files /dev/null and b/client/imagine-assets/button-background-checked.9.png differ diff --git a/client/imagine-assets/button-background-checked@2x.9.png b/client/imagine-assets/button-background-checked@2x.9.png new file mode 100644 index 0000000..9d080dc Binary files /dev/null and b/client/imagine-assets/button-background-checked@2x.9.png differ diff --git a/client/imagine-assets/button-background-hovered.9.png b/client/imagine-assets/button-background-hovered.9.png new file mode 100644 index 0000000..94e37b8 Binary files /dev/null and b/client/imagine-assets/button-background-hovered.9.png differ diff --git a/client/imagine-assets/button-background-hovered@2x.9.png b/client/imagine-assets/button-background-hovered@2x.9.png new file mode 100644 index 0000000..905d9e4 Binary files /dev/null and b/client/imagine-assets/button-background-hovered@2x.9.png differ diff --git a/client/imagine-assets/button-background-pressed.9.png b/client/imagine-assets/button-background-pressed.9.png new file mode 100644 index 0000000..bc4c3b3 Binary files /dev/null and b/client/imagine-assets/button-background-pressed.9.png differ diff --git a/client/imagine-assets/button-background-pressed@2x.9.png b/client/imagine-assets/button-background-pressed@2x.9.png new file mode 100644 index 0000000..778fe53 Binary files /dev/null and b/client/imagine-assets/button-background-pressed@2x.9.png differ diff --git a/client/imagine-assets/button-background.9.png b/client/imagine-assets/button-background.9.png new file mode 100644 index 0000000..85ed1a0 Binary files /dev/null and b/client/imagine-assets/button-background.9.png differ diff --git a/client/imagine-assets/button-background@2x.9.png b/client/imagine-assets/button-background@2x.9.png new file mode 100644 index 0000000..1eb7ebe Binary files /dev/null and b/client/imagine-assets/button-background@2x.9.png differ diff --git a/client/imagine-assets/dial-background-hovered.png b/client/imagine-assets/dial-background-hovered.png new file mode 100644 index 0000000..26add20 Binary files /dev/null and b/client/imagine-assets/dial-background-hovered.png differ diff --git a/client/imagine-assets/dial-background-hovered@2x.png b/client/imagine-assets/dial-background-hovered@2x.png new file mode 100644 index 0000000..01d8136 Binary files /dev/null and b/client/imagine-assets/dial-background-hovered@2x.png differ diff --git a/client/imagine-assets/dial-background-pressed.png b/client/imagine-assets/dial-background-pressed.png new file mode 100644 index 0000000..435acd1 Binary files /dev/null and b/client/imagine-assets/dial-background-pressed.png differ diff --git a/client/imagine-assets/dial-background-pressed@2x.png b/client/imagine-assets/dial-background-pressed@2x.png new file mode 100644 index 0000000..9bab579 Binary files /dev/null and b/client/imagine-assets/dial-background-pressed@2x.png differ diff --git a/client/imagine-assets/dial-background.png b/client/imagine-assets/dial-background.png new file mode 100644 index 0000000..8aab4d3 Binary files /dev/null and b/client/imagine-assets/dial-background.png differ diff --git a/client/imagine-assets/dial-background@2x.png b/client/imagine-assets/dial-background@2x.png new file mode 100644 index 0000000..a856971 Binary files /dev/null and b/client/imagine-assets/dial-background@2x.png differ diff --git a/client/imagine-assets/dial-handle-pressed.png b/client/imagine-assets/dial-handle-pressed.png new file mode 100644 index 0000000..9399262 Binary files /dev/null and b/client/imagine-assets/dial-handle-pressed.png differ diff --git a/client/imagine-assets/dial-handle-pressed@2x.png b/client/imagine-assets/dial-handle-pressed@2x.png new file mode 100644 index 0000000..5c563ab Binary files /dev/null and b/client/imagine-assets/dial-handle-pressed@2x.png differ diff --git a/client/imagine-assets/dial-handle.png b/client/imagine-assets/dial-handle.png new file mode 100644 index 0000000..a997dd5 Binary files /dev/null and b/client/imagine-assets/dial-handle.png differ diff --git a/client/imagine-assets/dial-handle@2x.png b/client/imagine-assets/dial-handle@2x.png new file mode 100644 index 0000000..afd1330 Binary files /dev/null and b/client/imagine-assets/dial-handle@2x.png differ diff --git a/client/imagine-assets/frame-background.9.png b/client/imagine-assets/frame-background.9.png new file mode 100644 index 0000000..fd7d545 Binary files /dev/null and b/client/imagine-assets/frame-background.9.png differ diff --git a/client/imagine-assets/frame-background@2x.9.png b/client/imagine-assets/frame-background@2x.9.png new file mode 100644 index 0000000..8328445 Binary files /dev/null and b/client/imagine-assets/frame-background@2x.9.png differ diff --git a/client/imagine-assets/imagine-assets.qrc b/client/imagine-assets/imagine-assets.qrc new file mode 100644 index 0000000..81eadda --- /dev/null +++ b/client/imagine-assets/imagine-assets.qrc @@ -0,0 +1,80 @@ + + + applicationwindow-background.png + applicationwindow-background@2x.png + button-background.9.png + button-background@2x.9.png + button-background-checked.9.png + button-background-checked@2x.9.png + button-background-checked-hovered.9.png + button-background-checked-hovered@2x.9.png + button-background-hovered.9.png + button-background-hovered@2x.9.png + button-background-pressed.9.png + button-background-pressed@2x.9.png + dial-background.png + dial-background@2x.png + dial-background-hovered.png + dial-background-hovered@2x.png + dial-background-pressed.png + dial-background-pressed@2x.png + dial-handle.png + dial-handle@2x.png + dial-handle-pressed.png + dial-handle-pressed@2x.png + frame-background.9.png + frame-background@2x.9.png + itemdelegate-background.9.png + itemdelegate-background@2x.9.png + itemdelegate-background-checked.9.png + itemdelegate-background-checked@2x.9.png + itemdelegate-background-hovered.9.png + itemdelegate-background-hovered@2x.9.png + itemdelegate-background-pressed.9.png + itemdelegate-background-pressed@2x.9.png + radiobutton-indicator.png + radiobutton-indicator@2x.png + radiobutton-indicator-checked.png + radiobutton-indicator-checked@2x.png + radiobutton-indicator-checked-hovered.png + radiobutton-indicator-checked-hovered@2x.png + radiobutton-indicator-checked-pressed.png + radiobutton-indicator-checked-pressed@2x.png + radiobutton-indicator-hovered.png + radiobutton-indicator-hovered@2x.png + radiobutton-indicator-pressed.png + radiobutton-indicator-pressed@2x.png + scrollindicator-handle.png + scrollindicator-handle@2x.png + slider-background-horizontal.9.png + slider-background-horizontal@2x.9.png + slider-handle.png + slider-handle@2x.png + slider-handle-hovered.png + slider-handle-hovered@2x.png + slider-handle-pressed.png + slider-handle-pressed@2x.png + slider-progress-horizontal.9.png + slider-progress-horizontal@2x.9.png + slider-progress-horizontal-pressed.9.png + slider-progress-horizontal-pressed@2x.9.png + switchdelegate-background.9.png + switchdelegate-background@2x.9.png + switchdelegate-handle.png + switchdelegate-handle@2x.png + switchdelegate-handle-checked.png + switchdelegate-handle-checked@2x.png + switchdelegate-handle-checked-hovered.png + switchdelegate-handle-checked-hovered@2x.png + switchdelegate-handle-hovered.png + switchdelegate-handle-hovered@2x.png + switchdelegate-handle-pressed.png + switchdelegate-handle-pressed@2x.png + switchdelegate-indicator.png + switchdelegate-indicator@2x.png + switchdelegate-indicator-pressed.png + switchdelegate-indicator-pressed@2x.png + toolseparator-separator-vertical.9.png + toolseparator-separator-vertical@2x.9.png + + diff --git a/client/imagine-assets/itemdelegate-background-checked.9.png b/client/imagine-assets/itemdelegate-background-checked.9.png new file mode 100644 index 0000000..4c6b475 Binary files /dev/null and b/client/imagine-assets/itemdelegate-background-checked.9.png differ diff --git a/client/imagine-assets/itemdelegate-background-checked@2x.9.png b/client/imagine-assets/itemdelegate-background-checked@2x.9.png new file mode 100644 index 0000000..9f4f705 Binary files /dev/null and b/client/imagine-assets/itemdelegate-background-checked@2x.9.png differ diff --git a/client/imagine-assets/itemdelegate-background-hovered.9.png b/client/imagine-assets/itemdelegate-background-hovered.9.png new file mode 100644 index 0000000..a5c189c Binary files /dev/null and b/client/imagine-assets/itemdelegate-background-hovered.9.png differ diff --git a/client/imagine-assets/itemdelegate-background-hovered@2x.9.png b/client/imagine-assets/itemdelegate-background-hovered@2x.9.png new file mode 100644 index 0000000..2b3c9c6 Binary files /dev/null and b/client/imagine-assets/itemdelegate-background-hovered@2x.9.png differ diff --git a/client/imagine-assets/itemdelegate-background-pressed.9.png b/client/imagine-assets/itemdelegate-background-pressed.9.png new file mode 100644 index 0000000..56b5534 Binary files /dev/null and b/client/imagine-assets/itemdelegate-background-pressed.9.png differ diff --git a/client/imagine-assets/itemdelegate-background-pressed@2x.9.png b/client/imagine-assets/itemdelegate-background-pressed@2x.9.png new file mode 100644 index 0000000..bbbbb8b Binary files /dev/null and b/client/imagine-assets/itemdelegate-background-pressed@2x.9.png differ diff --git a/client/imagine-assets/itemdelegate-background.9.png b/client/imagine-assets/itemdelegate-background.9.png new file mode 100644 index 0000000..1fbb562 Binary files /dev/null and b/client/imagine-assets/itemdelegate-background.9.png differ diff --git a/client/imagine-assets/itemdelegate-background@2x.9.png b/client/imagine-assets/itemdelegate-background@2x.9.png new file mode 100644 index 0000000..1888098 Binary files /dev/null and b/client/imagine-assets/itemdelegate-background@2x.9.png differ diff --git a/client/imagine-assets/radiobutton-indicator-checked-hovered.png b/client/imagine-assets/radiobutton-indicator-checked-hovered.png new file mode 100644 index 0000000..f64c966 Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator-checked-hovered.png differ diff --git a/client/imagine-assets/radiobutton-indicator-checked-hovered@2x.png b/client/imagine-assets/radiobutton-indicator-checked-hovered@2x.png new file mode 100644 index 0000000..ace1717 Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator-checked-hovered@2x.png differ diff --git a/client/imagine-assets/radiobutton-indicator-checked-pressed.png b/client/imagine-assets/radiobutton-indicator-checked-pressed.png new file mode 100644 index 0000000..c77ad47 Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator-checked-pressed.png differ diff --git a/client/imagine-assets/radiobutton-indicator-checked-pressed@2x.png b/client/imagine-assets/radiobutton-indicator-checked-pressed@2x.png new file mode 100644 index 0000000..2798f77 Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator-checked-pressed@2x.png differ diff --git a/client/imagine-assets/radiobutton-indicator-checked.png b/client/imagine-assets/radiobutton-indicator-checked.png new file mode 100644 index 0000000..ea714ea Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator-checked.png differ diff --git a/client/imagine-assets/radiobutton-indicator-checked@2x.png b/client/imagine-assets/radiobutton-indicator-checked@2x.png new file mode 100644 index 0000000..4f29b80 Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator-checked@2x.png differ diff --git a/client/imagine-assets/radiobutton-indicator-hovered.png b/client/imagine-assets/radiobutton-indicator-hovered.png new file mode 100644 index 0000000..a7d07ed Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator-hovered.png differ diff --git a/client/imagine-assets/radiobutton-indicator-hovered@2x.png b/client/imagine-assets/radiobutton-indicator-hovered@2x.png new file mode 100644 index 0000000..b0fff06 Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator-hovered@2x.png differ diff --git a/client/imagine-assets/radiobutton-indicator-pressed.png b/client/imagine-assets/radiobutton-indicator-pressed.png new file mode 100644 index 0000000..7d657ac Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator-pressed.png differ diff --git a/client/imagine-assets/radiobutton-indicator-pressed@2x.png b/client/imagine-assets/radiobutton-indicator-pressed@2x.png new file mode 100644 index 0000000..9a8b9cd Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator-pressed@2x.png differ diff --git a/client/imagine-assets/radiobutton-indicator.png b/client/imagine-assets/radiobutton-indicator.png new file mode 100644 index 0000000..b59ba0c Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator.png differ diff --git a/client/imagine-assets/radiobutton-indicator@2x.png b/client/imagine-assets/radiobutton-indicator@2x.png new file mode 100644 index 0000000..e4a2b9a Binary files /dev/null and b/client/imagine-assets/radiobutton-indicator@2x.png differ diff --git a/client/imagine-assets/scrollindicator-handle.png b/client/imagine-assets/scrollindicator-handle.png new file mode 100644 index 0000000..99206d7 Binary files /dev/null and b/client/imagine-assets/scrollindicator-handle.png differ diff --git a/client/imagine-assets/scrollindicator-handle@2x.png b/client/imagine-assets/scrollindicator-handle@2x.png new file mode 100644 index 0000000..85a9ebc Binary files /dev/null and b/client/imagine-assets/scrollindicator-handle@2x.png differ diff --git a/client/imagine-assets/slider-background-horizontal.9.png b/client/imagine-assets/slider-background-horizontal.9.png new file mode 100644 index 0000000..3d2406c Binary files /dev/null and b/client/imagine-assets/slider-background-horizontal.9.png differ diff --git a/client/imagine-assets/slider-background-horizontal@2x.9.png b/client/imagine-assets/slider-background-horizontal@2x.9.png new file mode 100644 index 0000000..6c8104f Binary files /dev/null and b/client/imagine-assets/slider-background-horizontal@2x.9.png differ diff --git a/client/imagine-assets/slider-handle-hovered.png b/client/imagine-assets/slider-handle-hovered.png new file mode 100644 index 0000000..bd26d82 Binary files /dev/null and b/client/imagine-assets/slider-handle-hovered.png differ diff --git a/client/imagine-assets/slider-handle-hovered@2x.png b/client/imagine-assets/slider-handle-hovered@2x.png new file mode 100644 index 0000000..000db40 Binary files /dev/null and b/client/imagine-assets/slider-handle-hovered@2x.png differ diff --git a/client/imagine-assets/slider-handle-pressed.png b/client/imagine-assets/slider-handle-pressed.png new file mode 100644 index 0000000..4a4d0be Binary files /dev/null and b/client/imagine-assets/slider-handle-pressed.png differ diff --git a/client/imagine-assets/slider-handle-pressed@2x.png b/client/imagine-assets/slider-handle-pressed@2x.png new file mode 100644 index 0000000..903c102 Binary files /dev/null and b/client/imagine-assets/slider-handle-pressed@2x.png differ diff --git a/client/imagine-assets/slider-handle.png b/client/imagine-assets/slider-handle.png new file mode 100644 index 0000000..8f812da Binary files /dev/null and b/client/imagine-assets/slider-handle.png differ diff --git a/client/imagine-assets/slider-handle@2x.png b/client/imagine-assets/slider-handle@2x.png new file mode 100644 index 0000000..b30a4f3 Binary files /dev/null and b/client/imagine-assets/slider-handle@2x.png differ diff --git a/client/imagine-assets/slider-progress-horizontal-pressed.9.png b/client/imagine-assets/slider-progress-horizontal-pressed.9.png new file mode 100644 index 0000000..7789f09 Binary files /dev/null and b/client/imagine-assets/slider-progress-horizontal-pressed.9.png differ diff --git a/client/imagine-assets/slider-progress-horizontal-pressed@2x.9.png b/client/imagine-assets/slider-progress-horizontal-pressed@2x.9.png new file mode 100644 index 0000000..e64c13d Binary files /dev/null and b/client/imagine-assets/slider-progress-horizontal-pressed@2x.9.png differ diff --git a/client/imagine-assets/slider-progress-horizontal.9.png b/client/imagine-assets/slider-progress-horizontal.9.png new file mode 100644 index 0000000..8e65ca3 Binary files /dev/null and b/client/imagine-assets/slider-progress-horizontal.9.png differ diff --git a/client/imagine-assets/slider-progress-horizontal@2x.9.png b/client/imagine-assets/slider-progress-horizontal@2x.9.png new file mode 100644 index 0000000..d512e40 Binary files /dev/null and b/client/imagine-assets/slider-progress-horizontal@2x.9.png differ diff --git a/client/imagine-assets/switchdelegate-background.9.png b/client/imagine-assets/switchdelegate-background.9.png new file mode 100644 index 0000000..1fbb562 Binary files /dev/null and b/client/imagine-assets/switchdelegate-background.9.png differ diff --git a/client/imagine-assets/switchdelegate-background@2x.9.png b/client/imagine-assets/switchdelegate-background@2x.9.png new file mode 100644 index 0000000..1888098 Binary files /dev/null and b/client/imagine-assets/switchdelegate-background@2x.9.png differ diff --git a/client/imagine-assets/switchdelegate-handle-checked-hovered.png b/client/imagine-assets/switchdelegate-handle-checked-hovered.png new file mode 100644 index 0000000..e66ef71 Binary files /dev/null and b/client/imagine-assets/switchdelegate-handle-checked-hovered.png differ diff --git a/client/imagine-assets/switchdelegate-handle-checked-hovered@2x.png b/client/imagine-assets/switchdelegate-handle-checked-hovered@2x.png new file mode 100644 index 0000000..05d6f82 Binary files /dev/null and b/client/imagine-assets/switchdelegate-handle-checked-hovered@2x.png differ diff --git a/client/imagine-assets/switchdelegate-handle-checked.png b/client/imagine-assets/switchdelegate-handle-checked.png new file mode 100644 index 0000000..bcfa06a Binary files /dev/null and b/client/imagine-assets/switchdelegate-handle-checked.png differ diff --git a/client/imagine-assets/switchdelegate-handle-checked@2x.png b/client/imagine-assets/switchdelegate-handle-checked@2x.png new file mode 100644 index 0000000..b9985f0 Binary files /dev/null and b/client/imagine-assets/switchdelegate-handle-checked@2x.png differ diff --git a/client/imagine-assets/switchdelegate-handle-hovered.png b/client/imagine-assets/switchdelegate-handle-hovered.png new file mode 100644 index 0000000..3de8aa1 Binary files /dev/null and b/client/imagine-assets/switchdelegate-handle-hovered.png differ diff --git a/client/imagine-assets/switchdelegate-handle-hovered@2x.png b/client/imagine-assets/switchdelegate-handle-hovered@2x.png new file mode 100644 index 0000000..b955159 Binary files /dev/null and b/client/imagine-assets/switchdelegate-handle-hovered@2x.png differ diff --git a/client/imagine-assets/switchdelegate-handle-pressed.png b/client/imagine-assets/switchdelegate-handle-pressed.png new file mode 100644 index 0000000..547b2c1 Binary files /dev/null and b/client/imagine-assets/switchdelegate-handle-pressed.png differ diff --git a/client/imagine-assets/switchdelegate-handle-pressed@2x.png b/client/imagine-assets/switchdelegate-handle-pressed@2x.png new file mode 100644 index 0000000..b4bb748 Binary files /dev/null and b/client/imagine-assets/switchdelegate-handle-pressed@2x.png differ diff --git a/client/imagine-assets/switchdelegate-handle.png b/client/imagine-assets/switchdelegate-handle.png new file mode 100644 index 0000000..fd81422 Binary files /dev/null and b/client/imagine-assets/switchdelegate-handle.png differ diff --git a/client/imagine-assets/switchdelegate-handle@2x.png b/client/imagine-assets/switchdelegate-handle@2x.png new file mode 100644 index 0000000..9a7456a Binary files /dev/null and b/client/imagine-assets/switchdelegate-handle@2x.png differ diff --git a/client/imagine-assets/switchdelegate-indicator-pressed.png b/client/imagine-assets/switchdelegate-indicator-pressed.png new file mode 100644 index 0000000..6833d62 Binary files /dev/null and b/client/imagine-assets/switchdelegate-indicator-pressed.png differ diff --git a/client/imagine-assets/switchdelegate-indicator-pressed@2x.png b/client/imagine-assets/switchdelegate-indicator-pressed@2x.png new file mode 100644 index 0000000..3d5498a Binary files /dev/null and b/client/imagine-assets/switchdelegate-indicator-pressed@2x.png differ diff --git a/client/imagine-assets/switchdelegate-indicator.png b/client/imagine-assets/switchdelegate-indicator.png new file mode 100644 index 0000000..3db5fe2 Binary files /dev/null and b/client/imagine-assets/switchdelegate-indicator.png differ diff --git a/client/imagine-assets/switchdelegate-indicator@2x.png b/client/imagine-assets/switchdelegate-indicator@2x.png new file mode 100644 index 0000000..b5c10f7 Binary files /dev/null and b/client/imagine-assets/switchdelegate-indicator@2x.png differ diff --git a/client/imagine-assets/toolseparator-separator-vertical.9.png b/client/imagine-assets/toolseparator-separator-vertical.9.png new file mode 100644 index 0000000..02c7a56 Binary files /dev/null and b/client/imagine-assets/toolseparator-separator-vertical.9.png differ diff --git a/client/imagine-assets/toolseparator-separator-vertical@2x.9.png b/client/imagine-assets/toolseparator-separator-vertical@2x.9.png new file mode 100644 index 0000000..e0390d3 Binary files /dev/null and b/client/imagine-assets/toolseparator-separator-vertical@2x.9.png differ diff --git a/client/include/client.hpp b/client/include/client.hpp index 19cd4b2..8740824 100644 --- a/client/include/client.hpp +++ b/client/include/client.hpp @@ -1,12 +1,20 @@ #include #include +#include + +#include "rep_dcdc_usb_200_replica.h" +#include "rep_thermal_replica.h" + class SBCBMCClient : public QObject { Q_OBJECT public: SBCBMCClient(QObject *parent = nullptr); ~SBCBMCClient(); - + public Q_SLOTS: + void ready(); private: QQmlApplicationEngine *engine; + Thermal_PropertiesReplica *thermal; + QRemoteObjectNode *node; }; \ No newline at end of file diff --git a/client/qml/CustomGlow.qml b/client/qml/CustomGlow.qml new file mode 100644 index 0000000..483059a --- /dev/null +++ b/client/qml/CustomGlow.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtGraphicalEffects 1.12 + +Glow { + color: glowColor + samples: 20 + spread: 0.3 +} diff --git a/client/qml/FeatureButton.qml b/client/qml/FeatureButton.qml new file mode 100644 index 0000000..d86b39c --- /dev/null +++ b/client/qml/FeatureButton.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Layouts 1.12 +import QtQuick.Controls 2.12 + +Button { + id: button + checkable: true + font.pixelSize: fontSizeExtraSmall + leftPadding: 4 + rightPadding: 4 + topPadding: 12 + bottomPadding: 12 + implicitWidth: 60 + implicitHeight: 90 + + icon.name: "placeholder" + icon.width: 44 + icon.height: 44 + display: Button.TextUnderIcon +} diff --git a/client/qml/GlowingLabel.qml b/client/qml/GlowingLabel.qml new file mode 100644 index 0000000..088e9c1 --- /dev/null +++ b/client/qml/GlowingLabel.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +// This container and the transform on the Label are +// necessary to get precise bounding rect of the text for layouting reasons, +// since some of the labels' font sizes can get quite large. +Item { + id: root + implicitHeight: labelTextMetrics.tightBoundingRect.height + implicitWidth: label.implicitWidth + + property alias text: label.text + property alias font: label.font + property alias horizontalAlignment: label.horizontalAlignment + property alias verticalAlignment: label.verticalAlignment + property bool glowEnabled: true + property color glowColor: colorGlow + property color color: colorBright + + Label { + id: label + anchors.baseline: root.baseline + color: root.color + + layer.enabled: root.glowEnabled + layer.effect: CustomGlow { + color: glowColor + } + + TextMetrics { + id: labelTextMetrics + text: label.text + font: label.font + } + + transform: Translate { + y: -labelTextMetrics.tightBoundingRect.y + } + } +} diff --git a/client/qml/StatsView.qml b/client/qml/StatsView.qml new file mode 100644 index 0000000..7df73dd --- /dev/null +++ b/client/qml/StatsView.qml @@ -0,0 +1,45 @@ +import QtQuick 2.12 +import QtQuick.Layouts 1.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.Imagine 2.12 +import QtQuick.Window 2.0 +import QtCharts 2.15 +import QtQuick.Extras 1.4 as OldExtras +import QtQuick.Controls.Styles 1.4 as Oldstyle +import QtRemoteObjects 5.12 + +Frame { + width: parent.width + Layout.fillWidth: true + Layout.fillHeight: true + ColumnLayout { + width: parent.width + GlowingLabel { + text: remoteModel.name + color: "white" + font.pixelSize: fontSizeMedium + Layout.alignment: Qt.AlignVCenter + Layout.fillWidth: true + + } + Frame { + width: parent.width + Layout.fillWidth: true + Layout.fillHeight: true + + OldExtras.CircularGauge { + style: Oldstyle.CircularGaugeStyle { + needle: Rectangle { + y: outerRadius * 0.15 + implicitWidth: outerRadius * 0.03 + implicitHeight: outerRadius * 0.9 + antialiasing: true + color: Qt.rgba(0.66, 0.3, 0, 1) + } + } + value: remoteModel.temp + anchors.centerIn: parent + } + } + } +} diff --git a/client/qml/automotive.qml b/client/qml/automotive.qml new file mode 100644 index 0000000..bac83c1 --- /dev/null +++ b/client/qml/automotive.qml @@ -0,0 +1,419 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Layouts 1.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.Imagine 2.12 +import QtQuick.Window 2.0 +import QtCharts 2.15 +import QtQuick.Extras 1.4 as OldExtras +import QtQuick.Controls.Styles 1.4 as Oldstyle + +ApplicationWindow { + id: window + width: 1024 + height: 768 + //minimumWidth: 750 + //minimumHeight: 1334 + visible: true + title: "Qt Quick Controls 2 - Imagine Style Example: Automotive" + + readonly property color colorGlow: "#1d6d64" + readonly property color colorWarning: "#d5232f" + readonly property color colorMain: "#6affcd" + readonly property color colorBright: "#ffffff" + readonly property color colorLightGrey: "#888" + readonly property color colorDarkGrey: "#333" + + readonly property int fontSizeExtraSmall: Qt.application.font.pixelSize * 0.8 + readonly property int fontSizeMedium: Qt.application.font.pixelSize * 1.5 + readonly property int fontSizeLarge: Qt.application.font.pixelSize * 2 + readonly property int fontSizeExtraLarge: Qt.application.font.pixelSize * 5 + + Component.onCompleted: { + x = Screen.width / 2 - width / 2 + y = Screen.height / 2 - height / 2 + } + + Shortcut { + sequence: "Ctrl+Q" + onActivated: Qt.quit() + } + Frame { + id: frame + anchors.fill: parent + anchors.margins: 5 + + RowLayout { + id: mainRowLayout + anchors.fill: parent + anchors.margins: 10 + spacing: 36 + + Container { + id: leftTabBar + + currentIndex: 0 + + Layout.fillWidth: false + Layout.fillHeight: true + + ButtonGroup { + buttons: columnLayout.children + } + + contentItem: ColumnLayout { + id: columnLayout + spacing: 3 + + Repeater { + model: leftTabBar.contentModel + } + } + + FeatureButton { + id: navigationFeatureButton + text: qsTr("Status") + icon.name: "statistics" + Layout.fillHeight: true + checked: true + onClicked: { + leftTabBar.currentIndex = 0 + } + } + + FeatureButton { + text: qsTr("Music") + icon.name: "music" + Layout.fillHeight: true + onClicked: { + leftTabBar.currentIndex = 1 + } + } + + FeatureButton { + text: qsTr("Message") + icon.name: "message" + Layout.fillHeight: true + onClicked: { + leftTabBar.currentIndex = 2 + } + } + + FeatureButton { + text: qsTr("Command") + icon.name: "command" + onClicked: { + leftTabBar.currentIndex = 3 + } + } + + FeatureButton { + text: qsTr("Settings") + icon.name: "settings" + onClicked: { + leftTabBar.currentIndex = 4 + } + } + } + + StackLayout { + currentIndex: leftTabBar.currentIndex + Layout.fillWidth: true + Layout.fillHeight: true + + ScrollView { + id: pluginView + spacing: 16 + clip : true + //ScrollBar.vertical.policy: ScrollBar.AlwaysOn + //ScrollBar.horizontal.policy: ScrollBar.AlwaysOn + ColumnLayout { + width: pluginView.width + height: parent.height + StatsView {} + StatsView {} + StatsView {} + StatsView {} + } + } + ColumnLayout { + spacing: 16 + + ButtonGroup { + id: viewButtonGroup + buttons: viewTypeRowLayout.children + } + + RowLayout { + id: viewTypeRowLayout + spacing: 3 + + Layout.bottomMargin: 12 + + Button { + text: qsTr("Compact") + font.pixelSize: fontSizeExtraSmall + checked: true + + Layout.fillWidth: true + } + Button { + text: qsTr("Full") + font.pixelSize: fontSizeExtraSmall + checkable: true + + Layout.fillWidth: true + } + } + + GlowingLabel { + text: qsTr("VOLUME") + color: "white" + font.pixelSize: fontSizeMedium + } + + Dial { + id: volumeDial + from: 0 + value: 42 + to: 100 + stepSize: 1 + + Layout.alignment: Qt.AlignHCenter + Layout.minimumWidth: 64 + Layout.minimumHeight: 64 + Layout.preferredWidth: 128 + Layout.preferredHeight: 128 + Layout.maximumWidth: 128 + Layout.maximumHeight: 128 + Layout.fillHeight: true + + Label { + text: volumeDial.value.toFixed(0) + color: "white" + font.pixelSize: Qt.application.font.pixelSize * 3 + anchors.centerIn: parent + } + } + + ButtonGroup { + id: audioSourceButtonGroup + } + + RowLayout { + Layout.topMargin: 16 + + GlowingLabel { + id: radioOption + text: qsTr("RADIO") + color: "white" + font.pixelSize: fontSizeMedium + horizontalAlignment: Label.AlignLeft + + Layout.fillWidth: true + } + GlowingLabel { + text: qsTr("AUX") + color: colorLightGrey + font.pixelSize: fontSizeMedium * 0.8 + horizontalAlignment: Label.AlignHCenter + glowEnabled: false + + Layout.alignment: Qt.AlignBottom + Layout.fillWidth: true + } + GlowingLabel { + text: qsTr("MP3") + color: colorDarkGrey + font.pixelSize: fontSizeMedium * 0.6 + horizontalAlignment: Label.AlignRight + glowEnabled: false + + Layout.alignment: Qt.AlignBottom + Layout.fillWidth: true + } + } + + Frame { + id: stationFrame + leftPadding: 1 + rightPadding: 1 + topPadding: 1 + bottomPadding: 1 + + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredHeight: 128 + + ListView { + clip: true + anchors.fill: parent + + ScrollIndicator.vertical: ScrollIndicator { + parent: stationFrame + anchors.top: parent.top + anchors.right: parent.right + anchors.rightMargin: 1 + anchors.bottom: parent.bottom + } + + model: ListModel { + ListElement { name: "V-Radio"; frequency: "105.5 MHz" } + ListElement { name: "World News"; frequency: "93.4 MHz" } + ListElement { name: "TekStep FM"; frequency: "95.0 MHz" } + ListElement { name: "Classic Radio"; frequency: "89.9 MHz" } + ListElement { name: "Buena Vista FM"; frequency: "100.8 MHz" } + ListElement { name: "Drive-by Radio"; frequency: "99.1 MHz" } + ListElement { name: "Unknown #1"; frequency: "104.5 MHz" } + ListElement { name: "Unknown #2"; frequency: "91.2 MHz" } + ListElement { name: "Unknown #3"; frequency: "93.8 MHz" } + ListElement { name: "Unknown #4"; frequency: "80.4 MHz" } + ListElement { name: "Unknown #5"; frequency: "101.1 MHz" } + ListElement { name: "Unknown #6"; frequency: "92.2 MHz" } + } + delegate: ItemDelegate { + id: stationDelegate + width: parent.width + height: 22 + text: model.name + font.pixelSize: fontSizeExtraSmall + topPadding: 0 + bottomPadding: 0 + + contentItem: RowLayout { + Label { + text: model.name + font: stationDelegate.font + horizontalAlignment: Text.AlignLeft + Layout.fillWidth: true + } + Label { + text: model.frequency + font: stationDelegate.font + horizontalAlignment: Text.AlignRight + Layout.fillWidth: true + } + } + } + } + } + + Frame { + Layout.fillWidth: true + + RowLayout { + anchors.fill: parent + + Label { + text: qsTr("Sort by") + font.pixelSize: fontSizeExtraSmall + + Layout.alignment: Qt.AlignTop + } + + ColumnLayout { + RadioButton { + text: qsTr("Name") + font.pixelSize: fontSizeExtraSmall + } + RadioButton { + text: qsTr("Frequency") + font.pixelSize: fontSizeExtraSmall + } + RadioButton { + text: qsTr("Favourites") + font.pixelSize: fontSizeExtraSmall + checked: true + } + + } + } + } + } + ColumnLayout { + spacing: 16 + Layout.fillWidth: true + + GlowingLabel { + text: qsTr("Blah") + color: "white" + font.pixelSize: fontSizeMedium + Layout.alignment: Qt.AlignHCenter + + } + } + ColumnLayout { + spacing: 16 + + GlowingLabel { + text: qsTr("Boo") + color: "white" + font.pixelSize: fontSizeMedium + Layout.alignment: Qt.AlignHCenter + } + } + ColumnLayout { + spacing: 16 + + GlowingLabel { + text: qsTr("Bamn") + color: "white" + font.pixelSize: fontSizeMedium + Layout.alignment: Qt.AlignHCenter + + } + } + } + + } + } +} diff --git a/client/qml/basecomponent.qml b/client/qml/basecomponent.qml new file mode 100644 index 0000000..f239ad5 --- /dev/null +++ b/client/qml/basecomponent.qml @@ -0,0 +1,4 @@ +import QtQuick.Controls 2.15 +GroupBox { + title: qsTr("Synchronize") +} \ No newline at end of file diff --git a/client/qml/components/Voltage.qml b/client/qml/components/Voltage.qml new file mode 100644 index 0000000..5003da3 --- /dev/null +++ b/client/qml/components/Voltage.qml @@ -0,0 +1,3 @@ +basecomponent { + +} \ No newline at end of file diff --git a/client/qml/main.qml b/client/qml/main.qml index 0997d81..ee47d70 100644 --- a/client/qml/main.qml +++ b/client/qml/main.qml @@ -1,4 +1,9 @@ +import QtQuick 2.15 import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.15 +import QtQuick.Window 2.0 +import QtCharts 2.15 + ApplicationWindow { visible: true @@ -17,5 +22,15 @@ ApplicationWindow { StackView { anchors.fill: parent + GridLayout { + id: grid + anchors.fill: parent + Text { text: "Three"; font.bold: true; } + Text { text: "words"; color: "red" } + Text { text: "in"; font.underline: true } + Text { text: "a"; font.pixelSize: 20 } + Text { text: "row"; font.strikeout: true } + } + } } \ No newline at end of file diff --git a/client/qml/qml.qrc b/client/qml/qml.qrc new file mode 100644 index 0000000..26e6f90 --- /dev/null +++ b/client/qml/qml.qrc @@ -0,0 +1,9 @@ + + + FeatureButton.qml + GlowingLabel.qml + CustomGlow.qml + automotive.qml + StatsView.qml + + diff --git a/client/qtquickcontrols2.conf b/client/qtquickcontrols2.conf new file mode 100644 index 0000000..c7fc7a6 --- /dev/null +++ b/client/qtquickcontrols2.conf @@ -0,0 +1,10 @@ +[Controls] +Style=Imagine + +[Imagine] +Path=:/imagine-assets + +[Imagine\Palette] +Text=#6affcd +ButtonText=#6affcd +WindowText=#6affcd diff --git a/client/sbcbmc-client.qrc b/client/sbcbmc-client.qrc index 8903331..be446ab 100644 --- a/client/sbcbmc-client.qrc +++ b/client/sbcbmc-client.qrc @@ -1,5 +1,6 @@ qml/main.qml +qtquickcontrols2.conf diff --git a/client/source/client.cpp b/client/source/client.cpp index f5e08e9..57c8941 100644 --- a/client/source/client.cpp +++ b/client/source/client.cpp @@ -1,9 +1,36 @@ +#include +#include #include "client.hpp" + + + SBCBMCClient::SBCBMCClient(QObject *parent) : QObject(parent) { - this->engine = new QQmlApplicationEngine("qrc:///qml/main.qml"); + node = new QRemoteObjectNode(); + node->connectToNode(QUrl("tcp://10.100.200.49:1998")); + + QObject::connect(node, &QRemoteObjectNode::remoteObjectAdded, + [](const QRemoteObjectSourceLocation& info){ + qDebug() << "New source added : " << info; + }); + +// qDebug() << "Waiting for registry "; +// node.waitForRegistry(10000); + + thermal = node->acquire(QStringLiteral("plugins/thermal/thermal_zone1/x86_pkg_temp")); + + qDebug() << "Waiting for Source"; + thermal->waitForSource(10000); + qDebug() << "Starting"; + qDebug() << thermal->state(); + //qmlRegisterType("custom",1,0,"DCDCUSB200_PropertiesReplica"); + qmlRegisterType("custom",1,0,"Thermal_PropertiesReplica"); + + ready(); +// this->engine = new QQmlApplicationEngine("qrc:/qml/automotive.qml"); + } SBCBMCClient::~SBCBMCClient() @@ -11,16 +38,13 @@ SBCBMCClient::~SBCBMCClient() } +void SBCBMCClient::ready() { + this->engine = new QQmlApplicationEngine(); + this->engine->rootContext()->setContextProperty("remoteModel", thermal); + this->engine->load("qrc:/qml/automotive.qml"); +} + #if 0 - QRemoteObjectNode node(QUrl("tcp://127.0.0.1:1999")); - - QObject::connect(&node, &QRemoteObjectNode::remoteObjectAdded, - [](const QRemoteObjectSourceLocation& info){ - qDebug() << "New source added : " << info; - }); - - qDebug() << "Waiting for registry "; - node.waitForRegistry(10000); qDebug() << "Already here sources : " << node.registry()->sourceLocations(); diff --git a/client/source/main.cpp b/client/source/main.cpp index 7ba5a7c..4d558f6 100644 --- a/client/source/main.cpp +++ b/client/source/main.cpp @@ -1,8 +1,9 @@ -#include +#include #include #include #include #include +#include #include "client.hpp" @@ -17,11 +18,18 @@ Q_LOGGING_CATEGORY(sbcclient, "sbcbmc.client"); int main(int argc, char *argv[]) { - QCoreApplication a(argc, argv); QCoreApplication::setApplicationName("sbcbmc-client"); //QCoreApplication::setApplicationVersion(DEF2STR(APP_VERSION)); QCoreApplication::setOrganizationName("DynamX"); QCoreApplication::setOrganizationDomain("dynam.com"); + QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + + QApplication a(argc, argv); + +QLoggingCategory::setFilterRules("qt.remoteobjects.debug=true"); + + QIcon::setThemeName("automotive"); QCommandLineParser parser; parser.setApplicationDescription("SBCBMC Client"); @@ -32,8 +40,5 @@ int main(int argc, char *argv[]) { SBCBMCClient client; - - - a.exec(); } \ No newline at end of file