|
|
@ -49,7 +49,6 @@ FlightMap { |
|
|
|
property var _rallyPointController: _planMasterController.rallyPointController |
|
|
|
property var _rallyPointController: _planMasterController.rallyPointController |
|
|
|
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle |
|
|
|
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle |
|
|
|
property var _activeVehicleCoordinate: _activeVehicle ? _activeVehicle.coordinate : QtPositioning.coordinate() |
|
|
|
property var _activeVehicleCoordinate: _activeVehicle ? _activeVehicle.coordinate : QtPositioning.coordinate() |
|
|
|
property var _guidedLocationCoordinate: QtPositioning.coordinate() |
|
|
|
|
|
|
|
property real _toolButtonTopMargin: parent.height - ScreenTools.availableHeight + (ScreenTools.defaultFontPixelHeight / 2) |
|
|
|
property real _toolButtonTopMargin: parent.height - ScreenTools.availableHeight + (ScreenTools.defaultFontPixelHeight / 2) |
|
|
|
|
|
|
|
|
|
|
|
property bool _disableVehicleTracking: false |
|
|
|
property bool _disableVehicleTracking: false |
|
|
@ -274,23 +273,58 @@ FlightMap { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Guided action location |
|
|
|
|
|
|
|
MapQuickItem { |
|
|
|
MapQuickItem { |
|
|
|
id: guidedLocationItem |
|
|
|
id: gotoLocationItem |
|
|
|
coordinate: _guidedLocationCoordinate |
|
|
|
visible: false |
|
|
|
visible: _activeVehicle && _activeVehicle.guidedModeSupported && _guidedLocationCoordinate.isValid |
|
|
|
|
|
|
|
z: QGroundControl.zOrderMapItems |
|
|
|
z: QGroundControl.zOrderMapItems |
|
|
|
anchorPoint.x: sourceItem.anchorPointX |
|
|
|
anchorPoint.x: sourceItem.anchorPointX |
|
|
|
anchorPoint.y: sourceItem.anchorPointY |
|
|
|
anchorPoint.y: sourceItem.anchorPointY |
|
|
|
|
|
|
|
|
|
|
|
property bool gotoLocation: true ///< true: Used for go to location, false: used for orbit |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sourceItem: MissionItemIndexLabel { |
|
|
|
sourceItem: MissionItemIndexLabel { |
|
|
|
checked: true |
|
|
|
checked: true |
|
|
|
index: -1 |
|
|
|
index: -1 |
|
|
|
label: guidedLocationItem.gotoLocation ? qsTr("Goto here", "Goto here waypoint") : qsTr("Orbit here", "Orbit here waypoint") |
|
|
|
label: qsTr("Goto here", "Goto here waypoint") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function show(coord) { |
|
|
|
|
|
|
|
gotoLocationItem.coordinate = coord |
|
|
|
|
|
|
|
gotoLocationItem.visible = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function hide() { |
|
|
|
|
|
|
|
gotoLocationItem.visible = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCMapCircleVisuals { |
|
|
|
|
|
|
|
id: orbitMapCircle |
|
|
|
|
|
|
|
mapControl: parent |
|
|
|
|
|
|
|
mapCircle: _mapCircle |
|
|
|
|
|
|
|
visible: false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
property alias center: _mapCircle.center |
|
|
|
|
|
|
|
property real radius: defaultRadius |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readonly property real defaultRadius: 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function show(coord) { |
|
|
|
|
|
|
|
orbitMapCircle.radius = defaultRadius |
|
|
|
|
|
|
|
orbitMapCircle.center = coord |
|
|
|
|
|
|
|
orbitMapCircle.visible = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function hide() { |
|
|
|
|
|
|
|
orbitMapCircle.visible = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: guidedActionsController.orbitMapCircle = orbitMapCircle |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCMapCircle { |
|
|
|
|
|
|
|
id: _mapCircle |
|
|
|
|
|
|
|
interactive: true |
|
|
|
|
|
|
|
radius.rawValue: orbitMapCircle.radius |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Handle guided mode clicks |
|
|
|
// Handle guided mode clicks |
|
|
|
MouseArea { |
|
|
|
MouseArea { |
|
|
@ -299,22 +333,27 @@ FlightMap { |
|
|
|
Menu { |
|
|
|
Menu { |
|
|
|
id: clickMenu |
|
|
|
id: clickMenu |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
property var coord |
|
|
|
|
|
|
|
|
|
|
|
MenuItem { |
|
|
|
MenuItem { |
|
|
|
text: qsTr("Go to location") |
|
|
|
text: qsTr("Go to location") |
|
|
|
visible: guidedActionsController.showGotoLocation |
|
|
|
visible: guidedActionsController.showGotoLocation |
|
|
|
|
|
|
|
|
|
|
|
onTriggered: { |
|
|
|
onTriggered: { |
|
|
|
guidedLocationItem.gotoLocation = true |
|
|
|
gotoLocationItem.show(clickMenu.coord) |
|
|
|
guidedActionsController.confirmAction(guidedActionsController.actionGoto, _guidedLocationCoordinate) |
|
|
|
orbitMapCircle.hide() |
|
|
|
|
|
|
|
guidedActionsController.confirmAction(guidedActionsController.actionGoto, clickMenu.coord) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
MenuItem { |
|
|
|
MenuItem { |
|
|
|
text: qsTr("Orbit at location") |
|
|
|
text: qsTr("Orbit at location") |
|
|
|
visible: guidedActionsController.showOrbit |
|
|
|
visible: guidedActionsController.showOrbit |
|
|
|
|
|
|
|
|
|
|
|
onTriggered: { |
|
|
|
onTriggered: { |
|
|
|
guidedLocationItem.gotoLocation = false |
|
|
|
orbitMapCircle.show(clickMenu.coord) |
|
|
|
guidedActionsController.confirmAction(guidedActionsController.actionOrbit, _guidedLocationCoordinate) |
|
|
|
gotoLocationItem.hide() |
|
|
|
|
|
|
|
guidedActionsController.confirmAction(guidedActionsController.actionOrbit, clickMenu.coord) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -322,16 +361,19 @@ FlightMap { |
|
|
|
onClicked: { |
|
|
|
onClicked: { |
|
|
|
if (guidedActionsController.guidedUIVisible || (!guidedActionsController.showGotoLocation && !guidedActionsController.showOrbit)) { |
|
|
|
if (guidedActionsController.guidedUIVisible || (!guidedActionsController.showGotoLocation && !guidedActionsController.showOrbit)) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
_guidedLocationCoordinate = flightMap.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */) |
|
|
|
orbitMapCircle.hide() |
|
|
|
|
|
|
|
gotoLocationItem.hide() |
|
|
|
|
|
|
|
var clickCoord = flightMap.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */) |
|
|
|
if (guidedActionsController.showGotoLocation && guidedActionsController.showOrbit) { |
|
|
|
if (guidedActionsController.showGotoLocation && guidedActionsController.showOrbit) { |
|
|
|
|
|
|
|
clickMenu.coord = clickCoord |
|
|
|
clickMenu.popup() |
|
|
|
clickMenu.popup() |
|
|
|
} else if (guidedActionsController.showGotoLocation) { |
|
|
|
} else if (guidedActionsController.showGotoLocation) { |
|
|
|
guidedLocationItem.gotoLocation = true |
|
|
|
_guidedLocationCoordinate = clickCoord |
|
|
|
guidedActionsController.confirmAction(guidedActionsController.actionGoto, _guidedLocationCoordinate) |
|
|
|
guidedActionsController.confirmAction(guidedActionsController.actionGoto, clickCoord) |
|
|
|
} else if (guidedActionsController.showOrbit) { |
|
|
|
} else if (guidedActionsController.showOrbit) { |
|
|
|
guidedLocationItem.gotoLocation = false |
|
|
|
orbitMapCircle.show(clickCoord) |
|
|
|
guidedActionsController.confirmAction(guidedActionsController.actionOrbit, _guidedLocationCoordinate) |
|
|
|
guidedActionsController.confirmAction(guidedActionsController.actionOrbit, clickCoord) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|