view OverviewMobile-to-JD.diff @ 1:594ba407689b default tip

Show temperature instead of power now the sensor is fitted.
author Daniel O'Connor <darius@dons.net.au>
date Tue, 21 Dec 2021 15:24:31 +1030
parents 57ffb39f29d4
children
line wrap: on
line source

--- OverviewMobile.qml	2021-12-13 22:43:39.000000000 +1030
+++ OverviewJD.qml	2021-12-13 22:43:19.000000000 +1030
@@ -1,3 +1,4 @@
+// Modified version of OverviewMobile.qml
 import QtQuick 1.1
 import com.victron.velib 1.0
 import "utils.js" as Utils
@@ -26,7 +27,7 @@
 	// Keeps track of which button on the bottom row is active
 	property int buttonIndex: 0
 
-	title: qsTr("Mobile")
+	title: qsTr("Java Drive")
 
 	Component.onCompleted: discoverMulti()
 
@@ -54,9 +55,23 @@
 				values: [
 					TileText {
 						text: sys.acInput.power.uiText
-						font.pixelSize: 30
+						font.pixelSize: 25
+					},
+					TileText {
+						property VBusItem inV1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/ActiveIn/L1/V"); unit: "V" }
+						text: inV1.format(1)
+						font.pixelSize: 15
+					},
+					TileText {
+						property VBusItem inI1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/ActiveIn/L1/I"); unit: "A" }
+						text: inI1.format(1)
+						font.pixelSize: 15
+					},
+					TileText {
+						property VBusItem inF1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/ActiveIn/L1/F"); unit: "Hz" }
+						text: inF1.format(0)
+						font.pixelSize: 15
 					}
-
 				]
 			}
 
@@ -68,7 +83,22 @@
 				values: [
 					TileText {
 						text: sys.acLoad.power.uiText
-						font.pixelSize: 30
+						font.pixelSize: 25
+					},
+					TileText {
+						property VBusItem outV1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/Out/L1/V"); unit: "V" }
+						text: outV1.format(1)
+						font.pixelSize: 15
+					},
+					TileText {
+						property VBusItem outI1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/Out/L1/I"); unit: "A" }
+						text: outI1.format(1)
+						font.pixelSize: 15
+					},
+					TileText {
+						property VBusItem outF1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/Out/L1/F"); unit: "Hz" }
+						text: outF1.format(0)
+						font.pixelSize: 15
 					}
 				]
 			}
@@ -297,7 +327,7 @@
 		}
 
 		Keys.onRightPressed: {
-			if (buttonIndex < (pumpButton.pumpEnabled ? 2 : 1))
+			if (buttonIndex < (pumpButton.pumpEnabled ? 3 : 2))
 				buttonIndex++
 
 			event.accepted = true
@@ -486,10 +516,36 @@
 		}
 	}
 
+	TileSpinBox {
+		id: battCurrentButton
+
+		anchors.bottom: parent.bottom
+		anchors.left: acModeButton.right
+		isCurrentItem: (buttonIndex == 2)
+		focus: root.active && isCurrentItem
+
+		bind: Utils.path(vebusPrefix, "/Dc/0/MaxChargeCurrent")
+		title: qsTr("BAT CURR LIMIT")
+		color: containsMouse && !editMode ? "#d3d3d3" : "#A8A8A8"
+		width: 134
+		fontPixelSize: 14
+		unit: "A"
+		readOnly: false
+		editable: true
+		buttonColor: "#979797"
+
+		Keys.onSpacePressed: showErrorToast(event)
+
+		function showErrorToast(event) {
+			editIsAllowed()
+			event.accepted = true
+		}
+	}
+
 	Tile {
 		id: pumpButton
 
-		anchors.left: acModeButton.right
+		anchors.left: battCurrentButton.right
 		anchors.bottom: parent.bottom
 
 		property variant texts: [ qsTr("AUTO"), qsTr("ON"), qsTr("OFF")]
@@ -498,7 +554,7 @@
 		property bool pumpEnabled: pumpRelay.value === 3
 
 		show: pumpEnabled
-		isCurrentItem: (buttonIndex == 2)
+		isCurrentItem: (buttonIndex == 3)
 		focus: root.active && isCurrentItem
 
 		title: qsTr("PUMP")