Commit 0198993e authored by pixhawk's avatar pixhawk

Merge branch 'experimental' of pixhawk.ethz.ch:qgroundcontrol into experimental

parents d5f5922c 1d560d9c
...@@ -13,12 +13,13 @@ google.load("earth", "1", { 'language': 'en'}); ...@@ -13,12 +13,13 @@ google.load("earth", "1", { 'language': 'en'});
var ge = null; var ge = null;
var initialized = false; var initialized = false;
var aircraft = new Array();
var currAircraft = 220; var currAircraft = 220;
var followEnabled = false; var followAircraft = false;
var currLat = 47.3769; var currLat = 47.3769;
var currLon = 8.549444; var currLon = 8.549444;
var currAlt = 470; var currAlt = 470;
var currFollowHeading = 0.0;
var homeLat = 0; var homeLat = 0;
var homeLon = 0; var homeLon = 0;
...@@ -32,17 +33,11 @@ var currTilt = 40.0; ///<< The tilt angle (in degrees) ...@@ -32,17 +33,11 @@ var currTilt = 40.0; ///<< The tilt angle (in degrees)
var currFollowTilt = 40.0; var currFollowTilt = 40.0;
var currView = null; var currView = null;
var M_PI = 3.14159265;
var planeOrient; var planeOrient;
var planeLoc; var planeLoc;
var aircraft = [];
var attitudes = [];
var locations = [];
var trails = [];
var trail; var trail;
var lineStringPlacemark; var lineStringPlacemark;
var lineStyle; var lineStyle;
...@@ -62,10 +57,7 @@ function init() { ...@@ -62,10 +57,7 @@ function init() {
function setCurrAircraft(id)
{
currAircraft = id;
}
function setGCSHome(lat, lon, alt) function setGCSHome(lat, lon, alt)
{ {
...@@ -98,6 +90,13 @@ function setGCSHome(lat, lon, alt) ...@@ -98,6 +90,13 @@ function setGCSHome(lat, lon, alt)
{ {
homeGroundLevel = alt; homeGroundLevel = alt;
} }
goHome();
} }
function createAircraft(id, type, color) function createAircraft(id, type, color)
...@@ -205,19 +204,17 @@ function setAircraftPositionAttitude(id, lat, lon, alt, roll, pitch, yaw) ...@@ -205,19 +204,17 @@ function setAircraftPositionAttitude(id, lat, lon, alt, roll, pitch, yaw)
currLat = lat; currLat = lat;
currLon = lon; currLon = lon;
currAlt = alt; currAlt = alt;
currFollowHeading = ((yaw/M_PI)+1.0)*360.0;
} }
// FIXME Currently invalid conversion from right-handed z-down to z-up frame planeOrient.setRoll(roll);
planeOrient.setRoll(((roll/M_PI)+1.0)*360.0); planeOrient.setTilt(pitch);
planeOrient.setTilt(((pitch/M_PI)+1.0)*360.0); planeOrient.setHeading(yaw);
planeOrient.setHeading(((yaw/M_PI)+1.0)*360.0);
planeLoc.setLatitude(lat); planeLoc.setLatitude(lat);
planeLoc.setLongitude(lon); planeLoc.setLongitude(lon);
planeLoc.setAltitude(alt); planeLoc.setAltitude(alt);
} }
...@@ -249,16 +246,24 @@ function setCurrentAircraft(id) ...@@ -249,16 +246,24 @@ function setCurrentAircraft(id)
currAircraft = id; currAircraft = id;
} }
function enableFollowing(follow)
{
followEnabled = follow;
}
function updateFollowAircraft() function updateFollowAircraft()
{ {
if (followEnabled)
{
currView = ge.getView().copyAsLookAt(ge.ALTITUDE_ABSOLUTE); currView = ge.getView().copyAsLookAt(ge.ALTITUDE_ABSOLUTE);
currView.setLatitude(currLat); currView.setLatitude(currLat);
currView.setLongitude(currLon); currView.setLongitude(currLon);
currView.setAltitude(currAlt); currView.setAltitude(currAlt);
currView.setRange(currViewRange); currView.setRange(currViewRange);
currView.setTilt(currFollowTilt); currView.setTilt(currFollowTilt);
currView.setHeading(currFollowHeading-90.0);
ge.getView().setAbstractView(currView); ge.getView().setAbstractView(currView);
}
} }
function failureCallback(object) function failureCallback(object)
......
...@@ -300,8 +300,9 @@ win32-msvc2008 { ...@@ -300,8 +300,9 @@ win32-msvc2008 {
DEFINES += QT_NO_DEBUG DEFINES += QT_NO_DEBUG
} }
# Special settings for debug debug {
#CONFIG += CONSOLE CONFIG += console
}
INCLUDEPATH += $$BASEDIR/lib/sdl/msvc/include \ INCLUDEPATH += $$BASEDIR/lib/sdl/msvc/include \
$$BASEDIR/lib/opal/include \ $$BASEDIR/lib/opal/include \
...@@ -379,6 +380,7 @@ win32-g++ { ...@@ -379,6 +380,7 @@ win32-g++ {
debug { debug {
#DESTDIR = $$BUILDDIR/debug #DESTDIR = $$BUILDDIR/debug
CONFIG += console
} }
release { release {
......
This diff is collapsed.
...@@ -11,19 +11,36 @@ ...@@ -11,19 +11,36 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#include <ActiveQt/QAxWidget> #include <ActiveQt/QAxWidget>
#include <ActiveQt/QAxObject>
#include "windows.h" #include "windows.h"
class QGCWebAxWidget : public QAxWidget class QGCWebAxWidget : public QAxWidget
{ {
public: public:
//Q_OBJECT
QGCWebAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0) QGCWebAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0)
: QAxWidget(parent, f) : QAxWidget(parent, f),
_document(NULL)
{ {
// Set web browser control // Set web browser control
setControl("{8856F961-340A-11D0-A96B-00C04FD705A2}"); setControl("{8856F961-340A-11D0-A96B-00C04FD705A2}");
//QObject::connect(this, SIGNAL(DocumentComplete(IDispatch*, QVariant&)), this, SLOT(setDocument(IDispatch*, QVariant&)));
} }
QAxObject* document()
{
return _document;
}
protected:
void setDocument(IDispatch* dispatch, QVariant& variant)
{
_document = this->querySubObject("Document()");
}
protected: protected:
QAxObject* _document;
virtual bool translateKeyEvent(int message, int keycode) const virtual bool translateKeyEvent(int message, int keycode) const
{ {
if (message >= WM_KEYFIRST && message <= WM_KEYLAST) if (message >= WM_KEYFIRST && message <= WM_KEYLAST)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment