-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPVFan.qml
112 lines (100 loc) · 2.82 KB
/
PVFan.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
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import BackEnd 1.0
Item {
property string title
property var fan
property int fieldMinWidth: 85
Layout.fillWidth: true
height: 59
function renderMode(mode) {
switch (mode) {
case BackEnd.ControlMode.Tbl:
return "%-table";
case BackEnd.ControlMode.PID:
return "PID";
case BackEnd.ControlMode.Fixed:
return "Fixed";
case BackEnd.ControlMode.Off:
return "Off";
}
return "ERR";
}
function renderSource(source) {
switch (source) {
case BackEnd.WaterSupplyTemp:
return "Water Supply Temp";
case BackEnd.WaterReturnTemp:
return "Water Return Temp";
case BackEnd.CaseTemp:
return "Case Temp";
case BackEnd.Aux1Temp:
return "Aux1 Temp";
case BackEnd.Aux2Temp:
return "Aux2 Temp";
case BackEnd.VirtualDeltaT:
return "DeltaT";
}
return "ERR";
}
RowLayout {
anchors.fill: parent
Label {
text: title
Layout.fillHeight: true
Layout.minimumWidth: 115
Layout.maximumWidth: 115
verticalAlignment: Text.AlignTop
}
TextFieldExt {
readOnly: true
Layout.maximumWidth: 135
autoSelectText: false
minWidth: fieldMinWidth
label: qsTr("RPM")
text: fan.pv.rpm
}
TextFieldExt {
readOnly: true
Layout.maximumWidth: 135
autoSelectText: false
minWidth: fieldMinWidth
label: qsTr("PWM")
text: fan.pv.pct + '%'
}
TextFieldExt {
readOnly: true
Layout.maximumWidth: 135
autoSelectText: false
minWidth: fieldMinWidth
label: qsTr("Mode")
text: qsTr(renderMode(fan.pv.mode))
}
TextFieldExt {
readOnly: true
Layout.maximumWidth: 235
autoSelectText: false
minWidth: 155
label: qsTr("Source")
text: qsTr(renderSource(fan.pv.source))
visible: fan.pv.mode < BackEnd.ControlMode.Fixed
}
Item {
Layout.preferredHeight: 59
Layout.minimumHeight: 59
Layout.minimumWidth: 155
Layout.maximumWidth: 235
Layout.fillWidth: true
height: 20
visible: fan.pv.mode >= BackEnd.ControlMode.Fixed
}
// force left alignment as width grows
Item {
Layout.preferredHeight: 59
Layout.minimumHeight: 59
Layout.minimumWidth: 0
Layout.fillWidth: true
}
}
}