Browse Source

Merge pull request #3463 from NaterGator/missionplan-tweaks

Mission Plan Tweaks
QGC4.4
Don Gagne 9 years ago
parent
commit
e594d7d313
  1. 9
      src/MissionEditor/MissionEditor.qml
  2. 70
      src/MissionEditor/MissionItemStatus.qml
  3. 2
      src/MissionEditor/SimpleItemEditor.qml
  4. 2
      src/MissionEditor/SurveyItemEditor.qml
  5. 6
      src/QmlControls/MissionItemEditor.qml

9
src/MissionEditor/MissionEditor.qml

@ -285,7 +285,6 @@ QGCView { @@ -285,7 +285,6 @@ QGCView {
if (addMissionItemsButton.checked) {
var sequenceNumber = controller.insertSimpleMissionItem(coordinate, controller.visualItems.count)
setCurrentItem(sequenceNumber)
editorListView.positionViewAtIndex(editorListView.count - 1, ListView.Contain)
} else {
editorMap.mapClicked(coordinate)
}
@ -485,6 +484,7 @@ QGCView { @@ -485,6 +484,7 @@ QGCView {
model: controller.visualItems
cacheBuffer: height * 2
clip: true
highlightMoveDuration: 250
delegate: MissionItemEditor {
missionItem: object
@ -499,11 +499,6 @@ QGCView { @@ -499,11 +499,6 @@ QGCView {
controller.removeMissionItem(index)
}
onInsert: {
var sequenceNumber = controller.insertSimpleMissionItem(editorMap.center, i)
setCurrentItem(sequenceNumber)
}
onMoveHomeToMapCenter: controller.visualItems.get(0).coordinate = editorMap.center
Connections {
@ -511,7 +506,7 @@ QGCView { @@ -511,7 +506,7 @@ QGCView {
onIsCurrentItemChanged: {
if (object.isCurrentItem) {
editorListView.positionViewAtIndex(index, ListView.Contain)
editorListView.currentIndex = index
}
}
}

70
src/MissionEditor/MissionItemStatus.qml

@ -74,53 +74,47 @@ Rectangle { @@ -74,53 +74,47 @@ Rectangle {
QGCLabel { text: _azimuthText }
}
QGCFlickable {
ListView {
id: statusListView
model: missionItems
highlightMoveDuration: 250
anchors.leftMargin: _margins
anchors.rightMargin: _margins
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width - valueGrid.width - (_margins * 2)
contentWidth: graphRow.width
orientation: ListView.Horizontal
spacing: 0
visible: _expanded
width: parent.width - valueGrid.width - (_margins * 2)
clip: true
Row {
id: graphRow
anchors.top: parent.top
anchors.bottom: parent.bottom
//anchors.margins: ScreenTools.defaultFontPixelWidth * ScreenTools.smallFontPointRatio
spacing: ScreenTools.defaultFontPixelWidth * ScreenTools.smallFontPointRatio
Repeater {
model: missionItems
Item {
height: graphRow.height
width: indicator.width
visible: object.specifiesCoordinate && !object.isStandaloneCoordinate
property real availableHeight: height - indicator.height
property bool graphAbsolute: true
MissionItemIndexLabel {
id: indicator
anchors.horizontalCenter: parent.horizontalCenter
y: availableHeight - (availableHeight * object.altPercent)
small: true
isCurrentItem: object.isCurrentItem
label: object.abbreviation
visible: object.relativeAltitude ? true : (object.homePosition || graphAbsolute)
}
delegate: Item {
height: statusListView.height
width: display ? (indicator.width + spacing) : 0
visible: display
property real availableHeight: height - indicator.height
property bool graphAbsolute: true
readonly property bool display: object.specifiesCoordinate && !object.isStandaloneCoordinate
readonly property real spacing: ScreenTools.defaultFontPixelWidth * ScreenTools.smallFontPointRatio
MissionItemIndexLabel {
id: indicator
anchors.horizontalCenter: parent.horizontalCenter
y: availableHeight - (availableHeight * object.altPercent)
small: true
isCurrentItem: object.isCurrentItem
label: object.abbreviation
visible: object.relativeAltitude ? true : (object.homePosition || graphAbsolute)
}
Connections {
target: object
/*
Taking these off for now since there really isn't room for the numbers
QGCLabel {
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
font.pointSize: ScreenTools.smallFontPointSize
text: (object.relativeAltitude ? "" : "=") + object.coordinate.altitude.toFixed(0)
onIsCurrentItemChanged: {
if (object.isCurrentItem) {
statusListView.currentIndex = index
}
*/
}
}
}

2
src/MissionEditor/SimpleItemEditor.qml

@ -13,7 +13,7 @@ import QGroundControl.Palette 1.0 @@ -13,7 +13,7 @@ import QGroundControl.Palette 1.0
Rectangle {
id: valuesRect
width: availableWidth
height: valuesItem.height
height: visible ? valuesItem.height : 0
color: qgcPal.windowShadeDark
visible: missionItem.isCurrentItem
radius: _radius

2
src/MissionEditor/SurveyItemEditor.qml

@ -10,7 +10,7 @@ import QGroundControl.Palette 1.0 @@ -10,7 +10,7 @@ import QGroundControl.Palette 1.0
// Editor for Survery mission items
Rectangle {
id: _root
height: editorColumn.height + (_margin * 2)
height: visible ? (editorColumn.height + (_margin * 2)) : 0
width: availableWidth
color: qgcPal.windowShadeDark
radius: _radius

6
src/QmlControls/MissionItemEditor.qml

@ -151,9 +151,9 @@ Rectangle { @@ -151,9 +151,9 @@ Rectangle {
anchors.topMargin: _margin
anchors.left: parent.left
anchors.top: commandPicker.bottom
height: _currentItem && item ? item.height : 0
source: _currentItem ? (missionItem.isSimpleItem ? "qrc:/qml/SimpleItemEditor.qml" : "qrc:/qml/SurveyItemEditor.qml") : ""
height: item ? item.height : 0
source: missionItem.isSimpleItem ? "qrc:/qml/SimpleItemEditor.qml" : "qrc:/qml/SurveyItemEditor.qml"
onLoaded: { item.visible = Qt.binding(function() { return _currentItem; }) }
property real availableWidth: _root.width - (_margin * 2) ///< How wide the editor should be
property var editorRoot: _root
}

Loading…
Cancel
Save