-
Notifications
You must be signed in to change notification settings - Fork 1
/
VariScreen.qml
126 lines (106 loc) · 2.98 KB
/
VariScreen.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import QtQuick 2.1
import BasicUIControls 1.0
import qb.components 1.0
Screen {
id: variScreen
property bool isDayschreen:false
onShown: {
//addCustomTopRightButton("Instellingen")
}
onCustomButtonClicked: {
//stage.openFullscreen(app.solarPanelConfigScreenUrl)
}
Component.onCompleted: {
app.valuesUpdated.connect(updateTile);
}
function updateTile(){
fromNowbarGraph.dataValues = app.prices10
fromNowbarGraph.xAxisValues= app.xAxisValues
todaybarGraph.dataValues = app.pricesToday10
todaybarGraph.xAxisValues= app.xAxisValuesToday
}
VariBarGraph {
id: fromNowbarGraph
anchors {
bottom: parent.bottom
bottomMargin: isNxt? 100:80
left : parent.left
leftMargin : isNxt? 10:8
}
height: isNxt? parent.height-100 : parent.height-80
width: isNxt? parent.width - 40 : parent.width - 32
hourGridColor: "red"
titleText: " Energiekosten per kWh (vanaf nu)"
titleFont: qfont.bold.name
titleSize: isNxt ? 40 : 32
showTitle: true
//backgroundcolor : "lightgrey"
backgroundcolor : colors.canvas
axisColor : "black"
barColor : colors.graphElecSingleOrLowTariff
lineXaxisvisible : true
textXaxisColor : "blue"
stepXtext: 3
valueFont: qfont.regular.name
valueSize: isNxt ? 16 : 12
valueTextColor : "black"
showValuesOnBar : true
levelColor :"red"
levelTextColor : "blue"
showLevels : true
showValuesOnLevel : true
dataValues: app.prices10
xAxisValues: app.xAxisValues
visible: app.currentPrice.length>1 & !isDayschreen
}
VariBarGraph {
id: todaybarGraph
anchors {
bottom: parent.bottom
bottomMargin: isNxt? 100:80
left : parent.left
leftMargin : isNxt? 10:8
}
height: isNxt? parent.height-100 : parent.height-80
width: isNxt? parent.width - 40 : parent.width - 32
hourGridColor: "red"
titleText: " Energiekosten per kWh (vandaag)"
titleFont: qfont.bold.name
titleSize: isNxt ? 40 : 32
showTitle: true
//backgroundcolor : "lightgrey"
backgroundcolor : colors.canvas
axisColor : "black"
barColor : colors.graphElecSingleOrLowTariff
lineXaxisvisible : true
textXaxisColor : "blue"
stepXtext: 3
valueFont: qfont.regular.name
valueSize: isNxt ? 16 : 12
valueTextColor : "black"
showValuesOnBar : true
levelColor :"red"
levelTextColor : "blue"
showLevels : true
showValuesOnLevel : true
dataValues: app.pricesToday10
xAxisValues: app.xAxisValuesToday
visible: app.currentPrice.length>1 & isDayschreen
}
SonosStandardButton {
id: switchButton
anchors {
bottom: parent.bottom
bottomMargin: isNxt? 10:8
right : parent.right
rightMargin : isNxt? 10:8
}
text: isDayschreen? "Vanaf nu" : "Vandaag"
width:isNxt ? 180: 144
height: isNxt ? 40:32
fontColorUp: "darkslategray"
fontPixelSize: isNxt ? 20 : 16
onClicked:
isDayschreen = !isDayschreen
}
}