Browse Source

Merge pull request #8843 from DonLakeFlyer/TransectStyleReFactor

Transect style re factor
QGC4.4
Don Gagne 5 years ago committed by GitHub
parent
commit
7146e5fe44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      qgcimages.qrc
  2. 2
      qgroundcontrol.qrc
  3. BIN
      resources/PatternCamera.png
  4. BIN
      resources/PatternGrid.png
  5. BIN
      resources/PatternPresets.png
  6. BIN
      resources/PatternTerrain.png
  7. 2
      src/PlanView/SimpleItemEditor.qml
  8. 176
      src/PlanView/SurveyItemEditor.qml
  9. 18
      src/PlanView/TransectStyleComplexItemTabBar.qml
  10. 51
      src/PlanView/TransectStyleComplexItemTerrainFollow.qml
  11. 32
      src/QmlControls/QGCTabButton.qml
  12. 2
      src/QmlControls/QGroundControl/Controls/qmldir

4
qgcimages.qrc

@ -125,6 +125,10 @@ @@ -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>

2
qgroundcontrol.qrc

@ -181,6 +181,8 @@ @@ -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>

BIN
resources/PatternCamera.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
resources/PatternGrid.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

BIN
resources/PatternPresets.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
resources/PatternTerrain.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

2
src/PlanView/SimpleItemEditor.qml

@ -19,8 +19,8 @@ Rectangle { @@ -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

176
src/PlanView/SurveyItemEditor.qml

@ -76,133 +76,27 @@ Rectangle { @@ -76,133 +76,27 @@ 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 {
anchors.left: parent.left
anchors.right: parent.right
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
@ -326,55 +220,6 @@ Rectangle { @@ -326,55 +220,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
anchors.right: parent.right
@ -388,22 +233,32 @@ Rectangle { @@ -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 { @@ -445,7 +300,6 @@ Rectangle {
}
}
}
}
Item { height: ScreenTools.defaultFontPixelHeight; width: 1 }

18
src/PlanView/TransectStyleComplexItemTabBar.qml

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
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 }
}

51
src/PlanView/TransectStyleComplexItemTerrainFollow.qml

@ -0,0 +1,51 @@ @@ -0,0 +1,51 @@
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
}
}
}

32
src/QmlControls/QGCTabButton.qml

@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
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
@ -8,16 +10,24 @@ import QGroundControl.ScreenTools 1.0 @@ -8,16 +10,24 @@ import QGroundControl.ScreenTools 1.0
TabButton {
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
}
contentItem: QGCLabel {
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
contentItem: IconLabel {
spacing: control.spacing
mirrored: control.mirrored
display: control.display
icon: control.icon
text: control.text
color: enabled ? (_showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText) : qgcPalDisabled.buttonText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
font: control.font
color: _showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText
}
background: Rectangle {
color: _showHighlight ? qgcPal.buttonHighlight : qgcPal.button
}
}

2
src/QmlControls/QGroundControl/Controls/qmldir

@ -101,6 +101,8 @@ SubMenuButton 1.0 SubMenuButton.qml @@ -101,6 +101,8 @@ SubMenuButton 1.0 SubMenuButton.qml
SurveyMapVisuals 1.0 SurveyMapVisuals.qml
TerrainStatus 1.0 TerrainStatus.qml
TransectStyleComplexItemStats 1.0 TransectStyleComplexItemStats.qml
TransectStyleComplexItemTabBar 1.0 TransectStyleComplexItemTabBar.qml
TransectStyleComplexItemTerrainFollow 1.0 TransectStyleComplexItemTerrainFollow.qml
TransectStyleMapVisuals 1.0 TransectStyleMapVisuals.qml
ToolStrip 1.0 ToolStrip.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml

Loading…
Cancel
Save