From 2eda97537b63d68b2e9ba06500e3fb491894d10c Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Sat, 7 Feb 2026 17:29:48 +0100 Subject: feat: camper van energy monitoring widget for Plasma 6 Pure QML KPackage widget with Rust background service for real-time Victron energy system monitoring via MQTT and D-Bus. Co-Authored-By: Claude Opus 4.6 --- package/contents/ui/FullRepresentation.qml | 203 +++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 package/contents/ui/FullRepresentation.qml (limited to 'package/contents/ui/FullRepresentation.qml') diff --git a/package/contents/ui/FullRepresentation.qml b/package/contents/ui/FullRepresentation.qml new file mode 100644 index 0000000..b76da53 --- /dev/null +++ b/package/contents/ui/FullRepresentation.qml @@ -0,0 +1,203 @@ +import QtQuick 6.0 +import QtQuick.Layouts 6.0 +import org.kde.kirigami as Kirigami +import org.kde.plasma.components 3.0 as PlasmaComponents + +ColumnLayout { + IconUtils { id: icons } + FormatUtils { id: fmt } + anchors.fill: parent + spacing: 8 + + // Header + PlasmaComponents.Label { + Layout.alignment: Qt.AlignCenter + text: "Camper Van Energy System" + font.pointSize: 14 + font.bold: true + } + + Kirigami.Separator { + Layout.fillWidth: true + } + + // Status availability indicator + PlasmaComponents.Label { + Layout.alignment: Qt.AlignCenter + text: root.connected ? "Status: Connected" : "Status: Disconnected" + color: root.connected ? "green" : "red" + font.pointSize: 10 + } + + // Battery level + RowLayout { + Layout.fillWidth: true + spacing: 8 + + PlasmaComponents.Label { + text: icons.getBatteryIcon(root.batterySoc) + font.pointSize: 16 + } + + PlasmaComponents.Label { + text: "Battery Level:" + font.pointSize: 11 + } + + PlasmaComponents.Label { + Layout.fillWidth: true + text: fmt.formatSoc(root.batterySoc) + font.pointSize: 11 + font.bold: true + horizontalAlignment: Text.AlignRight + } + } + + // System power + RowLayout { + Layout.fillWidth: true + spacing: 8 + + PlasmaComponents.Label { + text: "\uf0e7" // + font.pointSize: 16 + } + + PlasmaComponents.Label { + text: "System Power:" + font.pointSize: 11 + } + + PlasmaComponents.Label { + Layout.fillWidth: true + text: fmt.formatPower(root.connected, root.batteryPower) + font.pointSize: 11 + font.bold: true + horizontalAlignment: Text.AlignRight + } + } + + // Solar power + RowLayout { + Layout.fillWidth: true + spacing: 8 + + PlasmaComponents.Label { + text: "\uf185" // + font.pointSize: 16 + } + + PlasmaComponents.Label { + text: "Solar Power:" + font.pointSize: 11 + } + + PlasmaComponents.Label { + Layout.fillWidth: true + text: fmt.formatSolar(root.solarPower) + font.pointSize: 11 + font.bold: true + horizontalAlignment: Text.AlignRight + } + } + + // AC input + RowLayout { + Layout.fillWidth: true + spacing: 8 + + PlasmaComponents.Label { + text: "\uf1e6" // + font.pointSize: 16 + } + + PlasmaComponents.Label { + text: "AC Input:" + font.pointSize: 11 + } + + PlasmaComponents.Label { + Layout.fillWidth: true + text: fmt.formatAcPower(root.acInputPower) + font.pointSize: 11 + font.bold: true + horizontalAlignment: Text.AlignRight + } + } + + // AC load + RowLayout { + Layout.fillWidth: true + spacing: 8 + + PlasmaComponents.Label { + text: "\uf2db" // + font.pointSize: 16 + } + + PlasmaComponents.Label { + text: "AC Load:" + font.pointSize: 11 + } + + PlasmaComponents.Label { + Layout.fillWidth: true + text: fmt.formatAcPower(root.acLoadPower) + font.pointSize: 11 + font.bold: true + horizontalAlignment: Text.AlignRight + } + } + + // Status direction + RowLayout { + Layout.fillWidth: true + spacing: 8 + + PlasmaComponents.Label { + text: "\uf1fe" // + font.pointSize: 16 + } + + PlasmaComponents.Label { + text: "Status:" + font.pointSize: 11 + } + + PlasmaComponents.Label { + Layout.fillWidth: true + text: root.direction + font.pointSize: 11 + font.bold: true + horizontalAlignment: Text.AlignRight + } + } + + // Last updated + RowLayout { + Layout.fillWidth: true + spacing: 8 + + PlasmaComponents.Label { + text: "\uf017" // + font.pointSize: 16 + } + + PlasmaComponents.Label { + text: "Last Updated:" + font.pointSize: 11 + } + + PlasmaComponents.Label { + Layout.fillWidth: true + text: root.lastUpdated + font.pointSize: 11 + font.bold: true + horizontalAlignment: Text.AlignRight + } + } + + Kirigami.Separator { + Layout.fillWidth: true + } +} -- cgit v1.2.3