Skip to content

Commit

Permalink
Merge pull request mavlink#4714 from DonLakeFlyer/PlanWarnings
Browse files Browse the repository at this point in the history
Plan: Cleaning warning message output
  • Loading branch information
DonLakeFlyer authored Mar 6, 2017
2 parents b7ef745 + 6649562 commit 9e75a02
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
8 changes: 8 additions & 0 deletions src/FlightMap/Widgets/MapFitFunctions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ Item {
}

function fitMapViewportToMissionItems() {
if (!mapMissionController.visualItems) {
// Being called prior to controller.start
return
}
var coordList = [ ]
addMissionItemCoordsForFit(coordList)
fitMapViewportToAllCoordinates(coordList)
Expand Down Expand Up @@ -135,6 +139,10 @@ Item {
}

function fitMapViewportToAllItems() {
if (!mapMissionController.visualItems) {
// Being called prior to controller.start
return
}
var coordList = [ ]
addMissionItemCoordsForFit(coordList)
addFenceItemCoordsForFit(coordList)
Expand Down
2 changes: 0 additions & 2 deletions src/MissionEditor/MissionSettingsEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ Rectangle {
}

QGCLabel {
Layout.row: 2
text: qsTr("Cruise speed:")
visible: _showCruiseSpeed
Layout.fillWidth: true
Expand All @@ -172,7 +171,6 @@ Rectangle {
}

QGCLabel {
Layout.row: 3
text: qsTr("Hover speed:")
visible: _showHoverSpeed
Layout.fillWidth: true
Expand Down
30 changes: 18 additions & 12 deletions src/MissionEditor/SimpleItemMapVisual.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,38 @@ import QGroundControl.FlightMap 1.0
Item {
property var map ///< Map control to place item in

property var _missionItem: object
property var _itemVisual
property var _dragArea
property var _missionItem: object
property var _itemVisual
property var _dragArea
property bool _itemVisualShowing: false
property bool _dragAreaShowing: false

function hideItemVisuals() {
_itemVisual.destroy()
_itemVisual = undefined
if (_itemVisualShowing) {
_itemVisual.destroy()
_itemVisualShowing = false
}
}

function showItemVisuals() {
if (!_itemVisual) {
if (!_itemVisualShowing) {
_itemVisual = indicatorComponent.createObject(map)
map.addMapItem(_itemVisual)
_itemVisualShowing = true
}
}

function hideDragArea() {
if (_dragArea) {
if (_dragAreaShowing) {
_dragArea.destroy()
_dragArea = undefined
_dragAreaShowing = false
}
}

function showDragArea() {
if (!_dragArea) {
if (!_dragAreaShowing) {
_dragArea = dragAreaComponent.createObject(map)
_dragAreaShowing = true
}
}

Expand Down Expand Up @@ -81,10 +87,10 @@ Item {
id: dragAreaComponent

MissionItemIndicatorDrag {
itemIndicator: _itemVisual
itemCoordinate: _missionItem.coordinate
itemIndicator: _itemVisual
itemCoordinate: _missionItem.coordinate

onItemCoordinateChanged: _missionItem.coordinate = itemCoordinate
onItemCoordinateChanged: _missionItem.coordinate = itemCoordinate
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/MissionEditor/SurveyMapVisual.qml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Item {
anchorPoint.y: sourceItem.anchorPointY
z: QGroundControl.zOrderMapItems
coordinate: _missionItem.coordinate
visible: _missionItem.exitCoordinate.isValid

sourceItem:
MissionItemIndexLabel {
Expand All @@ -96,6 +97,7 @@ Item {
anchorPoint.y: sourceItem.anchorPointY
z: QGroundControl.zOrderMapItems
coordinate: _missionItem.exitCoordinate
visible: _missionItem.exitCoordinate.isValid

sourceItem:
MissionItemIndexLabel {
Expand Down

0 comments on commit 9e75a02

Please sign in to comment.