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
683cdd44
Commit
683cdd44
authored
Sep 08, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1852 from DonLakeFlyer/MapVideo
Add video background support
parents
8ce30794
07087525
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
170 additions
and
99 deletions
+170
-99
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+122
-51
FlightMap.qml
src/FlightMap/FlightMap.qml
+48
-48
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
683cdd44
...
@@ -63,6 +63,8 @@ Item {
...
@@ -63,6 +63,8 @@ Item {
property
real
_airSpeed
:
_activeVehicle
?
_activeVehicle
.
airSpeed
:
_defaultAirSpeed
property
real
_airSpeed
:
_activeVehicle
?
_activeVehicle
.
airSpeed
:
_defaultAirSpeed
property
real
_climbRate
:
_activeVehicle
?
_activeVehicle
.
climbRate
:
_defaultClimbRate
property
real
_climbRate
:
_activeVehicle
?
_activeVehicle
.
climbRate
:
_defaultClimbRate
property
bool
_showMap
:
true
function
getBool
(
value
)
{
function
getBool
(
value
)
{
return
value
===
'
0
'
?
false
:
true
;
return
value
===
'
0
'
?
false
:
true
;
}
}
...
@@ -72,11 +74,12 @@ Item {
...
@@ -72,11 +74,12 @@ Item {
}
}
FlightMap
{
FlightMap
{
id
:
flightMap
id
:
flightMap
anchors.fill
:
parent
anchors.fill
:
parent
mapName
:
"
FlightDisplayView
"
mapName
:
"
FlightDisplayView
"
latitude
:
parent
.
_latitude
latitude
:
parent
.
_latitude
longitude
:
parent
.
_longitude
longitude
:
parent
.
_longitude
visible
:
_showMap
// Add the vehicles to the map
// Add the vehicles to the map
MapItemView
{
MapItemView
{
...
@@ -120,56 +123,60 @@ Item {
...
@@ -120,56 +123,60 @@ Item {
}
}
}
}
}
}
// Mission item list
ListView
{
id
:
missionItemSummaryList
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.right
:
flightMap
.
mapWidgets
.
left
anchors.bottom
:
parent
.
bottom
height
:
ScreenTools
.
defaultFontPixelHeight
*
7
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
opacity
:
0.75
orientation
:
ListView
.
Horizontal
model
:
multiVehicleManager
.
activeVehicle
?
multiVehicleManager
.
activeVehicle
.
missionItems
:
0
property
real
_maxItemHeight
:
0
delegate
:
MissionItemSummary
{
opacity
:
0.75
missionItem
:
object
}
}
// ListView - Mission item list
}
QGCCompassWidget
{
x
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
heading
:
_heading
active
:
multiVehicleManager
.
activeVehicleAvailable
z
:
flightMap
.
z
+
2
}
QGCCompassWidget
{
QGCAttitudeWidget
{
x
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
anchors.right
:
parent
.
right
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
heading
:
parent
.
_heading
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
active
:
multiVehicleManager
.
activeVehicleAvailable
rollAngle
:
_roll
z
:
flightMap
.
z
+
2
pitchAngle
:
_pitch
}
active
:
multiVehicleManager
.
activeVehicleAvailable
z
:
flightMap
.
z
+
2
}
}
// Flight Map
QGCVideoBackground
{
anchors.fill
:
parent
display
:
videoDisplay
receiver
:
videoReceiver
visible
:
!
_showMap
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
:
root
.
heading
active
:
multiVehicleManager
.
activeVehicleAvailable
z
:
70
}
QGCAttitudeWidget
{
QGCAttitudeHUD
{
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
id
:
attitudeHUD
anchors.right
:
parent
.
right
rollAngle
:
_roll
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
pitchAngle
:
_pitch
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
30
)
rollAngle
:
parent
.
_roll
height
:
ScreenTools
.
defaultFontPixelSize
*
(
30
)
pitchAngle
:
parent
.
_pitch
active
:
multiVehicleManager
.
activeVehicleAvailable
active
:
multiVehicleManager
.
activeVehicleAvailable
}
z
:
flightMap
.
z
+
2
}
}
QGCAltitudeWidget
{
QGCAltitudeWidget
{
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
height
:
parent
.
height
*
0.65
>
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
?
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
:
parent
.
height
*
0.65
height
:
parent
.
height
*
0.65
>
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
?
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
:
parent
.
height
*
0.65
width
:
ScreenTools
.
defaultFontPixelSize
*
(
5
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
5
)
altitude
:
parent
.
_altitudeWGS84
altitude
:
_altitudeWGS84
z
:
30
z
:
30
}
}
...
@@ -177,15 +184,15 @@ Item {
...
@@ -177,15 +184,15 @@ Item {
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
width
:
ScreenTools
.
defaultFontPixelSize
*
(
5
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
5
)
height
:
parent
.
height
*
0.65
>
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
?
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
:
parent
.
height
*
0.65
height
:
parent
.
height
*
0.65
>
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
?
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
:
parent
.
height
*
0.65
speed
:
parent
.
_groundSpeed
speed
:
_groundSpeed
z
:
40
z
:
40
}
}
QGCCurrentSpeed
{
QGCCurrentSpeed
{
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
width
:
ScreenTools
.
defaultFontPixelSize
*
(
6.25
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
6.25
)
airspeed
:
parent
.
_airSpeed
airspeed
:
_airSpeed
groundspeed
:
parent
.
_groundSpeed
groundspeed
:
_groundSpeed
active
:
multiVehicleManager
.
activeVehicleAvailable
active
:
multiVehicleManager
.
activeVehicleAvailable
z
:
50
z
:
50
}
}
...
@@ -193,9 +200,73 @@ Item {
...
@@ -193,9 +200,73 @@ Item {
QGCCurrentAltitude
{
QGCCurrentAltitude
{
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
width
:
ScreenTools
.
defaultFontPixelSize
*
(
6.25
)
width
:
ScreenTools
.
defaultFontPixelSize
*
(
6.25
)
altitude
:
parent
.
_altitudeWGS84
altitude
:
_altitudeWGS84
vertZ
:
parent
.
_climbRate
vertZ
:
_climbRate
active
:
multiVehicleManager
.
activeVehicleAvailable
active
:
multiVehicleManager
.
activeVehicleAvailable
z
:
60
z
:
60
}
}
// Mission item list
ListView
{
id
:
missionItemSummaryList
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.right
:
optionsButton
.
left
anchors.bottom
:
parent
.
bottom
height
:
ScreenTools
.
defaultFontPixelHeight
*
7
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
opacity
:
0.75
orientation
:
ListView
.
Horizontal
model
:
multiVehicleManager
.
activeVehicle
?
multiVehicleManager
.
activeVehicle
.
missionItems
:
0
property
real
_maxItemHeight
:
0
delegate
:
MissionItemSummary
{
opacity
:
0.75
missionItem
:
object
}
}
// ListView - Mission item list
QGCButton
{
id
:
optionsButton
x
:
flightMap
.
mapWidgets
.
x
y
:
flightMap
.
mapWidgets
.
y
-
height
-
(
ScreenTools
.
defaultFontPixelHeight
/
2
)
width
:
flightMap
.
mapWidgets
.
width
text
:
"
Options
"
menu
:
optionsMenu
ExclusiveGroup
{
id
:
backgroundTypeGroup
}
Menu
{
id
:
optionsMenu
MenuItem
{
id
:
mapBackgroundMenuItem
exclusiveGroup
:
backgroundTypeGroup
checkable
:
true
checked
:
_showMap
text
:
"
Show map as background
"
onTriggered
:
_showMap
=
true
}
MenuItem
{
id
:
videoBackgroundMenuItem
exclusiveGroup
:
backgroundTypeGroup
checkable
:
true
checked
:
!
_showMap
text
:
"
Show video as background
"
onTriggered
:
_showMap
=
false
}
MenuSeparator
{
}
Component.onCompleted
:
flightMap
.
addMapMenuItems
(
optionsMenu
)
}
}
}
}
src/FlightMap/FlightMap.qml
View file @
683cdd44
...
@@ -47,7 +47,6 @@ Map {
...
@@ -47,7 +47,6 @@ Map {
property
real
heading
:
0
property
real
heading
:
0
property
bool
interactive
:
true
property
bool
interactive
:
true
property
string
mapName
:
'
defaultMap
'
property
string
mapName
:
'
defaultMap
'
property
alias
mapMenu
:
mapTypeMenu
property
alias
mapWidgets
:
controlWidgets
property
alias
mapWidgets
:
controlWidgets
property
bool
isSatelliteMap
:
false
property
bool
isSatelliteMap
:
false
...
@@ -62,8 +61,53 @@ Map {
...
@@ -62,8 +61,53 @@ Map {
plugin
:
Plugin
{
name
:
"
QGroundControl
"
}
plugin
:
Plugin
{
name
:
"
QGroundControl
"
}
Component.onCompleted
:
mapTypeMenu
.
update
()
ExclusiveGroup
{
id
:
mapTypeGroup
}
/*
function setCurrentMap(mapID) {
for (var i = 0; i < _map.supportedMapTypes.length; i++) {
if (mapID === _map.supportedMapTypes[i].name) {
_map.activeMapType = _map.supportedMapTypes[i]
multiVehicleManager.saveSetting(_map.mapName + "/currentMapType", mapID);
return;
}
}
}
function addMap(mapID, checked) {
var mItem = mapTypeMenu.addItem(mapID);
mItem.checkable = true
mItem.checked = checked
mItem.exclusiveGroup = currMapType
var menuSlot = function() {setCurrentMap(mapID);};
mItem.triggered.connect(menuSlot);
}
function addMapMenuItems(menu) {
var mapID = ''
if (_map.supportedMapTypes.length > 0)
mapID = _map.activeMapType.name;
mapID = multiVehicleManager.loadSetting(_map.mapName + "/currentMapType", mapID);
for (var i = 0; i < _map.supportedMapTypes.length; i++) {
var name = _map.supportedMapTypes[i].name;
addMap(name, mapID === name);
}
if(mapID != '')
setCurrentMap(mapID);
}
*/
function
addMapMenuItems
(
menu
)
{
for
(
var
i
=
0
;
i
<
_map
.
supportedMapTypes
.
length
;
i
++
)
{
var
name
=
_map
.
supportedMapTypes
[
i
].
name
;
var
mItem
=
menu
.
addItem
(
name
);
mItem
.
checkable
=
true
mItem
.
exclusiveGroup
=
mapTypeGroup
//var menuSlot = function() {setCurrentMap(mapID);};
//mItem.triggered.connect(menuSlot);
}
}
/// Map control widgets
/// Map control widgets
Column
{
Column
{
id
:
controlWidgets
id
:
controlWidgets
...
@@ -72,56 +116,12 @@ Map {
...
@@ -72,56 +116,12 @@ Map {
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
//-- Menu to select supported map types
Menu
{
id
:
mapTypeMenu
title
:
"
Map Type...
"
enabled
:
_map
.
visible
ExclusiveGroup
{
id
:
currMapType
}
function
setCurrentMap
(
mapID
)
{
for
(
var
i
=
0
;
i
<
_map
.
supportedMapTypes
.
length
;
i
++
)
{
if
(
mapID
===
_map
.
supportedMapTypes
[
i
].
name
)
{
_map
.
activeMapType
=
_map
.
supportedMapTypes
[
i
]
multiVehicleManager
.
saveSetting
(
_map
.
mapName
+
"
/currentMapType
"
,
mapID
);
return
;
}
}
}
function
addMap
(
mapID
,
checked
)
{
var
mItem
=
mapTypeMenu
.
addItem
(
mapID
);
mItem
.
checkable
=
true
mItem
.
checked
=
checked
mItem
.
exclusiveGroup
=
currMapType
var
menuSlot
=
function
()
{
setCurrentMap
(
mapID
);};
mItem
.
triggered
.
connect
(
menuSlot
);
}
function
update
()
{
clear
()
var
mapID
=
''
if
(
_map
.
supportedMapTypes
.
length
>
0
)
mapID
=
_map
.
activeMapType
.
name
;
mapID
=
multiVehicleManager
.
loadSetting
(
_map
.
mapName
+
"
/currentMapType
"
,
mapID
);
for
(
var
i
=
0
;
i
<
_map
.
supportedMapTypes
.
length
;
i
++
)
{
var
name
=
_map
.
supportedMapTypes
[
i
].
name
;
addMap
(
name
,
mapID
===
name
);
}
if
(
mapID
!=
''
)
setCurrentMap
(
mapID
);
}
}
QGCButton
{
id
:
optionsButton
text
:
"
Options
"
menu
:
mapTypeMenu
}
Row
{
Row
{
layoutDirection
:
Qt
.
RightToLeft
layoutDirection
:
Qt
.
RightToLeft
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_zoomIncrement
:
1.0
readonly
property
real
_zoomIncrement
:
1.0
property
real
_buttonWidth
:
(
optionsButton
.
width
-
spacing
)
/
2
property
real
_buttonWidth
:
ScreenTools
.
defaultFontPixelWidth
*
5
NumberAnimation
{
NumberAnimation
{
id
:
animateZoom
id
:
animateZoom
...
...
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