MultiVehicleList.qml 6.73 KB
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/

10 11 12
import QtQuick          2.3
import QtQuick.Controls 1.2
import QtQuick.Layouts  1.2
13 14 15 16 17 18 19 20

import QGroundControl               1.0
import QGroundControl.ScreenTools   1.0
import QGroundControl.Controls      1.0
import QGroundControl.Palette       1.0
import QGroundControl.Vehicle       1.0
import QGroundControl.FlightMap     1.0

21
Item {
Gus Grubba's avatar
Gus Grubba committed
22
    property var    guidedActionsController
23

24 25 26 27
    property real   _margin:        ScreenTools.defaultFontPixelWidth / 2
    property real   _widgetHeight:  ScreenTools.defaultFontPixelHeight * 3
    property color  _textColor:     "black"
    property real   _rectOpacity:   0.8
28

29
    QGCPalette { id: qgcPal }
30

31
    Rectangle {
32 33 34 35 36 37 38
        id:             mvCommands
        anchors.left:   parent.left
        anchors.right:  parent.right
        height:         mvCommandsColumn.height + (_margin *2)
        color:          qgcPal.missionItemEditor
        opacity:        _rectOpacity
        radius:         _margin
39

40 41 42 43
        DeadMouseArea {
            anchors.fill: parent
        }

44
        Column {
45
            id:                 mvCommandsColumn
46
            anchors.margins:    _margin
47
            anchors.top:        parent.top
48 49 50 51
            anchors.left:       parent.left
            anchors.right:      parent.right
            spacing:            _margin

52
            QGCLabel {
53 54
                anchors.left:   parent.left
                anchors.right:  parent.right
55 56 57 58
                text:           qsTr("The following commands will be applied to all vehicles")
                color:          _textColor
                wrapMode:       Text.WordWrap
                font.pointSize: ScreenTools.smallFontPointSize
59 60 61
            }

            Row {
62
                spacing:            _margin
63 64

                QGCButton {
65 66
                    text:       "Pause"
                    onClicked:  guidedActionsController.confirmAction(guidedActionsController.actionMVPause)
67 68 69
                }

                QGCButton {
70 71
                    text:       "Start Mision"
                    onClicked:  guidedActionsController.confirmAction(guidedActionsController.actionMVStartMission)
72 73 74 75
                }
            }
        }
    }
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109

    QGCListView {
        id:                 missionItemEditorListView
        anchors.left:       parent.left
        anchors.right:      parent.right
        anchors.topMargin:  _margin
        anchors.top:        mvCommands.bottom
        anchors.bottom:     parent.bottom
        spacing:            ScreenTools.defaultFontPixelHeight / 2
        orientation:        ListView.Vertical
        model:              QGroundControl.multiVehicleManager.vehicles
        cacheBuffer:        _cacheBuffer < 0 ? 0 : _cacheBuffer
        clip:               true

        property real _cacheBuffer:     height * 2

        delegate: Rectangle {
            width:      parent.width
            height:     innerColumn.y + innerColumn.height + _margin
            color:      qgcPal.missionItemEditor
            opacity:    _rectOpacity
            radius:     _margin

            property var    _vehicle:   object

            ColumnLayout {
                id:                 innerColumn
                anchors.margins:    _margin
                anchors.top:        parent.top
                anchors.left:       parent.left
                anchors.right:      parent.left
                spacing:            _margin

                RowLayout {
110
                    Layout.fillWidth:       true
111 112 113

                    QGCLabel {
                        Layout.alignment:   Qt.AlignTop
Gus Grubba's avatar
Gus Grubba committed
114
                        text:               _vehicle ? _vehicle.id : ""
115 116 117 118 119 120 121 122
                        color:              _textColor
                    }

                    ColumnLayout {
                        Layout.alignment:   Qt.AlignCenter
                        spacing:            _margin

                        FlightModeMenu {