Skip to content

Commit

Permalink
Add Angle, Rotate, Stats to Presets page
Browse files Browse the repository at this point in the history
  • Loading branch information
Don Gagne committed Sep 29, 2019
1 parent 8ef0d26 commit 83f994c
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 5 deletions.
65 changes: 63 additions & 2 deletions src/PlanView/SurveyItemEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right

Component.onCompleted: currentIndex = 0
Component.onCompleted: currentIndex = QGroundControl.settingsManager.planViewSettings.displayPresetsTabFirst.rawValue ? 2 : 0

QGCTabButton { text: qsTr("Grid") }
QGCTabButton { text: qsTr("Camera") }
Expand Down Expand Up @@ -255,7 +255,11 @@ Rectangle {
text: qsTr("Statistics")
}

TransectStyleComplexItemStats { }
TransectStyleComplexItemStats {
anchors.left: parent.left
anchors.right: parent.right
visible: statsHeader.checked
}
} // Grid Column

Column {
Expand Down Expand Up @@ -321,6 +325,63 @@ Rectangle {
text: qsTr("Save Settings As New Preset")
onClicked: mainWindow.showComponentDialog(savePresetDialog, qsTr("Save Preset"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel)
}

SectionHeader {
id: presectsTransectsHeader
anchors.left: undefined
anchors.right: undefined
Layout.fillWidth: true
text: qsTr("Transects")
}

GridLayout {
Layout.fillWidth: true
columnSpacing: _margin
rowSpacing: _margin
columns: 2
visible: presectsTransectsHeader.checked

QGCLabel { text: qsTr("Angle") }
FactTextField {
fact: missionItem.gridAngle
Layout.fillWidth: true
onUpdated: presetsAngleSlider.value = missionItem.gridAngle.value
}

QGCSlider {
id: presetsAngleSlider
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();
}
}

SectionHeader {
id: presetsStatsHeader
anchors.left: undefined
anchors.right: undefined
Layout.fillWidth: true
text: qsTr("Statistics")
}

TransectStyleComplexItemStats {
Layout.fillWidth: true
visible: presetsStatsHeader.checked
}
} // Camera Column

Component {
Expand Down
3 changes: 0 additions & 3 deletions src/PlanView/TransectStyleComplexItemStats.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ Grid {
// The following properties must be available up the hierarchy chain
//property var missionItem ///< Mission Item for editor

anchors.left: parent.left
anchors.right: parent.right
columns: 2
columnSpacing: ScreenTools.defaultFontPixelWidth
visible: statsHeader.checked

QGCLabel { text: qsTr("Survey Area") }
QGCLabel { text: QGroundControl.squareMetersToAppSettingsAreaUnits(missionItem.coveredArea).toFixed(2) + " " + QGroundControl.appSettingsAreaUnitsString }
Expand Down

0 comments on commit 83f994c

Please sign in to comment.