-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScopeViewForm.qml
More file actions
403 lines (371 loc) · 15.6 KB
/
ScopeViewForm.qml
File metadata and controls
403 lines (371 loc) · 15.6 KB
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
import QtQuick 2.4
import QtQuick.Controls 2.2
import ScopeViewModel 1.0
import CustomPlot 1.0
import QCustomPlot 1.0
import JogViewModel 1.0
Item {
ScopeViewModel {
id: scopeViewModel
}
Grid {
width: parent.width
height: parent.height
rows: 2
spacing: 4
MFrame {
width: parent.width
height: parent.height * 0.15
Grid // top Grid
{
width: parent.width
height: parent.height
columns: 7
spacing: 1
// rightPadding: 3
MButton {
id: btn_motor1
_text: "motor 1"
_height: parent.height * 0.5
_width: parent.width * 1 / 7
_isActive: true
onBtnClick: {
_title = "motor 1"
//************************
_isActive = true
btn_motor2._isActive = false
btn_motor3._isActive = false
btn_motor4._isActive = false
btn_motor5._isActive = false
btn_motor6._isActive = false
btn_all._isActive = false
//************************
// stackView1.pop()
// stackView1.push("JogViewForm.ui.qml")
scopeViewModel.setMotorNum(0)
customPlot.setMotorNum(0)
customPlot.motorNumChanged(0)
}
}
MButton {
id: btn_motor2
_text: "motor 2"
_height: parent.height * 0.5
_width: parent.width * 1 / 7
onBtnClick: {
_title = "motor 2"
//************************
_isActive = true
btn_motor1._isActive = false
btn_motor3._isActive = false
btn_motor4._isActive = false
btn_motor5._isActive = false
btn_motor6._isActive = false
btn_all._isActive = false
scopeViewModel.setMotorNum(1)
customPlot.setMotorNum(1)
customPlot.motorNumChanged(1)
}
}
MButton {
id: btn_motor3
_text: "motor 3"
_height: parent.height * 0.5
_width: parent.width * 1 / 7
onBtnClick: {
_title = "motor 3"
//************************
_isActive = true
btn_motor2._isActive = false
btn_motor1._isActive = false
btn_motor4._isActive = false
btn_motor5._isActive = false
btn_motor6._isActive = false
btn_all._isActive = false
scopeViewModel.setMotorNum(2)
customPlot.setMotorNum(2)
customPlot.motorNumChanged(2)
}
}
MButton {
id: btn_motor4
_text: "motor 4"
_height: parent.height * 0.5
_width: parent.width * 1 / 7
onBtnClick: {
_title = "motor 4"
//************************
_isActive = true
btn_motor2._isActive = false
btn_motor3._isActive = false
btn_motor1._isActive = false
btn_motor5._isActive = false
btn_motor6._isActive = false
btn_all._isActive = false
scopeViewModel.setMotorNum(3)
customPlot.setMotorNum(3)
customPlot.motorNumChanged(3)
}
}
MButton {
id: btn_motor5
_text: "motor 5"
_height: parent.height * 0.5
_width: parent.width * 1 / 7
onBtnClick: {
_title = "motor 5"
//************************
_isActive = true
btn_motor2._isActive = false
btn_motor3._isActive = false
btn_motor4._isActive = false
btn_motor1._isActive = false
btn_motor6._isActive = false
btn_all._isActive = false
scopeViewModel.setMotorNum(4)
customPlot.setMotorNum(4)
customPlot.motorNumChanged(4)
}
}
MButton {
id: btn_motor6
_text: "motor 6"
_height: parent.height * 0.5
_width: parent.width * 1 / 7
onBtnClick: {
_title = "motor 6"
//************************
_isActive = true
btn_motor2._isActive = false
btn_motor3._isActive = false
btn_motor4._isActive = false
btn_motor5._isActive = false
btn_motor1._isActive = false
btn_all._isActive = false
scopeViewModel.setMotorNum(5)
customPlot.setMotorNum(5)
customPlot.motorNumChanged(5)
}
}
MButton {
id: btn_all
_text: "all"
_height: parent.height * 0.5
_width: parent.width * 1 / 7
onBtnClick: {
_title = "all"
//************************
_isActive = true
btn_motor2._isActive = false
btn_motor3._isActive = false
btn_motor4._isActive = false
btn_motor5._isActive = false
btn_motor1._isActive = false
btn_motor6._isActive = false
// scopeViewModel.setMotorNum(5)
// customPlot.setMotorNum(5)
// customPlot.motorNumChanged(5)
}
}
}
}
MFrame {
width: parent.width
height: parent.height * 0.84
Grid {
// bottom Grid
width: parent.width
height: parent.height
columns: 1
rows: 3
CustomPlotItem {
visible: !btn_all._isActive
id: customPlot
width: parent.width
height: parent.height * .85
Component.onCompleted: initCustomPlot()
}
Grid{
width: parent.width
height: parent.height * .85
visible: btn_all._isActive
columns: 3
rows: 2
CustomPlotItem {
id: customPlot1
width: parent.width /3
height: parent.height /2
Component.onCompleted: initCustomPlotall(0)
}
CustomPlotItem {
id: customPlot2
width: parent.width /3
height: parent.height /2
Component.onCompleted: initCustomPlotall(1)
}
CustomPlotItem {
id: customPlot3
width: parent.width /3
height: parent.height /2
Component.onCompleted: initCustomPlotall(2)
}
CustomPlotItem {
id: customPlot4
width: parent.width /3
height: parent.height /2
Component.onCompleted: initCustomPlotall(3)
}
CustomPlotItem {
id: customPlot5
width: parent.width /3
height: parent.height /2
Component.onCompleted: initCustomPlotall(4)
}
CustomPlotItem {
id: customPlot6
width: parent.width /3
height: parent.height /2
Component.onCompleted: initCustomPlotall(5)
}
}
Grid {
width: parent.width
height: parent.height * 0.10
columns: 2
Label {
id: actual
// width:actual.text.length +20;
width: parent.width / 2
height: parent.height
color: "#5c5cff"
text: "Actual Position"
verticalAlignment: "AlignVCenter"
horizontalAlignment: "AlignHCenter"
}
Label {
id: ideal
width: parent.width / 2
// width:ideal.text.length+20;
height: parent.height
color: "#ff5c5c"
text: "Desired Position"
verticalAlignment: "AlignVCenter"
horizontalAlignment: "AlignHCenter"
}
// MButton{
// _width: parent.width * 0.15
// _height: 25
// _text:"-"
// onBtnPress: {
// //jogviewmodel.jogJoint(0,5,1)
// customPlot.stop = true
// }
// onBtnReleased: {
// //jogviewmodel.jogJoint(0,5,0)
// customPlot.stop = false
// }
// }
}
MFrame {
width: parent.width
height: parent.height * 0.15
anchors.bottom: parent.bottom
topPadding: 3
bottomPadding: 3
Grid {
width: parent.width
height: parent.height
columns: 5
spacing: 6
ComboBox {
id: mode
// width: parent.width / 5
height: parent.height
// anchors.margins : 0
model: ListModel {
ListElement {
text: "PTP Cartesian"
}
ListElement {
text: "Linear"
}
// ListElement {
// text: "PTP Joint"
// }
// ListElement {
// text: "Circle"
// }
}
}
ComboBox {
id: teachpoint
// Component.onCompleted: scopeViewModel.intializeTeachPoint()
// width: parent.width / 5
height: parent.height
model: TeachPointModel
delegate: ItemDelegate {
width: parent.width
text: model.name
}
displayText: TeachPointModel[currentIndex].name
}
MButton {
// width: 50
height: parent.height * .85
// anchors.horizontalCenter: parent
_text: "start"
onBtnClick: {
scopeViewModel.run(mode.currentText,
teachpoint.currentIndex)
customPlot.startCustomPlot()
customPlot1.startCustomPlot()
customPlot2.startCustomPlot()
customPlot3.startCustomPlot()
customPlot4.startCustomPlot()
customPlot5.startCustomPlot()
customPlot6.startCustomPlot()
}
}
MButton {
// width: 50
// anchors.horizontalCenter: parent.horizontalCenter
height: parent.height * .85
_text: "stop"
onBtnClick: {
customPlot.stopCustomPlot()
customPlot1.stopCustomPlot()
customPlot2.stopCustomPlot()
customPlot3.stopCustomPlot()
customPlot4.stopCustomPlot()
customPlot5.stopCustomPlot()
customPlot6.stopCustomPlot()
}
}
ComboBox {
// Component.onCompleted: scopeViewModel.intializeTeachPoint()
// width: parent.width / 5
height: parent.height
id:type
model: ListModel {
ListElement {
text: "Position"
}
ListElement {
text: "Velocity"
}
ListElement {
text: "Acceleration"
}
}
onCurrentIndexChanged:customPlot.setShowType(type.currentIndex)
}
}
}
}
}
}
}
/*##^## Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/