-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
1214 lines (1060 loc) · 42.1 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
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
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import QtMultimedia 5.12
import QtQuick 2.12
import QtQuick.Window 2.12 as W
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtQuick.Controls.Styles 1.4
import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
import QtSensors 5.10
import QtQml 2.12
import graph 1.0
//import QtQuick.Scene3D 2.15
import Qt3D.Core 2.0
import Qt3D.Render 2.0
import Qt3D.Extras 2.0
//import Ros 1.0
W.Window {
id: main
visible: true
width: 1920
height: 1080
color: "black"
title: qsTr("Gazebo")
property bool mShowState: true
// Image {
// id: imgBackground
// anchors.fill: parent
// opacity: 0.5
// source: "image://roscimage/usb_cam/image_raw"
// }
StackLayout {
id: stack
anchors.fill: parent
currentIndex: 0
Item {
Image {
id: roscimg
visible: true
cache: false
anchors.fill: parent
source: "image://roscimage/usb_cam/image_raw"
Timer {
interval: 50
repeat: true
running: true
onTriggered: { roscimg.source = ""; roscimg.source = "image://roscimage/usb_cam/image_raw" }
}
}
Image {
id:rosimg
visible:false
cache: false
anchors.fill: parent
source: "image://rosimage/usb_cam/image_raw"
Timer {
interval: 50
repeat: true
running: true
onTriggered: { rosimg.source = ""; rosimg.source = "image://rosimage/usb_cam/image_raw" }
}
}
Text {
id: camlowquality
visible: true
text: "CAM QUALITY:LOW"
x:1150
y:600
MouseArea {
anchors.fill: parent
onClicked: {
camlowquality.visible= false
camhighquality.visible= true
roscimg.visible= false
rosimg.visible= true
}
}
}
Text{
id: camhighquality
visible: false
text: "CAM QUALITY:HIGH"
color: "blue"
x:1150
y:600
MouseArea {
anchors.fill: parent
onClicked: {
camlowquality.visible= true
camhighquality.visible= false
roscimg.visible= true
rosimg.visible= false
}
}
}
Entity {
id: sceneRoot
Camera {
id: camera
projectionType: CameraLens.PerspectiveProjection
position: Qt.vector3d( 0.0, 0.0, 20 )
}
components: [
RenderSettings {
activeFrameGraph: ForwardRenderer {
camera: camera
clearColor: "white"
}
pickingSettings.pickMethod: PickingSettings.TrianglePicking
}
]
Entity {
id: cube
components: [cubeTransform]
Transform {
id: cubeTransform
translation: Qt.vector3d(2, 0, 10)
scale3D: Qt.vector3d(1, 4, 1)
rotation: fromEulerAngles( roll.roll,
pitch.pitch,
yaw.yaw )
}
}
}
Image {
id: dialRPM
x: mShowState ? 10 : -width
y: 70
width: implicitWidth * mScale
fillMode: Image.PreserveAspectFit
source: "qrc:/rpm.png"
property real mScale: 0.5
Behavior on x {
NumberAnimation {
duration: 300
}
}
CircularGauge {
id: gaugeRPM
width: 262 * dialRPM.mScale; height: width
x: 150 * dialRPM.mScale - width / 2; y: 155 * dialRPM.mScale - width / 2
value: rpmdata.rpmdata
maximumValue : 5000
stepSize: 50
style: CircularGaugeStyle {
id: gaugeRPMStyle
labelStepSize: 500
function degreesToRadians(degrees) {
return degrees * (Math.PI / 180);
}
tickmark: Rectangle {
visible: styleData.value % 500 == 0
implicitWidth: outerRadius * 0.02
antialiasing: true
implicitHeight: outerRadius * 0.06
color: "#01baff"
}
minorTickmark: Rectangle {
visible: false
implicitWidth: outerRadius * 0.01
antialiasing: true
implicitHeight: outerRadius * 0.03
color: "#01baff"
}
tickmarkLabel: Text {
font { pixelSize: 20 * dialRPM.mScale }
text: styleData.value
color: "#01baff"
antialiasing: true
}
needle: Rectangle {
y: outerRadius * 0.15
implicitWidth: outerRadius * 0.03
implicitHeight: outerRadius * 0.9
antialiasing: true
color: "#ff0000"
}
foreground: Item {
Image {
width: implicitWidth * dialRPM.mScale
fillMode: Image.PreserveAspectFit
source: "qrc:/rpm_center.png"
anchors.centerIn: parent
}
}
background: Rectangle {
radius: width / 2
color: "#000000"
}
}
}
Text {
text: "RPM: " + toFixed(rpmdata.rpmdata, 2)
anchors {
centerIn: gaugeRPM
verticalCenterOffset: -40 * dialRPM.mScale
}
font { pixelSize: 10 }
color: "#ff0000"
}
Item {
id: meterThrottle
anchors {
left: parent.left; leftMargin: 268 * dialRPM.mScale
bottom: parent.bottom; bottomMargin: 52 * dialRPM.mScale
}
width: imageThrottle.width
height: imageThrottle.height * throttledata.throttledata /200
clip: true
Image {
id: imageThrottle
anchors {
bottom: parent.bottom
}
width: implicitWidth * dialRPM.mScale
fillMode: Image.PreserveAspectFit
source: "qrc:/throttle.png"
}
}
MouseArea {
anchors.fill: parent
onClicked: {
/*
tachometer.visible = false
speedometer.visible = false
compassdial.visible = false
altimeterback.visible = false
ammeter.visible = false
//voltmeter.visible = false
throttlegauge.visible = false
batteryindicator.visible = false
dashboard.visible = true
*/
}
}
}
Rectangle {
id: speedometer
x: mShowState ? 10 : -width
y: 260
width: 170
height: 170
radius: width*0.5
color: "black"
Behavior on x {
NumberAnimation {
duration: 300
}
}
CircularGauge {
value: speed.speed
maximumValue : 10
x:10
y:10
width: 170
height: 170
anchors.centerIn: parent
style: CircularGaugeStyle {
labelStepSize: 0.5
tickmarkStepSize: 0.5
}
Text {
text: "SPEED: " + Math.round(speed.speed)
anchors {
centerIn: parent
verticalCenterOffset: -20
}
font { pixelSize: 11 }
color: "white"
}
Behavior on value {
NumberAnimation {
duration: 1000
}
}
MouseArea {
anchors.fill: parent
onClicked: {
/*
tachometer.visible = false
speedometer.visible = false
compassdial.visible = false
altimeterback.visible = false
ammeter.visible = false
//voltmeter.visible = false
throttlegauge.visible = false
batteryindicator.visible = false
dashboard.visible = true
*/
}
}
}
}
Item {
id: dialCurrent
x: mShowState ? 10 : -width
y: 460
width: 487 * mScale; height: 487 * mScale
//fillMode: Image.PreserveAspectFit
//source: "qrc:/current.png"
Behavior on x {
NumberAnimation {
duration: 300
}
}
property real mScale: 0.35
CircularGauge {
id: gaugeCurrent
anchors.fill: parent
value: currentdata.currentdata * 10
maximumValue : 100
stepSize: 1
style: CircularGaugeStyle {
id: gaugeCurrentStyle
labelStepSize: 10
function degreesToRadians(degrees) {
return degrees * (Math.PI / 180);
}
tickmark: Rectangle {
visible: styleData.value % 10 == 0
implicitWidth: outerRadius * 0.02
antialiasing: true
implicitHeight: outerRadius * 0.06
color: "#01baff"
}
minorTickmark: Rectangle {
visible: styleData.value % 10 != 0
implicitWidth: outerRadius * 0.01
antialiasing: true
implicitHeight: outerRadius * 0.03
color: "#01baff"
}
tickmarkLabel: Text {
font { pixelSize: 30 * dialCurrent.mScale; bold: true }
text: styleData.value / 10
color: "#01baff"
antialiasing: true
}
needle: Rectangle {
y: outerRadius * 0.15
implicitWidth: outerRadius * 0.03
implicitHeight: outerRadius * 0.9
antialiasing: true
color: "#01baff"
}
foreground: Item {
Image {
width: implicitWidth * dialCurrent.mScale
fillMode: Image.PreserveAspectFit
source: "qrc:/current_center.png"
anchors.centerIn: parent
}
}
background: Rectangle {
radius: width / 2
color: "#081831"
}
}
}
Text {
text: "CURRENT: " + toFixed(currentdata.currentdata, 2)
anchors {
centerIn: parent
verticalCenterOffset: -60 * dialCurrent.mScale
}
font { pixelSize: 10 }
color: "#00ade1"
}
Image {
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom; bottomMargin: 22 * dialCurrent.mScale
}
width: implicitWidth * dialCurrent.mScale
fillMode: Image.PreserveAspectFit
source: "qrc:/current_bottom.png"
Image {
id: imgBattery1
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom; bottomMargin: 20 * dialCurrent.mScale
}
width: 100 * dialCurrent.mScale
fillMode: Image.PreserveAspectFit
source: "qrc:/battery1.png"
Text {
text: Math.round(battery.battery) + "%"
anchors {
centerIn: parent
}
font { pixelSize: 25 * dialCurrent.mScale }
color: "#0ca30e"
}
}
}
MouseArea {
anchors.fill: parent
onClicked: {
/*
tachometer.visible = false
speedometer.visible = false
compassdial.visible = false
altimeterback.visible = false
ammeter.visible = false
//voltmeter.visible = false
throttlegauge.visible = false
batteryindicator.visible = false
dashboard.visible = true
*/
}
}
}
Image {
id: compassdial
source: "qrc:/compass.png"
x: mShowState ? 1130 : 1200 + width
y: 70
width: 160
height: 160
Behavior on x {
NumberAnimation {
duration: 300
}
}
Image {
id: compassarrow
source: "ARROW-Bright.png"
anchors.centerIn: parent
width: 10
height: 140
rotation: yaw.yaw
//Behavior on rotation {SmoothedAnimation{velocity: 200}}
}
MouseArea {
anchors.fill: parent
onClicked: {
/*
tachometer.visible = false
speedometer.visible = false
compassdial.visible = false
altimeterback.visible = false
ammeter.visible = false
//voltmeter.visible = false
throttlegauge.visible = false
batteryindicator.visible = false
dashboard.visible = true
*/
}
}
}
Item {
id: dialAdi
x: mShowState ? 1130 : 1200 + width
y: 260
width: 240 * mScale
height: 240 * mScale
transformOrigin: Item.Center
rotation: -m_roll
property real mScale: 0.7
property real _roll: roll.roll
on_RollChanged: {
updateValues()
}
property real _pitch: pitch.pitch
on_PitchChanged: {
updateValues()
}
property real m_originalPixPerDeg: 0.5
property real m_roll: 0
property real m_pitch: 0
property real m_faceDeltaX_old: 0
property real m_faceDeltaY_old: 0
property real m_faceDeltaX_new: 0
property real m_faceDeltaY_new: 0
property var updateValues: function() {
m_faceDeltaX_old = m_faceDeltaX_new
m_faceDeltaY_old = m_faceDeltaY_new
m_roll = Math.max(-180, Math.min(180, _roll))
m_pitch = Math.max(-50, Math.min(50, _pitch))
var delta = m_originalPixPerDeg * m_pitch
var roll_rad = Math.PI * m_roll / 180.0
m_faceDeltaX_new = dialAdi.mScale * delta * Math.sin( roll_rad )
m_faceDeltaY_new = dialAdi.mScale * delta * Math.cos( roll_rad )
imgFace.x += m_faceDeltaX_new - m_faceDeltaX_old
imgFace.y += m_faceDeltaY_new - m_faceDeltaY_old
var ret = new Object
return ret
}
Image {
id: imgBack
width: implicitWidth * dialAdi.mScale
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
source: "qrc:/adi_back.svg"
}
Image {
id: imgFace
width: implicitWidth * dialAdi.mScale
fillMode: Image.PreserveAspectFit
x: parent.width / 2 - width / 2; y: parent.height / 2 - height / 2
source: "qrc:/adi_face.svg"
}
Image {
id: imgRing
width: implicitWidth * dialAdi.mScale
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
source: "qrc:/adi_ring.svg"
}
Behavior on x {
NumberAnimation {
duration: 300
}
}
MouseArea {
anchors.fill: parent
onClicked: {
}
}
}
Image {
id: imgCase
width: implicitWidth * dialAdi.mScale
fillMode: Image.PreserveAspectFit
anchors.centerIn: dialAdi
source: "qrc:/adi_case.svg"
}
Item {
id: recBallastLoop
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom; bottomMargin: mShowState ? 0 : -height
Behavior on bottomMargin {
NumberAnimation {
duration: 300
}
}
}
width: parent.width - 500
height: 250
Image {
id: imgBallast
anchors {
left: parent.left; right: parent.right
verticalCenter: parent.verticalCenter
}
source: "qrc:/ballast.png"
fillMode: Image.PreserveAspectFit
property real ratio: width / implicitWidth
}
Image {
id: imgSensor1
anchors {
bottom: imgBallast.bottom; bottomMargin: 36 * imgBallast.ratio
left: imgBallast.left
}
width: implicitWidth * imgBallast.ratio
fillMode: Image.PreserveAspectFit
source: "qrc:/sensor1_%1.png".arg(outletpumpdata.outletpumpdata > 50 ? "green" : "red")
}
Image {
id: imgSensor2
anchors {
bottom: imgBallast.bottom; bottomMargin: 38 * imgBallast.ratio
right: imgBallast.right
}
width: implicitWidth * imgBallast.ratio
fillMode: Image.PreserveAspectFit
source: "qrc:/sensor2_%1.png".arg(inletpumpdata.inletpumpdata > 50 ? "green" : "red")
}
Image {
id: imgV1
anchors {
bottom: imgBallast.bottom; bottomMargin: 75 * imgBallast.ratio
left: imgBallast.left; leftMargin: 300 * imgBallast.ratio
}
width: implicitWidth * imgBallast.ratio
fillMode: Image.PreserveAspectFit
source: "qrc:/pump1_%1.png".arg(inflowdata.inflowdata > 0 ? "green" : "red")
}
Image {
id: imgV2
anchors {
bottom: imgBallast.bottom; bottomMargin: 124 * imgBallast.ratio
right: imgBallast.right; rightMargin: 348 * imgBallast.ratio
}
width: implicitWidth * imgBallast.ratio
fillMode: Image.PreserveAspectFit
source: "qrc:/pump2_%1.png".arg(outflowdata.outflowdata > 0 ? "green" : "red")
}
Rectangle {
id: line1
width: 3
anchors {
left: imgBallast.horizontalCenter
top: imgBallast.bottom; bottom: txtPressureBallast.verticalCenter
}
border { color: "#dfdfdf"; width: 2}
}
Rectangle {
id: line2
height: 3
anchors {
left: line1.right; right: txtPressureBallast.left
verticalCenter: txtPressureBallast.verticalCenter
}
border { color: "#dfdfdf"; width: 2}
}
Text {
id: txtPressureBallast
anchors {
verticalCenter: imgBallast.verticalCenter
horizontalCenter: imgBallast.horizontalCenter; horizontalCenterOffset: -10 * imgBallast.ratio
}
font { pixelSize: 15; bold: true }
text: toFixed(pressuredata.pressuredata, 2)
//text: outletpumpdata.outletpumpdata
}
}
}
Item {
id: graphPage
width: 1920
height: 1080
Column {
anchors.fill: parent
Rectangle {
height: dashboard.height
width: parent.width
}
Rectangle {
height: 500
width: parent.width
color: "green"
}
Rectangle {
property int graphHeight: 200
id: graphContainer
width: 1920
height: graphHeight
color: "black"
clip:true
Column {
id: col
z: 3
Row {
id: xRow
x: 10
Button {
width: 30
height: 30
text: "-"
onClicked: {
graph.scaleDownX()
}
}
Button {
width: 30
height: 30
text: "+"
onClicked: {
graph.scaleUpX()
}
}
Text {
text: "X scale:" + graph.xScale
anchors.verticalCenter: xRow.verticalCenter
width: 90
}
}
Row {
id: yRow
x: 10
Button {
width: 30
height: 30
text: "-"
onClicked: {
graph.scaleDownY()
}
}
Button {
width: 30
height: 30
text: "+"
onClicked: {
graph.scaleUpY()
}
}
Text {
text: "Y scale:" + graph.yScale
anchors.verticalCenter: yRow.verticalCenter
width: 90
}
}
Row {
id: holdRow
x: 10
Button {
width: 30
height: 30
text: "-"
onClicked: {
graph.decreaseHoldTime()
}
}
Button {
width: 30
height: 30
text: "+"
onClicked: {
graph.increaseHoldTime()
}
}
Text {
text: "Hold time:" +graph.holdTime + "s"
anchors.verticalCenter: holdRow.verticalCenter
width: 90
}
}
}
Flickable {
id: content
anchors.fill: parent
contentWidth: graph.xScale > 1 ? parent.width * graph.xScale : parent.width
contentHeight: graph.yScale > 1 ? graphContainer.graphHeight * graph.yScale : graphContainer.graphHeight
/// This is custom graph control Element. It is configured to store plot in range
/// from 0 to 10 and removes old data after 20 seconds.
Graph {
id: graph
width: content.contentWidth
height: content.contentHeight
yMin: -800 // Change this value to adjust y axis range
yMax: 500 // Change this value to adjust y axis range
clip:true
/// Demo function - can be removed after desired source of data is implemented
function newSample(i) {
return (Math.sin(10*(i / 100.0 * Math.PI * 2)) + 1) * 5 + Math.random() * 0.05;
}
/// Demo function - can be removed after desired source of data is implemented
// Component.onCompleted: {
// for (var i=0; i<100; ++i)
// appendSample(newSample(i));
// }
property var holdTimes: [10, 20, 30, 40, 50, 60, 120, 180, 240, 300,600,1000,2000,4000,8000]
property int currentHoldIndex: 1
holdTime: holdTimes[currentHoldIndex] // Change this value to adjust flushing time (value in seconds)
function increaseHoldTime() {
if (currentHoldIndex < holdTimes.length - 1) {
currentHoldIndex++
}
}
function decreaseHoldTime() {
if (currentHoldIndex > 0) {
currentHoldIndex--
}
}
function scaleUpY() {
if (graph.yScale < 512) {
graph.yScale *= 2
content.contentY *= 2
}
}
function scaleDownY() {
if (graph.yScale > (1/16)) {
graph.yScale /= 2
content.contentY /= 2
}
}
function scaleUpX() {
if (graph.xScale < 512) {
graph.xScale *= 2
}
}
function scaleDownX() {
if (graph.xScale > (1/16)) {
graph.xScale /= 2
}
}
/// Timer that executes samples removal. Only sample older than holdTime seconds
/// will be removed. This timer should be left here.
Timer {
id: timer
interval: 50 // This can be changed to something like 100 or 200.
repeat: true
running: true
onTriggered: {
graph.removeOldSamples();
/// Demo function - can be removed after desired source of data is implemented
// graph.appendSample(graph.newSample(++graph.offset));
}
}
property int offset: 100
/// This mouse area handles zooming in and out. Some values can be edited to adjust
/// scale range. Remember to keep scale values as powers of 2.
MouseArea {
anchors.fill: parent
onWheel: {
console.log("Wheel event, angle delta is:",wheel.angleDelta)
/// 512 can be change to 256 to lower the scale range or 1024 to increase
/// scaling range
if(wheel.angleDelta.y > 0) {
graph.scaleUpY()
}
/// 1/16 can be change to 1/8 to make the minimal scale larger
/// or 1/32 make the minimal scale smaller.
else if (wheel.angleDelta.y < 0) {
graph.scaleDownY()
}
console.log("Scale is:",graph.scale)
console.log("Content height is:",content.contentHeight)
}
}
/// Connections prepared for real data source. You need to specify the target
/// that emits certain signal and handle that signal.
Connections {
target: zpathdata // can be changed to any QObject that emits signals
/// Signal handler - it will be called after depthChanged signal is emitted
onZPathChanged: {
//console.log("Z data is",zpathdata.zpathdata)
// Uncomment this line to populate graph.
graph.appendSample(zpathdata.zpathdata)
}
}
}
}
}
}
}
}
Rectangle {
id: dashboard
anchors {
left: parent.left; right: parent.right
}
height: 50
color: "#88000000"
Rectangle {
color: "transparent"
anchors.left: buttonSwitch.right
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 5
width: 30
height: 30
Image {
anchors.fill:parent
source: "qrc:/gps_arrow.png"
MouseArea {
anchors.fill:parent
onClicked: stack.currentIndex = !stack.currentIndex
}
}
}
MouseArea {
id: buttonSwitch
anchors {
left: parent.left; leftMargin: 30
verticalCenter: parent.verticalCenter
}
width: 30; height: 30
scale: pressed ? 1.1 : 1.0
cursorShape: Qt.PointingHandCursor
Image {
anchors.fill: parent
source: "qrc:/switch.png"
}
onClicked: {
mShowState = !mShowState
}
}
Row {
anchors {
left: buttonSwitch.right; leftMargin: 50
verticalCenter: parent.verticalCenter
}
Text {
id: lblrpm