-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* "Actions" button now show a drop panel of additional action buttons * Custom build can add additional actions by overriding FlyViewAdditionalCustomActionsList.qml * Actions drop panel has three sections: Guided Actions, Custom Build Actions, Mavlink Actions * Fixes a number of problems with Mavlink Actions
- Loading branch information
1 parent
218d377
commit 1604ce9
Showing
15 changed files
with
218 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/**************************************************************************** | ||
* | ||
* (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 QtQuick | ||
import QtQuick.Controls | ||
import QtQuick.Layouts | ||
|
||
import QGroundControl | ||
import QGroundControl.Controls | ||
import QGroundControl.FlightDisplay | ||
import QGroundControl.Controllers | ||
|
||
ToolStripAction { | ||
id: action | ||
text: qsTr("Actions") | ||
iconSource: "/res/action.svg" | ||
visible: _additionalActions.anyActionAvailable || _mavlinkActions.anyActionAvailable || _customActions.anyActionAvailable | ||
enabled: true | ||
|
||
property var _guidedController: globals.guidedControllerFlyView | ||
|
||
property var _additionalActions: FlyViewAdditionalActionsList { | ||
guidedController: _guidedController | ||
} | ||
|
||
property var _mavlinkActions: MavlinkActionManager { | ||
actionFileNameFact: QGroundControl.settingsManager.mavlinkActionsSettings.flyViewActionsFile | ||
|
||
property bool anyActionAvailable: QGroundControl.multiVehicleManager.activeVehicle && actions.count > 0 | ||
} | ||
|
||
property var _customActions: FlyViewAdditionalCustomActionsList { | ||
guidedController: _guidedController | ||
} | ||
|
||
dropPanelComponent: Component { | ||
FlyViewAdditionalActionsPanel { | ||
additionalActions: _additionalActions | ||
mavlinkActions: _mavlinkActions.actions | ||
customActions: _customActions | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/**************************************************************************** | ||
* | ||
* (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 | ||
|
||
QtObject { | ||
property var guidedController | ||
|
||
property bool anyActionAvailable: guidedController.showStartMission || guidedController.showContinueMission || guidedController.showChangeAlt || | ||
guidedController.showLandAbort || guidedController.showChangeSpeed || guidedController.showGripper | ||
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 | ||
}, | ||
{ | ||
title: guidedController.changeSpeedTitle, | ||
text: guidedController.changeSpeedMessage, | ||
action: guidedController.actionChangeSpeed, | ||
visible: guidedController.showChangeSpeed | ||
}, | ||
{ | ||
title: guidedController.gripperTitle, | ||
text: guidedController.gripperMessage, | ||
action: guidedController.actionGripper, | ||
visible: guidedController.showGripper | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/**************************************************************************** | ||
* | ||
* (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 QtQuick | ||
import QtQuick.Layouts | ||
|
||
import QGroundControl | ||
import QGroundControl.Controls | ||
|
||
ColumnLayout { | ||
property var additionalActions | ||
property var mavlinkActions | ||
property var customActions | ||
|
||
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle | ||
property var _guidedController: globals.guidedControllerFlyView | ||
|
||
// Pre-defined Additional Guided Actions | ||
Repeater { | ||
model: additionalActions.model | ||
|
||
QGCButton { | ||
Layout.fillWidth: true | ||
text: modelData.title | ||
visible: modelData.visible | ||
|
||
onClicked: { | ||
dropPanel.hide() | ||
_guidedController.confirmAction(modelData.action) | ||
} | ||
} | ||
} | ||
|
||
// Custom Build Actions | ||
Repeater { | ||
model: customActions.model | ||
|
||
QGCButton { | ||
Layout.fillWidth: true | ||
text: modelData.title | ||
visible: modelData.visible | ||
|
||
onClicked: { | ||
dropPanel.hide() | ||
_guidedController.confirmAction(modelData.action) | ||
} | ||
} | ||
} | ||
|
||
// User-defined Mavlink Actions | ||
Repeater { | ||
model: _activeVehicle ? mavlinkActions : undefined // The action list is a QmlObjectListModel | ||
|
||
QGCButton { | ||
Layout.fillWidth: true | ||
text: object.label | ||
|
||
onClicked: { | ||
dropPanel.hide() | ||
object.sendTo(_activeVehicle) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.