@ -9,7 +9,8 @@
@@ -9,7 +9,8 @@
import QtQuick 2.3
import QtQuick . Controls 1.2
import QtQuick . Dialogs 1.2
import QtQuick . Dialogs 1.3
import QtQuick . Layouts 1.12
import QGroundControl 1.0
import QGroundControl . Palette 1.0
@ -25,108 +26,148 @@ AnalyzePage {
@@ -25,108 +26,148 @@ AnalyzePage {
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." )
property real _margin : ScreenTools . defaultFontPixelWidth * 2
readonly property real _margin : ScreenTools . defaultFontPixelWidth * 2
readonly property real _minWidth : ScreenTools . defaultFontPixelWidth * 20
readonly property real _maxWidth : ScreenTools . defaultFontPixelWidth * 30
Component {
id: pageComponent
Column {
id: mainColumn
GridLayout {
columns: 3
columnSpacing: _margin
rowSpacing: ScreenTools . defaultFontPixelWidth * 2
width: availableWidth
spacing: _margin
Row {
spacing: ScreenTools . defaultFontPixelWidth * 2
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProgressBar {
id: progressBar
width: geoTagPage . width - _margin * 5
maximumValue: 100
value: geoController . progress
Layout.fillWidth: true
Layout.alignment: Qt . AlignVCenter
Layout.columnSpan: 2
}
BusyIndicator {
running: geoController . progress > 0 && geoController . progress < 100 && geoController . errorMessage === ""
width: progressBar . height
height: progressBar . height
Layout.alignment: Qt . AlignVCenter
}
}
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QGCLabel {
text: geoController . errorMessage
font.bold: true
font.pointSize: ScreenTools . largeFontPointSize
color: "red"
Layout.columnSpan: 3
}
/ / H o r i z o n t a l s p a c e r l i n e
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - H o r i z o n t a l s p a c e r l i n e
Rectangle {
height: 1
width: geoTagPage . width * 1.0
color: qgcPal . windowShadeDark
anchors.horizontalCenter: parent . horizontalCenter
Layout.fillWidth: true
Layout.columnSpan: 3
}
Row {
spacing: _margin
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - L o g F i l e
QGCButton {
text: qsTr ( "Select log file" )
width: ScreenTools . defaultFontPixelWidth * 30
onClicked: geoController . pickLogFile ( )
anchors.verticalCenter: parent . verticalCenter
onClicked: openLogFile . open ( )
Layout.minimumWidth: _minWidth
Layout.maximumWidth: _maxWidth
Layout.fillWidth: true
Layout.alignment: Qt . AlignVCenter
FileDialog {
id: openLogFile
title: qsTr ( "Select log file" )
folder: shortcuts . home
nameFilters: [ qsTr ( "ULog file (*.ulg)" ) , qsTr ( "PX4 log file (*.px4log)" ) , qsTr ( "All Files (*.*)" ) ]
defaultSuffix: "ulg"
selectExisting: true
onAccepted: {
geoController . logFile = openLogFile . fileUrl
close ( )
}
}
}
QGCLabel {
text: geoController . logFile
anchors.verticalCenter: parent . verticalCenter
elide: Text . ElideLeft
Layout.fillWidth: true
Layout.alignment: Qt . AlignVCenter
Layout.columnSpan: 2
}
}
Row {
spacing: _margin
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - I m a g e D i r e c t o r y
QGCButton {
text: qsTr ( "Select image directory" )
width: ScreenTools . defaultFontPixelWidth * 30
onClicked: geoController . pickImageDirectory ( )
anchors.verticalCenter: parent . verticalCenter
onClicked: selectImageDir . open ( )
Layout.minimumWidth: _minWidth
Layout.maximumWidth: _maxWidth
Layout.fillWidth: true
Layout.alignment: Qt . AlignVCenter
FileDialog {
id: selectImageDir
title: qsTr ( "Select image directory" )
folder: shortcuts . home
selectFolder: true
selectExisting: true
onAccepted: {
geoController . imageDirectory = openLogFile . folder
close ( )
}
}
}
QGCLabel {
text: geoController . imageDirectory
anchors.verticalCenter: parent . verticalCenter
elide: Text . ElideLeft
Layout.fillWidth: true
Layout.alignment: Qt . AlignVCenter
Layout.columnSpan: 2
}
}
Row {
spacing: _margin
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - S a v e D i r e c t o r y
QGCButton {
text: qsTr ( "(Optionally) Select save directory" )
width: ScreenTools . defaultFontPixelWidth * 30
onClicked: geoController . pickSaveDirectory ( )
anchors.verticalCenter: parent . verticalCenter
onClicked: selectDestDir . open ( )
Layout.minimumWidth: _minWidth
Layout.maximumWidth: _maxWidth
Layout.fillWidth: true
Layout.alignment: Qt . AlignVCenter
FileDialog {
id: selectDestDir
title: qsTr ( "Select save directory" )
folder: shortcuts . home
selectFolder: true
selectExisting: true
onAccepted: {
geoController . saveDirectory = openLogFile . folder
close ( )
}
}
}
QGCLabel {
text: geoController . saveDirectory !== "" ? geoController.saveDirectory : "/TAGGED folder in your image folder"
anchors.verticalCenter: parent . verticalCenter
}
elide: Text . ElideLeft
Layout.fillWidth: true
Layout.alignment: Qt . AlignVCenter
Layout.columnSpan: 2
}
/ / H o r i z o n t a l s p a c e r l i n e
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - H o r i z o n t a l s p a c e r l i n e
Rectangle {
height: 1
width: geoTagPage . width * 1.0
color: qgcPal . windowShadeDark
anchors.horizontalCenter: parent . horizontalCenter
Layout.fillWidth: true
Layout.columnSpan: 3
}
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - E x e c u t e
QGCButton {
text: geoController . inProgress ? qsTr ( "Cancel Tagging" ) : qsTr ( "Start Tagging" )
width: ScreenTools . defaultFontPixelWidth * 30
Layout.alignment: Qt . AlignHCenter
Layout.columnSpan: 3
onClicked: {
if ( geoController . inProgress ) {
geoController . cancelTagging ( )
@ -135,6 +176,6 @@ AnalyzePage {
@@ -135,6 +176,6 @@ AnalyzePage {
}
}
}
} / / C o l u m n
} / / C o m p o n e n t
} / / A n a l y z e P a g e
}
}
}