QGCInstrumentWidgetAlternate.qml 3.05 KB
Newer Older
1 2
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
9 10


11
import QtQuick 2.3
12

13
import QGroundControl               1.0
14 15 16 17
import QGroundControl.Controls      1.0
import QGroundControl.ScreenTools   1.0
import QGroundControl.FactSystem    1.0
import QGroundControl.FlightMap     1.0
Don Gagne's avatar
Don Gagne committed
18
import QGroundControl.Palette       1.0
19 20

Rectangle {
Don Gagne's avatar
Don Gagne committed
21
    id:             root
22
    height:         _outerRadius * 4 + _valuesWidget.height
Don Gagne's avatar
Don Gagne committed
23 24
    radius:         _outerRadius
    color:          qgcPal.window
25 26 27 28

    // These properties are expected to be in the Loader
    //  property real maxHeight
    //  property bool showValues - true: show value pages
29

30
    property real   _innerRadius:       (width - (_topBottomMargin * 2)) / 2
31
    property real   _outerRadius:       _innerRadius + _topBottomMargin * 2
32 33
    property real   _spacing:           ScreenTools.defaultFontPixelHeight * 0.33
    property real   _topBottomMargin:   (width * 0.05) / 2
34
    property real   _availableValueHeight: maxHeight - (attitude.height + compass.height)
Don Gagne's avatar
Don Gagne committed
35

36 37 38 39 40
    // Prevent all clicks from going through to lower layers
    DeadMouseArea {
        anchors.fill: parent
    }

Don Gagne's avatar
Don Gagne committed
41
    QGCPalette { id: qgcPal }
42 43

    QGCAttitudeWidget {
44 45 46 47 48 49 50
        id:                   attitude
        anchors.topMargin :   _topBottomMargin
        anchors.bottomMargin: _topBottomMargin
        anchors.top:          parent.top
        size:                 _innerRadius * 2
        vehicle:              activeVehicle
        anchors.horizontalCenter: parent.horizontalCenter
51 52
    }

Don Gagne's avatar
Don Gagne committed
53 54 55
    Item {
        id:                 _valuesItem
        anchors.topMargin:  ScreenTools.defaultFontPixelHeight / 4
56
        anchors.bottomMargin:  ScreenTools.defaultFontPixelHeight / 4
57 58
        anchors.top:        attitude.bottom
        anchors.bottom:     compass.top
Don Gagne's avatar
Don Gagne committed
59 60
        width:              parent.width
        height:             _valuesWidget.height
61
        visible:            showValues
Don Gagne's avatar
Don Gagne committed
62

63 64 65 66 67
        // Prevent all clicks from going through to lower layers
        DeadMouseArea {
            anchors.fill: parent
        }

Don Gagne's avatar
Don Gagne committed
68 69 70 71 72
        Rectangle {
            anchors.fill:   _valuesWidget
            color:          qgcPal.window
        }

73
        PageView {
Don Gagne's avatar
Don Gagne committed
74 75 76 77
            id:                 _valuesWidget
            anchors.margins:    1
            anchors.left:       parent.left
            anchors.right:      parent.right
78
            maxHeight:          _availableValueHeight
Don Gagne's avatar
Don Gagne committed
79 80
        }
    }
81 82 83 84 85 86 87 88 89 90

    QGCCompassWidget {
        id:                         compass
        anchors.bottom :            parent.bottom
        anchors.bottomMargin:       _topBottomMargin
        anchors.topMargin:          _topBottomMargin
        size:                       _innerRadius * 2
        vehicle:                    activeVehicle
        anchors.horizontalCenter:   parent.horizontalCenter
    }
91
}