annotate OverviewMobile.qml @ 1:594ba407689b default tip

Show temperature instead of power now the sensor is fitted.
author Daniel O'Connor <darius@dons.net.au>
date Tue, 21 Dec 2021 15:24:31 +1030
parents 57ffb39f29d4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
1 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
2 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
3 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
4
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
5 OverviewPage {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
6 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
7
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
8 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
9 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
10 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
11 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
12 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
13 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
14 "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
15 "\"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
16 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
17 "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
18 "\"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
19 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
20 "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
21 "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
22 "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
23 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
24 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
25
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
26 // 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
27 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
28
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
29 title: qsTr("Mobile")
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
30
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
31 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
32
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
33 ListView {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
34 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
35
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
36 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
37 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
38 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
39
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
40 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
41 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
42 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
43 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
44 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
45 }
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 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
48 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
49 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
50 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
51 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
52 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
53 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
54 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
55 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
56 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
57 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
58 }
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 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
61 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
62
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
63 TileAcPower {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
64 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
65 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
66 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
67 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
68 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
69 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
70 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
71 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
72 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
73 ]
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 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
77 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
78 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
79 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
80 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
81 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
82 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
83
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
84 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
85 TileText {
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: 30
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
87 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
88 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
89 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
90 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
91 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
92 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
93 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
94 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
95 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
96 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
97 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
98
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
99 VBusItem {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
100 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
101 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
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 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
105 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
106 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
107 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
108 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
109 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
110 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
111 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
112 }
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 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
115 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
116 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
117
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
118 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
119 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
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 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
122 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
123 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
124 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
125 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
126 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
127 }
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 MbIcon {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
130 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
131 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
132 // 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
133 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
134 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
135 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
136
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
137 // 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
138 Image {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
139 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
140 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
141 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
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 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
146 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
147 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
148 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
149 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
150 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
151 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
152 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
153 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
154 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
155
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
156 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
157 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
158 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
159 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
160 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
161 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
162 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
163 text: {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
164 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
165 return "---"
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
166 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
167 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
168 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
169 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
170 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
171 }
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 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
174 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
175 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
176 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
177 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
178 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
179 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
180 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
181
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
182 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
183 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
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 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
186 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
187 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
188
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
189 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
190 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
191 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
192 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
193 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
194
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
195 Timer {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
196 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
197
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
198 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
199 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
200 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
201 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
202 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
203
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
204 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
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
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
207 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
208 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
209 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
210 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
211 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
212 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
213 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
214 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
215 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
216 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
217
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
218 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
219 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
220
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
221 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
222 {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
223 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
224 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
225 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
226 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
227 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
228 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
229 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
230 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
231 },
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
232 Marquee {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
233 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
234 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
235 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
236 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
237 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
238 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
239 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
240
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
241 ListView {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
242 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
243
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
244 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
245 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
246 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
247 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
248 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
249 // 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
250 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
251 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
252 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
253 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
254 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
255 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
256 Connections {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
257 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
258 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
259 }
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 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
263 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
264 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
265 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
266 }
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 // 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
269 Timer {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
270 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
271 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
272 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
273 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
274 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
275
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
276 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
277 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
278 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
279 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
280 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
281 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
282 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
283 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
284 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
285 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
286 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
287
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
288 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
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 Item {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
291 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
292 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
293 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
294 buttonIndex--
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
295
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
296 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
297 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
298
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
299 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
300 if (buttonIndex < (pumpButton.pumpEnabled ? 2 : 1))
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
301 buttonIndex++
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
302
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
303 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
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
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
307 MouseArea {
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 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
310 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
311 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
312 }
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 TileSpinBox {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
315 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
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 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
318 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
319 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
320 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
321
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
322 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
323 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
324 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
325 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
326 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
327 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
328 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
329 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
330
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
331 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
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 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
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 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
336 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
337 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
338 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
339 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
340
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
341 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
342 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
343 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
344 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
345 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
346 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
347 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
348 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
349 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
350 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
351 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
352 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
353 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
354 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
355
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
356 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
357 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
358
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
359 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
360 editIsAllowed()
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
361 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
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 }
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 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
366 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
367 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
368 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
369 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
370 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
371 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
372
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
373 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
374 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
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 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
377 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
378 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
379 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
380 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
381 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
382
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
383 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
384 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
385 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
386 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
387 ]
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 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
390 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
391
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
392 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
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 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
395 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
396 return
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
397
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
398 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
399 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
400 return
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
401 }
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 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
404 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
405 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
406 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
407 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
408 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
409 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
410 return
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
411 }
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 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
414 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
415 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
416 break;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
417 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
418 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
419 break;
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
420 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
421 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
422 break;
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
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
425 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
426 }
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 MouseArea {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
429 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
430 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
431 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
432 onClicked: {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
433 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
434 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
435 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
436 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
437
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
438 Rectangle {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
439 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
440 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
441 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
442 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
443 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
444 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
445 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
446 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
447 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
448
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
449 SequentialAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
450 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
451
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
452 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
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 NumberAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
455 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
456 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
457 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
458 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
459 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
460 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
461
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
462 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
463 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
464 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
465 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
466 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
467 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
468 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
469
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
470 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
471 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
472 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
473 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
474 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
475 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
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 PropertyAction {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
478 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
479 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
480 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
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
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
483 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
484
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
485 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
486 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
487 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
488
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
489 Tile {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
490 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
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 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
493 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
494
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
495 property 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
496 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
497 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
498 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
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 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
501 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
502 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
503
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
504 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
505 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
506 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
507 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
508 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
509 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
510
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
511 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
512 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
513
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
514 values: [
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
515 TileText {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
516 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
517 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
518 ]
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
519
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
520 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
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 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
523 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
524 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
525 return
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
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
528 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
529 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
530 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
531
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
532 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
533 value++
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
534 else
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
535 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
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
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
538 MouseArea {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
539 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
540 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
541 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
542 onClicked: {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
543 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
544 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
545 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
546 }
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 Rectangle {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
549 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
550 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
551 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
552 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
553 anchors {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
554 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
555 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
556 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
557 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
558
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
559 SequentialAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
560 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
561 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
562 NumberAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
563 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
564 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
565 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
566 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
567 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
568 }
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 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
571 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
572 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
573 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
574 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
575 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
576 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
577
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
578 ColorAnimation {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
579 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
580 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
581 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
582 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
583 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
584 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
585 PropertyAction {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
586 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
587 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
588 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
589 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
590 // 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
591 // 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
592 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
593 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
594 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
595
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
596 // 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
597 Connections {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
598 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
599 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
600 }
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 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
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 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
605 numberOfMultis++
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
606 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
607 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
608 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
609 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
610
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
611 // 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
612 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
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 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
615 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
616 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
617 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
618 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
619 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
620
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
621 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
622 {
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
623 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
624 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
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 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
627 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
628 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
629
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
630 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
631 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
632 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
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 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
635 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
636
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
637 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
638 }
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
639
57ffb39f29d4 First commit of new carousel page to allow battery charging current to
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
640 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
641 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
642 }