MockLink.qml 3.27 KB
Newer Older
1 2
/****************************************************************************
 *
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 12 13
import QtQuick          2.11
import QtQuick.Controls 2.4
import QtQuick.Layouts  1.11
14 15 16 17 18 19 20

import QGroundControl               1.0
import QGroundControl.Controls      1.0
import QGroundControl.Palette       1.0
import QGroundControl.ScreenTools   1.0

Rectangle {
Don Gagne's avatar
Don Gagne committed
21 22
    color:          qgcPal.window
    anchors.fill:   parent
23

24 25
    readonly property real _margins: ScreenTools.defaultFontPixelHeight

26 27
    QGCPalette { id: qgcPal; colorGroupEnabled: true }

Don Gagne's avatar
Don Gagne committed
28 29
    QGCFlickable {
        anchors.fill:   parent
30
        contentWidth:   column.width  + (_margins * 2)
31
        contentHeight:  column.height + (_margins * 2)
Don Gagne's avatar
Don Gagne committed
32
        clip:           true
33

34
        ColumnLayout {
Don Gagne's avatar
Don Gagne committed
35
            id:                 column
36
            anchors.margins:    _margins
Don Gagne's avatar
Don Gagne committed
37 38 39 40
            anchors.left:       parent.left
            anchors.top:        parent.top
            spacing:            ScreenTools.defaultFontPixelHeight

41 42 43 44
            QGCCheckBox {
                id:             sendStatusText
                text:           qsTr("Send status text + voice")
            }
Don Gagne's avatar
Don Gagne committed
45
            QGCButton {
46 47 48
                text:               qsTr("PX4 Vehicle")
                Layout.fillWidth:   true
                onClicked:          QGroundControl.startPX4MockLink(sendStatusText.checked)
Don Gagne's avatar
Don Gagne committed
49 50
            }
            QGCButton {
51 52 53 54
                text:               qsTr("APM ArduCopter Vehicle")
                visible:            QGroundControl.hasAPMSupport
                Layout.fillWidth:   true
                onClicked:          QGroundControl.startAPMArduCopterMockLink(sendStatusText.checked)
Don Gagne's avatar
Don Gagne committed
55 56
            }
            QGCButton {
57 58 59 60
                text:               qsTr("APM ArduPlane Vehicle")
                visible:            QGroundControl.hasAPMSupport
                Layout.fillWidth:   true
                onClicked:          QGroundControl.startAPMArduPlaneMockLink(sendStatusText.checked)
Don Gagne's avatar
Don Gagne committed
61
            }
62
            QGCButton {
63 64 65 66
                text:               qsTr("APM ArduSub Vehicle")
                visible:            QGroundControl.hasAPMSupport
                Layout.fillWidth:   true
                onClicked:          QGroundControl.startAPMArduSubMockLink(sendStatusText.checked)
67
            }
Don Gagne's avatar
Don Gagne committed
68
            QGCButton {
69 70 71 72
                text:               qsTr("APM ArduRover Vehicle")
                visible:            QGroundControl.hasAPMSupport
                Layout.fillWidth:   true
                onClicked:          QGroundControl.startAPMArduRoverMockLink(sendStatusText.checked)
Don Gagne's avatar
Don Gagne committed
73
            }
74 75 76 77
            QGCButton {
                text:               qsTr("Generic Vehicle")
                Layout.fillWidth:   true
                onClicked:          QGroundControl.startGenericMockLink(sendStatusText.checked)
Don Gagne's avatar
Don Gagne committed
78 79
            }
            QGCButton {
80 81 82
                text:               qsTr("Stop One MockLink")
                Layout.fillWidth:   true
                onClicked:          QGroundControl.stopOneMockLink()
Don Gagne's avatar
Don Gagne committed
83
            }
84 85 86
        }
    }
}