GeoTagPage.qml 4.96 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

    Component {
31
        id:                 pageComponent
Don Gagne's avatar
Don Gagne committed
32 33 34 35 36 37 38

        Column {
            id:         mainColumn
            width:      availableWidth
            spacing:    _margin

            Row {
39
                spacing: ScreenTools.defaultFontPixelWidth * 2
Don Gagne's avatar
Don Gagne committed
40

41 42 43 44
                ProgressBar {
                    id:             progressBar
                    width:          qgcView.width -_margin * 5
                    maximumValue:   100
45
                    value:          geoController.progress
Don Gagne's avatar
Don Gagne committed
46 47
                }

48
                BusyIndicator {
49
                    running:        geoController.progress > 0 && geoController.progress < 100 && geoController.errorMessage === ""
50 51
                    width:          progressBar.height
                    height:         progressBar.height
Don Gagne's avatar
Don Gagne committed
52
                }
53 54 55
            }

            QGCLabel {
56
                text:           geoController.errorMessage
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
                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
72 73 74

                QGCButton {
                    text:       qsTr("Select log file")
75
                    width:      ScreenTools.defaultFontPixelWidth * 30
76
                    onClicked:  geoController.pickLogFile()
77 78 79 80
                    anchors.verticalCenter:   parent.verticalCenter
                }

                QGCLabel {
81
                    text: geoController.logFile
82
                    anchors.verticalCenter:   parent.verticalCenter
Don Gagne's avatar
Don Gagne committed
83 84 85 86 87 88
                }
            }

            Row {
                spacing: _margin

89 90 91
                QGCButton {
                    text:       qsTr("Select image directory")
                    width:      ScreenTools.defaultFontPixelWidth * 30
92
                    onClicked:  geoController.pickImageDirectory()
93
                    anchors.verticalCenter:   parent.verticalCenter
Don Gagne's avatar
Don Gagne committed
94 95 96
                }

                QGCLabel {
97
                    text: geoController.imageDirectory
98
                    anchors.verticalCenter:   parent.verticalCenter
Don Gagne's avatar
Don Gagne committed
99
                }
100 101 102 103
            }

            Row {
                spacing: _margin
Don Gagne's avatar
Don Gagne committed
104 105

                QGCButton {
106 107
                    text:       qsTr("(Optionally) Select save directory")
                    width:      ScreenTools.defaultFontPixelWidth * 30
108
                    onClicked:  geoController.pickSaveDirectory()
109 110 111 112
                    anchors.verticalCenter:   parent.verticalCenter
                }

                QGCLabel {
113
                    text: geoController.saveDirectory !== "" ? geoController.saveDirectory : "/TAGGED folder in your image folder"
114
                    anchors.verticalCenter:   parent.verticalCenter
Don Gagne's avatar
Don Gagne committed
115 116 117
                }
            }

118 119 120 121 122 123 124
            // 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
125 126

            QGCButton {
127
                text: geoController.inProgress ? qsTr("Cancel Tagging") : qsTr("Start Tagging")
128
                width:      ScreenTools.defaultFontPixelWidth * 30
Don Gagne's avatar
Don Gagne committed
129
                onClicked: {
130 131
                    if (geoController.inProgress) {
                        geoController.cancelTagging()
Don Gagne's avatar
Don Gagne committed
132
                    } else {
133
                        geoController.startTagging()
Don Gagne's avatar
Don Gagne committed
134 135 136 137 138 139
                    }
                }
            }
        } // Column
    } // Component
} // AnalyzePage