SurveyItemEditor.qml 21.7 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.Layouts  1.2
5

6
import QGroundControl               1.0
7 8 9 10 11
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
12
import QGroundControl.FlightMap     1.0
13 14 15 16

// Editor for Survery mission items
Rectangle {
    id:         _root
17
    height:     visible ? (editorColumn.height + (_margin * 2)) : 0
18 19 20 21
    width:      availableWidth
    color:      qgcPal.windowShadeDark
    radius:     _radius

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

26 27 28 29 30 31
    property real   _margin:            ScreenTools.defaultFontPixelWidth * 0.25
    property int    _cameraIndex:       1
    property real   _fieldWidth:        ScreenTools.defaultFontPixelWidth * 10.5
    property var    _cameraList:        [ qsTr("Manual Grid (no camera specs)"), qsTr("Custom Camera Grid") ]
    property var    _vehicle:           QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
    property var    _vehicleCameraList: _vehicle.cameraList
Don Gagne's avatar
Don Gagne committed
32 33 34 35 36

    readonly property int _gridTypeManual:          0
    readonly property int _gridTypeCustomCamera:    1
    readonly property int _gridTypeCamera:          2

37 38 39
    Component.onCompleted: {
        for (var i=0; i<_vehicle.cameraList.length; i++) {
            _cameraList.push(_vehicle.cameraList[i].name)
Don Gagne's avatar
Don Gagne committed
40
        }
41
        gridTypeCombo.model = _cameraList
42
        if (missionItem.manualGrid.value) {
43 44
            gridTypeCombo.currentIndex = _gridTypeManual
        } else {
45 46 47 48 49 50
            var index = -1
            for (index=0; index<_cameraList.length; index++) {
                if (_cameraList[index] == missionItem.camera.value) {
                    break;
                }
            }
51 52 53 54 55
            if (index == -1) {
                gridTypeCombo.currentIndex = _gridTypeManual
            } else {
                gridTypeCombo.currentIndex = index
            }
Don Gagne's avatar
Don Gagne committed
56 57
        }
    }
Don Gagne's avatar
Don Gagne committed
58 59

    function recalcFromCameraValues() {
60 61 62 63 64
        var focalLength     = missionItem.cameraFocalLength.rawValue
        var sensorWidth     = missionItem.cameraSensorWidth.rawValue
        var sensorHeight    = missionItem.cameraSensorHeight.rawValue
        var imageWidth      = missionItem.cameraResolutionWidth.rawValue
        var imageHeight     = missionItem.cameraResolutionHeight.rawValue
Don Gagne's avatar
Don Gagne committed
65

66 67 68 69
        var altitude        = missionItem.gridAltitude.rawValue
        var groundResolution= missionItem.groundResolution.rawValue
        var frontalOverlap  = missionItem.frontalOverlap.rawValue
        var sideOverlap     = missionItem.sideOverlap.rawValue
Don Gagne's avatar
Don Gagne committed
70 71

        if (focalLength <= 0 || sensorWidth <= 0 || sensorHeight <= 0 || imageWidth <= 0 || imageHeight <= 0 || groundResolution <= 0) {
Don Gagne's avatar
Don Gagne committed
72 73 74
            return
        }

Don Gagne's avatar
Don Gagne committed
75 76
        var imageSizeSideGround     //size in side (non flying) direction of the image on the ground
        var imageSizeFrontGround    //size in front (flying) direction of the image on the ground
Don Gagne's avatar
Don Gagne committed
77 78
        var gridSpacing
        var cameraTriggerDistance
79

80
        if (missionItem.fixedValueIsAltitude.value) {
81
            groundResolution = (altitude * sensorWidth * 100) / (imageWidth * focalLength)
Don Gagne's avatar
Don Gagne committed
82 83 84
        } else {
            altitude = (imageWidth * groundResolution * focalLength) / (sensorWidth * 100)
        }
85

86
        if (missionItem.cameraOrientationLandscape.value) {
87
            imageSizeSideGround  = (imageWidth  * groundResolution) / 100
Don Gagne's avatar
Don Gagne committed
88
            imageSizeFrontGround = (imageHeight * groundResolution) / 100
Don Gagne's avatar
Don Gagne committed
89
        } else {
90 91
            imageSizeSideGround  = (imageHeight * groundResolution) / 100
            imageSizeFrontGround = (imageWidth  * groundResolution) / 100
Don Gagne's avatar
Don Gagne committed
92 93
        }

94 95 96
        gridSpacing = imageSizeSideGround * ( (100-sideOverlap) / 100 )
        cameraTriggerDistance = imageSizeFrontGround * ( (100-frontalOverlap) / 100 )

97
        if (missionItem.fixedValueIsAltitude.value) {
Don Gagne's avatar
Don Gagne committed
98 99 100 101
            missionItem.groundResolution.rawValue = groundResolution
        } else {
            missionItem.gridAltitude.rawValue = altitude
        }
Don Gagne's avatar
Don Gagne committed
102 103 104 105
        missionItem.gridSpacing.rawValue = gridSpacing
        missionItem.cameraTriggerDistance.rawValue = cameraTriggerDistance
    }

106
    function polygonCaptureStarted() {
Don Gagne's avatar
Don Gagne committed
107
        missionItem.clearPolygon()
108
    }
Don Gagne's avatar
Don Gagne committed
109

110 111 112
    function polygonCaptureFinished(coordinates) {
        for (var i=0; i<coordinates.length; i++) {
            missionItem.addPolygonCoordinate(coordinates[i])
Don Gagne's avatar
Don Gagne committed
113
        }
114
    }
Don Gagne's avatar
Don Gagne committed
115

116 117
    function polygonAdjustVertex(vertexIndex, vertexCoordinate) {
        missionItem.adjustPolygonCoordinate(vertexIndex, vertexCoordinate)
Don Gagne's avatar
Don Gagne committed
118 119
    }

120 121 122
    function polygonAdjustStarted() { }
    function polygonAdjustFinished() { }

Don Gagne's avatar
Don Gagne committed
123 124 125 126 127
    property bool _noCameraValueRecalc: false   ///< Prevents uneeded recalcs

    Connections {
        target: missionItem

128 129 130 131 132
        onIsCurrentItemChanged: {
            if (!missionItem.isCurrentItem) {
                polygonEditor.cancelPolygonEdit()
            }
        }
Don Gagne's avatar
Don Gagne committed
133 134
    }

135 136 137 138 139 140 141 142 143 144
    Connections {
        target: missionItem.camera

        onValueChanged: {
            if (gridTypeCombo.currentIndex >= _gridTypeCustomCamera && !_noCameraValueRecalc) {
                recalcFromCameraValues()
            }
        }
    }

Don Gagne's avatar
Don Gagne committed
145 146 147 148
    Connections {
        target: missionItem.gridAltitude

        onValueChanged: {
149
            if (gridTypeCombo.currentIndex >= _gridTypeCustomCamera && missionItem.fixedValueIsAltitude.value && !_noCameraValueRecalc) {
Don Gagne's avatar
Don Gagne committed
150 151 152 153 154
                recalcFromCameraValues()
            }
        }
    }

155 156
    QGCPalette { id: qgcPal; colorGroupEnabled: true }

Don Gagne's avatar
Don Gagne committed
157
    ExclusiveGroup {
Don Gagne's avatar
Don Gagne committed
158 159 160 161 162 163
        id: cameraOrientationGroup

        onCurrentChanged: {
            if (gridTypeCombo.currentIndex >= _gridTypeCustomCamera) {
                recalcFromCameraValues()
            }
164
        }
Don Gagne's avatar
Don Gagne committed
165 166
    }

Don Gagne's avatar
Don Gagne committed
167 168
    ExclusiveGroup { id: fixedValueGroup }

169 170 171 172 173
    Column {
        id:                 editorColumn
        anchors.margins:    _margin
        anchors.top:        parent.top
        anchors.left:       parent.left
174
        anchors.right:      parent.right
175 176
        spacing:            _margin

Don Gagne's avatar
Don Gagne committed
177 178 179 180
        QGCComboBox {
            id:             gridTypeCombo
            anchors.left:   parent.left
            anchors.right:  parent.right
181
            model:          _cameraList
Don Gagne's avatar
Don Gagne committed
182 183 184 185
            currentIndex:   -1

            onActivated: {
                if (index == _gridTypeManual) {
186
                    missionItem.manualGrid.value = true
187
                } else if (index == _gridTypeCustomCamera) {
188 189
                    missionItem.manualGrid.value = false
                    missionItem.camera.value = gridTypeCombo.textAt(index)
Don Gagne's avatar
Don Gagne committed
190
                } else {
191 192
                    missionItem.manualGrid.value = false
                    missionItem.camera.value = gridTypeCombo.textAt(index)
Don Gagne's avatar
Don Gagne committed
193
                    _noCameraValueRecalc = true
194 195 196 197 198 199
                    var listIndex = index - _gridTypeCamera
                    missionItem.cameraSensorWidth.rawValue      = _vehicleCameraList[listIndex].sensorWidth
                    missionItem.cameraSensorHeight.rawValue     = _vehicleCameraList[listIndex].sensorHeight
                    missionItem.cameraResolutionWidth.rawValue  = _vehicleCameraList[listIndex].imageWidth
                    missionItem.cameraResolutionHeight.rawValue = _vehicleCameraList[listIndex].imageHeight
                    missionItem.cameraFocalLength.rawValue      = _vehicleCameraList[listIndex].focalLength
Don Gagne's avatar
Don Gagne committed
200 201
                    _noCameraValueRecalc = false
                    recalcFromCameraValues()
202 203 204 205
                }
            }
        }

206
        QGCLabel { text: qsTr("Camera"); visible: gridTypeCombo.currentIndex !== _gridTypeManual}
207 208 209 210 211 212 213 214 215

        Rectangle {
            anchors.left:   parent.left
            anchors.right:  parent.right
            height:         1
            color:          qgcPal.text
            visible:        gridTypeCombo.currentIndex !== _gridTypeManual
        }

Don Gagne's avatar
Don Gagne committed
216 217
        // Camera based grid ui
        Column {
Don Gagne's avatar
Don Gagne committed
218
            anchors.left:   parent.left
Don Gagne's avatar
Don Gagne committed
219 220 221
            anchors.right:  parent.right
            spacing:        _margin
            visible:        gridTypeCombo.currentIndex != _gridTypeManual
Don Gagne's avatar
Don Gagne committed
222

Don Gagne's avatar
Don Gagne committed
223 224
            Row {
                spacing: _margin
225
                anchors.horizontalCenter: parent.horizontalCenter
226

Don Gagne's avatar
Don Gagne committed
227 228 229
                QGCRadioButton {
                    width:          _editFieldWidth
                    text:           "Landscape"
230
                    checked:        missionItem.cameraOrientationLandscape.value == 1
Don Gagne's avatar
Don Gagne committed
231
                    exclusiveGroup: cameraOrientationGroup
232
                    onClicked:      missionItem.cameraOrientationLandscape.value = 1
Don Gagne's avatar
Don Gagne committed
233
                }
234

Don Gagne's avatar
Don Gagne committed
235 236 237
                QGCRadioButton {
                    id:             cameraOrientationPortrait
                    text:           "Portrait"
238
                    checked:        missionItem.cameraOrientationLandscape.value == 0
Don Gagne's avatar
Don Gagne committed
239
                    exclusiveGroup: cameraOrientationGroup
240
                    onClicked:      missionItem.cameraOrientationLandscape.value = 0
Don Gagne's avatar
Don Gagne committed
241
                }
242 243
            }

Don Gagne's avatar
Don Gagne committed
244
            Column {
245
                id:             custCameraCol
Don Gagne's avatar
Don Gagne committed
246 247 248
                anchors.left:   parent.left
                anchors.right:  parent.right
                spacing:        _margin
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
                visible:        gridTypeCombo.currentIndex === _gridTypeCustomCamera

                RowLayout {
                    anchors.left:   parent.left
                    anchors.right:  parent.right
                    spacing:        _margin
                    Item { Layout.fillWidth: true }
                    QGCLabel {
                        Layout.preferredWidth:  _root._fieldWidth
                        text:                   qsTr("Width")
                    }
                    QGCLabel {
                        Layout.preferredWidth:  _root._fieldWidth
                        text:                   qsTr("Height")
                    }
                }
Don Gagne's avatar
Don Gagne committed
265

266 267 268 269 270
                RowLayout {
                    anchors.left:   parent.left
                    anchors.right:  parent.right
                    spacing:        _margin
                    QGCLabel { text: qsTr("Sensor:"); Layout.fillWidth: true }
Don Gagne's avatar
Don Gagne committed
271
                    FactTextField {
272
                        Layout.preferredWidth:  _root._fieldWidth
Don Gagne's avatar
Don Gagne committed
273 274 275
                        fact:                   missionItem.cameraSensorWidth
                    }
                    FactTextField {
276
                        Layout.preferredWidth:  _root._fieldWidth
Don Gagne's avatar
Don Gagne committed
277 278
                        fact:                   missionItem.cameraSensorHeight
                    }
279
                }
Don Gagne's avatar
Don Gagne committed
280

281 282 283 284 285
                RowLayout {
                    anchors.left:   parent.left
                    anchors.right:  parent.right
                    spacing:        _margin
                    QGCLabel { text: qsTr("Image:"); Layout.fillWidth: true }
Don Gagne's avatar
Don Gagne committed
286
                    FactTextField {
287
                        Layout.preferredWidth:  _root._fieldWidth
Don Gagne's avatar
Don Gagne committed
288 289 290
                        fact:                   missionItem.cameraResolutionWidth
                    }
                    FactTextField {
291
                        Layout.preferredWidth:  _root._fieldWidth
Don Gagne's avatar
Don Gagne committed
292 293 294 295
                        fact:                   missionItem.cameraResolutionHeight
                    }
                }

296 297 298 299 300 301 302 303 304 305 306 307
                RowLayout {
                    anchors.left:   parent.left
                    anchors.right:  parent.right
                    spacing:        _margin
                    QGCLabel {
                        text:                   missionItem.cameraFocalLength.name + ":"
                        Layout.fillWidth:       true
                    }
                    FactTextField {
                        Layout.preferredWidth:  _root._fieldWidth
                        fact:                   missionItem.cameraFocalLength
                    }
Don Gagne's avatar
Don Gagne committed
308 309
                }

310
            } // Column - custom camera
Don Gagne's avatar
Don Gagne committed
311

312 313 314
            RowLayout {
                anchors.left:   parent.left
                anchors.right:  parent.right
Don Gagne's avatar
Don Gagne committed
315
                spacing:        _margin
316 317 318 319
                Item { Layout.fillWidth: true }
                QGCLabel {
                    Layout.preferredWidth:  _root._fieldWidth
                    text:                   qsTr("Frontal")
Don Gagne's avatar
Don Gagne committed
320 321
                }
                QGCLabel {
322 323
                    Layout.preferredWidth:  _root._fieldWidth
                    text:                   qsTr("Side")
Don Gagne's avatar
Don Gagne committed
324
                }
325
            }
Don Gagne's avatar
Don Gagne committed
326

327 328 329 330 331
            RowLayout {
                anchors.left:   parent.left
                anchors.right:  parent.right
                spacing:        _margin
                QGCLabel { text: qsTr("Overlap:"); Layout.fillWidth: true }
Don Gagne's avatar
Don Gagne committed
332
                FactTextField {
333 334
                    Layout.preferredWidth:  _root._fieldWidth
                    fact:                   missionItem.frontalOverlap
Don Gagne's avatar
Don Gagne committed
335 336
                }
                FactTextField {
337 338
                    Layout.preferredWidth:  _root._fieldWidth
                    fact:                   missionItem.sideOverlap
Don Gagne's avatar
Don Gagne committed
339
                }
Don Gagne's avatar
Don Gagne committed
340 341
            }

342
            QGCLabel { text: qsTr("Grid") }
Don Gagne's avatar
Don Gagne committed
343 344 345 346 347 348

            Rectangle {
                anchors.left:   parent.left
                anchors.right:  parent.right
                height:         1
                color:          qgcPal.text
Don Gagne's avatar
Don Gagne committed
349 350
            }

351
            RowLayout {
Don Gagne's avatar
Don Gagne committed
352 353
                anchors.left:   parent.left
                anchors.right:  parent.right
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
                spacing:        _margin
                QGCLabel {
                    text:                   missionItem.gridAngle.name + ":"
                    Layout.fillWidth:       true
                    anchors.verticalCenter: parent.verticalCenter
                }
                FactTextField {
                    fact:                   missionItem.gridAngle
                    anchors.verticalCenter: parent.verticalCenter
                    Layout.preferredWidth:  _root._fieldWidth
                }
            }

            RowLayout {
                anchors.left:   parent.left
                anchors.right:  parent.right
                spacing:        _margin
                QGCLabel {
                    text:                   missionItem.turnaroundDist.name + ":"
                    Layout.fillWidth:       true
                    anchors.verticalCenter: parent.verticalCenter
                }
                FactTextField {
                    fact:                   missionItem.turnaroundDist
                    anchors.verticalCenter: parent.verticalCenter
                    Layout.preferredWidth:  _root._fieldWidth
                }
Don Gagne's avatar
Don Gagne committed
381 382
            }

Don Gagne's avatar
Don Gagne committed
383 384 385 386 387 388
            QGCLabel {
                anchors.left:   parent.left
                anchors.right:  parent.right
                wrapMode:       Text.WordWrap
                font.pointSize: ScreenTools.smallFontPointSize
                text:           qsTr("Which value would you like to keep constant as you adjust other settings:")
Don Gagne's avatar
Don Gagne committed
389 390
            }

Don Gagne's avatar
Don Gagne committed
391 392 393 394 395 396
            RowLayout {
                anchors.left:   parent.left
                anchors.right:  parent.right
                spacing:        _margin

                QGCRadioButton {
397 398
                    id:                     fixedAltitudeRadio
                    text:                   qsTr("Altitude:")
399
                    checked:                missionItem.fixedValueIsAltitude.value
400
                    exclusiveGroup:         fixedValueGroup
401
                    onClicked:              missionItem.fixedValueIsAltitude.value = 1
402 403
                    Layout.fillWidth:       true
                    anchors.verticalCenter: parent.verticalCenter
Don Gagne's avatar
Don Gagne committed
404
                }
405

Don Gagne's avatar
Don Gagne committed
406
                FactTextField {
407 408 409 410
                    fact:                   missionItem.gridAltitude
                    enabled:                fixedAltitudeRadio.checked
                    Layout.preferredWidth:  _root._fieldWidth
                    anchors.verticalCenter: parent.verticalCenter
411
                }
Don Gagne's avatar
Don Gagne committed
412
            }
Don Gagne's avatar
Don Gagne committed
413

Don Gagne's avatar
Don Gagne committed
414 415 416 417 418 419
            RowLayout {
                anchors.left:   parent.left
                anchors.right:  parent.right
                spacing:        _margin

                QGCRadioButton {
420 421
                    id:                     fixedGroundResolutionRadio
                    text:                   qsTr("Ground res:")
422
                    checked:                !missionItem.fixedValueIsAltitude.value
423
                    exclusiveGroup:         fixedValueGroup
424
                    onClicked:              missionItem.fixedValueIsAltitude.value = 0
425 426
                    Layout.fillWidth:       true
                    anchors.verticalCenter: parent.verticalCenter
427 428
                }

Don Gagne's avatar
Don Gagne committed
429
                FactTextField {
430 431 432 433
                    fact:                   missionItem.groundResolution
                    enabled:                fixedGroundResolutionRadio.checked
                    Layout.preferredWidth:  _root._fieldWidth
                    anchors.verticalCenter: parent.verticalCenter
Don Gagne's avatar
Don Gagne committed
434 435 436 437 438
                }
            }
        }

        // Manual grid ui
439
        Column {
Don Gagne's avatar
Don Gagne committed
440 441 442 443
            anchors.left:   parent.left
            anchors.right:  parent.right
            spacing:        _margin
            visible:        gridTypeCombo.currentIndex == _gridTypeManual
444

445
            QGCLabel { text: qsTr("Grid") }
446

Don Gagne's avatar
Don Gagne committed
447 448 449 450 451
            Rectangle {
                anchors.left:   parent.left
                anchors.right:  parent.right
                height:         1
                color:          qgcPal.text
Don Gagne's avatar
Don Gagne committed
452 453
            }

Don Gagne's avatar
Don Gagne committed
454 455 456
            FactTextFieldGrid {
                anchors.left:   parent.left
                anchors.right:  parent.right
457
                columnSpacing:  _margin * 10
Don Gagne's avatar
Don Gagne committed
458 459 460
                rowSpacing:     _margin
                factList:       [ missionItem.gridAngle, missionItem.gridSpacing, missionItem.gridAltitude, missionItem.turnaroundDist ]
            }
Don Gagne's avatar
Don Gagne committed
461

462
            FactCheckBox {
Don Gagne's avatar
Don Gagne committed
463 464
                anchors.left:   parent.left
                text:           qsTr("Relative altitude")
465
                fact:           missionItem.gridAltitudeRelative
Don Gagne's avatar
Don Gagne committed
466
            }
467

468
            QGCLabel { text: qsTr("Camera") }
469

Don Gagne's avatar
Don Gagne committed
470 471 472 473 474
            Rectangle {
                anchors.left:   parent.left
                anchors.right:  parent.right
                height:         1
                color:          qgcPal.text
Don Gagne's avatar
Don Gagne committed
475 476
            }

Don Gagne's avatar
Don Gagne committed
477 478 479 480 481
            RowLayout {
                anchors.left:   parent.left
                anchors.right:  parent.right
                spacing:        _margin

482
                FactCheckBox {
Don Gagne's avatar
Don Gagne committed
483 484
                    anchors.baseline:   cameraTriggerDistanceField.baseline
                    text:               qsTr("Trigger Distance:")
485
                    fact:               missionItem.cameraTrigger
Don Gagne's avatar
Don Gagne committed
486
                }
Don Gagne's avatar
Don Gagne committed
487

Don Gagne's avatar
Don Gagne committed
488 489 490 491
                FactTextField {
                    id:                 cameraTriggerDistanceField
                    Layout.fillWidth:   true
                    fact:               missionItem.cameraTriggerDistance
492
                    enabled:            missionItem.cameraTrigger.value
Don Gagne's avatar
Don Gagne committed
493
                }
Don Gagne's avatar
Don Gagne committed
494 495 496
            }
        }

497
        QGCLabel { text: qsTr("Polygon") }
Don Gagne's avatar
Don Gagne committed
498

499 500 501 502 503 504 505 506 507
        Rectangle {
            anchors.left:   parent.left
            anchors.right:  parent.right
            height:         1
            color:          qgcPal.text
        }

        Row {
            spacing: ScreenTools.defaultFontPixelWidth
508
            anchors.horizontalCenter: parent.horizontalCenter
509 510

            QGCButton {
511
                width:      _root.width * 0.45
512 513 514
                text:       polygonEditor.drawingPolygon ? qsTr("Finish Draw") : qsTr("Draw")
                visible:    !polygonEditor .adjustingPolygon
                enabled:    ((polygonEditor.drawingPolygon && polygonEditor.polygonReady) || !polygonEditor.drawingPolygon)
515 516

                onClicked: {
517 518
                    if (polygonEditor.drawingPolygon) {
                        polygonEditor.finishCapturePolygon()
519
                    } else {
520
                        polygonEditor.startCapturePolygon()
521
                    }
522 523 524
                }
            }

525
            QGCButton {
526
                width:      _root.width * 0.4
527 528
                text:       polygonEditor.adjustingPolygon ? qsTr("Finish Adjust") : qsTr("Adjust")
                visible:    missionItem.polygonPath.length > 0 && !polygonEditor.drawingPolygon
529

530
                onClicked: {
531 532
                    if (polygonEditor.adjustingPolygon) {
                        polygonEditor.finishAdjustPolygon()
533
                    } else {
534
                        polygonEditor.startAdjustPolygon(missionItem.polygonPath)
535
                    }
536 537 538
                }
            }
        }
539

540
        QGCLabel { text: qsTr("Statistics") }
541 542 543 544 545 546 547 548 549

        Rectangle {
            anchors.left:   parent.left
            anchors.right:  parent.right
            height:         1
            color:          qgcPal.text
        }

        Grid {
550 551
            columns:        2
            columnSpacing:  ScreenTools.defaultFontPixelWidth
552 553 554 555

            QGCLabel { text: qsTr("Survey area:") }
            QGCLabel { text: QGroundControl.squareMetersToAppSettingsAreaUnits(missionItem.coveredArea).toFixed(2) + " " + QGroundControl.appSettingsAreaUnitsString }

556
            QGCLabel { text: qsTr("Photo count:") }
557
            QGCLabel { text: missionItem.cameraShots }
558

559 560 561 562 563 564 565 566 567 568
            QGCLabel { text: qsTr("Photo interval:") }
            QGCLabel {
                text: {
                    var timeVal = missionItem.timeBetweenShots
                    if(!isFinite(timeVal) || missionItem.cameraShots === 0) {
                        return qsTr("N/A")
                    }
                    return timeVal.toFixed(1) + " " + qsTr("secs")
                }
            }
569
        }
570
    }
571 572 573 574 575 576

    PolygonEditor {
        id:             polygonEditor
        map:            editorMap
        callbackObject: parent
    }
577
}