-
Notifications
You must be signed in to change notification settings - Fork 0
/
P_Engine.qml
298 lines (251 loc) · 6.95 KB
/
P_Engine.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.12
import "."
Page {
id: enginePage
//needed to restore the values of the components when Drawer re-inits the page
onFocusChanged: {
//console.log("engineRPMValue = ", MyGlobal.engineRPMValue, " -- ", c_Engine.c_value)
c_Engine.c_state = MyGlobal.engineRPMState
c_Engine.c_value = MyGlobal.engineRPMValue
c_Engine.c_measure = MyGlobal.engineRPMMeasure
c_Engine.c_srcName = MyGlobal.engineRPMSrcName
c_EngineTemp.c_state = MyGlobal.engineTempState
c_EngineTemp.c_value = MyGlobal.engineTempValue
c_EngineTemp.c_measure = MyGlobal.engineTempMeasure
c_EngineTemp.c_srcName = MyGlobal.engineTempSrcName
c_Fuel.c_state = MyGlobal.fuelState
c_Fuel.c_value = MyGlobal.fuelValue
c_Fuel.c_measure = MyGlobal.fuelMeasure
c_Fuel.c_srcName = MyGlobal.fuelSrcName
c_OilPressure.c_state = MyGlobal.oilState
c_OilPressure.c_value = MyGlobal.oilValue
c_OilPressure.c_measure = MyGlobal.oilMeasure
c_OilPressure.c_srcName = MyGlobal.oilSrcName
c_Battery.c_state = MyGlobal.batteryState
c_Battery.c_value = MyGlobal.batteryValue
c_Battery.c_measure = MyGlobal.batteryMeasure
c_Battery.c_srcName = MyGlobal.batterySrcName
c_CoolantTemp.c_state = MyGlobal.coolantTempState
c_CoolantTemp.c_value = MyGlobal.coolantTempValue
c_CoolantTemp.c_measure = MyGlobal.coolantTempMeasure
c_CoolantTemp.c_srcName = MyGlobal.coolantTempSrcName
}
width: MyStyle.panelWidth
height: MyStyle.panelHeight
background: Rectangle {
color: MyStyle.backColor
}
title: qsTr("Engine Status")
Grid {
id: grid
anchors {
fill: parent;
margins: 0
}
columns: 3
columnSpacing: MyStyle.columnSpacing
leftPadding: MyStyle.columnSpacing
topPadding: MyStyle.rowSpacing
rowSpacing: MyStyle.rowSpacing
/////////////////////////////////////////////////
Comp {
id: c_Engine
c_objectName: "c_Engine"
c_state: 0
c_value: 518
c_measure: qsTr(" rpm")
c_srcName: "Images/engine.png"
Layout.row: 1
Layout.column: 0
Layout.alignment: Qt.AlignHCenter
Connections {
target: MyGlobal
onEngineRPMStateChanged: {
console.log("engineRPMStateChanged = ", MyGlobal.engineRPMState)
c_Engine.c_state = MyGlobal.engineRPMState
}
}
Connections {
target: MyGlobal
onEngineRPMValueChanged: {
c_Engine.c_value = MyGlobal.engineRPMValue
}
}
Connections {
target: MyGlobal
onEngineRPMSrcNameChanged: {
c_Engine.c_srcName = MyGlobal.engineRPMSrcName
}
}
Connections {
target: MyGlobal
onEngineRPMMeasureChanged: {
c_Engine.c_measure = MyGlobal.engineRPMMeasure
}
}
}
/////////////////////////////////////////////////
Comp {
id: c_Fuel
c_objectName: "c_Fuel"
c_value: 48.2
c_measure: qsTr("%")
c_srcName: "Images/fuel.png"
Connections {
target: MyGlobal
onFuelStateChanged: {
c_Fuel.c_state = MyGlobal.fuelState
}
}
Connections {
target: MyGlobal
onFuelValueChanged: {
c_Fuel.c_value = MyGlobal.fuelValue
}
}
Connections {
target: MyGlobal
onFuelSrcNameChanged: {
c_Fuel.c_srcName = MyGlobal.fuelSrcName
}
}
Connections {
target: MyGlobal
onFuelMeasureChanged: {
c_Fuel.c_measure = MyGlobal.fuelMeasure
}
}
}
/////////////////////////////////////////////////
Comp {
id: c_OilPressure
c_objectName: "c_OilPressure"
c_value: 40
c_measure: qsTr("psi")
c_srcName: "Images/oil.png"
Connections {
target: MyGlobal
onOilStateChanged: {
c_OilPressure.c_state = MyGlobal.oilState
}
}
Connections {
target: MyGlobal
onOilValueChanged: {
c_OilPressure.c_value = MyGlobal.oilValue
}
}
Connections {
target: MyGlobal
onOilSrcNameChanged: {
c_OilPressure.c_srcName = MyGlobal.oilSrcName
}
}
Connections {
target: MyGlobal
onOilMeasureChanged: {
c_OilPressure.c_measure = MyGlobal.oilMeasure
}
}
}
/////////////////////////////////////////////////
Comp {
id: c_EngineTemp
c_objectName: "c_EngineTemp"
c_value: 244.5
c_measure: MyStyle.centigradeStr
c_srcName: "Images/liquid_temperature.png"
Connections {
target: MyGlobal
onEngineTempStateChanged: {
c_EngineTemp.c_state = MyGlobal.engineTempState
}
}
Connections {
target: MyGlobal
onEngineTempValueChanged: {
c_EngineTemp.c_value = MyGlobal.engineTempValue
}
}
Connections {
target: MyGlobal
onEngineTempSrcNameChanged: {
c_EngineTemp.c_srcName = MyGlobal.engineTempSrcName
}
}
Connections {
target: MyGlobal
onEngineTempMeasureChanged: {
c_EngineTemp.c_measure = MyGlobal.engineTempMeasure
}
}
}
////////////////////////////////////////////////////////
Comp {
id: c_Battery
c_objectName: "c_Battery"
c_value: 14.8
c_measure: qsTr(" Vdc")
c_srcName: "Images/battery.png"
Connections {
target: MyGlobal
onBatteryStateChanged: {
c_Battery.c_state = MyGlobal.batteryState
}
}
Connections {
target: MyGlobal
onBatteryValueChanged: {
c_Battery.c_value = MyGlobal.batterylValue
}
}
Connections {
target: MyGlobal
onBatterySrcNameChanged: {
c_Battery.c_srcName = MyGlobal.batterySrcName
}
}
Connections {
target: MyGlobal
onBatteryMeasureChanged: {
c_Battery.c_measure = MyGlobal.batteryMeasure
}
}
}
//////////////////////////////////////////
Comp {
id: c_CoolantTemp
c_objectName: "c_CoolantTemp"
c_value: 190
c_measure: MyStyle.centigradeStr
c_srcName: "Images/coolant.png"
Connections {
target: MyGlobal
onCoolantTempStateChanged: {
c_CoolantTemp.c_state = MyGlobal.coolantTempState
}
}
Connections {
target: MyGlobal
onCoolantTempValueChanged: {
c_CoolantTemp.c_value = MyGlobal.coolantTempValue
}
}
Connections {
target: MyGlobal
onCoolantTempSrcNameChanged: {
c_CoolantTemp.c_srcName = MyGlobal.coolantTempSrcName
}
}
Connections {
target: MyGlobal
onCoolantTempMeasureChanged: {
c_CoolantTemp.c_measure = MyGlobal.coolantTempMeasure
}
}
}
}
}