diff options
| author | Dawid Rycerz <dawid@rycerz.xyz> | 2026-02-07 17:29:48 +0100 |
|---|---|---|
| committer | Dawid Rycerz <dawid@rycerz.xyz> | 2026-02-07 17:29:48 +0100 |
| commit | 2eda97537b63d68b2e9ba06500e3fb491894d10c (patch) | |
| tree | 52873ad380cd97f4327765aac24659a2b00079b1 /package/contents/ui/FullRepresentation.qml | |
feat: camper van energy monitoring widget for Plasma 6main
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 <noreply@anthropic.com>
Diffstat (limited to 'package/contents/ui/FullRepresentation.qml')
| -rw-r--r-- | package/contents/ui/FullRepresentation.qml | 203 |
1 files changed, 203 insertions, 0 deletions
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 + } +} |
