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
a656c246
Commit
a656c246
authored
Aug 14, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enabling the option of using Compass and Attitude Widgets or HUD.
parent
a9b28845
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
195 additions
and
162 deletions
+195
-162
qgroundcontrol.qrc
qgroundcontrol.qrc
+4
-4
FlightDisplay.qml
src/ui/flightdisplay/FlightDisplay.qml
+95
-71
QGCAttitudeHUD.qml
src/ui/qmlcommon/QGCAttitudeHUD.qml
+30
-52
QGCAttitudeWidget.qml
src/ui/qmlcommon/QGCAttitudeWidget.qml
+54
-21
QGCCompassHUD.qml
src/ui/qmlcommon/QGCCompassHUD.qml
+1
-3
QGCCompassWidget.qml
src/ui/qmlcommon/QGCCompassWidget.qml
+1
-1
QGCPitchIndicator.qml
src/ui/qmlcommon/QGCPitchIndicator.qml
+0
-0
qmldir
src/ui/qmlcommon/qmldir
+10
-10
No files found.
qgroundcontrol.qrc
View file @
a656c246
...
@@ -120,16 +120,16 @@
...
@@ -120,16 +120,16 @@
<file alias="MapDisplay.qml">src/ui/mapdisplay/MapDisplay.qml</file>
<file alias="MapDisplay.qml">src/ui/mapdisplay/MapDisplay.qml</file>
<file alias="QGroundControl/FlightControls/QGCAltitudeWidget.qml">src/ui/qmlcommon/QGCAltitudeWidget.qml</file>
<file alias="QGroundControl/FlightControls/QGCAltitudeWidget.qml">src/ui/qmlcommon/QGCAltitudeWidget.qml</file>
<file alias="QGroundControl/FlightControls/QGCArtificialHorizon.qml">src/ui/qmlcommon/QGCArtificialHorizon.qml</file>
<file alias="QGroundControl/FlightControls/QGCArtificialHorizon.qml">src/ui/qmlcommon/QGCArtificialHorizon.qml</file>
<file alias="QGroundControl/FlightControls/QGCAttitudeInstrument.qml">src/ui/qmlcommon/QGCAttitudeInstrument.qml</file>
<file alias="QGroundControl/FlightControls/QGCAttitudeWidget.qml">src/ui/qmlcommon/QGCAttitudeWidget.qml</file>
<file alias="QGroundControl/FlightControls/QGCAttitudeWidget.qml">src/ui/qmlcommon/QGCAttitudeWidget.qml</file>
<file alias="QGroundControl/FlightControls/QGCCompass.qml">src/ui/qmlcommon/QGCCompass.qml</file>
<file alias="QGroundControl/FlightControls/QGCAttitudeHUD.qml">src/ui/qmlcommon/QGCAttitudeHUD.qml</file>
<file alias="QGroundControl/FlightControls/QGCCompassInstrument.qml">src/ui/qmlcommon/QGCCompassInstrument.qml</file>
<file alias="QGroundControl/FlightControls/QGCCompassWidget.qml">src/ui/qmlcommon/QGCCompassWidget.qml</file>
<file alias="QGroundControl/FlightControls/QGCCompassHUD.qml">src/ui/qmlcommon/QGCCompassHUD.qml</file>
<file alias="QGroundControl/FlightControls/QGCCurrentAltitude.qml">src/ui/qmlcommon/QGCCurrentAltitude.qml</file>
<file alias="QGroundControl/FlightControls/QGCCurrentAltitude.qml">src/ui/qmlcommon/QGCCurrentAltitude.qml</file>
<file alias="QGroundControl/FlightControls/QGCCurrentSpeed.qml">src/ui/qmlcommon/QGCCurrentSpeed.qml</file>
<file alias="QGroundControl/FlightControls/QGCCurrentSpeed.qml">src/ui/qmlcommon/QGCCurrentSpeed.qml</file>
<file alias="QGroundControl/FlightControls/QGCHudMessage.qml">src/ui/qmlcommon/QGCHudMessage.qml</file>
<file alias="QGroundControl/FlightControls/QGCHudMessage.qml">src/ui/qmlcommon/QGCHudMessage.qml</file>
<file alias="QGroundControl/FlightControls/QGCMapBackground.qml">src/ui/qmlcommon/QGCMapBackground.qml</file>
<file alias="QGroundControl/FlightControls/QGCMapBackground.qml">src/ui/qmlcommon/QGCMapBackground.qml</file>
<file alias="QGroundControl/FlightControls/QGCMapToolButton.qml">src/ui/qmlcommon/QGCMapToolButton.qml</file>
<file alias="QGroundControl/FlightControls/QGCMapToolButton.qml">src/ui/qmlcommon/QGCMapToolButton.qml</file>
<file alias="QGroundControl/FlightControls/QGCPitch
Widget.qml">src/ui/qmlcommon/QGCPitchWidget
.qml</file>
<file alias="QGroundControl/FlightControls/QGCPitch
Indicator.qml">src/ui/qmlcommon/QGCPitchIndicator
.qml</file>
<file alias="QGroundControl/FlightControls/QGCSlider.qml">src/ui/qmlcommon/QGCSlider.qml</file>
<file alias="QGroundControl/FlightControls/QGCSlider.qml">src/ui/qmlcommon/QGCSlider.qml</file>
<file alias="QGroundControl/FlightControls/QGCSpeedWidget.qml">src/ui/qmlcommon/QGCSpeedWidget.qml</file>
<file alias="QGroundControl/FlightControls/QGCSpeedWidget.qml">src/ui/qmlcommon/QGCSpeedWidget.qml</file>
<file alias="QGroundControl/FlightControls/QGCVideoBackground.qml">src/ui/qmlcommon/QGCVideoBackground.qml</file>
<file alias="QGroundControl/FlightControls/QGCVideoBackground.qml">src/ui/qmlcommon/QGCVideoBackground.qml</file>
...
...
src/ui/flightdisplay/FlightDisplay.qml
View file @
a656c246
...
@@ -47,8 +47,6 @@ Item {
...
@@ -47,8 +47,6 @@ Item {
property
real
pitch
:
isNaN
(
MavManager
.
pitch
)
?
0
:
MavManager
.
pitch
property
real
pitch
:
isNaN
(
MavManager
.
pitch
)
?
0
:
MavManager
.
pitch
property
bool
showPitchIndicator
:
true
property
bool
showPitchIndicator
:
true
property
bool
showAttitudeIndicator
:
true
property
bool
showCompass
:
true
function
getBool
(
value
)
{
function
getBool
(
value
)
{
return
value
===
'
0
'
?
false
:
true
;
return
value
===
'
0
'
?
false
:
true
;
...
@@ -58,8 +56,11 @@ Item {
...
@@ -58,8 +56,11 @@ Item {
return
value
?
"
1
"
:
"
0
"
;
return
value
?
"
1
"
:
"
0
"
;
}
}
function
showHudInstruments
()
{
function
enforceExclusiveOption
(
setWidget
,
alternateWidget
,
defaultSetting
,
alternateSetting
)
{
return
videoBackground
.
visible
||
mapBackground
.
visible
;
setWidget
.
visible
=
!
setWidget
.
visible
;
flightDisplay
.
saveSetting
(
defaultSetting
,
setBool
(
setWidget
.
visible
));
alternateWidget
.
visible
=
setWidget
.
visible
?
false
:
alternateWidget
.
visible
;
flightDisplay
.
saveSetting
(
alternateSetting
,
setBool
(
alternateWidget
.
visible
));
}
}
Connections
{
Connections
{
...
@@ -75,9 +76,11 @@ Item {
...
@@ -75,9 +76,11 @@ Item {
mapBackground
.
showWaypoints
=
getBool
(
flightDisplay
.
loadSetting
(
"
mapShowWaypoints
"
,
"
0
"
));
mapBackground
.
showWaypoints
=
getBool
(
flightDisplay
.
loadSetting
(
"
mapShowWaypoints
"
,
"
0
"
));
mapBackground
.
alwaysNorth
=
getBool
(
flightDisplay
.
loadSetting
(
"
mapAlwaysPointsNorth
"
,
"
0
"
));
mapBackground
.
alwaysNorth
=
getBool
(
flightDisplay
.
loadSetting
(
"
mapAlwaysPointsNorth
"
,
"
0
"
));
videoBackground
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showVideoBackground
"
,
"
0
"
));
videoBackground
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showVideoBackground
"
,
"
0
"
));
showAttitudeIndicator
=
getBool
(
flightDisplay
.
loadSetting
(
"
showAttitudeIndicator
"
,
"
1
"
));
showPitchIndicator
=
getBool
(
flightDisplay
.
loadSetting
(
"
showPitchIndicator
"
,
"
1
"
));
showPitchIndicator
=
getBool
(
flightDisplay
.
loadSetting
(
"
showPitchIndicator
"
,
"
1
"
));
showCompass
=
getBool
(
flightDisplay
.
loadSetting
(
"
showCompass
"
,
"
1
"
));
compassWidget
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showCompassWidget
"
,
"
0
"
));
compassHUD
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showCompassHUD
"
,
"
1
"
));
attitudeWidget
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showAttitudeWidget
"
,
"
0
"
));
attitudeHUD
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showAttitudeHUD
"
,
"
1
"
));
altitudeWidget
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showAltitudeWidget
"
,
"
1
"
));
altitudeWidget
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showAltitudeWidget
"
,
"
1
"
));
speedWidget
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showSpeedWidget
"
,
"
1
"
));
speedWidget
.
visible
=
getBool
(
flightDisplay
.
loadSetting
(
"
showSpeedWidget
"
,
"
1
"
));
currentSpeed
.
showAirSpeed
=
getBool
(
flightDisplay
.
loadSetting
(
"
showCurrentAirSpeed
"
,
"
1
"
));
currentSpeed
.
showAirSpeed
=
getBool
(
flightDisplay
.
loadSetting
(
"
showCurrentAirSpeed
"
,
"
1
"
));
...
@@ -91,6 +94,16 @@ Item {
...
@@ -91,6 +94,16 @@ Item {
videoBackground
.
visible
=
false
;
videoBackground
.
visible
=
false
;
flightDisplay
.
saveSetting
(
"
showVideoBackground
"
,
setBool
(
videoBackground
.
visible
));
flightDisplay
.
saveSetting
(
"
showVideoBackground
"
,
setBool
(
videoBackground
.
visible
));
}
}
// Compass HUD or Widget. Not both:
if
(
compassWidget
.
visible
&&
compassHUD
.
visible
)
{
compassWidget
.
visible
=
false
;
flightDisplay
.
saveSetting
(
"
showCompassWidget
"
,
setBool
(
compassWidget
.
visible
));
}
// Attitude HUD or Widget. Not both:
if
(
attitudeWidget
.
visible
&&
attitudeHUD
.
visible
)
{
attitudeWidget
.
visible
=
false
;
flightDisplay
.
saveSetting
(
"
showAttitudeWidget
"
,
setBool
(
attitudeWidget
.
visible
));
}
// Disable video if we don't have support for it
// Disable video if we don't have support for it
if
(
!
flightDisplay
.
hasVideo
)
{
if
(
!
flightDisplay
.
hasVideo
)
{
videoBackground
.
visible
=
false
;
videoBackground
.
visible
=
false
;
...
@@ -103,19 +116,13 @@ Item {
...
@@ -103,19 +116,13 @@ Item {
Menu
{
Menu
{
id
:
contextMenu
id
:
contextMenu
ExclusiveGroup
{
id
:
backgroundDisplay
}
MenuItem
{
MenuItem
{
text
:
"
Map Background
"
text
:
"
Map Background
"
checkable
:
true
checkable
:
true
checked
:
mapBackground
.
visible
checked
:
mapBackground
.
visible
exclusiveGroup
:
backgroundDisplay
onTriggered
:
onTriggered
:
{
{
mapBackground
.
visible
=
!
mapBackground
.
visible
;
enforceExclusiveOption
(
mapBackground
,
videoBackground
,
"
showMapBackground
"
,
"
showVideoBackground
"
);
flightDisplay
.
saveSetting
(
"
showMapBackground
"
,
setBool
(
mapBackground
.
visible
));
videoBackground
.
visible
=
mapBackground
.
visible
?
false
:
videoBackground
.
visible
;
flightDisplay
.
saveSetting
(
"
showVideoBackground
"
,
setBool
(
videoBackground
.
visible
));
}
}
}
}
...
@@ -152,22 +159,39 @@ Item {
...
@@ -152,22 +159,39 @@ Item {
text
:
"
Video Background
"
text
:
"
Video Background
"
checkable
:
true
checkable
:
true
checked
:
videoBackground
.
visible
checked
:
videoBackground
.
visible
exclusiveGroup
:
backgroundDisplay
onTriggered
:
onTriggered
:
{
{
videoBackground
.
visible
=
!
videoBackground
.
visible
;
enforceExclusiveOption
(
videoBackground
,
mapBackground
,
"
showVideoBackground
"
,
"
showMapBackground
"
);
flightDisplay
.
saveSetting
(
"
showVideoBackground
"
,
setBool
(
videoBackground
.
visible
));
mapBackground
.
visible
=
videoBackground
.
visible
?
false
:
mapBackground
.
visible
;
flightDisplay
.
saveSetting
(
"
showMapBackground
"
,
setBool
(
mapBackground
.
visible
));
}
}
}
}
MenuSeparator
{}
MenuSeparator
{}
MenuItem
{
text
:
"
Attitude Widget
"
checkable
:
true
checked
:
attitudeWidget
.
visible
onTriggered
:
{
enforceExclusiveOption
(
attitudeWidget
,
attitudeHUD
,
"
showAttitudeWidget
"
,
"
showAttitudeHUD
"
);
}
}
MenuItem
{
text
:
"
Attitude HUD
"
checkable
:
true
checked
:
attitudeHUD
.
visible
onTriggered
:
{
enforceExclusiveOption
(
attitudeHUD
,
attitudeWidget
,
"
showAttitudeHUD
"
,
"
showAttitudeWidget
"
);
}
}
MenuItem
{
MenuItem
{
text
:
"
Pitch Indicator
"
text
:
"
Pitch Indicator
"
checkable
:
true
checkable
:
true
checked
:
showPitchIndicator
checked
:
showPitchIndicator
enabled
:
attitudeHUD
.
visible
||
attitudeWidget
.
visible
onTriggered
:
onTriggered
:
{
{
showPitchIndicator
=
!
showPitchIndicator
;
showPitchIndicator
=
!
showPitchIndicator
;
...
@@ -176,24 +200,22 @@ Item {
...
@@ -176,24 +200,22 @@ Item {
}
}
MenuItem
{
MenuItem
{
text
:
"
Attitude Indicator
"
text
:
"
Compass Widget
"
checkable
:
true
checkable
:
true
checked
:
showAttitudeIndicator
checked
:
compassWidget
.
visible
onTriggered
:
onTriggered
:
{
{
showAttitudeIndicator
=
!
showAttitudeIndicator
;
enforceExclusiveOption
(
compassWidget
,
compassHUD
,
"
showCompassWidget
"
,
"
showCompassHUD
"
);
flightDisplay
.
saveSetting
(
"
showAttitudeIndicator
"
,
setBool
(
showAttitudeIndicator
));
}
}
}
}
MenuItem
{
MenuItem
{
text
:
"
Compass
"
text
:
"
Compass
HUD
"
checkable
:
true
checkable
:
true
checked
:
showCompass
checked
:
compassHUD
.
visible
onTriggered
:
onTriggered
:
{
{
showCompass
=
!
showCompass
;
enforceExclusiveOption
(
compassHUD
,
compassWidget
,
"
showCompassHUD
"
,
"
showCompassWidget
"
);
flightDisplay
.
saveSetting
(
"
showCompass
"
,
setBool
(
showCompass
));
}
}
}
}
...
@@ -271,10 +293,14 @@ Item {
...
@@ -271,10 +293,14 @@ Item {
{
{
showPitchIndicator
=
true
;
showPitchIndicator
=
true
;
flightDisplay
.
saveSetting
(
"
showPitchIndicator
"
,
setBool
(
showPitchIndicator
));
flightDisplay
.
saveSetting
(
"
showPitchIndicator
"
,
setBool
(
showPitchIndicator
));
showAttitudeIndicator
=
true
;
attitudeWidget
.
visible
=
false
;
flightDisplay
.
saveSetting
(
"
showAttitudeIndicator
"
,
setBool
(
showAttitudeIndicator
));
flightDisplay
.
saveSetting
(
"
showAttitudeWidget
"
,
setBool
(
attitudeWidget
.
visible
));
showCompass
=
true
;
attitudeHUD
.
visible
=
true
;
flightDisplay
.
saveSetting
(
"
showCompass
"
,
setBool
(
showCompass
));
flightDisplay
.
saveSetting
(
"
showAttitudeHUD
"
,
setBool
(
attitudeHUD
.
visible
));
compassWidget
.
visible
=
false
flightDisplay
.
saveSetting
(
"
showCompassWidget
"
,
setBool
(
compassWidget
.
visible
));
compassHUD
.
visible
=
true
flightDisplay
.
saveSetting
(
"
showCompassHUD
"
,
setBool
(
compassHUD
.
visible
));
altitudeWidget
.
visible
=
true
;
altitudeWidget
.
visible
=
true
;
flightDisplay
.
saveSetting
(
"
showAltitudeWidget
"
,
setBool
(
altitudeWidget
.
visible
));
flightDisplay
.
saveSetting
(
"
showAltitudeWidget
"
,
setBool
(
altitudeWidget
.
visible
));
currentAltitude
.
showAltitude
=
true
;
currentAltitude
.
showAltitude
=
true
;
...
@@ -300,6 +326,8 @@ Item {
...
@@ -300,6 +326,8 @@ Item {
}
}
// Video and Map backgrounds are exclusive. If one is enabled the other is disabled.
QGCVideoBackground
{
QGCVideoBackground
{
id
:
videoBackground
id
:
videoBackground
anchors.fill
:
parent
anchors.fill
:
parent
...
@@ -329,13 +357,14 @@ Item {
...
@@ -329,13 +357,14 @@ Item {
z
:
mapBackground
.
z
+
1
z
:
mapBackground
.
z
+
1
}
}
QGCCompassInstrument
{
// Floating (Top Left) Compass Widget
id
:
compassInstrument
QGCCompassWidget
{
id
:
compassWidget
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
x
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
x
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
heading
:
isNaN
(
MavManager
.
heading
)
?
0
:
MavManager
.
heading
heading
:
isNaN
(
MavManager
.
heading
)
?
0
:
MavManager
.
heading
visible
:
showHudInstruments
()
&&
showCompass
z
:
mapBackground
.
z
+
2
z
:
mapBackground
.
z
+
2
onResetRequested
:
{
onResetRequested
:
{
y
=
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
y
=
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
...
@@ -346,14 +375,37 @@ Item {
...
@@ -346,14 +375,37 @@ Item {
}
}
}
}
QGCAttitudeInstrument
{
// HUD (lower middle) Compass
id
:
attitudeInstrument
QGCCompassHUD
{
id
:
compassHUD
y
:
root
.
height
*
0.7
x
:
root
.
width
*
0.5
-
ScreenTools
.
defaultFontPixelSize
*
(
5
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
10
)
height
:
ScreenTools
.
defaultFontPixelSize
*
(
10
)
heading
:
isNaN
(
MavManager
.
heading
)
?
0
:
MavManager
.
heading
z
:
70
}
// Sky/Ground background (visible when no Map or Video is enabled)
QGCArtificialHorizon
{
id
:
artificialHoriz
anchors.fill
:
parent
rollAngle
:
roll
pitchAngle
:
pitch
visible
:
!
videoBackground
.
visible
&&
!
mapBackground
.
visible
}
// Floating (Top Right) Attitude Widget
QGCAttitudeWidget
{
id
:
attitudeWidget
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
rollAngle
:
roll
rollAngle
:
roll
pitchAngle
:
pitch
pitchAngle
:
pitch
showPitch
:
showPitchIndicator
showPitch
:
showPitchIndicator
visible
:
showHudInstruments
()
&&
showAttitudeIndicator
anchors.right
:
root
.
right
anchors.right
:
root
.
right
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
z
:
mapBackground
.
z
+
2
z
:
mapBackground
.
z
+
2
...
@@ -367,35 +419,18 @@ Item {
...
@@ -367,35 +419,18 @@ Item {
}
}
}
}
QGCArtificialHorizon
{
// HUD (center) Attitude Indicator
id
:
artificialHoriz
anchors.fill
:
parent
rollAngle
:
roll
pitchAngle
:
pitch
visible
:
!
showHudInstruments
()
}
QGCAttitude
Widget
{
QGCAttitude
HUD
{
id
:
attitude
Widget
id
:
attitude
HUD
rollAngle
:
roll
rollAngle
:
roll
pitchAngle
:
pitch
pitchAngle
:
pitch
visible
:
!
showHudInstruments
()
&&
showAttitude
Indicator
showPitch
:
showPitch
Indicator
width
:
ScreenTools
.
defaultFontPixelSize
*
(
21.7
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
30
)
height
:
ScreenTools
.
defaultFontPixelSize
*
(
21.7
)
height
:
ScreenTools
.
defaultFontPixelSize
*
(
30
)
z
:
20
z
:
20
}
}
QGCPitchWidget
{
id
:
pitchWidget
visible
:
showPitchIndicator
&&
!
showHudInstruments
()
anchors.verticalCenter
:
parent
.
verticalCenter
pitchAngle
:
pitch
rollAngle
:
roll
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
10
)
z
:
30
}
QGCAltitudeWidget
{
QGCAltitudeWidget
{
id
:
altitudeWidget
id
:
altitudeWidget
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
...
@@ -438,17 +473,6 @@ Item {
...
@@ -438,17 +473,6 @@ Item {
z
:
60
z
:
60
}
}
QGCCompass
{
id
:
compassIndicator
y
:
root
.
height
*
0.7
x
:
root
.
width
*
0.5
-
ScreenTools
.
defaultFontPixelSize
*
(
5
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
10
)
height
:
ScreenTools
.
defaultFontPixelSize
*
(
10
)
heading
:
isNaN
(
MavManager
.
heading
)
?
0
:
MavManager
.
heading
visible
:
!
showHudInstruments
()
&&
showCompass
z
:
70
}
//- Context Menu
//- Context Menu
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
...
...
src/ui/qmlcommon/QGCAttitude
Instrument
.qml
→
src/ui/qmlcommon/QGCAttitude
HUD
.qml
View file @
a656c246
...
@@ -23,81 +23,59 @@ This file is part of the QGROUNDCONTROL project
...
@@ -23,81 +23,59 @@ This file is part of the QGROUNDCONTROL project
/**
/**
* @file
* @file
* @brief QGC Attitude
Instrumen
t
* @brief QGC Attitude
Widge
t
* @author Gus Grubba <mavlink@grubba.com>
* @author Gus Grubba <mavlink@grubba.com>
*/
*/
import
QtQuick
2.4
import
QtQuick
2.4
import
QGroundControl
.
Contr
ols
1.0
import
QGroundControl
.
ScreenTo
ols
1.0
QGCMovable
Item
{
Item
{
id
:
root
id
:
root
property
real
rollAngle
:
0
anchors.centerIn
:
parent
property
real
rollAngle
:
0
property
real
pitchAngle
:
0
property
real
pitchAngle
:
0
property
bool
showPitch
:
true
property
bool
showPitch
:
true
property
real
size
width
:
size
height
:
size
//----------------------------------------------------
//-- Artificial Horizon
QGCArtificialHorizon
{
rollAngle
:
root
.
rollAngle
pitchAngle
:
root
.
pitchAngle
anchors.fill
:
parent
}
//----------------------------------------------------
//-- Pointer
Image
{
Image
{
id
:
pointer
id
:
rollDial
source
:
"
/qmlimages/attitudePointer.svg
"
anchors
{
bottom
:
root
.
verticalCenter
;
horizontalCenter
:
parent
.
horizontalCenter
}
source
:
"
/qmlimages/rollDialWhite.svg
"
mipmap
:
true
mipmap
:
true
width
:
parent
.
width
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
anchors.fill
:
parent
transform
:
Rotation
{
origin.x
:
rollDial
.
width
/
2
origin.y
:
rollDial
.
height
angle
:
-
rollAngle
}
}
}
//----------------------------------------------------
//-- Instrument Dial
Image
{
Image
{
id
:
instrumentDial
id
:
pointer
source
:
"
/qmlimages/attitudeDial.svg
"
anchors
{
bottom
:
root
.
verticalCenter
;
horizontalCenter
:
parent
.
horizontalCenter
}
source
:
"
/qmlimages/rollPointerWhite.svg
"
mipmap
:
true
mipmap
:
true
width
:
rollDial
.
width
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
anchors.fill
:
parent
transform
:
Rotation
{
origin.x
:
root
.
width
/
2
origin.y
:
root
.
height
/
2
angle
:
-
rollAngle
}
}
}
//----------------------------------------------------
//-- Pitch
QGCPitchWidget
{
id
:
pitchWidget
visible
:
root
.
showPitch
size
:
root
.
size
*
0.65
anchors.verticalCenter
:
parent
.
verticalCenter
pitchAngle
:
root
.
pitchAngle
rollAngle
:
root
.
rollAngle
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0
)
}
//----------------------------------------------------
//-- Cross Hair
Image
{
Image
{
id
:
crossHair
id
:
crossHair
anchors.centerIn
:
parent
anchors.centerIn
:
parent
source
:
"
/qmlimages/crossHair.svg
"
source
:
"
/qmlimages/crossHair.svg
"
mipmap
:
true
mipmap
:
true
width
:
size
*
0.75
width
:
parent
.
width
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
}
}
//----------------------------------------------------
//-- Instrument Pannel
QGCPitchIndicator
{
Image
{
id
:
pitchIndicator
id
:
pannel
anchors.verticalCenter
:
parent
.
verticalCenter
source
:
"
/qmlimages/attitudeInstrument.svg
"
visible
:
root
.
showPitch
mipmap
:
true
pitchAngle
:
root
.
pitchAngle
fillMode
:
Image
.
PreserveAspectFit
rollAngle
:
root
.
rollAngle
anchors.fill
:
parent
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
10
)
}
}
}
}
src/ui/qmlcommon/QGCAttitudeWidget.qml
View file @
a656c246
...
@@ -23,48 +23,81 @@ This file is part of the QGROUNDCONTROL project
...
@@ -23,48 +23,81 @@ This file is part of the QGROUNDCONTROL project
/**
/**
* @file
* @file
* @brief QGC Attitude
Widge
t
* @brief QGC Attitude
Instrumen
t
* @author Gus Grubba <mavlink@grubba.com>
* @author Gus Grubba <mavlink@grubba.com>
*/
*/
import
QtQuick
2.4
import
QtQuick
2.4
import
QGroundControl
.
ScreenTo
ols
1.0
import
QGroundControl
.
Contr
ols
1.0
Item
{
QGCMovable
Item
{
id
:
root
id
:
root
anchors.centerIn
:
parent
property
real
rollAngle
:
0
property
real
rollAngle
:
0
property
real
pitchAngle
:
0
property
real
pitchAngle
:
0
property
bool
showPitch
:
true
property
real
size
width
:
size
height
:
size
//----------------------------------------------------
//-- Artificial Horizon
QGCArtificialHorizon
{
rollAngle
:
root
.
rollAngle
pitchAngle
:
root
.
pitchAngle
anchors.fill
:
parent
}
//----------------------------------------------------
//-- Pointer
Image
{
Image
{
id
:
rollDial
id
:
pointer
anchors
{
bottom
:
root
.
verticalCenter
;
horizontalCenter
:
parent
.
horizontalCenter
}
source
:
"
/qmlimages/attitudePointer.svg
"
source
:
"
/qmlimages/rollDialWhite.svg
"
mipmap
:
true
mipmap
:
true
width
:
parent
.
width
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
transform
:
Rotation
{
anchors.fill
:
parent
origin.x
:
rollDial
.
width
/
2
origin.y
:
rollDial
.
height
angle
:
-
rollAngle
}
}
}
//----------------------------------------------------
//-- Instrument Dial
Image
{
Image
{
id
:
pointer
id
:
instrumentDial
anchors
{
bottom
:
root
.
verticalCenter
;
horizontalCenter
:
parent
.
horizontalCenter
}
source
:
"
/qmlimages/attitudeDial.svg
"
source
:
"
/qmlimages/rollPointerWhite.svg
"
mipmap
:
true
mipmap
:
true
width
:
rollDial
.
width
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
anchors.fill
:
parent
transform
:
Rotation
{
origin.x
:
root
.
width
/
2
origin.y
:
root
.
height
/
2
angle
:
-
rollAngle
}
}
}
//----------------------------------------------------
//-- Pitch
QGCPitchIndicator
{
id
:
pitchWidget
visible
:
root
.
showPitch
size
:
root
.
size
*
0.65
anchors.verticalCenter
:
parent
.
verticalCenter
pitchAngle
:
root
.
pitchAngle
rollAngle
:
root
.
rollAngle
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0
)
}
//----------------------------------------------------
//-- Cross Hair
Image
{
Image
{
id
:
crossHair
id
:
crossHair
anchors.centerIn
:
parent
anchors.centerIn
:
parent
source
:
"
/qmlimages/crossHair.svg
"
source
:
"
/qmlimages/crossHair.svg
"
mipmap
:
true
mipmap
:
true
width
:
parent
.
width
width
:
size
*
0.75
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
}
}
//----------------------------------------------------
//-- Instrument Pannel
Image
{
id
:
pannel
source
:
"
/qmlimages/attitudeInstrument.svg
"
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
anchors.fill
:
parent
}
}
}
src/ui/qmlcommon/QGCCompass.qml
→
src/ui/qmlcommon/QGCCompass
HUD
.qml
View file @
a656c246
...
@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project
...
@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project
/**
/**
* @file
* @file
* @brief QGC Compass
* @brief QGC Compass
HUD
* @author Gus Grubba <mavlink@grubba.com>
* @author Gus Grubba <mavlink@grubba.com>
*/
*/
...
@@ -70,5 +70,3 @@ Item {
...
@@ -70,5 +70,3 @@ Item {
}
}
}
}
}
}
src/ui/qmlcommon/QGCCompass
Instrumen
t.qml
→
src/ui/qmlcommon/QGCCompass
Widge
t.qml
View file @
a656c246
...
@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project
...
@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project
/**
/**
* @file
* @file
* @brief QGC Compass
* @brief QGC Compass
Widget
* @author Gus Grubba <mavlink@grubba.com>
* @author Gus Grubba <mavlink@grubba.com>
*/
*/
...
...
src/ui/qmlcommon/QGCPitch
Widget
.qml
→
src/ui/qmlcommon/QGCPitch
Indicator
.qml
View file @
a656c246
File moved
src/ui/qmlcommon/qmldir
View file @
a656c246
Module QGroundControl.FlightControls
Module QGroundControl.FlightControls
QGCAltitudeWidget 1.0 QGCAltitudeWidget.qml
QGCAltitudeWidget 1.0 QGCAltitudeWidget.qml
QGCArtificialHorizon 1.0 QGCArtificialHorizon.qml
QGCAttitudeHUD 1.0 QGCAttitudeHUD.qml
QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml
QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml
QGCCompass 1.0 QGCCompass.qml
QGCCompassHUD 1.0 QGCCompassHUD.qml
QGCCompassWidget 1.0 QGCCompassWidget.qml
QGCCurrentAltitude 1.0 QGCCurrentAltitude.qml
QGCCurrentAltitude 1.0 QGCCurrentAltitude.qml
QGCCurrentSpeed 1.0 QGCCurrentSpeed.qml
QGCCurrentSpeed 1.0 QGCCurrentSpeed.qml
QGCHudMessage 1.0 QGCHudMessage.qml
QGCMapBackground 1.0 QGCMapBackground.qml
QGCMapBackground 1.0 QGCMapBackground.qml
QGCPitchWidget 1.0 QGCPitchWidget.qml
QGCSpeedWidget 1.0 QGCSpeedWidget.qml
QGCSlider 1.0 QGCSlider.qml
QGCWaypointEditor 1.0 QGCWaypointEditor.qml
QGCMapToolButton 1.0 QGCMapToolButton.qml
QGCMapToolButton 1.0 QGCMapToolButton.qml
QGCAttitudeInstrument 1.0 QGCAttitudeInstrument.qml
QGCPitchIndicator 1.0 QGCPitchIndicator.qml
QGCCompassInstrument 1.0 QGCCompassInstrument.qml
QGCSlider 1.0 QGCSlider.qml
QGCArtificialHorizon 1.0 QGCArtificialHorizon.qml
QGCSpeedWidget 1.0 QGCSpeedWidget.qml
QGCWaypoint 1.0 QGCWaypoint.qml
QGCHudMessage 1.0 QGCHudMessage.qml
QGCVideoBackground 1.0 QGCVideoBackground.qml
QGCVideoBackground 1.0 QGCVideoBackground.qml
QGCWaypoint 1.0 QGCWaypoint.qml
QGCWaypointEditor 1.0 QGCWaypointEditor.qml
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