forked from mavlink/qgroundcontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Frontend UI for GripperAction Feature
Now the user can release and grab the gripper while the UAV has motors armed with the action button and also while the motors are disarmed in a specific toolbar option.
- Loading branch information
Showing
16 changed files
with
272 additions
and
1 deletion.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,71 @@ | ||
|
||
import QtQuick 2.3 | ||
import QtQuick.Controls 1.2 | ||
import QtQuick.Controls.Styles 1.4 | ||
import QtQuick.Dialogs 1.2 | ||
import QtLocation 5.3 | ||
import QtPositioning 5.3 | ||
import QtQuick.Layouts 1.2 | ||
|
||
import QGroundControl 1.0 | ||
import QGroundControl.ScreenTools 1.0 | ||
import QGroundControl.Controls 1.0 | ||
import QGroundControl.Palette 1.0 | ||
import QGroundControl.Vehicle 1.0 | ||
import QGroundControl.FlightMap 1.0 | ||
|
||
Component { | ||
id: messageDialogComponent | ||
QGCPopupDialog { | ||
title: "Select one action" | ||
property var acceptFunction: null | ||
buttons: StandardButton.Cancel | ||
|
||
onRejected:{ | ||
_guidedController._gripperFunction = Vehicle.Invalid_option | ||
_guidedController.closeAll() | ||
close() | ||
} | ||
|
||
onAccepted: { | ||
if (acceptFunction) { | ||
_guidedController._gripperFunction = Vehicle.Invalid_option | ||
close() | ||
} | ||
} | ||
|
||
RowLayout { | ||
QGCColumnButton { | ||
id: grabButton | ||
text: "Grab" | ||
iconSource: "/res/GripperGrab.svg" | ||
pointSize: ScreenTools.defaultFontPointSize * 3.5 | ||
backRadius: width / 40 | ||
heightFactor: 0.75 | ||
Layout.preferredHeight: releaseButton.height | ||
Layout.preferredWidth: releaseButton.width | ||
|
||
onClicked: { | ||
_guidedController._gripperFunction = Vehicle.Gripper_grab | ||
close() | ||
} | ||
} | ||
|
||
QGCColumnButton { | ||
id: releaseButton | ||
text: "Release" | ||
iconSource: "/res/GripperRelease.svg" | ||
pointSize: ScreenTools.defaultFontPointSize * 3.5 | ||
backRadius: width / 40 | ||
heightFactor: 0.75 | ||
Layout.preferredWidth: ScreenTools.defaultFontPixelWidth * 27 | ||
Layout.preferredHeight: Layout.preferredWidth / 1.20 | ||
|
||
onClicked: { | ||
_guidedController._gripperFunction = Vehicle.Gripper_release | ||
close() | ||
} | ||
} | ||
} | ||
} | ||
} |
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,24 @@ | ||
/**************************************************************************** | ||
* | ||
* (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 | ||
import QGroundControl 1.0 | ||
|
||
GuidedToolStripAction { | ||
property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle | ||
property bool _initialConnectComplete: activeVehicle ? activeVehicle.initialConnectComplete : false | ||
property bool _grip_enable: _initialConnectComplete ? activeVehicle.hasGripper : false | ||
property bool _isVehicleArmed: _initialConnectComplete ? activeVehicle.armed : false | ||
|
||
text: "Gripper" | ||
iconSource: "/res/Gripper.svg" | ||
visible: !_isVehicleArmed && _grip_enable // in this way if the pilot it's on the ground can release the cargo without actions tool | ||
enabled: _grip_enable | ||
actionID: _guidedController.actionGripper | ||
} |
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.