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
7d8ebfd3
Commit
7d8ebfd3
authored
Dec 05, 2010
by
Lionel Heng
Browse files
Options
Browse Files
Download
Plain Diff
Fixed merge for qgroundcontrol.pro
parents
4cb06414
0f18c7c5
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
375 additions
and
28 deletions
+375
-28
earth.html
images/earth.html
+181
-21
mapnetwork.cpp
lib/QMapControl/src/mapnetwork.cpp
+3
-1
ascent-park-glider.skp
models/ascent-park-glider.skp
+0
-0
multiplex-easyglider.skp
models/multiplex-easyglider.skp
+0
-0
multiplex-twinstar.skp
models/multiplex-twinstar.skp
+0
-0
walkera-4g6.skp
models/walkera-4g6.skp
+0
-0
qgroundcontrol.pri
qgroundcontrol.pri
+4
-0
qgroundcontrol.pro
qgroundcontrol.pro
+7
-3
UAS.cc
src/uas/UAS.cc
+1
-0
UAS.h
src/uas/UAS.h
+0
-1
QGCGoogleEarthView.cc
src/ui/map3D/QGCGoogleEarthView.cc
+86
-2
QGCGoogleEarthView.h
src/ui/map3D/QGCGoogleEarthView.h
+39
-0
QGCGoogleEarthViewWin.ui
src/ui/map3D/QGCGoogleEarthViewWin.ui
+21
-0
QGCWebPage.cc
src/ui/map3D/QGCWebPage.cc
+12
-0
QGCWebPage.h
src/ui/map3D/QGCWebPage.h
+21
-0
No files found.
images/earth.html
View file @
7d8ebfd3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html>
<meta
http-equiv=
"content-type"
content=
"text/html; charset=utf-8"
/>
<head>
<!--
Copyright 2008 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- QGroundControl -->
<title>
QGroundControl Google Earth View
</title>
<!-- *** Replace the key below below with your own API key, available at http://code.google.com/apis/maps/signup.html *** -->
<script
type=
"text/javascript"
src=
"http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw"
></script>
<script
type=
"text/javascript"
>
google
.
load
(
"
earth
"
,
"
1
"
);
google
.
load
(
"
earth
"
,
"
1
"
,
{
'
language
'
:
'
en
'
}
);
var
ge
=
null
;
var
initialized
=
false
;
var
aircraft
=
new
Array
();
var
currAircraft
=
220
;
var
followAircraft
=
false
;
var
currLat
=
47.3769
;
var
currLon
=
8.549444
;
var
currAlt
=
470
;
var
homeLat
=
0
;
var
homeLon
=
0
;
var
homeAlt
=
0
;
var
homeViewRange
=
500
;
var
homeLocation
=
null
;
var
homeGroundLevel
=
0
;
var
currViewRange
=
3.0
;
///
<<
The
current
viewing
range
from
this
position
(
in
meters
)
var
currTilt
=
40.0
;
///
<<
The
tilt
angle
(
in
degrees
)
var
currFollowTilt
=
40.0
;
var
currView
=
null
;
var
planeOrient
;
var
planeLoc
;
// Aircraft class
function
isInitialized
()
{
return
initialized
;
}
function
init
()
{
google
.
earth
.
createInstance
(
"
map3d
"
,
initCallback
,
failureCallback
);
google
.
earth
.
createInstance
(
"
map3d
"
,
initCallback
,
failureCallback
);
}
function
setGCSHome
(
lat
,
lon
,
alt
)
{
homeLat
=
lat
;
homeLon
=
lon
;
homeAlt
=
alt
;
var
placemark
=
ge
.
createPlacemark
(
''
);
var
icon
=
ge
.
createIcon
(
''
);
icon
.
setHref
(
'
http://google-maps-icons.googlecode.com/files/blackH.png
'
);
var
style
=
ge
.
createStyle
(
''
);
style
.
getIconStyle
().
setIcon
(
icon
);
//style.getIconStyle().setScale(0.5);
placemark
.
setStyleSelector
(
style
);
// Set the placemark's location.
homeLocation
=
ge
.
createPoint
(
''
);
homeLocation
.
setLatitude
(
lat
);
homeLocation
.
setLongitude
(
lon
);
homeLocation
.
setAltitude
(
alt
);
placemark
.
setGeometry
(
homeLocation
);
// Add the placemark to Earth.
ge
.
getFeatures
().
appendChild
(
placemark
);
homeGroundLevel
=
ge
.
getGlobe
().
getGroundAltitude
(
lat
,
lon
);
if
(
homeGroundLevel
==
0
)
{
homeGroundLevel
=
alt
;
}
goHome
();
}
function
initCallback
(
object
)
{
function
initCallback
(
object
)
{
ge
=
object
;
ge
.
getWindow
().
setVisibility
(
true
);
ge
.
getOptions
().
setStatusBarVisibility
(
true
);
...
...
@@ -40,11 +107,104 @@ function initCallback(object) {
ge
.
getLayerRoot
().
enableLayerById
(
ge
.
LAYER_BUILDINGS
,
true
);
ge
.
getLayerRoot
().
enableLayerById
(
ge
.
LAYER_BORDERS
,
true
);
ge
.
getLayerRoot
().
enableLayerById
(
ge
.
LAYER_TREES
,
true
);
// Now after the Google Earth initialization, initialize the GCS view
setGCSHome
(
currLat
,
currLon
,
currAlt
);
// Create the first aircraft model
// Load 3D model
var
planePlacemark
=
ge
.
createPlacemark
(
''
);
planePlacemark
.
setName
(
'
aircraft
'
);
planeModel
=
ge
.
createModel
(
''
);
ge
.
getFeatures
().
appendChild
(
planePlacemark
);
planeLoc
=
ge
.
createLocation
(
''
);
planeModel
.
setLocation
(
planeLoc
);
planeLink
=
ge
.
createLink
(
''
);
planeOrient
=
ge
.
createOrientation
(
''
);
planeModel
.
setOrientation
(
planeOrient
);
planeLink
.
setHref
(
'
http://qgroundcontrol.org/_media/users/models/multiplex-twinstar.dae
'
);
planeModel
.
setLink
(
planeLink
);
planeModel
.
setAltitudeMode
(
ge
.
ALTITUDE_ABSOLUTE
);
planeLoc
.
setLatitude
(
currLat
);
planeLoc
.
setLongitude
(
currLon
);
planeLoc
.
setAltitude
(
currAlt
);
planePlacemark
.
setGeometry
(
planeModel
);
setAircraftPositionAttitude
(
220
,
47.3772
,
currLon
,
currAlt
+
50
,
20
,
15
,
50
);
enableFollowing
(
true
);
updateFollowAircraft
();
initialized
=
true
;
}
function
setAircraftPositionAttitude
(
id
,
lat
,
lon
,
alt
,
roll
,
pitch
,
yaw
)
{
if
(
id
==
currAircraft
)
{
currLat
=
lat
;
currLon
=
lon
;
currAlt
=
alt
;
}
planeOrient
.
setRoll
(
roll
);
planeOrient
.
setTilt
(
pitch
);
planeOrient
.
setHeading
(
yaw
);
planeLoc
.
setLatitude
(
lat
);
planeLoc
.
setLongitude
(
lon
);
planeLoc
.
setAltitude
(
alt
);
}
function
failureCallback
(
object
)
{
function
goHome
()
{
var
currView
=
ge
.
getView
().
copyAsLookAt
(
ge
.
ALTITUDE_ABSOLUTE
);
currView
.
setLatitude
(
homeLat
);
currView
.
setLongitude
(
homeLon
);
currView
.
setAltitude
(
homeAlt
);
currView
.
setRange
(
homeViewRange
);
currView
.
setTilt
(
currTilt
);
ge
.
getView
().
setAbstractView
(
currView
);
}
</script>
function
setCurrentAircraft
(
id
)
{
currAircraft
=
id
;
}
function
enableFollowing
(
follow
)
{
followEnabled
=
follow
;
}
function
updateFollowAircraft
()
{
if
(
followEnabled
)
{
currView
=
ge
.
getView
().
copyAsLookAt
(
ge
.
ALTITUDE_ABSOLUTE
);
currView
.
setLatitude
(
currLat
);
currView
.
setLongitude
(
currLon
);
currView
.
setAltitude
(
currAlt
);
currView
.
setRange
(
currViewRange
);
currView
.
setTilt
(
currFollowTilt
);
ge
.
getView
().
setAbstractView
(
currView
);
}
}
function
failureCallback
(
object
)
{
}
</script>
<style
type=
"text/css"
>
html
,
body
{
margin
:
0
;
...
...
lib/QMapControl/src/mapnetwork.cpp
View file @
7d8ebfd3
...
...
@@ -95,7 +95,9 @@ namespace qmapcontrol
}
else
{
qDebug
()
<<
"NETWORK_PIXMAP_ERROR: "
<<
ax
;
// QGC FIXME Error is currently undetected
// TODO Error is currently undetected
//qDebug() << "NETWORK_PIXMAP_ERROR: " << ax;
}
}
...
...
models/ascent-park-glider.skp
0 → 100644
View file @
7d8ebfd3
B
SketchUp Model૿{8.0.3161}䪯鷘Hᭇ亾胳튪弣ÿ璆䳺噃牥楳湯慍ー䌉䄀爀挀䌀甀爀瘀攀Ā䌊䄀琀琀爀椀戀甀琀攀䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀䌇䌀愀洀攀爀愀Ԁ䌊䌀漀洀瀀漀渀攀渀琀䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀䌆䌀甀爀瘀攀Ѐ䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀䌄䐀椀戀̀䌊䐀椀洀攀渀猀椀漀渀Ā䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ䌅䔀搀最攀Ȁ䌈䔀搀最攀唀猀攀Ā䌇䔀渀琀椀琀礀̀䌅䘀愀挀攀̀䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ䌌䘀漀渀琀䴀愀渀愀最攀爀䌆䜀爀漀甀瀀Ā䌆䤀洀愀最攀Ā䌆䰀愀礀攀爀Ȁ䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ䌅䰀漀漀瀀Ā䌉䴀愀琀攀爀椀愀氀ఀ䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ䌉倀愀最攀䰀椀猀琀Ā䌋倀漀氀礀氀椀渀攀㌀搀䌍刀攀氀愀琀椀漀渀猀栀椀瀀䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ䌋匀栀愀搀漀眀䤀渀昀漀܀䌇匀欀䘀漀渀琀Ā䌉匀欀攀琀挀栀䌀匀䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā䌉匀欀瀀匀琀礀氀攀Ā䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ䌅吀攀砀琀ऀ䌊吀攀砀琀匀琀礀氀攀Ԁ䌈吀攀砀琀甀爀攀䌊吀栀甀洀戀渀愀椀氀Ā䌇嘀攀爀琀攀砀䌉嘀椀攀眀倀愀最攀ఀ䌊圀愀琀攀爀洀愀爀欀Ā䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀ĀϿЀ䌀楄Ѣ阀 褀乐േᨊ
models/multiplex-easyglider.skp
0 → 100644
View file @
7d8ebfd3
B
SketchUp Model૿{8.0.3161}脔뗇밖㍆溃轧Ⳍÿ碐䳺噃牥楳湯慍ー䌉䄀爀挀䌀甀爀瘀攀Ā䌊䄀琀琀爀椀戀甀琀攀䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀䌇䌀愀洀攀爀愀Ԁ䌊䌀漀洀瀀漀渀攀渀琀䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀䌆䌀甀爀瘀攀Ѐ䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀䌄䐀椀戀̀䌊䐀椀洀攀渀猀椀漀渀Ā䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ䌅䔀搀最攀Ȁ䌈䔀搀最攀唀猀攀Ā䌇䔀渀琀椀琀礀̀䌅䘀愀挀攀̀䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ䌌䘀漀渀琀䴀愀渀愀最攀爀䌆䜀爀漀甀瀀Ā䌆䤀洀愀最攀Ā䌆䰀愀礀攀爀Ȁ䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ䌅䰀漀漀瀀Ā䌉䴀愀琀攀爀椀愀氀ఀ䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ䌉倀愀最攀䰀椀猀琀Ā䌋倀漀氀礀氀椀渀攀㌀搀䌍刀攀氀愀琀椀漀渀猀栀椀瀀䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ䌋匀栀愀搀漀眀䤀渀昀漀܀䌇匀欀䘀漀渀琀Ā䌉匀欀攀琀挀栀䌀匀䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā䌉匀欀瀀匀琀礀氀攀Ā䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ䌅吀攀砀琀ऀ䌊吀攀砀琀匀琀礀氀攀Ԁ䌈吀攀砀琀甀爀攀䌊吀栀甀洀戀渀愀椀氀Ā䌇嘀攀爀琀攀砀䌉嘀椀攀眀倀愀最攀ఀ䌊圀愀琀攀爀洀愀爀欀Ā䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀ĀϿЀ䌀楄Ѣ쌀褀乐േᨊ
models/multiplex-twinstar.skp
0 → 100644
View file @
7d8ebfd3
B
SketchUp Model૿{8.0.3161}횀팾뚥罁㞸켭᩼㳚ÿ筋䳺噃牥楳湯慍ー䌉䄀爀挀䌀甀爀瘀攀Ā䌊䄀琀琀爀椀戀甀琀攀䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀䌇䌀愀洀攀爀愀Ԁ䌊䌀漀洀瀀漀渀攀渀琀䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀䌆䌀甀爀瘀攀Ѐ䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀䌄䐀椀戀̀䌊䐀椀洀攀渀猀椀漀渀Ā䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ䌅䔀搀最攀Ȁ䌈䔀搀最攀唀猀攀Ā䌇䔀渀琀椀琀礀̀䌅䘀愀挀攀̀䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ䌌䘀漀渀琀䴀愀渀愀最攀爀䌆䜀爀漀甀瀀Ā䌆䤀洀愀最攀Ā䌆䰀愀礀攀爀Ȁ䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ䌅䰀漀漀瀀Ā䌉䴀愀琀攀爀椀愀氀ఀ䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ䌉倀愀最攀䰀椀猀琀Ā䌋倀漀氀礀氀椀渀攀㌀搀䌍刀攀氀愀琀椀漀渀猀栀椀瀀䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ䌋匀栀愀搀漀眀䤀渀昀漀܀䌇匀欀䘀漀渀琀Ā䌉匀欀攀琀挀栀䌀匀䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā䌉匀欀瀀匀琀礀氀攀Ā䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ䌅吀攀砀琀ऀ䌊吀攀砀琀匀琀礀氀攀Ԁ䌈吀攀砀琀甀爀攀䌊吀栀甀洀戀渀愀椀氀Ā䌇嘀攀爀琀攀砀䌉嘀椀攀眀倀愀最攀ఀ䌊圀愀琀攀爀洀愀爀欀Ā䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀ĀϿЀ䌀楄Ѣ㴀褀乐േᨊ
models/walkera-4g6.skp
0 → 100644
View file @
7d8ebfd3
B
SketchUp Model૿{8.0.3161}賥ₓ蹆ힲꪅ쳐棒ÿ瘢䳺噃牥楳湯慍ー䌉䄀爀挀䌀甀爀瘀攀Ā䌊䄀琀琀爀椀戀甀琀攀䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀䌇䌀愀洀攀爀愀Ԁ䌊䌀漀洀瀀漀渀攀渀琀䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀䌆䌀甀爀瘀攀Ѐ䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀䌄䐀椀戀̀䌊䐀椀洀攀渀猀椀漀渀Ā䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ䌅䔀搀最攀Ȁ䌈䔀搀最攀唀猀攀Ā䌇䔀渀琀椀琀礀̀䌅䘀愀挀攀̀䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ䌌䘀漀渀琀䴀愀渀愀最攀爀䌆䜀爀漀甀瀀Ā䌆䤀洀愀最攀Ā䌆䰀愀礀攀爀Ȁ䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ䌅䰀漀漀瀀Ā䌉䴀愀琀攀爀椀愀氀ఀ䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ䌉倀愀最攀䰀椀猀琀Ā䌋倀漀氀礀氀椀渀攀㌀搀䌍刀攀氀愀琀椀漀渀猀栀椀瀀䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ䌋匀栀愀搀漀眀䤀渀昀漀܀䌇匀欀䘀漀渀琀Ā䌉匀欀攀琀挀栀䌀匀䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā䌉匀欀瀀匀琀礀氀攀Ā䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ䌅吀攀砀琀ऀ䌊吀攀砀琀匀琀礀氀攀Ԁ䌈吀攀砀琀甀爀攀䌊吀栀甀洀戀渀愀椀氀Ā䌇嘀攀爀琀攀砀䌉嘀椀攀眀倀愀最攀ఀ䌊圀愀琀攀爀洀愀爀欀Ā䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀ĀϿЀ䌀楄Ѣ
qgroundcontrol.pri
View file @
7d8ebfd3
...
...
@@ -80,6 +80,8 @@ macx {
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$DESTDIR/qgroundcontrol.app/Contents/MacOs/.
# Copy google earth starter file
QMAKE_PRE_LINK += && cp -f $$BASEDIR/images/earth.html $$DESTDIR/qgroundcontrol.app/Contents/MacOs/.
# Copy model files
QMAKE_PRE_LINK += && cp -f $$BASEDIR/models/*.skp $$DESTDIR/qgroundcontrol.app/Contents/MacOs/.
exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) {
# No check for GLUT.framework since it's a MAC default
...
...
@@ -278,6 +280,8 @@ win32-msvc2008 {
message(Building for Windows Visual Studio 2008 (32bit))
CONFIG += qaxcontainer
# Special settings for debug
#CONFIG += CONSOLE
...
...
qgroundcontrol.pro
View file @
7d8ebfd3
...
...
@@ -141,7 +141,8 @@ FORMS += src/ui/MainWindow.ui \
src
/
ui
/
QGCRemoteControlView
.
ui
\
src
/
ui
/
QMap3D
.
ui
\
src
/
ui
/
QGCWebView
.
ui
\
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
ui
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
ui
\
src
/
ui
/
map3D
/
QGCGoogleEarthViewWin
.
ui
#
src
/
ui
/
WaypointGlobalView
.
ui
INCLUDEPATH
+=
src
\
...
...
@@ -234,7 +235,9 @@ HEADERS += src/MG.h \
src
/
ui
/
RadioCalibration
/
AbstractCalibrator
.
h
\
src
/
comm
/
QGCMAVLink
.
h
\
src
/
ui
/
QGCWebView
.
h
\
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
h
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
h
\
src
/
ui
/
map3D
/
QGCWebPage
.
h
contains
(
DEPENDENCIES_PRESENT
,
osg
)
{
message
(
"Including headers for OpenSceneGraph"
)
...
...
@@ -335,7 +338,8 @@ SOURCES += src/main.cc \
src
/
ui
/
RadioCalibration
/
AbstractCalibrator
.
cc
\
src
/
ui
/
RadioCalibration
/
RadioCalibrationData
.
cc
\
src
/
ui
/
QGCWebView
.
cc
\
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
cc
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
cc
\
src
/
ui
/
map3D
/
QGCWebPage
.
cc
contains
(
DEPENDENCIES_PRESENT
,
osg
)
{
message
(
"Including sources for OpenSceneGraph"
)
...
...
src/uas/UAS.cc
View file @
7d8ebfd3
...
...
@@ -782,6 +782,7 @@ void UAS::sendMessage(LinkInterface* link, mavlink_message_t message)
uint8_t
buffer
[
MAVLINK_MAX_PACKET_LEN
];
// Write message into buffer, prepending start sign
int
len
=
mavlink_msg_to_send_buffer
(
buffer
,
&
message
);
mavlink_finalize_message_chan
(
&
message
,
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
link
->
getId
(),
message
.
len
);
// If link is connected
if
(
link
->
isConnected
())
{
...
...
src/uas/UAS.h
View file @
7d8ebfd3
...
...
@@ -82,7 +82,6 @@ public:
double
getLocalX
()
const
{
return
localX
;
};
double
getLocalY
()
const
{
return
localY
;
};
double
getLocalZ
()
const
{
return
localZ
;
};
double
getLatitude
()
const
{
return
latitude
;
};
double
getLongitude
()
const
{
return
longitude
;
};
double
getAltitude
()
const
{
return
altitude
;
};
...
...
src/ui/map3D/QGCGoogleEarthView.cc
View file @
7d8ebfd3
#include <QWebFrame>
#include <QWebPage>
#include <QDebug>
#include "QGCGoogleEarthView.h"
#include "QGCWebPage.h"
#include "UASManager.h"
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
#else
#include "ui_QGCGoogleEarthView.h"
#endif
QGCGoogleEarthView
::
QGCGoogleEarthView
(
QWidget
*
parent
)
:
QWidget
(
parent
),
ui
(
new
Ui
::
QGCGoogleEarthView
)
QWidget
(
parent
),
updateTimer
(
new
QTimer
(
this
)),
mav
(
NULL
),
followCamera
(
true
),
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
webViewWin
(
new
QGCWebAxWidget
(
this
)),
#else
ui
(
new
Ui
::
QGCGoogleEarthView
)
#endif
{
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
// Create layout and attach webViewWin
#else
ui
->
setupUi
(
this
);
ui
->
webView
->
setPage
(
new
QGCWebPage
(
ui
->
webView
));
ui
->
webView
->
settings
()
->
setAttribute
(
QWebSettings
::
PluginsEnabled
,
true
);
ui
->
webView
->
load
(
QUrl
(
"earth.html"
));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
connect
(
updateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
updateState
()));
updateTimer
->
start
(
200
);
#endif
// Get list of available 3D models
// Load HTML file
// Parse for model links
// Populate model list
}
QGCGoogleEarthView
::~
QGCGoogleEarthView
()
...
...
@@ -15,6 +49,56 @@ QGCGoogleEarthView::~QGCGoogleEarthView()
delete
ui
;
}
void
QGCGoogleEarthView
::
setActiveUAS
(
UASInterface
*
uas
)
{
mav
=
uas
;
}
void
QGCGoogleEarthView
::
updateState
()
{
if
(
ui
->
webView
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
"isInitialized();"
).
toBool
())
{
static
bool
initialized
=
false
;
if
(
!
initialized
)
{
ui
->
webView
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
"setGCSHome(22.679833,8.549444, 470);"
);
initialized
=
true
;
}
int
uasId
=
0
;
double
lat
=
22.679833
;
double
lon
=
8.549444
;
double
alt
=
470.0
;
float
roll
=
0.0
f
;
float
pitch
=
0.0
f
;
float
yaw
=
0.0
f
;
if
(
mav
)
{
uasId
=
mav
->
getUASID
();
lat
=
mav
->
getLatitude
();
lon
=
mav
->
getLongitude
();
alt
=
mav
->
getAltitude
();
roll
=
mav
->
getRoll
();
pitch
=
mav
->
getPitch
();
yaw
=
mav
->
getYaw
();
}
ui
->
webView
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
QString
(
"setAircraftPositionAttitude(%1, %2, %3, %4, %6, %7, %8);"
)
.
arg
(
uasId
)
.
arg
(
lat
)
.
arg
(
lon
)
.
arg
(
alt
+
500
)
.
arg
(
roll
)
.
arg
(
pitch
)
.
arg
(
yaw
));
if
(
followCamera
)
{
ui
->
webView
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
QString
(
"updateFollowAircraft()"
));
}
}
}
void
QGCGoogleEarthView
::
changeEvent
(
QEvent
*
e
)
{
QWidget
::
changeEvent
(
e
);
...
...
src/ui/map3D/QGCGoogleEarthView.h
View file @
7d8ebfd3
...
...
@@ -2,10 +2,37 @@
#define QGCGOOGLEEARTHVIEW_H
#include <QWidget>
#include <QTimer>
#include <UASInterface.h>
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
QGCWebAxWidget
*
webViewWin
;
#include <ActiveQt/QAxWidget>
#include "windows.h"
class
WebAxWidget
:
public
QAxWidget
{
public:
WebAxWidget
(
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
f
=
0
)
:
QAxWidget
(
parent
,
f
)
{
}
protected:
virtual
bool
translateKeyEvent
(
int
message
,
int
keycode
)
const
{
if
(
message
>=
WM_KEYFIRST
&&
message
<=
WM_KEYLAST
)
return
true
;
else
return
QAxWidget
::
translateKeyEvent
(
message
,
keycode
);
}
};
#else
namespace
Ui
{
class
QGCGoogleEarthView
;
}
#endif
class
QGCGoogleEarthView
:
public
QWidget
{
...
...
@@ -15,11 +42,23 @@ public:
explicit
QGCGoogleEarthView
(
QWidget
*
parent
=
0
);
~
QGCGoogleEarthView
();
public
slots
:
/** @brief Update the internal state. Does not trigger a redraw */
void
updateState
();
/** @brief Set the currently selected UAS */
void
setActiveUAS
(
UASInterface
*
uas
);
protected:
void
changeEvent
(
QEvent
*
e
);
QTimer
*
updateTimer
;
UASInterface
*
mav
;
bool
followCamera
;
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
#else
private:
Ui
::
QGCGoogleEarthView
*
ui
;
#endif
};
#endif // QGCGOOGLEEARTHVIEW_H
src/ui/map3D/QGCGoogleEarthViewWin.ui
0 → 100644
View file @
7d8ebfd3
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>Form</class>
<widget class="QWidget" name="Form" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
</widget>
<pixmapfunction></pixmapfunction>
<connections/>
</ui>
src/ui/map3D/QGCWebPage.cc
0 → 100644
View file @
7d8ebfd3
#include "QGCWebPage.h"
#include <QDebug>
QGCWebPage
::
QGCWebPage
(
QObject
*
parent
)
:
QWebPage
(
parent
)
{
}
void
QGCWebPage
::
javaScriptConsoleMessage
(
const
QString
&
message
,
int
lineNumber
,
const
QString
&
sourceID
)
{
qDebug
()
<<
"JAVASCRIPT: "
<<
lineNumber
<<
sourceID
<<
message
;
}
src/ui/map3D/QGCWebPage.h
0 → 100644
View file @
7d8ebfd3
#ifndef QGCWEBPAGE_H
#define QGCWEBPAGE_H
#include <QWebPage>
class
QGCWebPage
:
public
QWebPage
{
Q_OBJECT
public:
explicit
QGCWebPage
(
QObject
*
parent
=
0
);
signals:
public
slots
:
protected:
void
javaScriptConsoleMessage
(
const
QString
&
message
,
int
lineNumber
,
const
QString
&
sourceID
);
};
#endif // QGCWEBPAGE_H
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