diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml index 77bdde48c8f7a11963ab9cad69fe6fca0d960226..1b1b7a00efb225c3b567b52e6cc8455be4402f09 100644 --- a/src/FlightDisplay/FlightDisplayView.qml +++ b/src/FlightDisplay/FlightDisplayView.qml @@ -98,7 +98,7 @@ QGCView { } } - PlanElemementMasterController { + PlanMasterController { id: masterController Component.onCompleted: start(false /* editMode */) } @@ -249,6 +249,7 @@ QGCView { flightWidgets: flightDisplayViewWidgets rightPanelWidth: ScreenTools.defaultFontPixelHeight * 9 qgcView: root + multiVehicleView: !singleVehicleView.checked scaleState: (_mainIsMap && flyViewOverlay.item) ? (flyViewOverlay.item.scaleState ? flyViewOverlay.item.scaleState : "bottomMode") : "bottomMode" } } diff --git a/src/FlightDisplay/FlightDisplayViewMap.qml b/src/FlightDisplay/FlightDisplayViewMap.qml index 93ed14a822ab7c566ce1c1e9dbc7da0cb4c450a0..4c08b002f7d7fa778069f79121a4954d06fd53c5 100644 --- a/src/FlightDisplay/FlightDisplayViewMap.qml +++ b/src/FlightDisplay/FlightDisplayViewMap.qml @@ -39,6 +39,7 @@ FlightMap { property var flightWidgets property var rightPanelWidth property var qgcView ///< QGCView control which contains this map + property var multiVehicleView ///< true: multi-vehicle view, false: single vehicle view property rect centerViewport: Qt.rect(0, 0, width, height) @@ -206,11 +207,23 @@ FlightMap { } } - // Add the items associated with the flight place to the map - PlanMapItems { - map: flightMap - largeMapView: _mainIsMap - masterController: _planMasterController + // Add the items associated with each vehicles flight plan to the map + Repeater { + model: QGroundControl.multiVehicleManager.vehicles + + PlanMapItems { + map: flightMap + largeMapView: _mainIsMap + masterController: masterController + isActiveVehicle: _vehicle.active + + property var _vehicle: object + + PlanMasterController { + id: masterController + Component.onCompleted: startStaticActiveVehicle(object) + } + } } GeoFenceMapVisuals { diff --git a/src/FlightMap/MapItems/PlanMapItems.qml b/src/FlightMap/MapItems/PlanMapItems.qml index b0775aa44d13d06e613b9bddad61029f76f9dcd6..559e2d092c85e88df5ceef5e55344bd86989e92b 100644 --- a/src/FlightMap/MapItems/PlanMapItems.qml +++ b/src/FlightMap/MapItems/PlanMapItems.qml @@ -22,6 +22,7 @@ Item { property var map ///< Map control to show items on property bool largeMapView ///< true: map takes up entire view, false: map is in small window property var masterController ///< Reference to PlanMasterController for vehicle + property bool isActiveVehicle ///< true: vehicle associated with plan is active, false: in-active property var _map: map property var _missionController: masterController.missionController @@ -35,11 +36,16 @@ Item { delegate: MissionItemMapVisual { map: _map - onClicked: guidedActionsController.confirmAction(guidedActionsController.actionSetWaypoint, Math.max(object.sequenceNumber, 1)) + onClicked: { + if (isActiveVehicle) { + // Only active vehicle supports click to change current mission item + guidedActionsController.confirmAction(guidedActionsController.actionSetWaypoint, Math.max(object.sequenceNumber, 1)) + } + } } } - // Waypiont lines + // Waypoint lines Instantiator { model: largeMapView ? _missionController.waypointLines : 0 diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index f4672d2c97b33526360e7748aceb32ec32e7ab9e..c2d515617763b3f1078bd79bf226563909d886cb 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -144,7 +144,7 @@ QGCView { } } - PlanElemementMasterController { + PlanMasterController { id: masterController Component.onCompleted: { diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index 26a5656d8f9863b95ada271267996bca47a4ae2e..827bf856b479f6d933f77380341902b5276c6e6f 100644 --- a/src/QGCApplication.cc +++ b/src/QGCApplication.cc @@ -365,7 +365,7 @@ void QGCApplication::_initCommon(void) qmlRegisterType ("QGroundControl.Controllers", 1, 0, "ParameterEditorController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "ESP8266ComponentController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "ScreenToolsController"); - qmlRegisterType ("QGroundControl.Controllers", 1, 0, "PlanElemementMasterController"); + qmlRegisterType ("QGroundControl.Controllers", 1, 0, "PlanMasterController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "ValuesWidgetController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "QGCFileDialogController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "RCChannelMonitorController");