MeasurementAreaEditor.qml 2.64 KB
Newer Older
1
import QtQuick 2.3
2
import QtQuick.Controls 1.2
3
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
GridLayout {
14
    id: editorColumn
15 16 17
    columns: 2
    columnSpacing: _margin
    rowSpacing: _margin
18
    width: availableWidth
19

20 21
    property var geoArea: undefined
    property int availableWidth
22

23
    property real _margin: ScreenTools.defaultFontPixelWidth / 2
24

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

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

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

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

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

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

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

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

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

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

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

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

96 97 98 99 100 101 102 103
        QGCLabel {
            text: qsTr("Area")
        }
        QGCLabel {
            text: QGroundControl.unitsConversion.squareMetersToAppSettingsAreaUnits(
                      geoArea.area).toFixed(
                      2) + " " + QGroundControl.unitsConversion.appSettingsAreaUnitsString
        }
104

105 106 107 108 109 110
        QGCLabel {
            text: qsTr("Tiles")
        }
        QGCLabel {
            text: geoArea.tiles.count
        }
111

112 113 114 115 116 117
        QGCLabel {
            text: qsTr("Max. Tiles")
        }
        QGCLabel {
            text: geoArea.maxTiles
        }
118 119
    }
} // Column