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
bec15660
Commit
bec15660
authored
Nov 08, 2019
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
31160466
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
66 deletions
+51
-66
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+51
-66
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
bec15660
...
...
@@ -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
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
// 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
vehicleWasArmed
:
false
property
bool
vehicleInMissionFlightMode
:
activeVehicle
?
(
activeVehicle
.
flightMode
===
activeVehicle
.
missionFlightMode
)
:
false
property
bool
vehicleWasInMissionFlightMode
:
false
property
bool
showMissionCompleteDialog
:
vehicleWasArmed
&&
vehicleWasInMissionFlightMode
&&
(
_missionController
.
containsItems
||
_geoFenceController
.
containsItems
||
_rallyPointController
.
containsItems
||
(
activeVehicle
?
activeVehicle
.
cameraTriggerPoints
.
count
!==
0
:
false
))
onVehicleArmedChanged
:
{
if
(
vehicleArmed
)
{
if
(
!
promptForMissionRemove
)
{
promptForMissionRemove
=
vehicleInMissionFlightMode
vehicleWasArmed
=
true
}
vehicleWasArmed
=
true
vehicleWasInMissionFlightMode
=
vehicleInMissionFlightMode
}
else
{
if
(
promptForMissionRemove
&&
(
_missionController
.
containsItems
||
_geoFenceController
.
containsItems
||
_rallyPointController
.
containsItems
))
{
// ArduPilot has a strange bug which prevents mission clear from working at certain times, so we can't show this dialog
if
(
!
activeVehicle
.
apmFirmware
)
{
mainWindow
.
showComponentDialog
(
missionCompleteDialogComponent
,
qsTr
(
"
Flight Plan complete
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Close
)
}
if
(
showMissionCompleteDialog
)
{
mainWindow
.
showComponentDialog
(
missionCompleteDialogComponent
,
qsTr
(
"
Flight Plan complete
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Close
)
}
promptForMissionRemove
=
false
vehicleWasArmed
=
false
vehicleWasInMissionFlightMode
=
false
}
}
onVehicleInMissionFlightModeChanged
:
{
if
(
!
promptForMissionRemov
e
&&
vehicleArmed
)
{
promptForMissionRemov
e
=
true
if
(
vehicleInMissionFlightMod
e
&&
vehicleArmed
)
{
vehicleWasInMissionFlightMod
e
=
true
}
}
...
...
@@ -193,46 +191,47 @@ Item {
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelHeight
ColumnLayout
{
Layout.fillWidth
:
true
spacing
:
ScreenTools
.
defaultFontPixelHeight
visible
:
!
activeVehicle
.
connectionLost
||
!
_guidedController
.
showResumeMission
QGCLabel
{
Layout.fillWidth
:
true
text
:
qsTr
(
"
%1 Images Taken
"
).
arg
(
activeVehicle
.
cameraTriggerPoints
.
count
)
horizontalAlignment
:
Text
.
AlignHCenter
visible
:
activeVehicle
.
cameraTriggerPoints
.
count
!==
0
}
QGCLabel
{
Layout.fillWidth
:
true
text
:
qsTr
(
"
%1 Images Taken
"
).
arg
(
activeVehicle
.
cameraTriggerPoints
.
count
)
horizontalAlignment
:
Text
.
AlignHCenter
visible
:
activeVehicle
.
cameraTriggerPoints
.
count
!==
0
QGCButton
{
Layout.fillWidth
:
true
text
:
qsTr
(
"
Remove plan from vehicle
"
)
visible
:
!
activeVehicle
.
connectionLost
// && !activeVehicle.apmFirmware // ArduPilot has a bug somewhere with mission clear
onClicked
:
{
_planController
.
removeAllFromVehicle
()
hideDialog
()
}
}
QGCButton
{
Layout.fillWidth
:
true
text
:
qsTr
(
"
Remove plan from vehicle
"
)
onClicked
:
{
_planController
.
removeAllFromVehicle
()
hideDialog
()
}
}
QGCButton
{
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignHCenter
text
:
qsTr
(
"
Leave plan on vehicle
"
)
onClicked
:
hideDialog
()
}
QGCButton
{
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignHCenter
text
:
qsTr
(
"
Leave plan on vehicle
"
)
onClicked
:
hideDialog
()
}
Rectangle
{
Layout.fillWidth
:
true
color
:
qgcPal
.
text
height
:
1
}
Rectangle
{
Layout.fillWidth
:
true
color
:
qgcPal
.
text
height
:
1
}
ColumnLayout
{
Layout.fillWidth
:
true
spacing
:
ScreenTools
.
defaultFontPixelHeight
visible
:
!
activeVehicle
.
connectionLost
&&
_guidedController
.
showResumeMission
QGCButton
{
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignHCenter
text
:
qsTr
(
"
Resume Mission From Waypoint %1
"
).
arg
(
_guidedController
.
_resumeMissionIndex
)
visible
:
_guidedController
.
showResumeMission
onClicked
:
{
guidedController
.
executeAction
(
_guidedController
.
actionResumeMission
,
null
,
null
)
...
...
@@ -244,29 +243,15 @@ Item {
Layout.fillWidth
:
true
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.
"
)
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
spacing
:
ScreenTools
.
defaultFontPixelHeight
visible
:
activeVehicle
.
connectionLost
&&
_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.
"
)
}
wrapMode
:
Text
.
WordWrap
color
:
qgcPal
.
warningText
text
:
qsTr
(
"
If you are changing batteries for Resume Mission do not disconnect from the vehicle.
"
)
visible
:
_guidedController
.
showResumeMission
}
}
}
...
...
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