Commit 9e75a02b authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4714 from DonLakeFlyer/PlanWarnings

Plan: Cleaning warning message output
parents b7ef7454 6649562c
...@@ -95,6 +95,10 @@ Item { ...@@ -95,6 +95,10 @@ Item {
} }
function fitMapViewportToMissionItems() { function fitMapViewportToMissionItems() {
if (!mapMissionController.visualItems) {
// Being called prior to controller.start
return
}
var coordList = [ ] var coordList = [ ]
addMissionItemCoordsForFit(coordList) addMissionItemCoordsForFit(coordList)
fitMapViewportToAllCoordinates(coordList) fitMapViewportToAllCoordinates(coordList)
...@@ -135,6 +139,10 @@ Item { ...@@ -135,6 +139,10 @@ Item {
} }
function fitMapViewportToAllItems() { function fitMapViewportToAllItems() {
if (!mapMissionController.visualItems) {
// Being called prior to controller.start
return
}
var coordList = [ ] var coordList = [ ]
addMissionItemCoordsForFit(coordList) addMissionItemCoordsForFit(coordList)
addFenceItemCoordsForFit(coordList) addFenceItemCoordsForFit(coordList)
......
...@@ -160,7 +160,6 @@ Rectangle { ...@@ -160,7 +160,6 @@ Rectangle {
} }
QGCLabel { QGCLabel {
Layout.row: 2
text: qsTr("Cruise speed:") text: qsTr("Cruise speed:")
visible: _showCruiseSpeed visible: _showCruiseSpeed
Layout.fillWidth: true Layout.fillWidth: true
...@@ -172,7 +171,6 @@ Rectangle { ...@@ -172,7 +171,6 @@ Rectangle {
} }
QGCLabel { QGCLabel {
Layout.row: 3
text: qsTr("Hover speed:") text: qsTr("Hover speed:")
visible: _showHoverSpeed visible: _showHoverSpeed
Layout.fillWidth: true Layout.fillWidth: true
......
...@@ -22,32 +22,38 @@ import QGroundControl.FlightMap 1.0 ...@@ -22,32 +22,38 @@ import QGroundControl.FlightMap 1.0
Item { Item {
property var map ///< Map control to place item in property var map ///< Map control to place item in
property var _missionItem: object property var _missionItem: object
property var _itemVisual property var _itemVisual
property var _dragArea property var _dragArea
property bool _itemVisualShowing: false
property bool _dragAreaShowing: false
function hideItemVisuals() { function hideItemVisuals() {
_itemVisual.destroy() if (_itemVisualShowing) {
_itemVisual = undefined _itemVisual.destroy()
_itemVisualShowing = false
}
} }
function showItemVisuals() { function showItemVisuals() {
if (!_itemVisual) { if (!_itemVisualShowing) {
_itemVisual = indicatorComponent.createObject(map) _itemVisual = indicatorComponent.createObject(map)
map.addMapItem(_itemVisual) map.addMapItem(_itemVisual)
_itemVisualShowing = true
} }
} }
function hideDragArea() { function hideDragArea() {
if (_dragArea) { if (_dragAreaShowing) {
_dragArea.destroy() _dragArea.destroy()
_dragArea = undefined _dragAreaShowing = false
} }
} }
function showDragArea() { function showDragArea() {
if (!_dragArea) { if (!_dragAreaShowing) {
_dragArea = dragAreaComponent.createObject(map) _dragArea = dragAreaComponent.createObject(map)
_dragAreaShowing = true
} }
} }
...@@ -81,10 +87,10 @@ Item { ...@@ -81,10 +87,10 @@ Item {
id: dragAreaComponent id: dragAreaComponent
MissionItemIndicatorDrag { MissionItemIndicatorDrag {
itemIndicator: _itemVisual itemIndicator: _itemVisual
itemCoordinate: _missionItem.coordinate itemCoordinate: _missionItem.coordinate
onItemCoordinateChanged: _missionItem.coordinate = itemCoordinate onItemCoordinateChanged: _missionItem.coordinate = itemCoordinate
} }
} }
......
...@@ -76,6 +76,7 @@ Item { ...@@ -76,6 +76,7 @@ Item {
anchorPoint.y: sourceItem.anchorPointY anchorPoint.y: sourceItem.anchorPointY
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
coordinate: _missionItem.coordinate coordinate: _missionItem.coordinate
visible: _missionItem.exitCoordinate.isValid
sourceItem: sourceItem:
MissionItemIndexLabel { MissionItemIndexLabel {
...@@ -96,6 +97,7 @@ Item { ...@@ -96,6 +97,7 @@ Item {
anchorPoint.y: sourceItem.anchorPointY anchorPoint.y: sourceItem.anchorPointY
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
coordinate: _missionItem.exitCoordinate coordinate: _missionItem.exitCoordinate
visible: _missionItem.exitCoordinate.isValid
sourceItem: sourceItem:
MissionItemIndexLabel { MissionItemIndexLabel {
......
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