MissionItemStatus.qml 3.11 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
9

10 11 12
import QtQuick          2.3
import QtQuick.Controls 1.2
import QtQuick.Layouts  1.2
13

14
import QGroundControl               1.0
15 16 17
import QGroundControl.ScreenTools   1.0
import QGroundControl.Controls      1.0
import QGroundControl.Palette       1.0
18 19
import QGroundControl.FactSystem    1.0
import QGroundControl.FactControls  1.0
20 21

Rectangle {
22
    height:     ScreenTools.defaultFontPixelHeight * 7
23
    radius:     ScreenTools.defaultFontPixelWidth * 0.5
24 25 26 27
    color:      qgcPal.window
    opacity:    0.80
    clip:       true

28
    property var missionItems                ///< List of all available mission items
29

30
    readonly property real _margins: ScreenTools.defaultFontPixelWidth
31

32
    QGCPalette { id: qgcPal }
33

34 35 36 37 38 39 40 41 42
    QGCLabel {
        id:                     label
        anchors.top:            parent.bottom
        width:                  parent.height
        text:                   qsTr("Altitude")
        horizontalAlignment:    Text.AlignHCenter
        rotation:               -90
        transformOrigin:        Item.TopLeft
    }
43

44 45 46
    QGCListView {
        id:                     statusListView
        anchors.margins:        _margins
47 48 49 50 51
        anchors.top:            parent.top
        anchors.bottom:         parent.bottom
        anchors.leftMargin:     ScreenTools.defaultFontPixelHeight
        anchors.left:           parent.left
        anchors.right:          parent.right
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
        model:                  missionItems
        highlightMoveDuration:  250
        orientation:            ListView.Horizontal
        spacing:                0
        clip:                   true
        currentIndex:           _currentMissionIndex

        delegate: Item {
            height:     statusListView.height
            width:      display ? (indicator.width + spacing)  : 0
            visible:    display

            property real availableHeight:  height - indicator.height
            property bool graphAbsolute:    true
            readonly property bool display: object.specifiesCoordinate && !object.isStandaloneCoordinate
            readonly property real spacing: ScreenTools.defaultFontPixelWidth * ScreenTools.smallFontPointRatio

            MissionItemIndexLabel {
                id:                         indicator
                anchors.horizontalCenter:   parent.horizontalCenter
                y:                          availableHeight - (availableHeight * object.altPercent)
                small:                      true
                checked:                    object.isCurrentItem
75 76
                label:                      object.abbreviation.charAt(0)
                index:                      object.sequenceNumber
77
                visible:                    object.relativeAltitude ? true : (object.homePosition || graphAbsolute)
78 79 80 81
            }
        }
    }
}
82

83