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
eb793fc5
Unverified
Commit
eb793fc5
authored
Nov 08, 2019
by
Don Gagne
Committed by
GitHub
Nov 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7996 from DonLakeFlyer/ResumeMission
Mission Complete dialog rework
parents
0cb4bf8b
bec15660
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
67 deletions
+52
-67
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+51
-66
FlightDisplayViewWidgets.qml
src/FlightDisplay/FlightDisplayViewWidgets.qml
+1
-1
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
eb793fc5
...
@@ -144,33 +144,31 @@ Item {
...
@@ -144,33 +144,31 @@ Item {
}
}
}
}
// The following code is used to track vehicle states such that we prompt to remove mission from vehicle when mission completes
// The following code is used to track vehicle states for showing the mission complete dialog
property
bool
vehicleArmed
:
activeVehicle
?
activeVehicle
.
armed
:
true
// true here prevents pop up from showing during shutdown
property
bool
vehicleArmed
:
activeVehicle
?
activeVehicle
.
armed
:
true
// true here prevents pop up from showing during shutdown
property
bool
vehicleWasArmed
:
false
property
bool
vehicleWasArmed
:
false
property
bool
vehicleInMissionFlightMode
:
activeVehicle
?
(
activeVehicle
.
flightMode
===
activeVehicle
.
missionFlightMode
)
:
false
property
bool
vehicleInMissionFlightMode
:
activeVehicle
?
(
activeVehicle
.
flightMode
===
activeVehicle
.
missionFlightMode
)
:
false
property
bool
vehicleWasInMissionFlightMode
:
false
property
bool
promptForMissionRemove
:
false
property
bool
showMissionCompleteDialog
:
vehicleWasArmed
&&
vehicleWasInMissionFlightMode
&&
(
_missionController
.
containsItems
||
_geoFenceController
.
containsItems
||
_rallyPointController
.
containsItems
||
(
activeVehicle
?
activeVehicle
.
cameraTriggerPoints
.
count
!==
0
:
false
))
onVehicleArmedChanged
:
{
onVehicleArmedChanged
:
{
if
(
vehicleArmed
)
{
if
(
vehicleArmed
)
{
if
(
!
promptForMissionRemove
)
{
vehicleWasArmed
=
true
promptForMissionRemove
=
vehicleInMissionFlightMode
vehicleWasInMissionFlightMode
=
vehicleInMissionFlightMode
vehicleWasArmed
=
true
}
}
else
{
}
else
{
if
(
promptForMissionRemove
&&
(
_missionController
.
containsItems
||
_geoFenceController
.
containsItems
||
_rallyPointController
.
containsItems
))
{
if
(
showMissionCompleteDialog
)
{
// ArduPilot has a strange bug which prevents mission clear from working at certain times, so we can't show this dialog
mainWindow
.
showComponentDialog
(
missionCompleteDialogComponent
,
qsTr
(
"
Flight Plan complete
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Close
)
if
(
!
activeVehicle
.
apmFirmware
)
{
mainWindow
.
showComponentDialog
(
missionCompleteDialogComponent
,
qsTr
(
"
Flight Plan complete
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Close
)
}
}
}
promptForMissionRemove
=
false
vehicleWasArmed
=
false
vehicleWasInMissionFlightMode
=
false
}
}
}
}
onVehicleInMissionFlightModeChanged
:
{
onVehicleInMissionFlightModeChanged
:
{
if
(
!
promptForMissionRemov
e
&&
vehicleArmed
)
{
if
(
vehicleInMissionFlightMod
e
&&
vehicleArmed
)
{
promptForMissionRemov
e
=
true
vehicleWasInMissionFlightMod
e
=
true
}
}
}
}
...
@@ -193,46 +191,47 @@ Item {
...
@@ -193,46 +191,47 @@ Item {
anchors.margins
:
_margins
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelHeight
ColumnLayout
{
QGCLabel
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
spacing
:
ScreenTools
.
defaultFontPixelHeight
text
:
qsTr
(
"
%1 Images Taken
"
).
arg
(
activeVehicle
.
cameraTriggerPoints
.
count
)
visible
:
!
activeVehicle
.
connectionLost
||
!
_guidedController
.
showResumeMission
horizontalAlignment
:
Text
.
AlignHCenter
visible
:
activeVehicle
.
cameraTriggerPoints
.
count
!==
0
}
QGCLabel
{
QGCButton
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
text
:
qsTr
(
"
%1 Images Taken
"
).
arg
(
activeVehicle
.
cameraTriggerPoints
.
count
)
text
:
qsTr
(
"
Remove plan from vehicle
"
)
horizontalAlignment
:
Text
.
AlignHCenter
visible
:
!
activeVehicle
.
connectionLost
// && !activeVehicle.apmFirmware // ArduPilot has a bug somewhere with mission clear
visible
:
activeVehicle
.
cameraTriggerPoints
.
count
!==
0
onClicked
:
{
_planController
.
removeAllFromVehicle
()
hideDialog
()
}
}
}
QGCButton
{
QGCButton
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
text
:
qsTr
(
"
Remove plan from vehicle
"
)
Layout.alignment
:
Qt
.
AlignHCenter
onClicked
:
{
text
:
qsTr
(
"
Leave plan on vehicle
"
)
_planController
.
removeAllFromVehicle
()
onClicked
:
hideDialog
()
hideDialog
()
}
}
}
QGCButton
{
Rectangle
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignHCenter
color
:
qgcPal
.
text
text
:
qsTr
(
"
Leave plan on vehicle
"
)
height
:
1
onClicked
:
hideDialog
()
}
}
Rectangle
{
ColumnLayout
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
color
:
qgcPal
.
text
spacing
:
ScreenTools
.
defaultFontPixelHeight
height
:
1
visible
:
!
activeVehicle
.
connectionLost
&&
_guidedController
.
showResumeMission
}
QGCButton
{
QGCButton
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignHCenter
Layout.alignment
:
Qt
.
AlignHCenter
text
:
qsTr
(
"
Resume Mission From Waypoint %1
"
).
arg
(
_guidedController
.
_resumeMissionIndex
)
text
:
qsTr
(
"
Resume Mission From Waypoint %1
"
).
arg
(
_guidedController
.
_resumeMissionIndex
)
visible
:
_guidedController
.
showResumeMission
onClicked
:
{
onClicked
:
{
guidedController
.
executeAction
(
_guidedController
.
actionResumeMission
,
null
,
null
)
guidedController
.
executeAction
(
_guidedController
.
actionResumeMission
,
null
,
null
)
...
@@ -244,29 +243,15 @@ Item {
...
@@ -244,29 +243,15 @@ Item {
Layout.fillWidth
:
true
Layout.fillWidth
:
true
wrapMode
:
Text
.
WordWrap
wrapMode
:
Text
.
WordWrap
text
:
qsTr
(
"
Resume Mission will rebuild the current mission from the last flown waypoint and upload it to the vehicle for the next flight.
"
)
text
:
qsTr
(
"
Resume Mission will rebuild the current mission from the last flown waypoint and upload it to the vehicle for the next flight.
"
)
visible
:
_guidedController
.
showResumeMission
}
QGCLabel
{
Layout.fillWidth
:
true
wrapMode
:
Text
.
WordWrap
color
:
qgcPal
.
warningText
text
:
qsTr
(
"
If you are changing batteries for Resume Mission do not disconnect from the vehicle when communication is lost.
"
)
visible
:
_guidedController
.
showResumeMission
}
}
}
}
ColumnLayout
{
QGCLabel
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
spacing
:
ScreenTools
.
defaultFontPixelHeight
wrapMode
:
Text
.
WordWrap
visible
:
activeVehicle
.
connectionLost
&&
_guidedController
.
showResumeMission
color
:
qgcPal
.
warningText
text
:
qsTr
(
"
If you are changing batteries for Resume Mission do not disconnect from the vehicle.
"
)
QGCLabel
{
visible
:
_guidedController
.
showResumeMission
Layout.fillWidth
:
true
wrapMode
:
Text
.
WordWrap
color
:
qgcPal
.
warningText
text
:
qsTr
(
"
If you are changing batteries for Resume Mission do not disconnect from the vehicle.
"
)
}
}
}
}
}
}
}
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
eb793fc5
...
@@ -134,7 +134,7 @@ Item {
...
@@ -134,7 +134,7 @@ Item {
spacing
:
ScreenTools
.
defaultFontPixelHeight
spacing
:
ScreenTools
.
defaultFontPixelHeight
property
bool
noGPSLockVisible
:
activeVehicle
&&
!
activeVehicle
.
coordinate
.
isValid
&&
mainIsMap
property
bool
noGPSLockVisible
:
activeVehicle
&&
!
activeVehicle
.
coordinate
.
isValid
&&
mainIsMap
property
bool
prearmErrorVisible
:
activeVehicle
&&
activeVehicle
.
prearmError
property
bool
prearmErrorVisible
:
activeVehicle
&&
!
activeVehicle
.
armed
&&
activeVehicle
.
prearmError
QGCLabel
{
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
...
...
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