5import QGroundControl.Controls
10 property bool showPitch: true
11 property var vehicle: null
13 property bool showHeading: false
15 property real _rollAngle: vehicle ? vehicle.roll.rawValue : 0
16 property real _pitchAngle: vehicle ? vehicle.pitch.rawValue : 0
21 QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
28 //----------------------------------------------------
29 //-- Artificial Horizon
30 QGCArtificialHorizon {
32 pitchAngle: _pitchAngle
35 //----------------------------------------------------
39 source: "/qmlimages/attitudePointer.svg"
41 fillMode: Image.PreserveAspectFit
43 sourceSize.height: parent.height
45 //----------------------------------------------------
49 source: "/qmlimages/attitudeDial.svg"
51 fillMode: Image.PreserveAspectFit
53 sourceSize.height: parent.height
55 origin.x: root.width / 2
56 origin.y: root.height / 2
60 //----------------------------------------------------
64 visible: root.showPitch
66 anchors.verticalCenter: parent.verticalCenter
67 pitchAngle: _pitchAngle
69 color: Qt.rgba(0,0,0,0)
71 //----------------------------------------------------
75 anchors.centerIn: parent
76 source: "/qmlimages/crossHair.svg"
79 sourceSize.width: width
80 fillMode: Image.PreserveAspectFit
86 anchors.fill: instrument
93 width: instrument.width
94 height: instrument.height
100 height: parent.height
110 color: Qt.rgba(0,0,0,0)
111 border.color: qgcPal.text
116 anchors.bottomMargin: Math.round(ScreenTools.defaultFontPixelHeight * .75)
117 anchors.bottom: parent.bottom
118 anchors.horizontalCenter: parent.horizontalCenter
119 text: _headingString3
123 property string _headingString: vehicle ? vehicle.heading.rawValue.toFixed(0) : "OFF"
124 property string _headingString2: _headingString.length === 1 ? "0" + _headingString : _headingString
125 property string _headingString3: _headingString2.length === 2 ? "0" + _headingString2 : _headingString2