Unverified Commit 7146e5fe authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8843 from DonLakeFlyer/TransectStyleReFactor

Transect style re factor
parents e7885097 f30a8f28
......@@ -125,6 +125,10 @@
<file alias="no-logging.svg">src/AutoPilotPlugins/PX4/Images/no-logging.svg</file>
<file alias="ObjectAvoidance.svg">src/AutoPilotPlugins/PX4/Images/ObjectAvoidance.svg</file>
<file alias="PaperPlane.svg">src/ui/toolbar/Images/PaperPlane.svg</file>
<file alias="PatternCamera.png">resources/PatternCamera.png</file>
<file alias="PatternGrid.png">resources/PatternGrid.png</file>
<file alias="PatternPresets.png">resources/PatternPresets.png</file>
<file alias="PatternTerrain.png">resources/PatternTerrain.png</file>
<file alias="PiP.svg">src/FlightMap/Images/PiP.svg</file>
<file alias="pipHide.svg">src/FlightMap/Images/pipHide.svg</file>
<file alias="pipResize.svg">src/FlightMap/Images/pipResize.svg</file>
......
......@@ -181,6 +181,8 @@
<file alias="QGroundControl/Controls/TakeoffItemMapVisual.qml">src/PlanView/TakeoffItemMapVisual.qml</file>
<file alias="QGroundControl/Controls/ToolStrip.qml">src/QmlControls/ToolStrip.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemStats.qml">src/PlanView/TransectStyleComplexItemStats.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemTabBar.qml">src/PlanView/TransectStyleComplexItemTabBar.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemTerrainFollow.qml">src/PlanView/TransectStyleComplexItemTerrainFollow.qml</file>
<file alias="QGroundControl/Controls/VehicleRotationCal.qml">src/QmlControls/VehicleRotationCal.qml</file>
<file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file>
<file alias="QGroundControl/Controls/VerticalFactValueGrid.qml">src/QmlControls/VerticalFactValueGrid.qml</file>
......
......@@ -19,8 +19,8 @@ Rectangle {
property bool _specifiesAltitude: missionItem.specifiesAltitude
property real _margin: ScreenTools.defaultFontPixelHeight / 2
property bool _supportsTerrainFrame: missionItem.masterController.supportsTerrain
property var _controllerVehicle: missionItem.masterController.controllerVehicle
property bool _supportsTerrainFrame: _controllerVehicle.supportsTerrainFrame
property int _globalAltMode: missionItem.masterController.missionController.globalAltitudeMode
property bool _globalAltModeIsMixed: _globalAltMode == QGroundControl.AltitudeModeNone
......
......@@ -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 }
......
import QtQuick 2.3
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
QGCTabBar {
id: tabBar
anchors.left: parent.left
anchors.right: parent.right
Component.onCompleted: currentIndex = QGroundControl.settingsManager.planViewSettings.displayPresetsTabFirst.rawValue ? 2 : 0
QGCTabButton { icon.source: "/qmlimages/PatternGrid.png"; icon.height: ScreenTools.defaultFontPixelHeight }
QGCTabButton { icon.source: "/qmlimages/PatternCamera.png"; icon.height: ScreenTools.defaultFontPixelHeight }
QGCTabButton { icon.source: "/qmlimages/PatternTerrain.png"; icon.height: ScreenTools.defaultFontPixelHeight }
QGCTabButton { icon.source: "/qmlimages/PatternPresets.png"; icon.height: ScreenTools.defaultFontPixelHeight }
}
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.2
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
visible: tabBar.currentIndex === 2
property var missionItem
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
enabled: 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
}
}
}
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls.impl 2.12
import QtQml 2.12
import QGroundControl 1.0
import QGroundControl.Palette 1.0
......@@ -7,17 +9,25 @@ import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
TabButton {
id: control
id: control
font.pointSize: ScreenTools.defaultFontPointSize
font.family: ScreenTools.normalFontFamily
property bool _showHighlight: (pressed | hovered | checked)
QGCPalette { id: qgcPalDisabled; colorGroupEnabled: false }
background: Rectangle {
color: enabled ? (_showHighlight ? qgcPal.buttonHighlight : qgcPal.button) : qgcPalDisabled.button
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
contentItem: IconLabel {
spacing: control.spacing
mirrored: control.mirrored
display: control.display
icon: control.icon
text: control.text
font: control.font
color: _showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText
}
contentItem: QGCLabel {
text: control.text
color: enabled ? (_showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText) : qgcPalDisabled.buttonText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
background: Rectangle {
color: _showHighlight ? qgcPal.buttonHighlight : qgcPal.button
}
}
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