Commit 1f2b0334 authored by pixhawk's avatar pixhawk

Fixed compile error, reverted HTML file to clean state

parent 0198993e
......@@ -13,13 +13,12 @@ google.load("earth", "1", { 'language': 'en'});
var ge = null;
var initialized = false;
var aircraft = new Array();
var currAircraft = 220;
var followAircraft = false;
var followEnabled = false;
var currLat = 47.3769;
var currLon = 8.549444;
var currAlt = 470;
var currFollowHeading = 0.0;
var homeLat = 0;
var homeLon = 0;
......@@ -33,11 +32,17 @@ var currTilt = 40.0; ///<< The tilt angle (in degrees)
var currFollowTilt = 40.0;
var currView = null;
var M_PI = 3.14159265;
var planeOrient;
var planeLoc;
var aircraft = [];
var attitudes = [];
var locations = [];
var trails = [];
var trail;
var lineStringPlacemark;
var lineStyle;
......@@ -57,7 +62,10 @@ function init() {
function setCurrAircraft(id)
{
currAircraft = id;
}
function setGCSHome(lat, lon, alt)
{
......@@ -90,13 +98,6 @@ function setGCSHome(lat, lon, alt)
{
homeGroundLevel = alt;
}
goHome();
}
function createAircraft(id, type, color)
......@@ -204,17 +205,19 @@ function setAircraftPositionAttitude(id, lat, lon, alt, roll, pitch, yaw)
currLat = lat;
currLon = lon;
currAlt = alt;
currFollowHeading = ((yaw/M_PI)+1.0)*360.0;
}
planeOrient.setRoll(roll);
planeOrient.setTilt(pitch);
planeOrient.setHeading(yaw);
// FIXME Currently invalid conversion from right-handed z-down to z-up frame
planeOrient.setRoll(((roll/M_PI)+1.0)*360.0);
planeOrient.setTilt(((pitch/M_PI)+1.0)*360.0);
planeOrient.setHeading(((yaw/M_PI)+1.0)*360.0);
planeLoc.setLatitude(lat);
planeLoc.setLongitude(lon);
planeLoc.setAltitude(alt);
planeLoc.setLatitude(lat);
planeLoc.setLongitude(lon);
planeLoc.setAltitude(alt);
}
......@@ -246,24 +249,16 @@ 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);
currView.setHeading(currFollowHeading-90.0);
ge.getView().setAbstractView(currView);
}
}
function failureCallback(object)
......
......@@ -2,8 +2,6 @@
#include <QDir>
#include <QShowEvent>
#include <QSettings>
#include <QAxObject>
#include <QUuid>
#include <QDebug>
#include <QFile>
......@@ -16,7 +14,12 @@
#include "QGCWebPage.h"
#endif
#include "QGC.h"
#ifdef _MSC_VER
#include <QAxObject>
#include <QUuid>
#endif
#include "QGC.h"
#include "ui_QGCGoogleEarthView.h"
#include "QGCGoogleEarthView.h"
......@@ -103,8 +106,8 @@ QGCGoogleEarthView::~QGCGoogleEarthView()
void QGCGoogleEarthView::addUAS(UASInterface* uas)
{
#ifdef Q_OS_MAC
// uasid, type, color (in aarrbbgg format)
webViewMac->page()->currentFrame()->evaluateJavaScript(QString("createAircraft(%1, %2, %3);").arg(uas->getUASID()).arg(uas->getSystemType()).arg(uas->getColor().name().remove(0, 1).prepend("50")));
// uasid, type, color (in aarrbbgg format)
webViewMac->page()->currentFrame()->evaluateJavaScript(QString("createAircraft(%1, %2, %3);").arg(uas->getUASID()).arg(uas->getSystemType()).arg(uas->getColor().name().remove(0, 1).prepend("50")));
#endif
#ifdef _MSC_VER
//if (webViewMac->page()->currentFrame()->evaluateJavaScript("isInitialized();").toBool())
......@@ -136,9 +139,9 @@ void QGCGoogleEarthView::updateGlobalPosition(UASInterface* uas, double lat, dou
Q_UNUSED(usec);
#ifdef Q_OS_MAC
webViewMac->page()->currentFrame()->evaluateJavaScript(QString("addTrailPosition(%1, %2, %3, %4);").arg(uas->getUASID()).arg(lat, 0, 'f', 15).arg(lon, 0, 'f', 15).arg(alt, 0, 'f', 15));
//qDebug() << QString("addTrailPosition(%1, %2, %3, %4);").arg(uas->getUASID()).arg(lat, 0, 'f', 15).arg(lon, 0, 'f', 15).arg(alt, 0, 'f', 15);
//qDebug() << QString("addTrailPosition(%1, %2, %3, %4);").arg(uas->getUASID()).arg(lat, 0, 'f', 15).arg(lon, 0, 'f', 15).arg(alt, 0, 'f', 15);
#endif
#ifdef _MSC_VER
//if (webViewMac->page()->currentFrame()->evaluateJavaScript("isInitialized();").toBool())
......@@ -185,16 +188,16 @@ void QGCGoogleEarthView::setHome(double lat, double lon, double alt)
#endif
}
void QGCGoogleEarthView::hideEvent(QHideEvent* event)
{
Q_UNUSED(event) updateTimer->stop();
}
void QGCGoogleEarthView::hideEvent(QHideEvent* event)
{
Q_UNUSED(event) updateTimer->stop();
}
void QGCGoogleEarthView::showEvent(QShowEvent* event)
{
// React only to internal (pre-display)
// events
Q_UNUSED(event)
Q_UNUSED(event)
{
// Enable widget, initialize on first run
if (!webViewInitialized)
......@@ -286,9 +289,9 @@ void QGCGoogleEarthView::initializeGoogleEarth()
void QGCGoogleEarthView::updateState()
{
#if (QGC_EVENTLOOP_DEBUG)
qDebug() << "EVENTLOOP:" << __FILE__ << __LINE__;
#endif
#if (QGC_EVENTLOOP_DEBUG)
qDebug() << "EVENTLOOP:" << __FILE__ << __LINE__;
#endif
if (gEarthInitialized)
{
int uasId = 0;
......
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