Commit 82eb4f53 authored by DoinLakeFlyer's avatar DoinLakeFlyer

parent 2a20075f
......@@ -659,6 +659,8 @@ HEADERS += \
src/QmlControls/RCToParamDialogController.h \
src/QmlControls/ScreenToolsController.h \
src/QmlControls/TerrainProfile.h \
src/QmlControls/ToolStripAction.h \
src/QmlControls/ToolStripActionList.h \
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h \
src/Settings/ADSBVehicleManagerSettings.h \
src/Settings/AppSettings.h \
......@@ -867,6 +869,8 @@ SOURCES += \
src/QmlControls/RCToParamDialogController.cc \
src/QmlControls/ScreenToolsController.cc \
src/QmlControls/TerrainProfile.cc \
src/QmlControls/ToolStripAction.cc \
src/QmlControls/ToolStripActionList.cc \
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc \
src/Settings/ADSBVehicleManagerSettings.cc \
src/Settings/AppSettings.cc \
......
......@@ -203,12 +203,19 @@
<file alias="QGroundControl/FlightDisplay/FlyViewMissionCompleteDialog.qml">src/FlightDisplay/FlyViewMissionCompleteDialog.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewPreFlightChecklistPopup.qml">src/FlightDisplay/FlyViewPreFlightChecklistPopup.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewToolStrip.qml">src/FlightDisplay/FlyViewToolStrip.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewToolStripActionList.qml">src/FlightDisplay/FlyViewToolStripActionList.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewVideo.qml">src/FlightDisplay/FlyViewVideo.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewWidgetLayer.qml">src/FlightDisplay/FlyViewWidgetLayer.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionActionList.qml">src/FlightDisplay/GuidedActionActionList.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionConfirm.qml">src/FlightDisplay/GuidedActionConfirm.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionList.qml">src/FlightDisplay/GuidedActionList.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionsController.qml">src/FlightDisplay/GuidedActionsController.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionLand.qml">src/FlightDisplay/GuidedActionLand.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionList.qml">src/FlightDisplay/GuidedActionList.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionTakeoff.qml">src/FlightDisplay/GuidedActionTakeoff.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionPause.qml">src/FlightDisplay/GuidedActionPause.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionRTL.qml">src/FlightDisplay/GuidedActionRTL.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedAltitudeSlider.qml">src/FlightDisplay/GuidedAltitudeSlider.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedToolStripAction.qml">src/FlightDisplay/GuidedToolStripAction.qml</file>
<file alias="QGroundControl/FlightDisplay/MultiVehicleList.qml">src/FlightDisplay/MultiVehicleList.qml</file>
<file alias="QGroundControl/FlightDisplay/MultiVehiclePanel.qml">src/FlightDisplay/MultiVehiclePanel.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightBatteryCheck.qml">src/FlightDisplay/PreFlightBatteryCheck.qml</file>
......@@ -216,6 +223,7 @@
<file alias="QGroundControl/FlightDisplay/PreFlightRCCheck.qml">src/FlightDisplay/PreFlightRCCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSensorsHealthCheck.qml">src/FlightDisplay/PreFlightSensorsHealthCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSoundCheck.qml">src/FlightDisplay/PreFlightSoundCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightCheckListShowAction.qml">src/FlightDisplay/PreFlightCheckListShowAction.qml</file>
<file alias="QGroundControl/FlightDisplay/TerrainProgress.qml">src/FlightDisplay/TerrainProgress.qml</file>
<file alias="QGroundControl/FlightDisplay/VehicleWarnings.qml">src/FlightDisplay/VehicleWarnings.qml</file>
<file alias="QGroundControl/FlightDisplay/qmldir">src/QmlControls/QGroundControl/FlightDisplay/qmldir</file>
......
......@@ -34,8 +34,8 @@ import QGroundControl.Vehicle 1.0
Item {
id: _root
property var parentToolInsets // These insets tell you what screen real estate is available for positioning the controls in your overlay
property var toolInsets: _toolInsets // These are the insets for your custom overlay additions
property var parentToolInsets // These insets tell you what screen real estate is available for positioning the controls in your overlay
property var totalToolInsets: _toolInsets // These are the insets for your custom overlay additions
property var mapControl
QGCToolInsets {
......
......@@ -27,10 +27,9 @@ Popup {
clip: true
}
property bool useChecklist: QGroundControl.settingsManager.appSettings.useChecklist.rawValue && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _enforceChecklist: useChecklist && QGroundControl.settingsManager.appSettings.enforceChecklist.rawValue
property bool _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist.rawValue && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
property bool _enforceChecklist: _useChecklist && QGroundControl.settingsManager.appSettings.enforceChecklist.rawValue
property bool _checklistComplete: _activeVehicle && (_activeVehicle.checkListState === Vehicle.CheckListPassed)
on_ActiveVehicleChanged: _showPreFlightChecklistIfNeeded()
......
......@@ -7,103 +7,26 @@
*
****************************************************************************/
import QGroundControl 1.0
import QGroundControl.Controls 1.0
import QtQml.Models 2.12
import QGroundControl 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FlightDisplay 1.0
ToolStrip {
title: qsTr("Fly")
id: _root
title: qsTr("Fly")
property var guidedActionsController
property var guidedActionList
property bool usePreFlightChecklist
signal displayPreFlightChecklist
property bool _anyActionAvailable: guidedActionsController.showStartMission || guidedActionsController.showResumeMission || guidedActionsController.showChangeAlt || guidedActionsController.showLandAbort
property var _actionModel: [
{
title: guidedActionsController.startMissionTitle,
text: guidedActionsController.startMissionMessage,
action: guidedActionsController.actionStartMission,
visible: guidedActionsController.showStartMission
},
{
title: guidedActionsController.continueMissionTitle,
text: guidedActionsController.continueMissionMessage,
action: guidedActionsController.actionContinueMission,
visible: guidedActionsController.showContinueMission
},
{
title: guidedActionsController.changeAltTitle,
text: guidedActionsController.changeAltMessage,
action: guidedActionsController.actionChangeAlt,
visible: guidedActionsController.showChangeAlt
},
{
title: guidedActionsController.landAbortTitle,
text: guidedActionsController.landAbortMessage,
action: guidedActionsController.actionLandAbort,
visible: guidedActionsController.showLandAbort
}
]
model: [
{
name: "Checklist",
iconSource: "/qmlimages/check.svg",
buttonVisible: usePreFlightChecklist,
buttonEnabled: usePreFlightChecklist && activeVehicle && !activeVehicle.armed,
},
{
name: guidedActionsController.takeoffTitle,
iconSource: "/res/takeoff.svg",
buttonVisible: guidedActionsController.showTakeoff || !guidedActionsController.showLand,
buttonEnabled: guidedActionsController.showTakeoff,
action: guidedActionsController.actionTakeoff
},
{
name: guidedActionsController.landTitle,
iconSource: "/res/land.svg",
buttonVisible: guidedActionsController.showLand && !guidedActionsController.showTakeoff,
buttonEnabled: guidedActionsController.showLand,
action: guidedActionsController.actionLand
},
{
name: guidedActionsController.rtlTitle,
iconSource: "/res/rtl.svg",
buttonVisible: true,
buttonEnabled: guidedActionsController.showRTL,
action: guidedActionsController.actionRTL
},
{
name: guidedActionsController.pauseTitle,
iconSource: "/res/pause-mission.svg",
buttonVisible: guidedActionsController.showPause,
buttonEnabled: guidedActionsController.showPause,
action: guidedActionsController.actionPause
},
{
name: qsTr("Action"),
iconSource: "/res/action.svg",
buttonVisible: _anyActionAvailable,
buttonEnabled: true,
action: -1
}
]
onClicked: {
if(index === 0) {
displayPreFlightChecklist()
} else {
guidedActionsController.closeAll()
var action = model[index].action
if (action === -1) {
guidedActionList.model = _actionModel
guidedActionList.visible = true
} else {
guidedActionsController.confirmAction(action)
}
}
FlyViewToolStripActionList {
id: flyViewToolStripActionList
onDisplayPreFlightChecklist: _root.displayPreFlightChecklist()
}
model: flyViewToolStripActionList.model
}
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQml.Models 2.12
import QGroundControl 1.0
import QGroundControl.Controls 1.0
ToolStripActionList {
signal displayPreFlightChecklist
model: [
PreFlightCheckListShowAction {
onTriggered: displayPreFlightChecklist()
},
GuidedActionTakeoff {
guidedController: guidedActionsController
},
GuidedActionLand {
guidedController: guidedActionsController
},
GuidedActionRTL {
guidedController: guidedActionsController
},
GuidedActionPause {
guidedController: guidedActionsController
},
GuidedActionActionList {
guidedController: guidedActionsController
}
]
}
......@@ -38,7 +38,7 @@ Item {
property var mapControl
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _planMasterController: mainWindow.planMasterControllerPlanView
property var _planMasterController: mainWindow.planMasterControllerFlyView
property var _missionController: _planMasterController.missionController
property var _geoFenceController: _planMasterController.geoFenceController
property var _rallyPointController: _planMasterController.rallyPointController
......@@ -115,7 +115,6 @@ Item {
maxHeight: parent.height - y - parentToolInsets.leftEdgeBottomInset - _toolsMargin
guidedActionsController: _guidedController
guidedActionList: _guidedActionList
usePreFlightChecklist: preFlightChecklistPopup.useChecklist
visible: !QGroundControl.videoManager.fullScreen
onDisplayPreFlightChecklist: preFlightChecklistPopup.open()
......
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QGroundControl.FlightDisplay 1.0
GuidedToolStripAction {
text: guidedController.actionListTitle
iconSource: "/res/action.svg"
visible: guidedController.showActionList
enabled: true
actionID: guidedController.actionActionList
}
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QGroundControl.FlightDisplay 1.0
GuidedToolStripAction {
text: guidedController.landTitle
message: guidedController.landMessage
iconSource: "/res/land.svg"
visible: guidedController.showLand && !guidedController.showTakeoff
enabled: guidedController.showLand
actionID: guidedController.actionLand
}
......@@ -14,6 +14,7 @@ import QtQuick.Layouts 1.2
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FlightDisplay 1.0
import QGroundControl.Palette 1.0
/// Dialog showing list of available guided actions
......@@ -28,12 +29,41 @@ Rectangle {
property var guidedController
property var altitudeSlider
property alias model: actionRepeater.model
function show() {
visible = true
}
property real _margins: Math.round(ScreenTools.defaultFontPixelHeight * 0.66)
property real _actionWidth: ScreenTools.defaultFontPixelWidth * 25
property real _actionHorizSpacing: ScreenTools.defaultFontPixelHeight * 2
property var _model: [
{
title: guidedController.startMissionTitle,
text: guidedController.startMissionMessage,
action: guidedController.actionStartMission,
visible: guidedController.showStartMission
},
{
title: guidedController.continueMissionTitle,
text: guidedController.continueMissionMessage,
action: guidedController.actionContinueMission,
visible: guidedController.showContinueMission
},
{
title: guidedController.changeAltTitle,
text: guidedController.changeAltMessage,
action: guidedController.actionChangeAlt,
visible: guidedController.showChangeAlt
},
{
title: guidedController.landAbortTitle,
text: guidedController.landAbortMessage,
action: guidedController.actionLandAbort,
visible: guidedController.showLandAbort
}
]
QGCPalette { id: qgcPal }
......@@ -67,7 +97,8 @@ Rectangle {
spacing: _actionHorizSpacing
Repeater {
id: actionRepeater
id: actionRepeater
model: _model
ColumnLayout {
spacing: ScreenTools.defaultFontPixelHeight / 2
......
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QGroundControl.FlightDisplay 1.0
GuidedToolStripAction {
text: guidedController.pauseTitle
iconSource: "/res/pause-mission.svg"
visible: guidedController.showPause
enabled: guidedController.showPause
actionID: guidedController.actionPause
}
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QGroundControl.FlightDisplay 1.0
GuidedToolStripAction {
text: guidedController.rtlTitle
iconSource: "/res/rtl.svg"
visible: true
enabled: guidedController.showRTL
actionID: guidedController.actionRTL
}
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QGroundControl.FlightDisplay 1.0
GuidedToolStripAction {
text: guidedController.takeoffTitle
iconSource: "/res/takeoff.svg"
visible: guidedController.showTakeoff || !guidedController.showLand
enabled: guidedController.showTakeoff
actionID: guidedController.actionTakeoff
}
......@@ -52,6 +52,7 @@ Item {
readonly property string gotoTitle: qsTr("Go To Location")
readonly property string vtolTransitionTitle: qsTr("VTOL Transition")
readonly property string roiTitle: qsTr("ROI")
readonly property string actionListTitle: qsTr("Action")
readonly property string armMessage: qsTr("Arm the vehicle.")
readonly property string disarmMessage: qsTr("Disarm the vehicle")
......@@ -95,6 +96,7 @@ Item {
readonly property int actionVtolTransitionToFwdFlight: 20
readonly property int actionVtolTransitionToMRFlight: 21
readonly property int actionROI: 22
readonly property int actionActionList: 23
property bool _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist.rawValue && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
property bool _enforceChecklist: _useChecklist && QGroundControl.settingsManager.appSettings.enforceChecklist.rawValue
......@@ -114,6 +116,7 @@ Item {
property bool showROI: _guidedActionsEnabled && !_hideROI && _vehicleFlying && activeVehicle.roiModeSupported && !_missionActive
property bool showLandAbort: _guidedActionsEnabled && _vehicleFlying && _fixedWingOnApproach
property bool showGotoLocation: _guidedActionsEnabled && _vehicleFlying
property bool showActionList: _guidedActionsEnabled && (showStartMission || showResumeMission || showChangeAlt || showLandAbort)
// Note: The '_missionItemCount - 2' is a hack to not trigger resume mission when a mission ends with an RTL item
property bool showResumeMission: activeVehicle && !_vehicleArmed && _vehicleWasFlying && _missionAvailable && _resumeMissionIndex > 0 && (_resumeMissionIndex < _missionItemCount - 2)
......@@ -412,6 +415,9 @@ Item {
confirmDialog.message = roiMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showROI })
break;
case actionActionList:
actionList.show()
return
default:
console.warn("Unknown actionCode", actionCode)
return
......
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QGroundControl.Controls 1.0
ToolStripAction {
property var guidedController
property int actionID
property string message
onTriggered: {
guidedActionsController.closeAll()
if (actionID === -1) {
// FIXME: NYI
guidedActionList.model = _actionModel
guidedActionList.visible = true
} else {
guidedController.confirmAction(actionID)
}
}
}
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QGroundControl 1.0
import QGroundControl.Controls 1.0
ToolStripAction {
text: qsTr("Checklist")
iconSource: "/qmlimages/check.svg"
visible: _useChecklist
enabled: _useChecklist && _activeVehicle && !_activeVehicle.armed
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist.rawValue && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
}
......@@ -277,13 +277,11 @@ Item {
function insertROIAfterCurrent(coordinate) {
var nextIndex = _missionController.currentPlanViewVIIndex + 1
_missionController.insertROIMissionItem(coordinate, nextIndex, true /* makeCurrentItem */)
_addROIOnClick = false
}
function insertCancelROIAfterCurrent() {
var nextIndex = _missionController.currentPlanViewVIIndex + 1
_missionController.insertCancelROIMissionItem(nextIndex, true /* makeCurrentItem */)
_addROIOnClick = false
}
function insertComplexItemAfterCurrent(complexItemName) {
......@@ -421,8 +419,8 @@ Item {
if (_addWaypointOnClick) {
insertSimpleItemAfterCurrent(coordinate)
} else if (_addROIOnClick) {
_addROIOnClick = false
insertROIAfterCurrent(coordinate)
_addROIOnClick = false
}
break
......@@ -589,117 +587,95 @@ Item {
property bool _isRallyLayer: _editingLayer == _layerRallyPoints
property bool _isMissionLayer: _editingLayer == _layerMission
model: [
/*{
name: qsTr("Fly"),
iconSource: "/qmlimages/PaperPlane.svg",
buttonEnabled: true,
buttonVisible: true,
},*/
{
name: qsTr("File"),
iconSource: "/qmlimages/MapSync.svg",
buttonEnabled: !_planMasterController.syncInProgress,
buttonVisible: true,
showAlternateIcon: _planMasterController.dirty,
alternateIconSource:"/qmlimages/MapSyncChanged.svg",
dropPanelComponent: syncDropPanel
},
{
name: qsTr("Takeoff"),
iconSource: "/res/takeoff.svg",
buttonEnabled: _missionController.isInsertTakeoffValid,
buttonVisible: _isMissionLayer
},
{
name: _editingLayer == _layerRallyPoints ? qsTr("Rally Point") : qsTr("Waypoint"),
iconSource: "/qmlimages/MapAddMission.svg",
buttonEnabled: _isRallyLayer ? true : _missionController.flyThroughCommandsAllowed,
buttonVisible: _isRallyLayer || _isMissionLayer,
toggle: true,
checked: _addWaypointOnClick
},
{
name: _missionController.isROIActive ? qsTr("Cancel ROI") : qsTr("ROI"),
iconSource: "/qmlimages/MapAddMission.svg",
buttonEnabled: !_missionController.onlyInsertTakeoffValid,
buttonVisible: _isMissionLayer && _planMasterController.controllerVehicle.roiModeSupported,
toggle: !_missionController.isROIActive
},
{
name: _singleComplexItem ? _missionController.complexMissionItemNames[0] : qsTr("Pattern"),
iconSource: "/qmlimages/MapDrawShape.svg",
buttonEnabled: _missionController.flyThroughCommandsAllowed,
buttonVisible: _isMissionLayer,
dropPanelComponent: _singleComplexItem ? undefined : patternDropPanel
},
{
name: _planMasterController.controllerVehicle.multiRotor ? qsTr("Return") : qsTr("Land"),
iconSource: "/res/rtl.svg",
buttonEnabled: _missionController.isInsertLandValid,
buttonVisible: _isMissionLayer
},
{
name: qsTr("Center"),
iconSource: "/qmlimages/MapCenter.svg",
buttonEnabled: true,
buttonVisible: true,
dropPanelComponent: centerMapDropPanel
}
]
ToolStripActionList {
id: toolStripActionList
model: [
ToolStripAction {
text: qsTr("File")
enabled: !_planMasterController.syncInProgress
visible: true
showAlternateIcon: _planMasterController.dirty
iconSource: "/qmlimages/MapSync.svg"
alternateIconSource: "/qmlimages/MapSyncChanged.svg"
dropPanelComponent: syncDropPanel
},
ToolStripAction {
text: qsTr("Takeoff")
iconSource: "/res/takeoff.svg"
enabled: _missionController.isInsertTakeoffValid
visible: toolStrip._isMissionLayer
onTriggered: {
toolStrip.allAddClickBoolsOff()
insertTakeItemAfterCurrent()
}
},
ToolStripAction {
text: _editingLayer == _layerRallyPoints ? qsTr("Rally Point") : qsTr("Waypoint")
iconSource: "/qmlimages/MapAddMission.svg"
enabled: toolStrip._isRallyLayer ? true : _missionController.flyThroughCommandsAllowed
visible: toolStrip._isRallyLayer || toolStrip._isMissionLayer
checkable: true
onCheckedChanged: _addWaypointOnClick = checked
property bool myAddWaypointOnClick: _addWaypointOnClick
onMyAddWaypointOnClickChanged: checked = _addWaypointOnClick
},
ToolStripAction {
text: _missionController.isROIActive ? qsTr("Cancel ROI") : qsTr("ROI")
iconSource: "/qmlimages/MapAddMission.svg"
enabled: !_missionController.onlyInsertTakeoffValid
visible: toolStrip._isMissionLayer && _planMasterController.controllerVehicle.roiModeSupported
checkable: !_missionController.isROIActive
onCheckedChanged: _addROIOnClick = checked
onTriggered: {
if (_missionController.isROIActive) {
toolStrip.allAddClickBoolsOff()
insertCancelROIAfterCurrent()
}
}
property bool myAddROIOnClick: _addROIOnClick
onMyAddROIOnClickChanged: checked = _addROIOnClick
},
ToolStripAction {
text: _singleComplexItem ? _missionController.complexMissionItemNames[0] : qsTr("Pattern")
iconSource: "/qmlimages/MapDrawShape.svg"
enabled: _missionController.flyThroughCommandsAllowed
visible: toolStrip._isMissionLayer
dropPanelComponent: _singleComplexItem ? undefined : patternDropPanel
onTriggered: {
toolStrip.allAddClickBoolsOff()
if (_singleComplexItem) {
insertComplexItemAfterCurrent(_missionController.complexMissionItemNames[0])
}
}
},
ToolStripAction {
text: _planMasterController.controllerVehicle.multiRotor ? qsTr("Return") : qsTr("Land")
iconSource: "/res/rtl.svg"
enabled: _missionController.isInsertLandValid
visible: toolStrip._isMissionLayer
onTriggered: {
toolStrip.allAddClickBoolsOff()
insertLandItemAfterCurrent()
}
},
ToolStripAction {
text: qsTr("Center")
iconSource: "/qmlimages/MapCenter.svg"
enabled: true
visible: true
dropPanelComponent: centerMapDropPanel
}
]
}
model: toolStripActionList.model
function allAddClickBoolsOff() {
_addROIOnClick = false
_addWaypointOnClick = false
}
onClicked: {
switch (index) {
/*case flyButtonIndex:
mainWindow.showFlyView()
break*/
case takeoffButtonIndex:
allAddClickBoolsOff()
insertTakeItemAfterCurrent()
break
case waypointButtonIndex:
if (_addWaypointOnClick) {
allAddClickBoolsOff()
setChecked(index, false)
} else {
allAddClickBoolsOff()
_addWaypointOnClick = checked
}
break
case roiButtonIndex:
if (_addROIOnClick) {
allAddClickBoolsOff()
setChecked(index, false)
} else {
allAddClickBoolsOff()
if (_missionController.isROIActive) {
insertCancelROIAfterCurrent()
} else {
_addROIOnClick = checked
}
}
break
case patternButtonIndex:
allAddClickBoolsOff()
if (_singleComplexItem) {
insertComplexItemAfterCurrent(_missionController.complexMissionItemNames[0])
}
break
case landButtonIndex:
allAddClickBoolsOff()
insertLandItemAfterCurrent()
break
}
}
onDropped: {
allAddClickBoolsOff()
}
onDropped: allAddClickBoolsOff()
}
//-----------------------------------------------------------