SurveyItemEditor.qml 17.4 KB
Newer Older
1 2
import QtQuick          2.3
import QtQuick.Controls 1.2
Don Gagne's avatar
Don Gagne committed
3
import QtQuick.Dialogs  1.2
4
import QtQuick.Extras   1.4
5
import QtQuick.Layouts  1.2
6

7
import QGroundControl               1.0
8 9 10
import QGroundControl.ScreenTools   1.0
import QGroundControl.Vehicle       1.0
import QGroundControl.Controls      1.0
11
import QGroundControl.FactSystem    1.0
12 13
import QGroundControl.FactControls  1.0
import QGroundControl.Palette       1.0
14
import QGroundControl.FlightMap     1.0
15 16 17

Rectangle {
    id:         _root
18
    height:     visible ? (editorColumn.height + (_margin * 2)) : 0
19 20 21 22
    width:      availableWidth
    color:      qgcPal.windowShadeDark
    radius:     _radius

Ricardo de Almeida Gonzaga's avatar
Ricardo de Almeida Gonzaga committed
23
    // The following properties must be available up the hierarchy chain
24 25 26
    //property real   availableWidth    ///< Width for control
    //property var    missionItem       ///< Mission Item for editor

27 28 29
    property real   _margin:                    ScreenTools.defaultFontPixelWidth / 2
    property real   _fieldWidth:                ScreenTools.defaultFontPixelWidth * 10.5
    property var    _vehicle:                   QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
30
    property real   _cameraMinTriggerInterval:  _missionItem.cameraCalc.minTriggerInterval.rawValue
31
    property bool   _polygonDone:               false
DoinLakeFlyer's avatar
DoinLakeFlyer committed
32
    property string _doneAdjusting:             qsTr("Done")
33 34
    property var    _missionItem:               missionItem
    property bool   _presetsAvailable:          _missionItem.presetNames.length !== 0
Don Gagne's avatar
Don Gagne committed
35

36
    function polygonCaptureStarted() {
37
        _missionItem.clearPolygon()
38
    }
Don Gagne's avatar
Don Gagne committed
39

40 41
    function polygonCaptureFinished(coordinates) {
        for (var i=0; i<coordinates.length; i++) {
42
            _missionItem.addPolygonCoordinate(coordinates[i])
Don Gagne's avatar
Don Gagne committed
43
        }
44
    }
Don Gagne's avatar
Don Gagne committed
45

46
    function polygonAdjustVertex(vertexIndex, vertexCoordinate) {
47
        _missionItem.adjustPolygonCoordinate(vertexIndex, vertexCoordinate)
Don Gagne's avatar
Don Gagne committed
48 49
    }

50 51 52
    function polygonAdjustStarted() { }
    function polygonAdjustFinished() { }

53 54 55 56 57 58 59
    QGCPalette { id: qgcPal; colorGroupEnabled: true }

    Column {
        id:                 editorColumn
        anchors.margins:    _margin
        anchors.top:        parent.top
        anchors.left:       parent.left
60
        anchors.right:      parent.right
61

62
        ColumnLayout {
63
            id:             wizardColumn
64 65
            anchors.left:   parent.left
            anchors.right:  parent.right
66
            spacing:        _margin
67
            visible:        !_missionItem.surveyAreaPolygon.isValid || _missionItem.wizardMode
68

69
            ColumnLayout {
70
                Layout.fillWidth:   true
71 72