4import QGroundControl.Controls
5import QGroundControl.FlyView
6import QGroundControl.FlightMap
10 implicitWidth: (compassRadius * 2) + attitudeSpacing + attitudeSize
11 implicitHeight: implicitWidth
13 property alias attitudeSize: rollIndicator.attitudeSize
14 property alias attitudeSpacing: rollIndicator.attitudeSpacing
15 property real extraInset: attitudeSize + attitudeSpacing
16 property real extraValuesWidth: compassRadius
17 property real defaultCompassRadius: (mainWindow.width * 0.15) / 2
18 property real maxCompassRadius: ScreenTools.defaultFontPixelHeight * 7 / 2
19 property real compassRadius: Math.min(defaultCompassRadius, maxCompassRadius)
20 property real compassBorder: ScreenTools.defaultFontPixelHeight / 2
21 property var vehicle: globals.activeVehicle
22 property var qgcPal: QGroundControl.globalPalette
23 property bool usedByMultipleVehicleList: false
25 property real _totalAttitudeSize: attitudeSize + attitudeSpacing
27 IntegratedAttitudeIndicator {
29 x: -_totalAttitudeSize
30 attitudeAngleDegrees: vehicle ? vehicle.roll.rawValue : 0
31 compassRadius: control.compassRadius
34 IntegratedAttitudeIndicator {
35 x: -_totalAttitudeSize
36 // Negated: rotating the indicator 90° clockwise moves its zero tick to the right of the
37 // compass but leaves the sweep direction clockwise, which would draw nose up as downward.
38 attitudeAngleDegrees: vehicle ? -vehicle.pitch.rawValue : 0
39 compassRadius: control.compassRadius
40 attitudeSize: control.attitudeSize
41 attitudeSpacing: control.attitudeSpacing
42 transformOrigin: Item.Center
48 width: compassRadius * 2
54 size: parent.width - compassBorder
55 vehicle: control.vehicle
56 usedByMultipleVehicleList: control.usedByMultipleVehicleList
57 anchors.centerIn: parent