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
eb1a5020
Commit
eb1a5020
authored
Sep 01, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Video option menu
parent
6f295b67
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
166 deletions
+10
-166
FlightDisplayWidget.qml
src/FlightDisplay/FlightDisplayWidget.qml
+10
-166
No files found.
src/FlightDisplay/FlightDisplayWidget.qml
View file @
eb1a5020
...
...
@@ -85,23 +85,8 @@ Item {
Component
.
onCompleted
:
{
mapBackground
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showMapBackground
"
,
"
0
"
));
videoBackground
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showVideoBackground
"
,
"
0
"
));
showPitchIndicator
=
getBool
(
flightDisplay
.
loadSetting
(
"
showPitchIndicator
"
,
"
1
"
));
altitudeWidget
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showAltitudeWidget
"
,
"
1
"
));
speedWidget
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showSpeedWidget
"
,
"
1
"
));
currentSpeed
.
showAirSpeed
=
getBool
(
flightDisplay
.
loadSetting
(
"
showCurrentAirSpeed
"
,
"
1
"
));
currentSpeed
.
showGroundSpeed
=
getBool
(
flightDisplay
.
loadSetting
(
"
showCurrentGroundSpeed
"
,
"
1
"
));
currentAltitude
.
showClimbRate
=
getBool
(
flightDisplay
.
loadSetting
(
"
showCurrentClimbRate
"
,
"
1
"
));
currentAltitude
.
showAltitude
=
getBool
(
flightDisplay
.
loadSetting
(
"
showCurrentAltitude
"
,
"
1
"
));
// Insert Map Type menu before separator
contextMenu
.
insertItem
(
2
,
mapBackground
.
mapMenu
);
// Video or Map. Not both:
if
(
mapBackground
.
visible
&&
videoBackground
.
visible
)
{
videoBackground
.
visible
=
false
;
flightDisplay
.
saveSetting
(
"
showVideoBackground
"
,
setBool
(
videoBackground
.
visible
));
}
videoBackground
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showVideoBackground
"
,
"
0
"
));
// Disable video if we don't have support for it
if
(
!
flightDisplay
.
hasVideo
)
{
videoBackground
.
visible
=
false
;
...
...
@@ -114,140 +99,13 @@ Item {
Menu
{
id
:
contextMenu
MenuItem
{
text
:
"
Map Background
"
checkable
:
true
checked
:
mapBackground
.
visible
onTriggered
:
{
enforceExclusiveOption
(
mapBackground
,
videoBackground
,
"
showMapBackground
"
,
"
showVideoBackground
"
);
}
}
MenuSeparator
{}
MenuItem
{
id
:
videoMenu
text
:
"
Video Background
"
checkable
:
true
checked
:
videoBackground
.
visible
onTriggered
:
{
enforceExclusiveOption
(
videoBackground
,
mapBackground
,
"
showVideoBackground
"
,
"
showMapBackground
"
);
}
}
MenuSeparator
{}
MenuItem
{
text
:
"
Pitch Indicator
"
checkable
:
true
checked
:
showPitchIndicator
enabled
:
attitudeHUD
.
visible
||
attitudeWidget
.
visible
onTriggered
:
{
showPitchIndicator
=
!
showPitchIndicator
;
flightDisplay
.
saveSetting
(
"
showPitchIndicator
"
,
setBool
(
showPitchIndicator
));
}
}
MenuItem
{
text
:
"
Altitude Indicator
"
checkable
:
true
checked
:
altitudeWidget
.
visible
onTriggered
:
{
altitudeWidget
.
visible
=
!
altitudeWidget
.
visible
;
flightDisplay
.
saveSetting
(
"
showAltitudeWidget
"
,
setBool
(
altitudeWidget
.
visible
));
}
}
MenuItem
{
text
:
"
Current Altitude
"
checkable
:
true
checked
:
currentAltitude
.
showAltitude
onTriggered
:
{
currentAltitude
.
showAltitude
=
!
currentAltitude
.
showAltitude
;
flightDisplay
.
saveSetting
(
"
showCurrentAltitude
"
,
setBool
(
currentAltitude
.
showAltitude
));
}
}
MenuItem
{
text
:
"
Current Climb Rate
"
checkable
:
true
checked
:
currentAltitude
.
showClimbRate
onTriggered
:
{
currentAltitude
.
showClimbRate
=
!
currentAltitude
.
showClimbRate
;
flightDisplay
.
saveSetting
(
"
showCurrentClimbRate
"
,
setBool
(
currentAltitude
.
showClimbRate
));
}
}
MenuItem
{
text
:
"
Speed Indicator
"
checkable
:
true
checked
:
speedWidget
.
visible
onTriggered
:
{
speedWidget
.
visible
=
!
speedWidget
.
visible
;
flightDisplay
.
saveSetting
(
"
showSpeedWidget
"
,
setBool
(
speedWidget
.
visible
));
}
}
MenuItem
{
text
:
"
Current Air Speed
"
checkable
:
true
checked
:
currentSpeed
.
showAirSpeed
onTriggered
:
{
currentSpeed
.
showAirSpeed
=
!
currentSpeed
.
showAirSpeed
;
flightDisplay
.
saveSetting
(
"
showCurrentAirSpeed
"
,
setBool
(
currentSpeed
.
showAirSpeed
));
}
}
MenuItem
{
text
:
"
Current Ground Speed
"
checkable
:
true
checked
:
currentSpeed
.
showGroundSpeed
onTriggered
:
{
currentSpeed
.
showGroundSpeed
=
!
currentSpeed
.
showGroundSpeed
;
flightDisplay
.
saveSetting
(
"
showCurrentGroundSpeed
"
,
setBool
(
currentSpeed
.
showGroundSpeed
));
}
}
MenuSeparator
{}
MenuItem
{
text
:
"
Restore Defaults
"
onTriggered
:
{
showPitchIndicator
=
true
;
flightDisplay
.
saveSetting
(
"
showPitchIndicator
"
,
setBool
(
showPitchIndicator
));
attitudeWidget
.
visible
=
false
;
flightDisplay
.
saveSetting
(
"
showAttitudeWidget
"
,
setBool
(
attitudeWidget
.
visible
));
compassWidget
.
visible
=
false
flightDisplay
.
saveSetting
(
"
showCompassWidget
"
,
setBool
(
compassWidget
.
visible
));
altitudeWidget
.
visible
=
true
;
flightDisplay
.
saveSetting
(
"
showAltitudeWidget
"
,
setBool
(
altitudeWidget
.
visible
));
currentAltitude
.
showAltitude
=
true
;
flightDisplay
.
saveSetting
(
"
showCurrentAltitude
"
,
setBool
(
currentAltitude
.
showAltitude
));
currentAltitude
.
showClimbRate
=
true
;
flightDisplay
.
saveSetting
(
"
showCurrentClimbRate
"
,
setBool
(
currentAltitude
.
showClimbRate
));
speedWidget
.
visible
=
true
;
flightDisplay
.
saveSetting
(
"
showSpeedWidget
"
,
setBool
(
speedWidget
.
visible
));
currentSpeed
.
showAirSpeed
=
true
;
flightDisplay
.
saveSetting
(
"
showCurrentAirSpeed
"
,
setBool
(
currentSpeed
.
showAirSpeed
));
currentSpeed
.
showGroundSpeed
=
true
;
flightDisplay
.
saveSetting
(
"
showCurrentGroundSpeed
"
,
setBool
(
currentSpeed
.
showGroundSpeed
));
mapBackground
.
visible
=
false
;
flightDisplay
.
saveSetting
(
"
showMapBackground
"
,
setBool
(
mapBackground
.
visible
));
videoBackground
.
visible
=
false
;
flightDisplay
.
saveSetting
(
"
showVideoBackground
"
,
setBool
(
videoBackground
.
visible
));
}
onToggled
:
videoBackground
.
visible
=
checked
}
}
// Video and Map backgrounds are exclusive. If one is enabled the other is disabled.
...
...
@@ -260,15 +118,6 @@ Item {
z
:
10
}
FlightMap
{
id
:
mapBackground
anchors.fill
:
parent
mapName
:
'
FlightDisplayWidget
'
latitude
:
mapBackground
.
visible
?
root
.
latitude
:
root
.
defaultLatitude
longitude
:
mapBackground
.
visible
?
root
.
longitude
:
root
.
defaultLongitude
z
:
10
}
// HUD (lower middle) Compass
QGCCompassHUD
{
...
...
@@ -289,7 +138,7 @@ Item {
anchors.fill
:
parent
rollAngle
:
roll
pitchAngle
:
pitch
visible
:
!
videoBackground
.
visible
&&
!
mapBackground
.
visible
visible
:
!
videoBackground
.
visible
}
// HUD (center) Attitude Indicator
...
...
@@ -349,16 +198,11 @@ Item {
z
:
60
}
//- Context Menu
MouseArea
{
anchors.fill
:
parent
z
:
1000
acceptedButtons
:
Qt
.
RightButton
onClicked
:
{
if
(
mouse
.
button
==
Qt
.
RightButton
)
{
contextMenu
.
popup
();
}
}
QGCButton
{
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
text
:
"
Options
"
menu
:
contextMenu
}
}
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