MeasurementAreaEditor.qml 2.6 KB
Newer Older
1 2 3
import QtQuick          2.3
import QtQuick.Controls 1.2
import QtQuick.Layouts  1.2
4

5 6 7 8 9 10 11
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
12

13 14 15 16 17
GridLayout {
    id:                 editorColumn
    columns: 2
    columnSpacing: _margin
    rowSpacing: _margin
18 19
    width:      availableWidth

20 21
    property var geoArea: undefined
    property int availableWidth
22

23
    property real _margin: ScreenTools.defaultFontPixelWidth / 2
24

25 26 27
    Component.onCompleted: {
        console.assert(geoArea !== undefined, "please set the areaItem property")
    }
28

29 30 31 32 33 34
    SectionHeader {
        id:         tilesHeader
        text:       qsTr("Tiles")
        Layout.columnSpan: 2
        Layout.fillWidth: true
    }
35

36 37 38 39 40 41 42 43 44 45 46
    GridLayout{
        visible: tilesHeader.checked
        Layout.fillWidth: true
        Layout.columnSpan: 2
        columnSpacing: _margin
        rowSpacing: _margin
        columns: 2

        QGCLabel {
            text: qsTr("Height")
            Layout.fillWidth:   true
47 48
        }

49 50 51
        FactTextField {
            fact:               geoArea.tileHeight
            Layout.fillWidth:   true
52 53
        }

54 55 56 57
        QGCLabel {
            text: qsTr("Width")
            Layout.fillWidth: true
        }
58

59 60 61 62
        FactTextField {
            fact:               geoArea.tileWidth
            Layout.fillWidth:   true
        }
63

64 65 66 67
        QGCLabel {
            text: qsTr("Min. Area")
            Layout.fillWidth:   true
        }
68

69 70 71 72
        FactTextField {
            fact:               geoArea.minTileArea
            Layout.fillWidth:   true
        }
73

74

75 76 77 78 79
        FactCheckBox {
            text:               qsTr("Show Tiles")
            fact:               geoArea.showTiles
        }
    }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
80 81


82 83 84 85 86 87
    SectionHeader {
        id:     statsHeader
        text:   qsTr("Statistics")
        Layout.fillWidth: true
        Layout.columnSpan: 2
    }
88

89 90 91 92 93 94 95
    GridLayout{
        visible: statsHeader.checked
        Layout.fillWidth: true
        Layout.columnSpan: 2
        columnSpacing: _margin
        rowSpacing: _margin
        columns: 2
96

97 98
        QGCLabel { text: qsTr("Area") }
//        QGCLabel { text: QGroundControl.squareMetersToAppSettingsAreaUnits(geoArea.area).toFixed(2) + " " + QGroundControl.appSettingsAreaUnitsString }
99

100

101 102
        QGCLabel { text: qsTr("Tiles") }
        QGCLabel { text: geoArea.tiles.count }
103

104 105 106 107
        QGCLabel { text: qsTr("Max. Tiles") }
        QGCLabel { text: geoArea.maxTiles }
    }
} // Column