From f30a8f288599e74fe6c2909df00fc85c2a140fd8 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Mon, 15 Jun 2020 10:33:59 -0700 Subject: [PATCH] Use new Transect common controls --- src/PlanView/SurveyItemEditor.qml | 176 +++--------------------------- 1 file changed, 15 insertions(+), 161 deletions(-) diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml index 805384714..4c2dc9945 100644 --- a/src/PlanView/SurveyItemEditor.qml +++ b/src/PlanView/SurveyItemEditor.qml @@ -76,108 +76,7 @@ Rectangle { horizontalAlignment: Text.AlignHCenter text: qsTr("Use the Polygon Tools to create the polygon which outlines your survey area.") } - - /* - Trial of new "done" model so leaving for now in case it comes back - QGCButton { - text: qsTr("Done With Polygon") - Layout.fillWidth: true - enabled: missionItem.surveyAreaPolygon.isValid && !missionItem.surveyAreaPolygon.traceMode - onClicked: { - if (!_presetsAvailable) { - missionItem.wizardMode = false - // Trial of no auto select next item - //editorRoot.selectNextNotReadyItem() - } - _polygonDone = true - } - } - */ - } - - /* - Trial of new "done" model so leaving for now in case it comes back - ColumnLayout { - Layout.fillWidth: true - spacing: _margin - visible: _polygonDone - - QGCLabel { - Layout.fillWidth: true - wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignHCenter - text: qsTr("Apply a Preset or click %1 for manual setup.").arg(_doneAdjusting) - } - - QGCComboBox { - id: wizardPresetCombo - Layout.fillWidth: true - model: missionItem.presetNames - } - - QGCButton { - Layout.fillWidth: true - text: qsTr("Apply Preset") - enabled: missionItem.presetNames.length != 0 - onClicked: missionItem.loadPreset(wizardPresetCombo.textAt(wizardPresetCombo.currentIndex)) - } - - SectionHeader { - id: wizardPresectsTransectsHeader - Layout.fillWidth: true - text: qsTr("Transects") - } - - GridLayout { - Layout.fillWidth: true - columnSpacing: _margin - rowSpacing: _margin - columns: 2 - visible: wizardPresectsTransectsHeader.checked - - QGCLabel { text: qsTr("Angle") } - FactTextField { - fact: missionItem.gridAngle - Layout.fillWidth: true - onUpdated: wizardPresetsAngleSlider.value = missionItem.gridAngle.value - } - - QGCSlider { - id: wizardPresetsAngleSlider - minimumValue: 0 - maximumValue: 359 - stepSize: 1 - tickmarksEnabled: false - Layout.fillWidth: true - Layout.columnSpan: 2 - Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 1.5 - onValueChanged: missionItem.gridAngle.value = value - Component.onCompleted: value = missionItem.gridAngle.value - updateValueWhileDragging: true - } - - QGCButton { - Layout.columnSpan: 2 - Layout.fillWidth: true - text: qsTr("Rotate Entry Point") - onClicked: missionItem.rotateEntryPoint(); - } - } - - Item { height: ScreenTools.defaultFontPixelHeight; width: 1 } - - QGCButton { - text: _doneAdjusting - Layout.fillWidth: true - enabled: missionItem.surveyAreaPolygon.isValid - onClicked: { - missionItem.wizardMode = false - // Trial of no auto select next item - //editorRoot.selectNextNotReadyItem() - } - } } - */ } Column { @@ -186,23 +85,18 @@ Rectangle { spacing: _margin visible: !wizardColumn.visible - QGCTabBar { + TransectStyleComplexItemTabBar { id: tabBar anchors.left: parent.left anchors.right: parent.right - - Component.onCompleted: currentIndex = QGroundControl.settingsManager.planViewSettings.displayPresetsTabFirst.rawValue ? 2 : 0 - - QGCTabButton { text: qsTr("Grid") } - QGCTabButton { text: qsTr("Camera") } - QGCTabButton { text: qsTr("Presets") } } + // Grid tab Column { anchors.left: parent.left anchors.right: parent.right spacing: _margin - visible: tabBar.currentIndex == 0 + visible: tabBar.currentIndex === 0 QGCLabel { anchors.left: parent.left @@ -325,55 +219,6 @@ Rectangle { } } - SectionHeader { - id: terrainHeader - anchors.left: parent.left - anchors.right: parent.right - text: qsTr("Terrain") - checked: missionItem.followTerrain - } - - ColumnLayout { - anchors.left: parent.left - anchors.right: parent.right - spacing: _margin - visible: terrainHeader.checked - - - QGCCheckBox { - id: followsTerrainCheckBox - text: qsTr("Vehicle follows terrain") - checked: missionItem.followTerrain - onClicked: missionItem.followTerrain = checked - } - - GridLayout { - Layout.fillWidth: true - columnSpacing: _margin - rowSpacing: _margin - columns: 2 - visible: followsTerrainCheckBox.checked - - QGCLabel { text: qsTr("Tolerance") } - FactTextField { - fact: missionItem.terrainAdjustTolerance - Layout.fillWidth: true - } - - QGCLabel { text: qsTr("Max Climb Rate") } - FactTextField { - fact: missionItem.terrainAdjustMaxClimbRate - Layout.fillWidth: true - } - - QGCLabel { text: qsTr("Max Descent Rate") } - FactTextField { - fact: missionItem.terrainAdjustMaxDescentRate - Layout.fillWidth: true - } - } - } - SectionHeader { id: statsHeader anchors.left: parent.left @@ -388,22 +233,32 @@ Rectangle { } } // Grid Column + // Camera Tab Column { anchors.left: parent.left anchors.right: parent.right spacing: _margin - visible: tabBar.currentIndex == 1 + visible: tabBar.currentIndex === 1 CameraCalcCamera { cameraCalc: missionItem.cameraCalc } } // Camera Column + // Terrain Tab + TransectStyleComplexItemTerrainFollow { + anchors.left: parent.left + anchors.right: parent.right + spacing: _margin + visible: tabBar.currentIndex === 2 + } + + // Presets Tab ColumnLayout { anchors.left: parent.left anchors.right: parent.right spacing: _margin - visible: tabBar.currentIndex == 2 + visible: tabBar.currentIndex === 3 QGCLabel { Layout.fillWidth: true @@ -445,7 +300,6 @@ Rectangle { } } } - } Item { height: ScreenTools.defaultFontPixelHeight; width: 1 } -- 2.22.0