annotate OverviewJD.qml @ 0:57ffb39f29d4

First commit of new carousel page to allow battery charging current to be adjusted.
author Daniel O'Connor <darius@dons.net.au>
date Mon, 13 Dec 2021 23:05:38 +1030
parents
children 594ba407689b
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 {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
204 text: sys.battery.power.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
205 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
206 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
207 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
208 }
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 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
213 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
214
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
215 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
216 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
217 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
218
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
219 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
220 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
221 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
222 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
223 }
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 Timer {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
226 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
227
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
228 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
229 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
230 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
231 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
232 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
233
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
234 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
235 }
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 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
238 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
239 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
240 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
241 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
242 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
243 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
244 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
245 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
246 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
247
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
248 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
249 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
250
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
251 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
252 {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
253 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
254 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
255 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
256 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
257 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
258 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
259 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
260 }
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 Marquee {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
263 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
264 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
265 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
266 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
267 }
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 ListView {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
272 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
273
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
274 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
275 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
276 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
277 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
278 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
279 // 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
280 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
281 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
282 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
283 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
284 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
285 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
286 Connections {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
287 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
288 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
289 }
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 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
293 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
294 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
295 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
296 }
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 // 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
299 Timer {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
300 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
301 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
302 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
303 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
304 }
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 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
307 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
308 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
309 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
310 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
311 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
312 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
313 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
314 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
315 }
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 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
319
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
320 Item {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
321 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
322 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
323 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
324 buttonIndex--
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
325
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
326 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
327 }
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 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
330 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
331 buttonIndex++
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
332
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
333 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
334 }
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 MouseArea {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
338 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
339 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
340 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
341 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
342 }
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 TileSpinBox {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
345 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
346
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
347 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
348 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
349 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
350 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
351
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
352 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
353 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
354 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
355 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
356 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
357 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
358 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
359 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
360
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
361 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
362
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
363 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
364
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
365 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
366 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
367 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
368 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
369 }
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 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
372 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
373 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
374 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
375 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
376 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
377 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
378 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
379 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
380 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
381 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
382 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
383 }
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 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
387 }
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 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
390 editIsAllowed()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
391 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
392 }
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 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
396 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
397 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
398 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
399 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
400 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
401 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
402
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
403 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
404 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
405
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
406 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
407 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
408 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
409 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
410 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
411 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
412
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
413 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
414 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
415 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
416 }
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 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
420 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
421
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
422 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
423
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
424 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
425 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
426 return
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
427
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
428 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
429 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
430 return
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
431 }
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 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
434 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
435 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
436 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
437 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
438 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
439 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
440 return
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
441 }
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 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
444 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
445 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
446 break;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
447 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
448 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
449 break;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
450 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
451 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
452 break;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
453 }
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 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
456 }
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 MouseArea {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
459 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
460 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
461 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
462 onClicked: {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
463 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
464 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
465 }
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 Rectangle {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
469 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
470 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
471 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
472 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
473 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
474 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
475 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
476 }
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 SequentialAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
480 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
481
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
482 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
483
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
484 NumberAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
485 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
486 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
487 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
488 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
489 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
490 }
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 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
493 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
494 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
495 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
496 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
497 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
498 }
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 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
501 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
502 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
503 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
504 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
505 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
506 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
507 PropertyAction {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
508 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
509 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
510 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
511 }
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 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
514
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
515 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
516 }
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 TileSpinBox {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
520 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
521
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
522 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
523 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
524 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
525 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
526
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
527 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
528 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
529 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
530 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
531 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
532 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
533 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
534 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
535 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
536
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
537 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
538
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
539 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
540 editIsAllowed()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
541 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
542 }
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 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
546 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
547
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
548 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
549 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
550
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
551 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
552 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
553 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
554 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
555
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
556 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
557 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
558 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
559
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
560 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
561 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
562 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
563 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
564 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
565 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
566
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
567 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
568 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
569
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
570 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
571 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
572 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
573 }
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 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
577
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
578 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
579 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
580 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
581 return
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
582 }
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 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
585 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
586 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
587
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
588 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
589 value++
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
590 else
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
591 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
592 }
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 MouseArea {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
595 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
596 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
597 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
598 onClicked: {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
599 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
600 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
601 }
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 Rectangle {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
605 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
606 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
607 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
608 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
609 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
610 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
611 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
612 }
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 SequentialAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
616 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
617 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
618 NumberAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
619 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
620 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
621 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
622 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
623 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
624 }
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 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
627 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
628 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
629 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
630 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
631 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
632 }
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 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
635 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
636 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
637 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
638 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
639 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
640 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
641 PropertyAction {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
642 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
643 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
644 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
645 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
646 // 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
647 // 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
648 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
649 }
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 // 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
653 Connections {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
654 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
655 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
656 }
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 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
659 {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
660 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
661 numberOfMultis++
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
662 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
663 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
664 }
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 // 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
668 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
669 {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
670 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
671 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
672 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
673 }
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 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
678 {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
679 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
680 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
681
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
682 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
683 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
684 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
685
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
686 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
687 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
688 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
689
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
690 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
691 }
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 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
694 }
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 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
697 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
698 }