QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GPSIndicator.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4import QGroundControl
5import QGroundControl.Controls
6
7// Used as the base class control for nboth VehicleGPSIndicator and RTKGPSIndicator
8
9Item {
10 id: control
11 width: gpsIndicatorRow.width
12 anchors.top: parent.top
13 anchors.bottom: parent.bottom
14
15 property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
16 property bool _rtkConnected: QGroundControl.gpsRtk.connected.value
17
18 QGCPalette { id: qgcPal }
19
20 Row {
21 id: gpsIndicatorRow
22 anchors.top: parent.top
23 anchors.bottom: parent.bottom
24 spacing: ScreenTools.defaultFontPixelWidth / 2
25
26 Row {
27 anchors.top: parent.top
28 anchors.bottom: parent.bottom
29 spacing: -ScreenTools.defaultFontPixelWidth / 2
30
31 QGCLabel {
32 id: gpsLabel
33 rotation: 90
34 text: qsTr("RTK")
35 color: qgcPal.windowTransparentText
36 anchors.verticalCenter: parent.verticalCenter
37 visible: _rtkConnected
38 }
39
40 QGCColoredImage {
41 id: gpsIcon
42 width: height
43 anchors.top: parent.top
44 anchors.bottom: parent.bottom
45 source: "/qmlimages/Gps.svg"
46 fillMode: Image.PreserveAspectFit
47 sourceSize.height: height
48 opacity: (_activeVehicle && _activeVehicle.gps.count.value >= 0) ? 1 : 0.5
49 color: qgcPal.windowTransparentText
50 }
51 }
52
53 Column {
54 id: gpsValuesColumn
55 anchors.verticalCenter: parent.verticalCenter
56 visible: _activeVehicle && !isNaN(_activeVehicle.gps.hdop.value)
57 spacing: 0
58
59 QGCLabel {
60 anchors.horizontalCenter: hdopValue.horizontalCenter
61 color: qgcPal.windowTransparentText
62 text: _activeVehicle ? _activeVehicle.gps.count.valueString : ""
63 }
64
65 QGCLabel {
66 id: hdopValue
67 color: qgcPal.windowTransparentText
68 text: _activeVehicle ? _activeVehicle.gps.hdop.value.toFixed(1) : ""
69 }
70 }
71 }
72
73 MouseArea {
74 anchors.fill: parent
75 onClicked: mainWindow.showIndicatorDrawer(gpsIndicatorPage, control)
76 }
77
78 Component {
79 id: gpsIndicatorPage
80
81 GPSIndicatorPage { }
82 }
83}