diff --git a/src/AnalyzeView/AnalyzeView.qml b/src/AnalyzeView/AnalyzeView.qml index fb1b5e5d1895d64929ec56ceb6068c892d469df2..43905e22899ab80543ff38bdc073353c63a725c4 100644 --- a/src/AnalyzeView/AnalyzeView.qml +++ b/src/AnalyzeView/AnalyzeView.qml @@ -36,6 +36,14 @@ Rectangle { readonly property real _verticalMargin: _defaultTextHeight / 2 readonly property real _buttonWidth: _defaultTextWidth * 18 + GeoTagController { + id: geoController + } + + LogDownloadController { + id: logController + } + MavlinkConsoleController { id: conController } diff --git a/src/AnalyzeView/GeoTagPage.qml b/src/AnalyzeView/GeoTagPage.qml index 7b0102dde8ff89ff67b4f2f239f2f274900ef3df..dbaa678792cba5f29d3c9a91de898843a5e344bd 100644 --- a/src/AnalyzeView/GeoTagPage.qml +++ b/src/AnalyzeView/GeoTagPage.qml @@ -27,10 +27,6 @@ AnalyzePage { property real _margin: ScreenTools.defaultFontPixelWidth * 2 - GeoTagController { - id: controller - } - Component { id: pageComponent @@ -46,18 +42,18 @@ AnalyzePage { id: progressBar width: qgcView.width -_margin * 5 maximumValue: 100 - value: controller.progress + value: geoController.progress } BusyIndicator { - running: controller.progress > 0 && controller.progress < 100 && controller.errorMessage === "" + running: geoController.progress > 0 && geoController.progress < 100 && geoController.errorMessage === "" width: progressBar.height height: progressBar.height } } QGCLabel { - text: controller.errorMessage + text: geoController.errorMessage font.bold: true font.pointSize: ScreenTools.largeFontPointSize color: "red" @@ -77,12 +73,12 @@ AnalyzePage { QGCButton { text: qsTr("Select log file") width: ScreenTools.defaultFontPixelWidth * 30 - onClicked: controller.pickLogFile() + onClicked: geoController.pickLogFile() anchors.verticalCenter: parent.verticalCenter } QGCLabel { - text: controller.logFile + text: geoController.logFile anchors.verticalCenter: parent.verticalCenter } } @@ -93,12 +89,12 @@ AnalyzePage { QGCButton { text: qsTr("Select image directory") width: ScreenTools.defaultFontPixelWidth * 30 - onClicked: controller.pickImageDirectory() + onClicked: geoController.pickImageDirectory() anchors.verticalCenter: parent.verticalCenter } QGCLabel { - text: controller.imageDirectory + text: geoController.imageDirectory anchors.verticalCenter: parent.verticalCenter } } @@ -109,12 +105,12 @@ AnalyzePage { QGCButton { text: qsTr("(Optionally) Select save directory") width: ScreenTools.defaultFontPixelWidth * 30 - onClicked: controller.pickSaveDirectory() + onClicked: geoController.pickSaveDirectory() anchors.verticalCenter: parent.verticalCenter } QGCLabel { - text: controller.saveDirectory != "" ? controller.saveDirectory : "/TAGGED folder in your image folder" + text: geoController.saveDirectory != "" ? geoController.saveDirectory : "/TAGGED folder in your image folder" anchors.verticalCenter: parent.verticalCenter } } @@ -128,13 +124,13 @@ AnalyzePage { } QGCButton { - text: controller.inProgress ? qsTr("Cancel Tagging") : qsTr("Start Tagging") + text: geoController.inProgress ? qsTr("Cancel Tagging") : qsTr("Start Tagging") width: ScreenTools.defaultFontPixelWidth * 30 onClicked: { - if (controller.inProgress) { - controller.cancelTagging() + if (geoController.inProgress) { + geoController.cancelTagging() } else { - controller.startTagging() + geoController.startTagging() } } } diff --git a/src/AnalyzeView/LogDownloadPage.qml b/src/AnalyzeView/LogDownloadPage.qml index 98917c2d318f70b30e56c7041924d152699de32a..dbd642bf67d23935794adbdd706f6ae5262ad89c 100644 --- a/src/AnalyzeView/LogDownloadPage.qml +++ b/src/AnalyzeView/LogDownloadPage.qml @@ -27,20 +27,6 @@ AnalyzePage { property real _margin: ScreenTools.defaultFontPixelWidth property real _butttonWidth: ScreenTools.defaultFontPixelWidth * 10 - LogDownloadController { - id: controller - - onSelectionChanged: { - tableView.selection.clear() - for(var i = 0; i < controller.model.count; i++) { - var o = controller.model.get(i) - if (o && o.selected) { - tableView.selection.select(i, i) - } - } - } - } - QGCPalette { id: palette; colorGroupEnabled: enabled } Component { @@ -50,11 +36,24 @@ AnalyzePage { width: availableWidth height: availableHeight + Connections { + target: logController + onSelectionChanged: { + tableView.selection.clear() + for(var i = 0; i < logController.model.count; i++) { + var o = logController.model.get(i) + if (o && o.selected) { + tableView.selection.select(i, i) + } + } + } + } + TableView { id: tableView anchors.top: parent.top anchors.bottom: parent.bottom - model: controller.model + model: logController.model selectionMode: SelectionMode.MultiSelection Layout.fillWidth: true @@ -65,7 +64,7 @@ AnalyzePage { delegate : Text { horizontalAlignment: Text.AlignHCenter text: { - var o = controller.model.get(styleData.row) + var o = logController.model.get(styleData.row) return o ? o.id : "" } } @@ -77,11 +76,11 @@ AnalyzePage { horizontalAlignment: Text.AlignHCenter delegate : Text { text: { - var o = controller.model.get(styleData.row) + var o = logController.model.get(styleData.row) if (o) { //-- Have we received this entry already? - if(controller.model.get(styleData.row).received) { - var d = controller.model.get(styleData.row).time + if(logController.model.get(styleData.row).received) { + var d = logController.model.get(styleData.row).time if(d.getUTCFullYear() < 2010) return qsTr("Date Unknown") else @@ -100,7 +99,7 @@ AnalyzePage { delegate : Text { horizontalAlignment: Text.AlignRight text: { - var o = controller.model.get(styleData.row) + var o = logController.model.get(styleData.row) return o ? o.sizeStr : "" } } @@ -113,7 +112,7 @@ AnalyzePage { delegate : Text { horizontalAlignment: Text.AlignHCenter text: { - var o = controller.model.get(styleData.row) + var o = logController.model.get(styleData.row) return o ? o.status : "" } } @@ -125,7 +124,7 @@ AnalyzePage { Layout.alignment: Qt.AlignTop | Qt.AlignLeft QGCButton { - enabled: !controller.requestingList && !controller.downloadingLogs + enabled: !logController.requestingList && !logController.downloadingLogs text: qsTr("Refresh") width: _butttonWidth @@ -133,33 +132,33 @@ AnalyzePage { if (!QGroundControl.multiVehicleManager.activeVehicle || QGroundControl.multiVehicleManager.activeVehicle.isOfflineEditingVehicle) { logDownloadPage.showMessage(qsTr("Log Refresh"), qsTr("You must be connected to a vehicle in order to download logs."), StandardButton.Ok) } else { - controller.refresh() + logController.refresh() } } } QGCButton { - enabled: !controller.requestingList && !controller.downloadingLogs && tableView.selection.count > 0 + enabled: !logController.requestingList && !logController.downloadingLogs && tableView.selection.count > 0 text: qsTr("Download") width: _butttonWidth onClicked: { //-- Clear selection - for(var i = 0; i < controller.model.count; i++) { - var o = controller.model.get(i) + for(var i = 0; i < logController.model.count; i++) { + var o = logController.model.get(i) if (o) o.selected = false } //-- Flag selected log files tableView.selection.forEach(function(rowIndex){ - var o = controller.model.get(rowIndex) + var o = logController.model.get(rowIndex) if (o) o.selected = true }) //-- Download them - controller.download() + logController.download() } } QGCButton { - enabled: !controller.requestingList && !controller.downloadingLogs && controller.model.count > 0 + enabled: !logController.requestingList && !logController.downloadingLogs && logController.model.count > 0 text: qsTr("Erase All") width: _butttonWidth onClicked: logDownloadPage.showDialog(eraseAllMessage, @@ -175,7 +174,7 @@ AnalyzePage { function accept() { logDownloadPage.hideDialog() - controller.eraseAll() + logController.eraseAll() } } } @@ -184,8 +183,8 @@ AnalyzePage { QGCButton { text: qsTr("Cancel") width: _butttonWidth - enabled: controller.requestingList || controller.downloadingLogs - onClicked: controller.cancel() + enabled: logController.requestingList || logController.downloadingLogs + onClicked: logController.cancel() } } // Column - Buttons } // RowLayout