WimaGlobalMeasurementPolygonEditor.qml 3.84 KB
Newer Older
1 2 3 4 5 6
import QtQuick          2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs  1.2
import QtQuick.Extras   1.4
import QtQuick.Layouts  1.2
7

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

16 17 18 19 20 21 22 23 24 25
// Editor for Operating Area items
Rectangle {
    id:         _root
    height:     visible ? (editorColumn.height + (_margin * 2)) : 0
    width:      availableWidth
    color:      qgcPal.windowShadeDark
    radius:     _radius

    // The following properties must be available up the hierarchy chain
    //property real   availableWidth    ///< Width for control
Valentin Platzgummer's avatar
Valentin Platzgummer committed
26
    //property var    areaItem       ///< Mission Item for editor
27 28 29

    property real   _margin:                    ScreenTools.defaultFontPixelWidth / 2
    property real   _fieldWidth:                ScreenTools.defaultFontPixelWidth * 10.5
Valentin Platzgummer's avatar
Valentin Platzgummer committed
30 31 32 33 34 35 36 37
    property var    polyline:                   areaItem.polyline
    property var    operatingPolygon:           areaItem.polygon
    property bool   initNecesarry:              true

    function editPolyline(){
        polyline.setInteractive(true);
    }

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52



    QGCPalette { id: qgcPal; colorGroupEnabled: true }

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

        SectionHeader {
            id:         scanHeader
Valentin Platzgummer's avatar
Valentin Platzgummer committed
53
            text:       qsTr("Settings")
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
        }

        Column {
            anchors.left:   parent.left
            anchors.right:  parent.right
            spacing:        _margin
            visible:        scanHeader.checked

            GridLayout {
                anchors.left:   parent.left
                anchors.right:  parent.right
                columnSpacing:  _margin
                rowSpacing:     _margin
                columns:        2

                QGCLabel {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
70
                    text:       qsTr("Bottom Layer Altitude")
71 72
                }
                FactTextField {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
73
                    fact:               areaItem.bottomLayerAltitude
74 75 76
                    Layout.fillWidth:   true
                }

Valentin Platzgummer's avatar
Valentin Platzgummer committed
77
                QGCLabel { text: qsTr("Number of Layers") }
78
                FactTextField {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
79
                    fact:               areaItem.numberOfLayers
80 81 82
                    Layout.fillWidth:   true
                }

Valentin Platzgummer's avatar
Valentin Platzgummer committed
83
                QGCLabel { text: qsTr("Layer Distance") }
84
                FactTextField {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
85
                    fact:               areaItem.layerDistance
86 87
                    Layout.fillWidth:   true
                }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
88 89


90 91 92 93 94 95 96
            }

            Item {
                height: ScreenTools.defaultFontPixelHeight / 2
                width:  1
            }
        } // Column - Scan
Valentin Platzgummer's avatar
Valentin Platzgummer committed
97 98 99 100 101 102 103 104 105 106 107 108 109 110
        SectionHeader {
            id:         polylineHeader
            text:       qsTr("Gateway Poly Line")
        }

        QGCButton {
            id:                     polylineEditor
            anchors.topMargin:      _margin / 2
            anchors.leftMargin:     ScreenTools.defaultFontPixelWidth * 2
            anchors.rightMargin:    ScreenTools.defaultFontPixelWidth
            text:                   "Edit Polyline"

            onClicked: editPolyline()
        }
111 112 113 114 115 116 117 118 119 120 121

        SectionHeader {
            id:     statsHeader
            text:   qsTr("Statistics")
        }

        Grid {
            columns:        2
            columnSpacing:  ScreenTools.defaultFontPixelWidth
            visible:        statsHeader.checked

Valentin Platzgummer's avatar
Valentin Platzgummer committed
122 123
            /*QGCLabel { text: qsTr("Layers") }
            QGCLabel { text: areaItem.layers.valueString }*/
124

Valentin Platzgummer's avatar
Valentin Platzgummer committed
125
            }
126 127
    } // Column
} // Rectangle