Commit e157baa8 authored by DonLakeFlyer's avatar DonLakeFlyer

Fly: Fix click to set new mission item

parent 09cb4e84
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
<file alias="MixersComponent.qml">src/AutoPilotPlugins/Common/MixersComponent.qml</file> <file alias="MixersComponent.qml">src/AutoPilotPlugins/Common/MixersComponent.qml</file>
<file alias="MockLink.qml">src/ui/preferences/MockLink.qml</file> <file alias="MockLink.qml">src/ui/preferences/MockLink.qml</file>
<file alias="MockLinkSettings.qml">src/ui/preferences/MockLinkSettings.qml</file> <file alias="MockLinkSettings.qml">src/ui/preferences/MockLinkSettings.qml</file>
<file alias="MultiVehicleView.qml">src/MultiVehicle/MultiVehicleView.qml</file>
<file alias="MotorComponent.qml">src/AutoPilotPlugins/Common/MotorComponent.qml</file> <file alias="MotorComponent.qml">src/AutoPilotPlugins/Common/MotorComponent.qml</file>
<file alias="OfflineMap.qml">src/QtLocationPlugin/QMLControl/OfflineMap.qml</file> <file alias="OfflineMap.qml">src/QtLocationPlugin/QMLControl/OfflineMap.qml</file>
<file alias="PowerComponent.qml">src/AutoPilotPlugins/PX4/PowerComponent.qml</file> <file alias="PowerComponent.qml">src/AutoPilotPlugins/PX4/PowerComponent.qml</file>
...@@ -58,7 +57,6 @@ ...@@ -58,7 +57,6 @@
<file alias="QGroundControl/Controls/FWLandingPatternMapVisual.qml">src/MissionEditor/FWLandingPatternMapVisual.qml</file> <file alias="QGroundControl/Controls/FWLandingPatternMapVisual.qml">src/MissionEditor/FWLandingPatternMapVisual.qml</file>
<file alias="QGroundControl/Controls/GeoFenceEditor.qml">src/MissionEditor/GeoFenceEditor.qml</file> <file alias="QGroundControl/Controls/GeoFenceEditor.qml">src/MissionEditor/GeoFenceEditor.qml</file>
<file alias="QGroundControl/Controls/GeoFenceMapVisuals.qml">src/MissionEditor/GeoFenceMapVisuals.qml</file> <file alias="QGroundControl/Controls/GeoFenceMapVisuals.qml">src/MissionEditor/GeoFenceMapVisuals.qml</file>
<file alias="QGroundControl/Controls/GuidedBar.qml">src/QmlControls/GuidedBar.qml</file>
<file alias="QGroundControl/Controls/IndicatorButton.qml">src/QmlControls/IndicatorButton.qml</file> <file alias="QGroundControl/Controls/IndicatorButton.qml">src/QmlControls/IndicatorButton.qml</file>
<file alias="QGroundControl/Controls/JoystickThumbPad.qml">src/QmlControls/JoystickThumbPad.qml</file> <file alias="QGroundControl/Controls/JoystickThumbPad.qml">src/QmlControls/JoystickThumbPad.qml</file>
<file alias="QGroundControl/Controls/MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file> <file alias="QGroundControl/Controls/MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file>
......
...@@ -257,7 +257,12 @@ FlightMap { ...@@ -257,7 +257,12 @@ FlightMap {
model: _mainIsMap ? missionController.visualItems : 0 model: _mainIsMap ? missionController.visualItems : 0
delegate: MissionItemMapVisual { delegate: MissionItemMapVisual {
map: flightMap map: flightMap
onClicked: {
_retaskSequence = object.sequenceNumber
flightWidgets.guidedModeBar.confirmAction(parent.flightWidgets.guidedModeBar.confirmRetask)
}
} }
} }
......
...@@ -318,7 +318,7 @@ Item { ...@@ -318,7 +318,7 @@ Item {
guidedModeConfirm.confirmText = qsTr("move vehicle") guidedModeConfirm.confirmText = qsTr("move vehicle")
break; break;
case confirmRetask: case confirmRetask:
guidedModeConfirm.confirmText = qsTr("active waypoint change") guidedModeConfirm.confirmText = qsTr("activate waypoint change")
break; break;
case confirmOrbit: case confirmOrbit:
guidedModeConfirm.confirmText = qsTr("enter orbit mode") guidedModeConfirm.confirmText = qsTr("enter orbit mode")
......
...@@ -20,8 +20,12 @@ import QGroundControl.FlightMap 1.0 ...@@ -20,8 +20,12 @@ import QGroundControl.FlightMap 1.0
/// Fixed Wing Landing Pattern map visuals /// Fixed Wing Landing Pattern map visuals
Item { Item {
id: _root
property var map ///< Map control to place item in property var map ///< Map control to place item in
signal clicked(int sequenceNumber)
property var _missionItem: object property var _missionItem: object
property var _itemVisuals: [ ] property var _itemVisuals: [ ]
property var _mouseArea property var _mouseArea
...@@ -208,7 +212,7 @@ Item { ...@@ -208,7 +212,7 @@ Item {
label: "Loiter" label: "Loiter"
checked: _missionItem.isCurrentItem checked: _missionItem.isCurrentItem
onClicked: setCurrentItem(_missionItem.sequenceNumber) onClicked: _root.clicked(_missionItem.sequenceNumber)
} }
} }
} }
...@@ -243,7 +247,7 @@ Item { ...@@ -243,7 +247,7 @@ Item {
label: "Land" label: "Land"
checked: _missionItem.isCurrentItem checked: _missionItem.isCurrentItem
onClicked: setCurrentItem(_missionItem.sequenceNumber) onClicked: _root.clicked(_missionItem.sequenceNumber)
} }
} }
} }
......
...@@ -49,7 +49,7 @@ QGCView { ...@@ -49,7 +49,7 @@ QGCView {
property var activeVehiclePosition: _activeVehicle ? _activeVehicle.coordinate : QtPositioning.coordinate() property var activeVehiclePosition: _activeVehicle ? _activeVehicle.coordinate : QtPositioning.coordinate()
property bool _lightWidgetBorders: editorMap.isSatelliteMap property bool _lightWidgetBorders: editorMap.isSatelliteMap
property bool _addWaypointOnClick: false property bool _addWaypointOnClick: false
property bool _singleComplexItem: missionController.complexMissionItemNames.length == 1 property bool _singleComplexItem: missionController.complexMissionItemNames.length === 1
/// The controller which should be called for load/save, send to/from vehicle calls /// The controller which should be called for load/save, send to/from vehicle calls
property var _syncDropDownController: missionController property var _syncDropDownController: missionController
...@@ -459,7 +459,8 @@ QGCView { ...@@ -459,7 +459,8 @@ QGCView {
model: missionController.visualItems model: missionController.visualItems
delegate: MissionItemMapVisual { delegate: MissionItemMapVisual {
map: editorMap map: editorMap
onClicked: setCurrentItem(sequenceNumber)
} }
} }
...@@ -702,6 +703,10 @@ QGCView { ...@@ -702,6 +703,10 @@ QGCView {
property bool _showZoom: !ScreenTools.isMobile property bool _showZoom: !ScreenTools.isMobile
property bool mySingleComplexItem: _singleComplexItem
onMySingleComplexItemChanged: console.log(model[1].dropPanelComponent)
model: [ model: [
{ {
name: "Waypoint", name: "Waypoint",
......
...@@ -17,12 +17,14 @@ import QGroundControl.Palette 1.0 ...@@ -17,12 +17,14 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
/// Mission item edit control /// Mission item map visual
Item { Item {
id: _root id: _root
property var map ///< Map control to place item in property var map ///< Map control to place item in
signal clicked(int sequenceNumber)
property var _visualItem property var _visualItem
Component.onCompleted: { Component.onCompleted: {
...@@ -32,6 +34,7 @@ Item { ...@@ -32,6 +34,7 @@ Item {
console.log("Error loading Qml: ", object.mapVisualQML, component.errorString()) console.log("Error loading Qml: ", object.mapVisualQML, component.errorString())
} }
_visualItem = component.createObject(map, { "map": _root.map }) _visualItem = component.createObject(map, { "map": _root.map })
_visualItem.clicked.connect(_root.clicked)
} }
} }
......
...@@ -20,8 +20,12 @@ import QGroundControl.FlightMap 1.0 ...@@ -20,8 +20,12 @@ import QGroundControl.FlightMap 1.0
/// Mission Settings map visuals /// Mission Settings map visuals
Item { Item {
id: _root
property var map ///< Map control to place item in property var map ///< Map control to place item in
signal clicked(int sequenceNumber)
property var _missionItem: object property var _missionItem: object
property var _itemVisual property var _itemVisual
property var _dragArea property var _dragArea
...@@ -103,7 +107,7 @@ Item { ...@@ -103,7 +107,7 @@ Item {
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
missionItem: _missionItem missionItem: _missionItem
onClicked: setCurrentItem(_missionItem.sequenceNumber) onClicked: _root.clicked(_missionItem.sequenceNumber)
// These are the non-coordinate child mission items attached to this item // These are the non-coordinate child mission items attached to this item
Row { Row {
...@@ -119,7 +123,7 @@ Item { ...@@ -119,7 +123,7 @@ Item {
z: 2 z: 2
specifiesCoordinate: false specifiesCoordinate: false
onClicked: setCurrentItem(object.sequenceNumber) onClicked: _root.Clicked(object.sequenceNumber)
} }
} }
} }
......
...@@ -20,6 +20,7 @@ import QGroundControl.FlightMap 1.0 ...@@ -20,6 +20,7 @@ import QGroundControl.FlightMap 1.0
/// Simple Mission Item visuals /// Simple Mission Item visuals
Item { Item {
id: _root
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
...@@ -28,6 +29,8 @@ Item { ...@@ -28,6 +29,8 @@ Item {
property bool _itemVisualShowing: false property bool _itemVisualShowing: false
property bool _dragAreaShowing: false property bool _dragAreaShowing: false
signal clicked(int sequenceNumber)
function hideItemVisuals() { function hideItemVisuals() {
if (_itemVisualShowing) { if (_itemVisualShowing) {
_itemVisual.destroy() _itemVisual.destroy()
...@@ -104,7 +107,7 @@ Item { ...@@ -104,7 +107,7 @@ Item {
missionItem: _missionItem missionItem: _missionItem
sequenceNumber: _missionItem.sequenceNumber sequenceNumber: _missionItem.sequenceNumber
onClicked: setCurrentItem(_missionItem.sequenceNumber) onClicked: _root.clicked(_missionItem.sequenceNumber)
// These are the non-coordinate child mission items attached to this item // These are the non-coordinate child mission items attached to this item
Row { Row {
...@@ -120,7 +123,7 @@ Item { ...@@ -120,7 +123,7 @@ Item {
checked: object.isCurrentItem checked: object.isCurrentItem
specifiesCoordinate: false specifiesCoordinate: false
onClicked: setCurrentItem(object.sequenceNumber) onClicked: _root.clicked(object.sequenceNumber)
} }
} }
} }
......
...@@ -20,6 +20,8 @@ import QGroundControl.FlightMap 1.0 ...@@ -20,6 +20,8 @@ import QGroundControl.FlightMap 1.0
/// Survey Complex Mission Item visuals /// Survey Complex Mission Item visuals
Item { Item {
id: _root
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
...@@ -30,6 +32,8 @@ Item { ...@@ -30,6 +32,8 @@ Item {
property var _dragHandles property var _dragHandles
property var _splitHandles property var _splitHandles
signal clicked(int sequenceNumber)
function _addVisualElements() { function _addVisualElements() {
_polygon = polygonComponent.createObject(map) _polygon = polygonComponent.createObject(map)
_grid = gridComponent.createObject(map) _grid = gridComponent.createObject(map)
...@@ -148,13 +152,11 @@ Item { ...@@ -148,13 +152,11 @@ Item {
coordinate: _missionItem.coordinate coordinate: _missionItem.coordinate
visible: _missionItem.exitCoordinate.isValid visible: _missionItem.exitCoordinate.isValid
sourceItem: sourceItem: MissionItemIndexLabel {
MissionItemIndexLabel {
index: _missionItem.sequenceNumber index: _missionItem.sequenceNumber
label: "Entry" label: "Entry"
checked: _missionItem.isCurrentItem checked: _missionItem.isCurrentItem
onClicked: _root.clicked(_missionItem.sequenceNumber)
onClicked: setCurrentItem(_missionItem.sequenceNumber)
} }
} }
} }
...@@ -170,13 +172,11 @@ Item { ...@@ -170,13 +172,11 @@ Item {
coordinate: _missionItem.exitCoordinate coordinate: _missionItem.exitCoordinate
visible: _missionItem.exitCoordinate.isValid visible: _missionItem.exitCoordinate.isValid
sourceItem: sourceItem: MissionItemIndexLabel {
MissionItemIndexLabel {
index: _missionItem.lastSequenceNumber index: _missionItem.lastSequenceNumber
label: "Exit" label: "Exit"
checked: _missionItem.isCurrentItem checked: _missionItem.isCurrentItem
onClicked: _root.clicked(_missionItem.sequenceNumber)
onClicked: setCurrentItem(_missionItem.sequenceNumber)
} }
} }
} }
......
...@@ -1279,6 +1279,7 @@ void MissionController::_activeVehicleSet(void) ...@@ -1279,6 +1279,7 @@ void MissionController::_activeVehicleSet(void)
connect(_activeVehicle, &Vehicle::homePositionChanged, this, &MissionController::_activeVehicleHomePositionChanged); connect(_activeVehicle, &Vehicle::homePositionChanged, this, &MissionController::_activeVehicleHomePositionChanged);
connect(_activeVehicle, &Vehicle::defaultCruiseSpeedChanged, this, &MissionController::_recalcMissionFlightStatus); connect(_activeVehicle, &Vehicle::defaultCruiseSpeedChanged, this, &MissionController::_recalcMissionFlightStatus);
connect(_activeVehicle, &Vehicle::defaultHoverSpeedChanged, this, &MissionController::_recalcMissionFlightStatus); connect(_activeVehicle, &Vehicle::defaultHoverSpeedChanged, this, &MissionController::_recalcMissionFlightStatus);
connect(_activeVehicle, &Vehicle::vehicleTypeChanged, this, &MissionController::complexMissionItemNamesChanged);
if (_activeVehicle->parameterManager()->parametersReady() && !syncInProgress()) { if (_activeVehicle->parameterManager()->parametersReady() && !syncInProgress()) {
// We are switching between two previously existing vehicles. We have to manually ask for the items from the Vehicle. // We are switching between two previously existing vehicles. We have to manually ask for the items from the Vehicle.
......
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