Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
12109fad
Commit
12109fad
authored
Apr 12, 2017
by
Don Gagne
Committed by
GitHub
Apr 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4967 from DonLakeFlyer/GuidedFixes
Guided fixes
parents
4fe3514b
b15835f7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
83 deletions
+99
-83
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+64
-9
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+3
-54
GuidedActionsController.qml
src/FlightDisplay/GuidedActionsController.qml
+31
-19
MissionController.cc
src/MissionManager/MissionController.cc
+1
-1
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
12109fad
...
...
@@ -96,6 +96,16 @@ QGCView {
onResumeMissionReady
:
guidedActionsController
.
confirmAction
(
guidedActionsController
.
actionResumeMissionReady
)
}
GeoFenceController
{
id
:
flyGeoFenceController
Component.onCompleted
:
start
(
false
/* editMode */
)
}
RallyPointController
{
id
:
flyRallyPointController
Component.onCompleted
:
start
(
false
/* editMode */
)
}
MessageDialog
{
id
:
px4JoystickSupport
text
:
qsTr
(
"
Joystick support requires MAVLink MANUAL_CONTROL support.
"
)
+
...
...
@@ -123,6 +133,49 @@ QGCView {
}
}
// The following code is used to track vehicle states such that we prompt to remove mission from vehicle when mission completes
property
bool
vehicleArmed
:
_activeVehicle
?
_activeVehicle
.
armed
:
true
// true here prevents pop up from showing during shutdown
property
bool
vehicleWasArmed
:
false
property
bool
vehicleInMissionFlightMode
:
_activeVehicle
?
(
_activeVehicle
.
flightMode
===
_activeVehicle
.
missionFlightMode
)
:
false
property
bool
promptForMissionRemove
:
false
onVehicleArmedChanged
:
{
if
(
vehicleArmed
)
{
if
(
!
promptForMissionRemove
)
{
promptForMissionRemove
=
vehicleInMissionFlightMode
vehicleWasArmed
=
true
}
}
else
{
if
(
promptForMissionRemove
&&
(
flyMissionController
.
containsItems
||
flyGeoFenceController
.
containsItems
||
flyRallyPointController
.
containsItems
))
{
root
.
showDialog
(
removeMissionDialogComponent
,
qsTr
(
"
Flight complete
"
),
showDialogDefaultWidth
,
StandardButton
.
No
|
StandardButton
.
Yes
)
}
promptForMissionRemove
=
false
}
}
onVehicleInMissionFlightModeChanged
:
{
if
(
!
promptForMissionRemove
&&
vehicleArmed
)
{
promptForMissionRemove
=
true
}
}
Component
{
id
:
removeMissionDialogComponent
QGCViewMessage
{
message
:
qsTr
(
"
Do you want to remove the mission from the vehicle?
"
)
function
accept
()
{
flyMissionController
.
removeAllFromVehicle
()
flyGeoFenceController
.
removeAllFromVehicle
()
flyRallyPointController
.
removeAllFromVehicle
()
hideDialog
()
}
}
}
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
_mainIsMap
?
_flightMap
.
isSatelliteMap
:
true
}
QGCViewPanel
{
...
...
@@ -157,14 +210,16 @@ QGCView {
}
]
FlightDisplayViewMap
{
id
:
_flightMap
anchors.fill
:
parent
missionController
:
flyMissionController
guidedActionsController
:
_guidedController
flightWidgets
:
flightDisplayViewWidgets
rightPanelWidth
:
ScreenTools
.
defaultFontPixelHeight
*
9
qgcView
:
root
scaleState
:
(
_mainIsMap
&&
flyViewOverlay
.
item
)
?
(
flyViewOverlay
.
item
.
scaleState
?
flyViewOverlay
.
item
.
scaleState
:
"
bottomMode
"
)
:
"
bottomMode
"
id
:
_flightMap
anchors.fill
:
parent
missionController
:
flyMissionController
geoFenceController
:
flyGeoFenceController
rallyPointController
:
flyRallyPointController
guidedActionsController
:
_guidedController
flightWidgets
:
flightDisplayViewWidgets
rightPanelWidth
:
ScreenTools
.
defaultFontPixelHeight
*
9
qgcView
:
root
scaleState
:
(
_mainIsMap
&&
flyViewOverlay
.
item
)
?
(
flyViewOverlay
.
item
.
scaleState
?
flyViewOverlay
.
item
.
scaleState
:
"
bottomMode
"
)
:
"
bottomMode
"
}
}
...
...
@@ -356,7 +411,7 @@ QGCView {
buttonVisible
:
[
_guidedController
.
showTakeoff
||
!
_guidedController
.
showLand
,
_guidedController
.
showLand
&&
!
_guidedController
.
showTakeoff
,
true
,
true
,
true
,
_guidedController
.
smartShotsAvailable
]
buttonEnabled
:
[
_guidedController
.
showTakeoff
,
_guidedController
.
showLand
,
_guidedController
.
showRTL
,
_guidedController
.
showPause
,
_anyActionAvailable
,
_anySmartShotAvailable
]
property
bool
_anyActionAvailable
:
_guidedController
.
show
EmergenyStop
||
_guidedController
.
show
StartMission
||
_guidedController
.
showResumeMission
||
_guidedController
.
showChangeAlt
||
_guidedController
.
showLandAbort
property
bool
_anyActionAvailable
:
_guidedController
.
showStartMission
||
_guidedController
.
showResumeMission
||
_guidedController
.
showChangeAlt
||
_guidedController
.
showLandAbort
property
bool
_anySmartShotAvailable
:
_guidedController
.
showOrbit
property
var
_actionModel
:
[
{
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
12109fad
...
...
@@ -33,6 +33,8 @@ FlightMap {
property
alias
scaleState
:
mapScale
.
state
property
var
missionController
property
var
geoFenceController
property
var
rallyPointController
property
var
guidedActionsController
property
var
flightWidgets
property
var
rightPanelWidth
...
...
@@ -137,59 +139,6 @@ FlightMap {
}
}
GeoFenceController
{
id
:
geoFenceController
Component.onCompleted
:
start
(
false
/* editMode */
)
}
RallyPointController
{
id
:
rallyPointController
Component.onCompleted
:
start
(
false
/* editMode */
)
}
// The following code is used to track vehicle states such that we prompt to remove mission from vehicle when mission completes
property
bool
vehicleArmed
:
_activeVehicle
?
_activeVehicle
.
armed
:
false
property
bool
vehicleWasArmed
:
false
property
bool
vehicleInMissionFlightMode
:
_activeVehicle
?
(
_activeVehicle
.
flightMode
===
_activeVehicle
.
missionFlightMode
)
:
false
property
bool
promptForMissionRemove
:
false
onVehicleArmedChanged
:
{
if
(
vehicleArmed
)
{
if
(
!
promptForMissionRemove
)
{
promptForMissionRemove
=
vehicleInMissionFlightMode
vehicleWasArmed
=
true
}
}
else
{
if
(
promptForMissionRemove
&&
(
missionController
.
containsItems
||
geoFenceController
.
containsItems
||
rallyPointController
.
containsItems
))
{
qgcView
.
showDialog
(
removeMissionDialogComponent
,
qsTr
(
"
Flight complete
"
),
showDialogDefaultWidth
,
StandardButton
.
No
|
StandardButton
.
Yes
)
}
promptForMissionRemove
=
false
}
}
onVehicleInMissionFlightModeChanged
:
{
if
(
!
promptForMissionRemove
&&
vehicleArmed
)
{
promptForMissionRemove
=
true
}
}
Component
{
id
:
removeMissionDialogComponent
QGCViewMessage
{
message
:
qsTr
(
"
Do you want to remove the mission from the vehicle?
"
)
function
accept
()
{
missionController
.
removeAllFromVehicle
()
geoFenceController
.
removeAllFromVehicle
()
rallyPointController
.
removeAllFromVehicle
()
hideDialog
()
}
}
}
ExclusiveGroup
{
id
:
_mapTypeButtonsExclusiveGroup
}
...
...
@@ -239,7 +188,7 @@ FlightMap {
delegate
:
MissionItemMapVisual
{
map
:
flightMap
onClicked
:
guidedActionsController
.
confirmAction
(
guidedActionsController
.
actionSetWaypoint
,
object
.
sequenceNumber
)
onClicked
:
guidedActionsController
.
confirmAction
(
guidedActionsController
.
actionSetWaypoint
,
Math
.
max
(
object
.
sequenceNumber
,
1
)
)
}
}
...
...
src/FlightDisplay/GuidedActionsController.qml
View file @
12109fad
...
...
@@ -78,29 +78,41 @@ Item {
readonly
property
int
actionResumeMissionReady
:
14
readonly
property
int
actionPause
:
15
property
bool
showEmergenyStop
:
!
_hideEmergenyStop
&&
_activeVehicle
&&
_
activeVehicle
.
a
rmed
&&
_activeVehicle
.
flying
property
bool
showDisarm
:
_activeVehicle
&&
_
activeVehicle
.
a
rmed
&&
!
_activeVehicle
.
flying
property
bool
showRTL
:
_activeVehicle
&&
_
activeVehicle
.
a
rmed
&&
_activeVehicle
.
guidedModeSupported
&&
_activeVehicle
.
flying
&&
!
_vehicleInRTLMode
property
bool
showEmergenyStop
:
!
_hideEmergenyStop
&&
_activeVehicle
&&
_
vehicleA
rmed
&&
_activeVehicle
.
flying
property
bool
showDisarm
:
_activeVehicle
&&
_
vehicleA
rmed
&&
!
_activeVehicle
.
flying
property
bool
showRTL
:
_activeVehicle
&&
_
vehicleA
rmed
&&
_activeVehicle
.
guidedModeSupported
&&
_activeVehicle
.
flying
&&
!
_vehicleInRTLMode
property
bool
showTakeoff
:
_activeVehicle
&&
_activeVehicle
.
guidedModeSupported
&&
!
_activeVehicle
.
flying
&&
!
_activeVehicle
.
fixedWing
property
bool
showLand
:
_activeVehicle
&&
_activeVehicle
.
guidedModeSupported
&&
_
activeVehicle
.
a
rmed
&&
!
_activeVehicle
.
fixedWing
&&
!
_vehicleInLandMode
property
bool
showLand
:
_activeVehicle
&&
_activeVehicle
.
guidedModeSupported
&&
_
vehicleA
rmed
&&
!
_activeVehicle
.
fixedWing
&&
!
_vehicleInLandMode
property
bool
showStartMission
:
_activeVehicle
&&
_missionAvailable
&&
!
_missionActive
property
bool
showResumeMission
:
_activeVehicle
&&
!
_activeVehicle
.
flying
&&
_missionAvailable
&&
_resumeMissionIndex
>
0
property
bool
showPause
:
_activeVehicle
&&
_
activeVehicle
.
a
rmed
&&
_activeVehicle
.
pauseVehicleSupported
&&
_activeVehicle
.
flying
&&
!
_vehiclePaused
property
bool
showChangeAlt
:
(
_activeVehicle
&&
_activeVehicle
.
flying
)
&&
_activeVehicle
.
guidedModeSupported
&&
_
activeVehicle
.
a
rmed
&&
!
_missionActive
property
bool
showOrbit
:
!
_hideOrbit
&&
_activeVehicle
&&
_activeVehicle
.
flying
&&
_activeVehicle
.
orbitModeSupported
&&
_
activeVehicle
.
a
rmed
&&
!
_missionActive
property
bool
showPause
:
_activeVehicle
&&
_
vehicleA
rmed
&&
_activeVehicle
.
pauseVehicleSupported
&&
_activeVehicle
.
flying
&&
!
_vehiclePaused
property
bool
showChangeAlt
:
(
_activeVehicle
&&
_activeVehicle
.
flying
)
&&
_activeVehicle
.
guidedModeSupported
&&
_
vehicleA
rmed
&&
!
_missionActive
property
bool
showOrbit
:
!
_hideOrbit
&&
_activeVehicle
&&
_activeVehicle
.
flying
&&
_activeVehicle
.
orbitModeSupported
&&
_
vehicleA
rmed
&&
!
_missionActive
property
bool
showLandAbort
:
_activeVehicle
&&
_activeVehicle
.
flying
&&
_activeVehicle
.
fixedWing
property
bool
showGotoLocation
:
_activeVehicle
&&
_activeVehicle
.
guidedMode
&&
_activeVehicle
.
flying
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_missionAvailable
:
missionController
.
containsItems
property
bool
_missionActive
:
_activeVehicle
?
_activeVehicle
.
flightMode
===
_activeVehicle
.
missionFlightMode
:
false
property
bool
_vehiclePaused
:
_activeVehicle
?
_activeVehicle
.
flightMode
===
_activeVehicle
.
pauseFlightMode
:
false
property
bool
_vehicleInRTLMode
:
_activeVehicle
?
_activeVehicle
.
flightMode
===
_activeVehicle
.
rtlFlightMode
:
false
property
bool
_vehicleInLandMode
:
_activeVehicle
?
_activeVehicle
.
flightMode
===
_activeVehicle
.
landFlightMode
:
false
property
int
_resumeMissionIndex
:
missionController
.
resumeMissionIndex
property
bool
_hideEmergenyStop
:
!
QGroundControl
.
corePlugin
.
options
.
guidedBarShowEmergencyStop
property
bool
_hideOrbit
:
!
QGroundControl
.
corePlugin
.
options
.
guidedBarShowOrbit
property
var
_actionData
onShowStartMissionChanged
:
console
.
log
(
showStartMission
,
_activeVehicle
,
_missionAvailable
,
_missionActive
,
_vehicleArmed
,
_vehicleInLandMode
,
_vehicleInRTLMode
)
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
string
_flightMode
:
_activeVehicle
?
_activeVehicle
.
flightMode
:
""
property
bool
_missionAvailable
:
missionController
.
containsItems
property
bool
_missionActive
:
_activeVehicle
?
_vehicleArmed
&&
(
_vehicleInLandMode
||
_vehicleInRTLMode
||
_vehicleInMissionMode
)
:
false
property
bool
_vehicleArmed
:
_activeVehicle
?
_activeVehicle
.
armed
:
false
property
bool
_vehiclePaused
:
false
property
bool
_vehicleInMissionMode
:
false
property
bool
_vehicleInRTLMode
:
false
property
bool
_vehicleInLandMode
:
false
property
int
_resumeMissionIndex
:
missionController
.
resumeMissionIndex
property
bool
_hideEmergenyStop
:
!
QGroundControl
.
corePlugin
.
options
.
guidedBarShowEmergencyStop
property
bool
_hideOrbit
:
!
QGroundControl
.
corePlugin
.
options
.
guidedBarShowOrbit
property
var
_actionData
on_FlightModeChanged
:
{
_vehiclePaused
=
_flightMode
===
_activeVehicle
.
pauseFlightMode
_vehicleInRTLMode
=
_flightMode
===
_activeVehicle
.
rtlFlightMode
_vehicleInLandMode
=
_flightMode
===
_activeVehicle
.
landFlightMode
_vehicleInMissionMode
=
_flightMode
===
_activeVehicle
.
missionFlightMode
// Must be last to get correct signalling for showStartMission popups
}
// Called when an action is about to be executed in order to confirm
function
confirmAction
(
actionCode
,
actionData
)
{
...
...
@@ -203,10 +215,10 @@ Item {
_activeVehicle
.
startMission
()
break
case
actionArm
:
_
activeVehicle
.
a
rmed
=
true
_
vehicleA
rmed
=
true
break
case
actionDisarm
:
_
activeVehicle
.
a
rmed
=
false
_
vehicleA
rmed
=
false
break
case
actionEmergencyStop
:
_activeVehicle
.
emergencyStop
()
...
...
src/MissionManager/MissionController.cc
View file @
12109fad
...
...
@@ -1482,7 +1482,7 @@ int MissionController::resumeMissionIndex(void) const
if
(
!
_editMode
)
{
resumeIndex
=
_activeVehicle
->
missionManager
()
->
lastCurrentIndex
()
+
(
_activeVehicle
->
firmwarePlugin
()
->
sendHomePositionToVehicle
()
?
0
:
1
);
if
(
resumeIndex
>
1
)
{
if
(
resumeIndex
>
1
&&
resumeIndex
!=
_visualItems
->
value
<
VisualMissionItem
*>
(
_visualItems
->
count
()
-
1
)
->
sequenceNumber
()
)
{
// Resume at the item previous to the item we were heading towards
resumeIndex
--
;
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment