Commit ed9e7e27 authored by DonLakeFlyer's avatar DonLakeFlyer

parent 7146e5fe
...@@ -27,23 +27,24 @@ Rectangle { ...@@ -27,23 +27,24 @@ Rectangle {
property real _margin: ScreenTools.defaultFontPixelWidth / 2 property real _margin: ScreenTools.defaultFontPixelWidth / 2
property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 10.5 property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 10.5
property var _vehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle property var _vehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
property real _cameraMinTriggerInterval: missionItem.cameraCalc.minTriggerInterval.rawValue property real _cameraMinTriggerInterval: _missionItem.cameraCalc.minTriggerInterval.rawValue
property bool _polygonDone: false property bool _polygonDone: false
property string _doneAdjusting: qsTr("Done") property string _doneAdjusting: qsTr("Done")
property bool _presetsAvailable: missionItem.presetNames.length !== 0 property var _missionItem: missionItem
property bool _presetsAvailable: _missionItem.presetNames.length !== 0
function polygonCaptureStarted() { function polygonCaptureStarted() {
missionItem.clearPolygon() _missionItem.clearPolygon()
} }
function polygonCaptureFinished(coordinates) { function polygonCaptureFinished(coordinates) {
for (var i=0; i<coordinates.length; i++) { for (var i=0; i<coordinates.length; i++) {
missionItem.addPolygonCoordinate(coordinates[i]) _missionItem.addPolygonCoordinate(coordinates[i])
} }
} }
function polygonAdjustVertex(vertexIndex, vertexCoordinate) { function polygonAdjustVertex(vertexIndex, vertexCoordinate) {
missionItem.adjustPolygonCoordinate(vertexIndex, vertexCoordinate) _missionItem.adjustPolygonCoordinate(vertexIndex, vertexCoordinate)
} }
function polygonAdjustStarted() { } function polygonAdjustStarted() { }
...@@ -63,7 +64,7 @@ Rectangle { ...@@ -63,7 +64,7 @@ Rectangle {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
spacing: _margin spacing: _margin
visible: !missionItem.surveyAreaPolygon.isValid || missionItem.wizardMode visible: !_missionItem.surveyAreaPolygon.isValid || _missionItem.wizardMode
ColumnLayout { ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
...@@ -104,16 +105,16 @@ Rectangle { ...@@ -104,16 +105,16 @@ Rectangle {
text: qsTr("WARNING: Photo interval is below minimum interval (%1 secs) supported by camera.").arg(_cameraMinTriggerInterval.toFixed(1)) text: qsTr("WARNING: Photo interval is below minimum interval (%1 secs) supported by camera.").arg(_cameraMinTriggerInterval.toFixed(1))
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
color: qgcPal.warningText color: qgcPal.warningText
visible: missionItem.cameraShots > 0 && _cameraMinTriggerInterval !== 0 && _cameraMinTriggerInterval > missionItem.timeBetweenShots visible: _missionItem.cameraShots > 0 && _cameraMinTriggerInterval !== 0 && _cameraMinTriggerInterval > _missionItem.timeBetweenShots
} }
CameraCalcGrid { CameraCalcGrid {
cameraCalc: missionItem.cameraCalc cameraCalc: _missionItem.cameraCalc
vehicleFlightIsFrontal: true vehicleFlightIsFrontal: true
distanceToSurfaceLabel: qsTr("Altitude") distanceToSurfaceLabel: qsTr("Altitude")
distanceToSurfaceAltitudeMode: missionItem.followTerrain ? distanceToSurfaceAltitudeMode: _missionItem.followTerrain ?
QGroundControl.AltitudeModeAboveTerrain : QGroundControl.AltitudeModeAboveTerrain :
(missionItem.cameraCalc.distanceToSurfaceRelative ? QGroundControl.AltitudeModeRelative : QGroundControl.AltitudeModeAbsolute) (_missionItem.cameraCalc.distanceToSurfaceRelative ? QGroundControl.AltitudeModeRelative : QGroundControl.AltitudeModeAbsolute)
frontalDistanceLabel: qsTr("Trigger Dist") frontalDistanceLabel: qsTr("Trigger Dist")
sideDistanceLabel: qsTr("Spacing") sideDistanceLabel: qsTr("Spacing")
} }
...@@ -135,9 +136,9 @@ Rectangle { ...@@ -135,9 +136,9 @@ Rectangle {
QGCLabel { text: qsTr("Angle") } QGCLabel { text: qsTr("Angle") }
FactTextField { FactTextField {
fact: missionItem.gridAngle fact: _missionItem.gridAngle
Layout.fillWidth: true Layout.fillWidth: true
onUpdated: angleSlider.value = missionItem.gridAngle.value onUpdated: angleSlider.value = _missionItem.gridAngle.value
} }
QGCSlider { QGCSlider {
...@@ -149,8 +150,8 @@ Rectangle { ...@@ -149,8 +150,8 @@ Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 1.5 Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 1.5
onValueChanged: missionItem.gridAngle.value = value onValueChanged: _missionItem.gridAngle.value = value
Component.onCompleted: value = missionItem.gridAngle.value Component.onCompleted: value = _missionItem.gridAngle.value
updateValueWhileDragging: true updateValueWhileDragging: true
} }
...@@ -158,14 +159,14 @@ Rectangle { ...@@ -158,14 +159,14 @@ Rectangle {
text: qsTr("Turnaround dist") text: qsTr("Turnaround dist")
} }
FactTextField { FactTextField {
fact: missionItem.turnAroundDistance fact: _missionItem.turnAroundDistance
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
QGCButton { QGCButton {
text: qsTr("Rotate Entry Point") text: qsTr("Rotate Entry Point")
onClicked: missionItem.rotateEntryPoint(); onClicked: _missionItem.rotateEntryPoint();
} }
ColumnLayout { ColumnLayout {
...@@ -180,40 +181,40 @@ Rectangle { ...@@ -180,40 +181,40 @@ Rectangle {
model: [ model: [
{ {
text: qsTr("Hover and capture image"), text: qsTr("Hover and capture image"),
fact: missionItem.hoverAndCapture, fact: _missionItem.hoverAndCapture,
enabled: !missionItem.followTerrain, enabled: !_missionItem.followTerrain,
visible: missionItem.hoverAndCaptureAllowed visible: _missionItem.hoverAndCaptureAllowed
}, },
{ {
text: qsTr("Refly at 90 deg offset"), text: qsTr("Refly at 90 deg offset"),
fact: missionItem.refly90Degrees, fact: _missionItem.refly90Degrees,
enabled: !missionItem.followTerrain, enabled: !_missionItem.followTerrain,
visible: true visible: true
}, },
{ {
text: qsTr("Images in turnarounds"), text: qsTr("Images in turnarounds"),
fact: missionItem.cameraTriggerInTurnAround, fact: _missionItem.cameraTriggerInTurnAround,
enabled: missionItem.hoverAndCaptureAllowed ? !missionItem.hoverAndCapture.rawValue : true, enabled: _missionItem.hoverAndCaptureAllowed ? !_missionItem.hoverAndCapture.rawValue : true,
visible: true visible: true
}, },
{ {
text: qsTr("Fly alternate transects"), text: qsTr("Fly alternate transects"),
fact: missionItem.flyAlternateTransects, fact: _missionItem.flyAlternateTransects,
enabled: true, enabled: true,
visible: _vehicle ? (_vehicle.fixedWing || _vehicle.vtol) : false visible: _vehicle ? (_vehicle.fixedWing || _vehicle.vtol) : false
}, },
{ {
text: qsTr("Relative altitude"), text: qsTr("Relative altitude"),
enabled: missionItem.cameraCalc.isManualCamera && !missionItem.followTerrain, enabled: _missionItem.cameraCalc.isManualCamera && !_missionItem.followTerrain,
visible: QGroundControl.corePlugin.options.showMissionAbsoluteAltitude || (!missionItem.cameraCalc.distanceToSurfaceRelative && !missionItem.followTerrain), visible: QGroundControl.corePlugin.options.showMissionAbsoluteAltitude || (!_missionItem.cameraCalc.distanceToSurfaceRelative && !_missionItem.followTerrain),
checked: missionItem.cameraCalc.distanceToSurfaceRelative checked: _missionItem.cameraCalc.distanceToSurfaceRelative
} }
] ]
onItemClicked: { onItemClicked: {
if (index == 4) { if (index == 4) {
missionItem.cameraCalc.distanceToSurfaceRelative = !missionItem.cameraCalc.distanceToSurfaceRelative _missionItem.cameraCalc.distanceToSurfaceRelative = !_missionItem.cameraCalc.distanceToSurfaceRelative
console.log(missionItem.cameraCalc.distanceToSurfaceRelative) console.log(_missionItem.cameraCalc.distanceToSurfaceRelative)
} }
} }
} }
...@@ -241,7 +242,7 @@ Rectangle { ...@@ -241,7 +242,7 @@ Rectangle {
visible: tabBar.currentIndex === 1 visible: tabBar.currentIndex === 1
CameraCalcCamera { CameraCalcCamera {
cameraCalc: missionItem.cameraCalc cameraCalc: _missionItem.cameraCalc
} }
} // Camera Column } // Camera Column
...@@ -251,6 +252,7 @@ Rectangle { ...@@ -251,6 +252,7 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
spacing: _margin spacing: _margin
visible: tabBar.currentIndex === 2 visible: tabBar.currentIndex === 2
missionItem: _missionItem
} }
// Presets Tab // Presets Tab
...@@ -269,7 +271,7 @@ Rectangle { ...@@ -269,7 +271,7 @@ Rectangle {
QGCComboBox { QGCComboBox {
id: presetCombo id: presetCombo
Layout.fillWidth: true Layout.fillWidth: true
model: missionItem.presetNames model: _missionItem.presetNames
} }
RowLayout { RowLayout {
...@@ -278,14 +280,14 @@ Rectangle { ...@@ -278,14 +280,14 @@ Rectangle {
QGCButton { QGCButton {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Apply Preset") text: qsTr("Apply Preset")
enabled: missionItem.presetNames.length != 0 enabled: _missionItem.presetNames.length != 0
onClicked: missionItem.loadPreset(presetCombo.textAt(presetCombo.currentIndex)) onClicked: _missionItem.loadPreset(presetCombo.textAt(presetCombo.currentIndex))
} }
QGCButton { QGCButton {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Delete Preset") text: qsTr("Delete Preset")
enabled: missionItem.presetNames.length != 0 enabled: _missionItem.presetNames.length != 0
onClicked: mainWindow.showComponentDialog(deletePresetMessage, qsTr("Delete Preset"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) onClicked: mainWindow.showComponentDialog(deletePresetMessage, qsTr("Delete Preset"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No)
Component { Component {
...@@ -294,7 +296,7 @@ Rectangle { ...@@ -294,7 +296,7 @@ Rectangle {
message: qsTr("Are you sure you want to delete '%1' preset?").arg(presetName) message: qsTr("Are you sure you want to delete '%1' preset?").arg(presetName)
property string presetName: presetCombo.textAt(presetCombo.currentIndex) property string presetName: presetCombo.textAt(presetCombo.currentIndex)
function accept() { function accept() {
missionItem.deletePreset(presetName) _missionItem.deletePreset(presetName)
hideDialog() hideDialog()
} }
} }
...@@ -326,9 +328,9 @@ Rectangle { ...@@ -326,9 +328,9 @@ Rectangle {
QGCLabel { text: qsTr("Angle") } QGCLabel { text: qsTr("Angle") }
FactTextField { FactTextField {
fact: missionItem.gridAngle fact: _missionItem.gridAngle
Layout.fillWidth: true Layout.fillWidth: true
onUpdated: presetsAngleSlider.value = missionItem.gridAngle.value onUpdated: presetsAngleSlider.value = _missionItem.gridAngle.value
} }
QGCSlider { QGCSlider {
...@@ -340,8 +342,8 @@ Rectangle { ...@@ -340,8 +342,8 @@ Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 1.5 Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 1.5
onValueChanged: missionItem.gridAngle.value = value onValueChanged: _missionItem.gridAngle.value = value
Component.onCompleted: value = missionItem.gridAngle.value Component.onCompleted: value = _missionItem.gridAngle.value
updateValueWhileDragging: true updateValueWhileDragging: true
} }
...@@ -349,7 +351,7 @@ Rectangle { ...@@ -349,7 +351,7 @@ Rectangle {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Rotate Entry Point") text: qsTr("Rotate Entry Point")
onClicked: missionItem.rotateEntryPoint(); onClicked: _missionItem.rotateEntryPoint();
} }
} }
...@@ -372,7 +374,7 @@ Rectangle { ...@@ -372,7 +374,7 @@ Rectangle {
QGCViewDialog { QGCViewDialog {
function accept() { function accept() {
if (presetNameField.text != "") { if (presetNameField.text != "") {
missionItem.savePreset(presetNameField.text) _missionItem.savePreset(presetNameField.text)
hideDialog() hideDialog()
} }
} }
...@@ -407,9 +409,9 @@ Rectangle { ...@@ -407,9 +409,9 @@ Rectangle {
selectExisting: true selectExisting: true
onAcceptedForLoad: { onAcceptedForLoad: {
missionItem.surveyAreaPolygon.loadKMLOrSHPFile(file) _missionItem.surveyAreaPolygon.loadKMLOrSHPFile(file)
missionItem.resetState = false _missionItem.resetState = false
//editorMap.mapFitFunctions.fitMapViewportToMissionItems() //editorMap.mapFitFunctions.fitMapViewportTo_missionItems()
close() close()
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment