GeoTagPage.qml 4.97 KB
Newer Older
Don Gagne's avatar
Don Gagne committed
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

10 11
import QtQuick          2.3
import QtQuick.Controls 1.2
Don Gagne's avatar
Don Gagne committed
12 13
import QtQuick.Dialogs  1.2

14
import QGroundControl               1.0
Don Gagne's avatar
Don Gagne committed
15
import QGroundControl.Palette       1.0
16 17
import QGroundControl.FactSystem    1.0
import QGroundControl.FactControls  1.0
Don Gagne's avatar
Don Gagne committed
18 19 20 21 22 23 24
import QGroundControl.Controls      1.0
import QGroundControl.ScreenTools   1.0
import QGroundControl.Controllers   1.0

AnalyzePage {
    id:                 geoTagPage
    pageComponent:      pageComponent
25 26
    pageName:           qsTr("GeoTag Images")
    pageDescription:    qsTr("GeoTag Images is used to tag a set of images from a survey mission with gps coordinates. You must provide the binary log from the flight as well as the directory which contains the images to tag.")
Don Gagne's avatar
Don Gagne committed
27

28
    property real _margin: ScreenTools.defaultFontPixelWidth * 2
Don Gagne's avatar
Don Gagne committed
29 30 31 32 33 34

    GeoTagController {
        id: controller
    }

    Component {
35
        id:                 pageComponent
Don Gagne's avatar
Don Gagne committed
36 37 38 39 40 41 42

        Column {
            id:         mainColumn
            width:      availableWidth
            spacing:    _margin

            Row {
43
                spacing: ScreenTools.defaultFontPixelWidth * 2
Don Gagne's avatar
Don Gagne committed
44

45 46 47 48 49
                ProgressBar {
                    id:             progressBar
                    width:          qgcView.width -_margin * 5
                    maximumValue:   100
                    value:          controller.progress
Don Gagne's avatar
Don Gagne committed
50 51
                }

52 53 54 55
                BusyIndicator {
                    running:        controller.progress > 0 && controller.progress < 100 && controller.errorMessage === ""
                    width:          progressBar.height
                    height:         progressBar.height
Don Gagne's avatar
Don Gagne committed
56
                }
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
            }

            QGCLabel {
                text:           controller.errorMessage
                font.bold:      true
                font.pointSize: ScreenTools.largeFontPointSize
                color:          "red"
            }

            // Horizontal spacer line
            Rectangle {
              height:                     1
              width:                      qgcView.width * 1.0
              color:                      qgcPal.windowShadeDark
              anchors.horizontalCenter:   parent.horizontalCenter
            }

            Row {
                spacing: _margin
Don Gagne's avatar
Don Gagne committed
76 77 78

                QGCButton {
                    text:       qsTr("Select log file")
79
                    width:      ScreenTools.defaultFontPixelWidth * 30
Don Gagne's avatar
Don Gagne committed
80
                    onClicked:  controller.pickLogFile()
81 82 83 84 85 86
                    anchors.verticalCenter:   parent.verticalCenter
                }

                QGCLabel {
                    text: controller.logFile
                    anchors.verticalCenter:   parent.verticalCenter
Don Gagne's avatar
Don Gagne committed
87 88 89 90 91 92
                }
            }

            Row {
                spacing: _margin

93 94 95 96 97
                QGCButton {
                    text:       qsTr("Select image directory")
                    width:      ScreenTools.defaultFontPixelWidth * 30
                    onClicked:  controller.pickImageDirectory()
                    anchors.verticalCenter:   parent.verticalCenter
Don Gagne's avatar
Don Gagne committed
98 99 100 101
                }

                QGCLabel {
                    text: controller.imageDirectory
102
                    anchors.verticalCenter:   parent.verticalCenter
Don Gagne's avatar
Don Gagne committed
103
                }
104 105 106 107
            }

            Row {
                spacing: _margin
Don Gagne's avatar
Don Gagne committed
108 109

                QGCButton {
110 111 112 113 114 115 116 117 118
                    text:       qsTr("(Optionally) Select save directory")
                    width:      ScreenTools.defaultFontPixelWidth * 30
                    onClicked:  controller.pickSaveDirectory()
                    anchors.verticalCenter:   parent.verticalCenter
                }

                QGCLabel {
                    text: controller.saveDirectory != "" ? controller.saveDirectory : "/TAGGED folder in your image folder"
                    anchors.verticalCenter:   parent.verticalCenter
Don Gagne's avatar
Don Gagne committed
119 120 121
                }
            }

122 123 124 125 126 127 128
            // Horizontal spacer line
            Rectangle {
              height:                     1
              width:                      qgcView.width * 1.0
              color:                      qgcPal.windowShadeDark
              anchors.horizontalCenter:   parent.horizontalCenter
            }
Don Gagne's avatar
Don Gagne committed
129 130 131

            QGCButton {
                text: controller.inProgress ? qsTr("Cancel Tagging") : qsTr("Start Tagging")
132
                width:      ScreenTools.defaultFontPixelWidth * 30
Don Gagne's avatar
Don Gagne committed
133 134 135 136 137 138 139 140 141 142 143
                onClicked: {
                    if (controller.inProgress) {
                        controller.cancelTagging()
                    } else {
                        controller.startTagging()
                    }
                }
            }
        } // Column
    } // Component
} // AnalyzePage