annotate OverviewJD.qml @ 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
1 // Modified version of OverviewMobile.qml
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
2 import QtQuick 1.1
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
3 import com.victron.velib 1.0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
4 import "utils.js" as Utils
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
5
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
6 OverviewPage {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
7 id: root
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
8
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
9 property variant sys: theSystem
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
10 property string settingsBindPreffix: "com.victronenergy.settings"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
11 property string pumpBindPreffix: "com.victronenergy.pump.startstop0"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
12 property variant activeNotifications: NotificationCenter.notifications.filter(
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
13 function isActive(obj) { return obj.active} )
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
14 property string noAdjustableByDmc: qsTr("This setting is disabled when a Digital Multi Control " +
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
15 "is connected. If it was recently disconnected execute " +
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
16 "\"Redetect system\" that is avalible on the inverter menu page.")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
17 property string noAdjustableByBms: qsTr("This setting is disabled when a VE.Bus BMS " +
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
18 "is connected. If it was recently disconnected execute " +
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
19 "\"Redetect system\" that is avalible on the inverter menu page.")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
20 property string noAdjustableTextByConfig: qsTr("This setting is disabled. " +
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
21 "Possible reasons are \"Overruled by remote\" is not enabled or " +
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
22 "an assistant is preventing the adjustment. Please, check " +
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
23 "the inverter configuration with VEConfigure.")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
24 property int numberOfMultis: 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
25 property string vebusPrefix: ""
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
26
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
27 // Keeps track of which button on the bottom row is active
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
28 property int buttonIndex: 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
29
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
30 title: qsTr("Java Drive")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
31
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
32 Component.onCompleted: discoverMulti()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
33
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
34 ListView {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
35 id: pwColumn
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
36
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
37 property int tilesCount: solarTile.visible || dcSystem.visible ? 3 : 2
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
38 property int tileHeight: Math.ceil(height / tilesCount)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
39 interactive: false // static tiles
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
40
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
41 width: 136
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
42 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
43 left: parent.left
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
44 top: parent.top;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
45 bottom: acModeButton.top;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
46 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
47
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
48 model: VisualItemModel {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
49 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
50 width: pwColumn.width
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
51 height: visible ? pwColumn.tileHeight : 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
52 title: qsTr("AC INPUT")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
53 color: "#82acde"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
54 visible: !dcSystem.visible || !solarTile.visible
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
55 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
56 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
57 text: sys.acInput.power.uiText
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
58 font.pixelSize: 25
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
59 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
60 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
61 property VBusItem inV1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/ActiveIn/L1/V"); unit: "V" }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
62 text: inV1.format(1)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
63 font.pixelSize: 15
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
64 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
65 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
66 property VBusItem inI1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/ActiveIn/L1/I"); unit: "A" }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
67 text: inI1.format(1)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
68 font.pixelSize: 15
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
69 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
70 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
71 property VBusItem inF1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/ActiveIn/L1/F"); unit: "Hz" }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
72 text: inF1.format(0)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
73 font.pixelSize: 15
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
74 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
75 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
76 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
77
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
78 TileAcPower {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
79 width: pwColumn.width
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
80 height: visible ? pwColumn.tileHeight : 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
81 title: qsTr("AC LOADS")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
82 color: "#e68e8a"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
83 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
84 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
85 text: sys.acLoad.power.uiText
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
86 font.pixelSize: 25
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
87 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
88 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
89 property VBusItem outV1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/Out/L1/V"); unit: "V" }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
90 text: outV1.format(1)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
91 font.pixelSize: 15
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
92 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
93 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
94 property VBusItem outI1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/Out/L1/I"); unit: "A" }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
95 text: outI1.format(1)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
96 font.pixelSize: 15
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
97 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
98 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
99 property VBusItem outF1: VBusItem { bind: Utils.path(sys.vebusPrefix, "/Ac/Out/L1/F"); unit: "Hz" }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
100 text: outF1.format(0)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
101 font.pixelSize: 15
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
102 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
103 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
104 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
105
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
106 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
107 id: solarTile
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
108 width: pwColumn.width
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
109 height: visible ? pwColumn.tileHeight : 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
110 title: qsTr("PV CHARGER")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
111 color: "#2cc36b"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
112 visible : sys.pvCharger.power.valid
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
113
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
114 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
115 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
116 font.pixelSize: 30
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
117 text: sys.pvCharger.power.uiText
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
118 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
119 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
120 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
121 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
122 id: dcSystem
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
123 width: pwColumn.width
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
124 height: visible ? pwColumn.tileHeight : 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
125 title: qsTr("DC SYSTEM")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
126 color: "#16a085"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
127 visible : hasDcSys.value === 1
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
128
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
129 VBusItem {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
130 id: hasDcSys
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
131 bind: Utils.path(settingsBindPreffix, "/Settings/SystemSetup/HasDcSystem")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
132 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
133
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
134 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
135 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
136 font.pixelSize: 30
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
137 text: sys.dcSystem.power.format(0)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
138 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
139 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
140 text: !sys.dcSystem.power.valid ? "---" :
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
141 sys.dcSystem.power.value < 0 ? qsTr("to battery") : qsTr("from battery")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
142 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
143 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
144 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
145 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
146 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
147
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
148 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
149 id: logoTile
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
150
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
151 color: "#575748"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
152 height: 120
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
153 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
154 left: pwColumn.right
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
155 right: tanksColum.left
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
156 top: parent.top
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
157 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
158
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
159 MbIcon {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
160 x: 1
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
161 y: 1
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
162 // see below, so the svg instead of a png if there is a 1x1 image
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
163 visible: customImage.sourceSize.width === 1 && customImage.sourceSize.height === 1
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
164 iconId: "mobile-builder-logo-svg"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
165 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
166
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
167 // The uploaded png, the default is a 1x1 transparent pixel now.
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
168 Image {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
169 id: customImage
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
170 source: "image://theme/mobile-builder-logo"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
171 anchors.centerIn: parent
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
172 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
173 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
174
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
175 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
176 id: batteryTile
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
177 height: 112
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
178 title: qsTr("BATTERY")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
179 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
180 left: pwColumn.right
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
181 right: stateTile.left
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
182 top: logoTile.bottom
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
183 bottom: acModeButton.top
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
184 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
185
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
186 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
187 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
188 text: sys.battery.soc.absFormat(0)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
189 font.pixelSize: 30
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
190 height: 32
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
191 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
192 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
193 text: {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
194 if (!sys.battery.state.valid)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
195 return "---"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
196 switch(sys.battery.state.value) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
197 case sys.batteryStateIdle: return qsTr("idle")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
198 case sys.batteryStateCharging : return qsTr("charging")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
199 case sys.batteryStateDischarging : return qsTr("discharging")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
200 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
201 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
202 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
203 TileText {
1
594ba407689b Show temperature instead of power now the sensor is fitted.
Daniel O'Connor <darius@dons.net.au>
parents: 0
diff changeset
204 property VBusItem battTemp: VBusItem { bind: Utils.path("com.victronenergy.system", "/Dc/Battery/Temperature"); unit: "C" }
594ba407689b Show temperature instead of power now the sensor is fitted.
Daniel O'Connor <darius@dons.net.au>
parents: 0
diff changeset
205 text: battTemp.format(1)
0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
206 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
207 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
208 text: sys.battery.voltage.format(1) + " " + sys.battery.current.format(1)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
209 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
210 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
211 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
212
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
213 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
214 id: stateTile
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
215
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
216 width: 104
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
217 title: qsTr("STATUS")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
218 color: "#4789d0"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
219
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
220 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
221 right: tanksColum.left
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
222 top: logoTile.bottom
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
223 bottom: acModeButton.top
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
224 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
225
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
226 Timer {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
227 id: wallClock
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
228
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
229 running: true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
230 repeat: true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
231 interval: 1000
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
232 triggeredOnStart: true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
233 onTriggered: time = Qt.formatDateTime(new Date(), "hh:mm")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
234
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
235 property string time
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
236 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
237
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
238 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
239 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
240 id: systemTile
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
241 text: wallClock.time
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
242 font.pixelSize: 30
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
243 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
244 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
245 property VeQuickItem gpsService: VeQuickItem { uid: "dbus/com.victronenergy.system/GpsService" }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
246 property VeQuickItem speed: VeQuickItem { uid: Utils.path("dbus/", gpsService.value, "/Speed") }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
247 property VeQuickItem speedUnit: VeQuickItem { uid: "dbus/com.victronenergy.settings/Settings/Gps/SpeedUnit" }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
248
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
249 text: speed.value === undefined ? "" : getValue()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
250 visible: speed.value !== undefined && speedUnit.value !== undefined
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
251
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
252 function getValue()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
253 {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
254 if (speedUnit.value === "km/h")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
255 return (speed.value * 3.6).toFixed(1) + speedUnit.value
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
256 if (speedUnit.value === "mph")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
257 return (speed.value * 2.236936).toFixed(1) + speedUnit.value
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
258 if (speedUnit.value === "kt")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
259 return (speed.value * (3600/1852)).toFixed(1) + speedUnit.value
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
260 return speed.value.toFixed(2) + "m/s"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
261 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
262 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
263 Marquee {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
264 text: notificationText()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
265 width: stateTile.width
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
266 interval: 100
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
267 fontSize: 13
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
268 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
269 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
270 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
271
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
272 ListView {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
273 id: tanksColum
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
274
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
275 property int tileHeight: Math.ceil(height / Math.max(count, 2))
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
276 width: 134
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
277 interactive: false // static tiles
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
278 model: TankModel { id: tankModel }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
279 delegate: TileTank {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
280 // Without an intermediate assignment this will trigger a binding loop warning.
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
281 property variant theService: DBusServices.get(buddy.id)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
282 service: theService
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
283 width: tanksColum.width
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
284 height: tanksColum.tileHeight
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
285 pumpBindPrefix: root.pumpBindPreffix
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
286 compact: tankModel.rowCount > (pumpButton.pumpEnabled ? 4 : 5)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
287 Connections {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
288 target: scrollTimer
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
289 onTriggered: doScroll()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
290 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
291 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
292
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
293 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
294 top: root.top
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
295 bottom: pumpButton.pumpEnabled ? acModeButton.top : acModeButton.bottom
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
296 right: root.right
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
297 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
298
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
299 // Synchronise tank name text scroll start
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
300 Timer {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
301 id: scrollTimer
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
302 interval: 15000
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
303 repeat: true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
304 running: root.active && tankModel.rowCount > 4
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
305 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
306
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
307 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
308 title: qsTr("TANKS")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
309 anchors.fill: parent
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
310 values: TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
311 text: qsTr("No tanks found")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
312 width: parent.width
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
313 wrapMode: Text.WordWrap
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
314 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
315 z: -1
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
316 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
317 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
318
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
319 Keys.forwardTo: [keyHandler]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
320
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
321 Item {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
322 id: keyHandler
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
323 Keys.onLeftPressed: {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
324 if (buttonIndex > 0)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
325 buttonIndex--
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
326
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
327 event.accepted = true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
328 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
329
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
330 Keys.onRightPressed: {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
331 if (buttonIndex < (pumpButton.pumpEnabled ? 3 : 2))
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
332 buttonIndex++
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
333
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
334 event.accepted = true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
335 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
336 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
337
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
338 MouseArea {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
339 anchors.fill: parent
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
340 enabled: parent.active
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
341 onPressed: mouse.accepted = acCurrentButton.expanded
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
342 onClicked: acCurrentButton.cancel()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
343 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
344
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
345 TileSpinBox {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
346 id: acCurrentButton
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
347
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
348 anchors.bottom: parent.bottom
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
349 anchors.left: parent.left
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
350 isCurrentItem: (buttonIndex == 0)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
351 focus: root.active && isCurrentItem
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
352
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
353 bind: Utils.path(vebusPrefix, "/Ac/ActiveIn/CurrentLimit")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
354 title: qsTr("AC CURRENT LIMIT")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
355 color: containsMouse && !editMode ? "#d3d3d3" : "#A8A8A8"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
356 width: pumpButton.pumpEnabled ? 160 : 173
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
357 fontPixelSize: 14
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
358 unit: "A"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
359 readOnly: currentLimitIsAdjustable.value !== 1 || numberOfMultis > 1
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
360 buttonColor: "#979797"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
361
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
362 VBusItem { id: currentLimitIsAdjustable; bind: Utils.path(vebusPrefix, "/Ac/ActiveIn/CurrentLimitIsAdjustable") }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
363
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
364 Keys.onSpacePressed: showErrorToast(event)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
365
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
366 function editIsAllowed() {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
367 if (numberOfMultis > 1) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
368 toast.createToast(qsTr("It is not possible to change this setting when there are more than one inverter connected."), 5000)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
369 return false
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
370 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
371
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
372 if (currentLimitIsAdjustable.value === 0) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
373 if (dmc.valid) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
374 toast.createToast(noAdjustableByDmc, 5000)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
375 return false
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
376 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
377 if (bms.valid) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
378 toast.createToast(noAdjustableByBms, 5000)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
379 return false
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
380 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
381 if (!dmc.valid && !bms.valid) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
382 toast.createToast(noAdjustableTextByConfig, 5000)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
383 return false
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
384 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
385 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
386
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
387 return true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
388 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
389
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
390 function showErrorToast(event) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
391 editIsAllowed()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
392 event.accepted = true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
393 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
394 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
395
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
396 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
397 id: acModeButton
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
398 anchors.left: acCurrentButton.right
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
399 anchors.bottom: parent.bottom
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
400 property variant texts: { 4: qsTr("OFF"), 3: qsTr("ON"), 1: qsTr("CHARGER ONLY") }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
401 property int value: mode.valid ? mode.value : 3
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
402 property int shownValue: applyAnimation2.running ? applyAnimation2.pendingValue : value
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
403
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
404 isCurrentItem: (buttonIndex == 1)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
405 focus: root.active && isCurrentItem
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
406
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
407 editable: true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
408 readOnly: !modeIsAdjustable.valid || modeIsAdjustable.value !== 1 || numberOfMultis > 1
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
409 width: pumpButton.pumpEnabled ? 160 : 173
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
410 height: 45
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
411 color: acModeButtonMouseArea.containsPressed ? "#d3d3d3" : "#A8A8A8"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
412 title: qsTr("AC MODE")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
413
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
414 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
415 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
416 text: modeIsAdjustable.valid && numberOfMultis === 1 ? qsTr("%1").arg(acModeButton.texts[acModeButton.shownValue]) : qsTr("NOT AVAILABLE")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
417 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
418 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
419
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
420 VBusItem { id: mode; bind: Utils.path(vebusPrefix, "/Mode") }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
421 VBusItem { id: modeIsAdjustable; bind: Utils.path(vebusPrefix,"/ModeIsAdjustable") }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
422
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
423 Keys.onSpacePressed: edit()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
424
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
425 function edit() {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
426 if (!mode.valid)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
427 return
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
428
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
429 if (numberOfMultis > 1) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
430 toast.createToast(qsTr("It is not possible to change this setting when there are more than one inverter connected."), 5000)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
431 return
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
432 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
433
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
434 if (modeIsAdjustable.value === 0) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
435 if (dmc.valid)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
436 toast.createToast(noAdjustableByDmc, 5000)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
437 if (bms.valid)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
438 toast.createToast(noAdjustableByBms, 5000)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
439 if (!dmc.valid && !bms.valid)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
440 toast.createToast(noAdjustableTextByConfig, 5000)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
441 return
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
442 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
443
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
444 switch (shownValue) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
445 case 4:
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
446 applyAnimation2.pendingValue = 3
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
447 break;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
448 case 3:
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
449 applyAnimation2.pendingValue = 1
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
450 break;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
451 case 1:
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
452 applyAnimation2.pendingValue = 4
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
453 break;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
454 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
455
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
456 applyAnimation2.restart()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
457 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
458
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
459 MouseArea {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
460 id: acModeButtonMouseArea
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
461 anchors.fill: parent
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
462 property bool containsPressed: containsMouse && pressed
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
463 onClicked: {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
464 buttonIndex = 1
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
465 parent.edit()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
466 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
467 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
468
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
469 Rectangle {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
470 id: timerRect2
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
471 height: 2
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
472 width: acModeButton.width * 0.8
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
473 visible: applyAnimation2.running
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
474 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
475 bottom: parent.bottom; bottomMargin: 5
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
476 horizontalCenter: parent.horizontalCenter
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
477 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
478 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
479
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
480 SequentialAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
481 id: applyAnimation2
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
482
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
483 property int pendingValue
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
484
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
485 NumberAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
486 target: timerRect2
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
487 property: "width"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
488 from: 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
489 to: acModeButton.width * 0.8
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
490 duration: 3000
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
491 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
492
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
493 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
494 target: acModeButton
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
495 property: "color"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
496 from: "#A8A8A8"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
497 to: "#4789d0"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
498 duration: 200
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
499 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
500
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
501 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
502 target: acModeButton
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
503 property: "color"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
504 from: "#4789d0"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
505 to: "#A8A8A8"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
506 duration: 200
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
507 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
508 PropertyAction {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
509 target: timerRect2
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
510 property: "width"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
511 value: 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
512 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
513
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
514 ScriptAction { script: mode.setValue(applyAnimation2.pendingValue) }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
515
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
516 PauseAnimation { duration: 1000 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
517 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
518 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
519
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
520 TileSpinBox {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
521 id: battCurrentButton
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
522
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
523 anchors.bottom: parent.bottom
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
524 anchors.left: acModeButton.right
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
525 isCurrentItem: (buttonIndex == 2)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
526 focus: root.active && isCurrentItem
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
527
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
528 bind: Utils.path(vebusPrefix, "/Dc/0/MaxChargeCurrent")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
529 title: qsTr("BAT CURR LIMIT")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
530 color: containsMouse && !editMode ? "#d3d3d3" : "#A8A8A8"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
531 width: 134
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
532 fontPixelSize: 14
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
533 unit: "A"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
534 readOnly: false
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
535 editable: true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
536 buttonColor: "#979797"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
537
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
538 Keys.onSpacePressed: showErrorToast(event)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
539
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
540 function showErrorToast(event) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
541 editIsAllowed()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
542 event.accepted = true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
543 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
544 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
545
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
546 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
547 id: pumpButton
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
548
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
549 anchors.left: battCurrentButton.right
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
550 anchors.bottom: parent.bottom
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
551
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
552 property variant texts: [ qsTr("AUTO"), qsTr("ON"), qsTr("OFF")]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
553 property int value: 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
554 property bool reset: false
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
555 property bool pumpEnabled: pumpRelay.value === 3
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
556
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
557 show: pumpEnabled
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
558 isCurrentItem: (buttonIndex == 3)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
559 focus: root.active && isCurrentItem
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
560
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
561 title: qsTr("PUMP")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
562 width: show ? 160 : 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
563 height: 45
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
564 editable: true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
565 readOnly: false
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
566 color: pumpButtonMouseArea.containsPressed ? "#d3d3d3" : "#A8A8A8"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
567
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
568 VBusItem { id: pump; bind: Utils.path(settingsBindPreffix, "/Settings/Pump0/Mode") }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
569 VBusItem { id: pumpRelay; bind: Utils.path(settingsBindPreffix, "/Settings/Relay/Function") }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
570
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
571 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
572 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
573 text: pumpButton.pumpEnabled ? qsTr("%1").arg(pumpButton.texts[pumpButton.value]) : qsTr("DISABLED")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
574 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
575 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
576
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
577 Keys.onSpacePressed: edit()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
578
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
579 function edit() {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
580 if (!pumpEnabled) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
581 toast.createToast(qsTr("Pump functionality is not enabled. To enable it go to the relay settings page and set function to \"Tank pump\""), 5000)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
582 return
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
583 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
584
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
585 reset = true
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
586 applyAnimation.restart()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
587 reset = false
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
588
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
589 if (value < 2)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
590 value++
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
591 else
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
592 value = 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
593 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
594
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
595 MouseArea {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
596 id: pumpButtonMouseArea
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
597 property bool containsPressed: containsMouse && pressed
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
598 anchors.fill: parent
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
599 onClicked: {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
600 buttonIndex = 2
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
601 parent.edit()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
602 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
603 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
604
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
605 Rectangle {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
606 id: timerRect
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
607 height: 2
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
608 width: pumpButton.width * 0.8
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
609 visible: applyAnimation.running
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
610 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
611 bottom: parent.bottom; bottomMargin: 5
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
612 horizontalCenter: parent.horizontalCenter
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
613 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
614 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
615
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
616 SequentialAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
617 id: applyAnimation
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
618 alwaysRunToEnd: false
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
619 NumberAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
620 target: timerRect
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
621 property: "width"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
622 from: 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
623 to: pumpButton.width * 0.8
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
624 duration: 3000
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
625 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
626
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
627 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
628 target: pumpButton
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
629 property: "color"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
630 from: "#A8A8A8"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
631 to: "#4789d0"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
632 duration: 200
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
633 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
634
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
635 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
636 target: pumpButton
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
637 property: "color"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
638 from: "#4789d0"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
639 to: "#A8A8A8"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
640 duration: 200
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
641 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
642 PropertyAction {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
643 target: timerRect
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
644 property: "width"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
645 value: 0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
646 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
647 // Do not set value if the animation is restarted by user pressing the button
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
648 // to move between options
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
649 onCompleted: if (!pumpButton.reset) pump.setValue(pumpButton.value)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
650 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
651 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
652
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
653 // When new service is found check if is a tank sensor
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
654 Connections {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
655 target: DBusServices
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
656 onDbusServiceFound: addService(service)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
657 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
658
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
659 function addService(service)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
660 {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
661 if (service.type === DBusService.DBUS_SERVICE_MULTI) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
662 numberOfMultis++
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
663 if (vebusPrefix === "")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
664 vebusPrefix = service.name;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
665 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
666 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
667
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
668 // Check available services to find tank sesnsors
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
669 function discoverMulti()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
670 {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
671 for (var i = 0; i < DBusServices.count; i++) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
672 if (DBusServices.at(i).type === DBusService.DBUS_SERVICE_MULTI) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
673 addService(DBusServices.at(i))
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
674 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
675 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
676 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
677
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
678 function notificationText()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
679 {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
680 if (activeNotifications.length === 0)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
681 return qsTr("no alarms")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
682
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
683 var descr = []
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
684 for (var n = 0; n < activeNotifications.length; n++) {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
685 var notification = activeNotifications[n];
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
686
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
687 var text = notification.serviceName + " - " + notification.description;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
688 if (notification.value !== "" )
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
689 text += ": " + notification.value
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
690
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
691 descr.push(text)
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
692 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
693
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
694 return descr.join(" | ")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
695 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
696
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
697 VBusItem { id: dmc; bind: Utils.path(vebusPrefix, "/Devices/Dmc/Version") }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
698 VBusItem { id: bms; bind: Utils.path(vebusPrefix, "/Devices/Bms/Version") }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
699 }