-
Notifications
You must be signed in to change notification settings - Fork 0
/
SensorQML.qml
69 lines (60 loc) · 1.68 KB
/
SensorQML.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
import QtQuick
import QtQuick.Controls
//Value next to sensors???
// do a GridView
Item {
id: root
width: 50
height: 50
property string name: "N/A"
property int fontSize : 12
property real sensorValue: 0.0 //frameHandler.sensors.Lox_Tank_1.rawValue.toFixed(2)
property real safeThreshold: 400.0
property real warningThreshold: 700.0
property real criticalThreshold: 1000.0
property color safeColor : "white"
property color warningColor : "yellow"
property color criticalColor: "orange"
property color runnnColor : "red"
state: "safe"
//frameHandler.sensors.Lox_Tank_1.rawValue.toFixed(2) + " psi"
// do a GridView in MainPage.qml
Text {
id: value
anchors.fill: parent
//color: safeColor
text: name + ": " + sensorValue.toFixed(2) + " psi" //Change colors of text if pressure approaches certain threshold
//text: qsTr("Text\n" + frameHandler.sensors.Lox_Tank_1.timestamp.toFixed(2) + " s" )
font.pixelSize: fontSize
}
states: [
State {
name: "safe"
PropertyChanges {
target: value
color: safeColor
}
},
State {
name: "warning"
PropertyChanges {
target: value
color: warningColor
}
},
State {
name: "critical"
PropertyChanges {
target: value
color: criticalColor
}
},
State {
name: "RUNNN"
PropertyChanges {
target: value
color: runnnColor
}
}
]
}