-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
302 lines (292 loc) · 5.52 KB
/
main.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
299
300
301
302
import Qt 4.7
//import "Gauge"
import "Button"
import "Osk"
import GaugeImage 0.1
import "Setup"
import "TroubleCodes"
Rectangle {
x:0
y:0
width: 1280
height: 800
color: "black"
Text {
x: 100
y: 100
width: 300
height: 50
text: (propertyMap["010C"] ? propertyMap["010C"] : "");
}
Text {
x: 500
y: 600
width: 300
height: 50
text: (propertyMap["consoleMessage"] ? propertyMap["consoleMessage"] : "");
}
Text {
x: 500
y: 650
width: 300
height: 50
text: (propertyMap["connectedMessage"] ? propertyMap["connectedMessage"] : "");
}
GaugeImage {
x:0
y:0
width:200
height:200
minimum:-40
maximum:200
numLabels:3
startAngle:45
endAngle:270
Behavior on m_value { PropertyAnimation { properties: "m_value"; duration: (propertyMap["0105_DURATION"] ? propertyMap["0105_DURATION"] : 500) } }
m_value: (propertyMap["0105"] ? propertyMap["0105"] : 0)
}
GaugeImage {
x:425
y:0
width:250
height:250
minimum:0
maximum:655
numLabels:3
startAngle:90
endAngle:270
Behavior on m_value { PropertyAnimation { properties: "m_value"; duration: (propertyMap["0110_DURATION"] ? propertyMap["0110_DURATION"] : 500) } }
m_value: (propertyMap["0110"] ? propertyMap["0110"] : 0) * 10
}
GaugeImage {
x:0
y:250
width:550
height:550
minimum: 0
maximum: 7000
numLabels: 7
startAngle: 45
endAngle: 315
Behavior on m_value { PropertyAnimation { properties: "m_value"; duration: (propertyMap["010C_DURATION"] ? propertyMap["010C_DURATION"] : 500) } }
m_value: (propertyMap["010C"] ? propertyMap["010C"] : 0)
}
GaugeImage {
x: 640
y: 250
width:550
height: 550
minimum:0
maximum: 140
numLabels: 7
startAngle: 45
endAngle: 315
Behavior on m_value { PropertyAnimation { properties: "m_value"; duration: (propertyMap["010D_DURATION"] ? propertyMap["010D_DURATION"] : 500) } }
m_value: (propertyMap["010D"] ? propertyMap["010D"] : 0)
}
GaugeImage {
x: 975
y: 0
width:300
height: 300
minimum:0
maximum: 140
numLabels: 7
startAngle: 45
endAngle: 315
Behavior on m_value { PropertyAnimation { properties: "m_value"; duration: (propertyMap["010F_DURATION"] ? propertyMap["010F_DURATION"] : 500) } }
m_value: (propertyMap["010F"] ? propertyMap["010F"] : 0)
}
Rectangle {
id:taskbar
x:-1180
y:700
width:1280
height:100
Rectangle {
x:0
y:0
width:200
height:100
color: "orange"
radius: 10
Rectangle {
radius: 10
x:5
y:5
width:190
height:90
color: "black"
MouseArea {
anchors.fill: parent
onClicked: {
Qt.quit()
}
Text {
font.pixelSize: 30
color: "white"
anchors.fill: parent
horizontalAlignment:Text.AlignHCenter
verticalAlignment:Text.AlignVCenter
text: "Quit"
}
}
}
}
Rectangle {
x:200
y:0
width:200
height:100
radius: 10
color: "orange"
Rectangle {
radius: 10
color: "black"
x: 5
y: 5
width: 190
height: 90
MouseArea {
x: 0
y: 0
anchors.rightMargin: 0
anchors.bottomMargin: 0
anchors.leftMargin: 0
anchors.topMargin: 0
anchors.fill: parent
onClicked: {
window.connect();
//Qt.quit()
}
Text {
font.pixelSize: 30
color: "white"
anchors.fill: parent
horizontalAlignment:Text.AlignHCenter
verticalAlignment:Text.AlignVCenter
text: "Connect"
}
}
}
}
Rectangle {
x:400
y:0
width:200
height:100
color: "orange"
radius: 10
Rectangle {
x:5
y:5
width:190
height:90
radius: 10
color: "black"
MouseArea {
anchors.fill: parent
onClicked: {
window.disconnect();
}
Text {
font.pixelSize:30
color: "white"
anchors.fill: parent
horizontalAlignment:Text.AlignHCenter
verticalAlignment:Text.AlignVCenter
text: "Disconnect"
}
}
}
}
Button {
x:600
y:0
width:200
height:100
outerColor:"orange"
textColor:"orange"
text:"Setup"
onClicked: {
setup.x = 200
}
}
Rectangle {
x:980
y:0
width:200
height:100
color: "orange"
radius: 10
Rectangle {
x:5
y:5
width:190
height:90
radius: 10
color: "black"
MouseArea {
anchors.fill: parent
onClicked: {
troublecodewindow.x = 300
}
Text {
font.pixelSize:30
color: "white"
anchors.fill: parent
horizontalAlignment:Text.AlignHCenter
verticalAlignment:Text.AlignVCenter
text: "Trouble Codes"
}
}
}
}
property bool expanded:false
Behavior on x { PropertyAnimation { properties: "x"; duration: 500 } }
Button {
x:1180
y:0
width:100
height:100
onClicked: {
if (parent.expanded)
{
parent.expanded = false;
taskbar.x = -1180
}
else
{
parent.expanded = true;
taskbar.x = 0
}
}
}
}
TroubleCodes {
id:troublecodewindow
x:-500
y:100
}
Osk {
id:osk
z:1
x:100
y:-500
width:1100
height:500
property TextInput target;
Behavior on y { PropertyAnimation { properties: "y"; duration: 500 } }
onOkHit: {
target.text = text;
osk.y = -500
}
}
Setup {
id: setup
x:-900
y:200
width:600
height: 400
}
}