Commit 4e86e85f authored by Don Gagne's avatar Don Gagne

Merge pull request #1404 from DonLakeFlyer/RemoveGoogleEarth

Remove GoogleEarth support
parents 48416b2c 244aff2e
......@@ -162,46 +162,6 @@ OSGDependency {
src/ui/map3D/ImageryParamDialog.cc
}
#
# [OPTIONAL] Google Earth dependency. Provides Google Earth view to supplement 2D map view.
# Only supported on Mac and Windows where Google Earth can be installed.
#
GoogleEarthDisableOverride {
contains(DEFINES, DISABLE_GOOGLE_EARTH) {
message("Skipping support for Google Earth view (manual override from command line)")
DEFINES -= DISABLE_GOOGLE_EARTH
}
# Otherwise the user can still disable this feature in the user_config.pri file.
else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_GOOGLE_EARTH) {
message("Skipping support for Google Earth view (manual override from user_config.pri)")
} else:MacBuild {
message("Including support for Google Earth view")
DEFINES += QGC_GOOGLE_EARTH_ENABLED
HEADERS += src/ui/map3D/QGCGoogleEarthView.h \
src/ui/map3D/QGCWebPage.h \
src/ui/QGCWebView.h
SOURCES += src/ui/map3D/QGCGoogleEarthView.cc \
src/ui/map3D/QGCWebPage.cc \
src/ui/QGCWebView.cc
FORMS += src/ui/QGCWebView.ui
} else:WindowsBuild {
message("Including support for Google Earth view")
DEFINES += QGC_GOOGLE_EARTH_ENABLED
HEADERS += src/ui/map3D/QGCGoogleEarthView.h \
src/ui/map3D/QGCWebPage.h \
src/ui/QGCWebView.h
SOURCES += src/ui/map3D/QGCGoogleEarthView.cc \
src/ui/map3D/QGCWebPage.cc \
src/ui/QGCWebView.cc
FORMS += src/ui/QGCWebView.ui
QT += axcontainer
} else {
message("Skipping support for Google Earth view (unsupported platform)")
}
} else {
message("Skipping support for Google Earth due to Issue 1157")
}
#
# [REQUIRED] EIGEN matrix library
# NOMINMAX constant required to make internal min/max work.
......
......@@ -125,11 +125,6 @@ contains(DEFINES, QGC_NOTIFY_TUNES_ENABLED) {
QT += multimedia
}
!contains(DEFINES, DISABLE_GOOGLE_EARTH) {
QT += webkit webkitwidgets
}
# testlib is needed even in release flavor for QSignalSpy support
QT += testlib
......@@ -291,7 +286,6 @@ FORMS += \
src/ui/QGCSensorSettingsWidget.ui \
src/ui/QGCDataPlot2D.ui \
src/ui/QMap3D.ui \
src/ui/map3D/QGCGoogleEarthView.ui \
src/ui/uas/QGCUnconnectedInfoWidget.ui \
src/ui/designer/QGCToolWidget.ui \
src/ui/designer/QGCParamSlider.ui \
......
......@@ -263,20 +263,18 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
_ui.actionMissionView->setShortcut(QApplication::translate("MainWindow", "Meta+2", 0));
_ui.actionFlightView->setShortcut(QApplication::translate("MainWindow", "Meta+3", 0));
_ui.actionEngineersView->setShortcut(QApplication::translate("MainWindow", "Meta+4", 0));
_ui.actionGoogleEarthView->setShortcut(QApplication::translate("MainWindow", "Meta+5", 0));
_ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Meta+6", 0));
_ui.actionTerminalView->setShortcut(QApplication::translate("MainWindow", "Meta+7", 0));
_ui.actionSimulationView->setShortcut(QApplication::translate("MainWindow", "Meta+8", 0));
_ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Meta+5", 0));
_ui.actionTerminalView->setShortcut(QApplication::translate("MainWindow", "Meta+6", 0));
_ui.actionSimulationView->setShortcut(QApplication::translate("MainWindow", "Meta+7", 0));
_ui.actionFullscreen->setShortcut(QApplication::translate("MainWindow", "Meta+Return", 0));
#else
_ui.actionSetup->setShortcut(QApplication::translate("MainWindow", "Ctrl+1", 0));
_ui.actionMissionView->setShortcut(QApplication::translate("MainWindow", "Ctrl+2", 0));
_ui.actionFlightView->setShortcut(QApplication::translate("MainWindow", "Ctrl+3", 0));
_ui.actionEngineersView->setShortcut(QApplication::translate("MainWindow", "Ctrl+4", 0));
_ui.actionGoogleEarthView->setShortcut(QApplication::translate("MainWindow", "Ctrl+5", 0));
_ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Ctrl+6", 0));
_ui.actionTerminalView->setShortcut(QApplication::translate("MainWindow", "Ctrl+7", 0));
_ui.actionSimulationView->setShortcut(QApplication::translate("MainWindow", "Ctrl+8", 0));
_ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Ctrl+5", 0));
_ui.actionTerminalView->setShortcut(QApplication::translate("MainWindow", "Ctrl+6", 0));
_ui.actionSimulationView->setShortcut(QApplication::translate("MainWindow", "Ctrl+7", 0));
_ui.actionFullscreen->setShortcut(QApplication::translate("MainWindow", "Ctrl+Return", 0));
#endif
......@@ -486,16 +484,6 @@ void MainWindow::_buildTerminalView(void)
}
}
void MainWindow::_buildGoogleEarthView(void)
{
#ifdef QGC_GOOGLE_EARTH_ENABLED
if (!_googleEarthView) {
_googleEarthView = new QGCGoogleEarthView(this);
_googleEarthView->setVisible(false);
}
#endif
}
void MainWindow::_buildLocal3DView(void)
{
#ifdef QGC_OSG_ENABLED
......@@ -731,9 +719,6 @@ void MainWindow::loadSettings()
case VIEW_TERMINAL:
#ifdef QGC_OSG_ENABLED
case VIEW_LOCAL3D:
#endif
#ifdef QGC_GOOGLE_EARTH_ENABLED
case VIEW_GOOGLEEARTH:
#endif
_currentView = currentViewCandidate;
break;
......@@ -837,14 +822,10 @@ void MainWindow::connectCommonActions()
perspectives->addAction(_ui.actionMissionView);
perspectives->addAction(_ui.actionSetup);
perspectives->addAction(_ui.actionTerminalView);
perspectives->addAction(_ui.actionGoogleEarthView);
perspectives->addAction(_ui.actionLocal3DView);
perspectives->setExclusive(true);
/* Hide the actions that are not relevant */
#ifndef QGC_GOOGLE_EARTH_ENABLED
_ui.actionGoogleEarthView->setVisible(false);
#endif
#ifndef QGC_OSG_ENABLED
_ui.actionLocal3DView->setVisible(false);
#endif
......@@ -880,11 +861,6 @@ void MainWindow::connectCommonActions()
_ui.actionTerminalView->setChecked(true);
_ui.actionTerminalView->activate(QAction::Trigger);
}
if (_currentView == VIEW_GOOGLEEARTH)
{
_ui.actionGoogleEarthView->setChecked(true);
_ui.actionGoogleEarthView->activate(QAction::Trigger);
}
if (_currentView == VIEW_LOCAL3D)
{
_ui.actionLocal3DView->setChecked(true);
......@@ -917,8 +893,6 @@ void MainWindow::connectCommonActions()
connect(_ui.actionSimulationView, SIGNAL(triggered()), this, SLOT(loadSimulationView()));
connect(_ui.actionEngineersView, SIGNAL(triggered()), this, SLOT(loadEngineerView()));
connect(_ui.actionMissionView, SIGNAL(triggered()), this, SLOT(loadOperatorView()));
connect(_ui.actionSetup,SIGNAL(triggered()),this,SLOT(loadSetupView()));
connect(_ui.actionGoogleEarthView, SIGNAL(triggered()), this, SLOT(loadGoogleEarthView()));
connect(_ui.actionLocal3DView, SIGNAL(triggered()), this, SLOT(loadLocal3DView()));
connect(_ui.actionTerminalView,SIGNAL(triggered()),this,SLOT(loadTerminalView()));
......@@ -1121,11 +1095,6 @@ void MainWindow::_loadCurrentViewState(void)
centerView = _terminalView;
break;
case VIEW_GOOGLEEARTH:
_buildGoogleEarthView();
centerView = _googleEarthView;
break;
case VIEW_LOCAL3D:
_buildLocal3DView();
centerView = _local3DView;
......@@ -1267,17 +1236,6 @@ void MainWindow::loadTerminalView()
}
}
void MainWindow::loadGoogleEarthView()
{
if (_currentView != VIEW_GOOGLEEARTH)
{
_storeCurrentViewState();
_currentView = VIEW_GOOGLEEARTH;
_ui.actionGoogleEarthView->setChecked(true);
_loadCurrentViewState();
}
}
void MainWindow::loadLocal3DView()
{
if (_currentView != VIEW_LOCAL3D)
......
......@@ -57,9 +57,6 @@ This file is part of the QGROUNDCONTROL project
#include "HDDisplay.h"
#include "HSIDisplay.h"
#include "opmapcontrol.h"
#ifdef QGC_GOOGLE_EARTH_ENABLED
#include "QGCGoogleEarthView.h"
#endif
#include "MainToolBar.h"
#include "LogCompressor.h"
......@@ -159,8 +156,6 @@ public slots:
void loadOperatorView();
/** @brief Load Terminal Console views */
void loadTerminalView();
/** @brief Load Google Earth View */
void loadGoogleEarthView();
/** @brief Load local 3D view */
void loadLocal3DView();
/** @brief Manage Links */
......@@ -229,7 +224,6 @@ protected:
VIEW_SETUP, // Setup view. Used for initializing the system for operation. Includes UI for calibration, firmware updating/checking, and parameter modifcation.
VIEW_TERMINAL, // Terminal interface. Used for communicating with the remote system, usually in a special configuration input mode.
VIEW_LOCAL3D, // A local 3D view. Provides a local 3D view that makes visualizing 3D attitude/orientation/pose easy while in operation.
VIEW_GOOGLEEARTH // 3D Google Earth view. A 3D terrain view, though the vehicle is still 2D.
} VIEW_SECTIONS;
/** @brief Catch window resize events */
......@@ -247,9 +241,6 @@ protected:
QPointer<Linecharts> linechartWidget;
#ifdef QGC_OSG_ENABLED
QPointer<QWidget> q3DWidget;
#endif
#ifdef QGC_GOOGLE_EARTH_ENABLED
QPointer<QGCGoogleEarthView> earthWidget;
#endif
QPointer<QGCFirmwareUpdate> firmwareUpdateWidget;
......@@ -312,7 +303,6 @@ private:
QPointer<QWidget> _engineeringView;
QPointer<QWidget> _simView;
QPointer<QWidget> _terminalView;
QPointer<QWidget> _googleEarthView;
QPointer<QWidget> _local3DView;
// Dock widget names
......@@ -342,7 +332,6 @@ private:
void _buildEngineeringView(void);
void _buildSimView(void);
void _buildTerminalView(void);
void _buildGoogleEarthView(void);
void _buildLocal3DView(void);
void _storeCurrentViewState(void);
......
......@@ -97,7 +97,6 @@
<addaction name="actionLoadCustomWidgetFile"/>
<addaction name="separator"/>
</widget>
<addaction name="actionGoogleEarthView"/>
<addaction name="actionLocal3DView"/>
<addaction name="actionTerminalView"/>
<addaction name="actionSimulationView"/>
......@@ -328,14 +327,6 @@
<string>Terminal</string>
</property>
</action>
<action name="actionGoogleEarthView">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Google Earth</string>
</property>
</action>
<action name="actionLocal3DView">
<property name="checkable">
<bool>true</bool>
......
This diff is collapsed.
#ifndef QGCGOOGLEEARTHVIEW_H
#define QGCGOOGLEEARTHVIEW_H
#include <QWidget>
#include <QTimer>
#include <UASInterface.h>
#if (defined Q_OS_MAC)
#include <QWebView>
#endif
#ifdef _MSC_VER
#include <ActiveQt/QAxWidget>
#include <ActiveQt/QAxObject>
#include "windows.h"
class QGCWebAxWidget : public QAxWidget
{
public:
//Q_OBJECT
QGCWebAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0)
: QAxWidget(parent, f)/*,
_document(NULL)*/
{
// Set web browser control
setControl("{8856F961-340A-11D0-A96B-00C04FD705A2}");
// WARNING: Makes it impossible to actually debug javascript. But useful in production mode
setProperty("ScriptErrorsSuppressed", true);
// see: http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx?fid=285594&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=151#GoalScriptError
//this->dynamicCall("setProperty(const QString&,
//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()");
}
QAxObject* _document;*/
virtual bool translateKeyEvent(int message, int keycode) const {
if (message >= WM_KEYFIRST && message <= WM_KEYLAST)
return true;
else
return QAxWidget::translateKeyEvent(message, keycode);
}
};
#endif
namespace Ui
{
class QGCGoogleEarthView;
}
class Waypoint;
class QGCGoogleEarthView : public QWidget
{
Q_OBJECT
public:
explicit QGCGoogleEarthView(QWidget *parent = 0);
~QGCGoogleEarthView();
enum VIEW_MODE {
VIEW_MODE_SIDE = 0, ///< View from above, orientation is free
VIEW_MODE_MAP, ///< View from above, orientation is north (map view)
VIEW_MODE_CHASE_LOCKED, ///< Locked chase camera
VIEW_MODE_CHASE_FREE, ///< Position is chasing object, but view can rotate around object
};
public slots:
/** @brief Update the internal state. Does not trigger a redraw */
void updateState();
/** @brief Add a new MAV/UAS to the visualization */
void addUAS(UASInterface* uas);
/** @brief Set the currently selected UAS */
void setActiveUAS(UASInterface* uas);
/** @brief Update the global position */
void updateGlobalPosition(UASInterface* uas, double lat, double lon, double alt, quint64 usec);
/** @brief Update a single waypoint */
void updateWaypoint(int uas, Waypoint* wp);
/** @brief Update the waypoint list */
void updateWaypointList(int uas);
/** @brief Show the vehicle trail */
void showTrail(bool state);
/** @brief Clear the current vehicle trails and start with new ones */
void clearTrails();
/** @brief Show the waypoints */
void showWaypoints(bool state);
/** @brief Follow the aircraft during flight */
void follow(bool follow);
/** @brief Go to the home location */
void goHome();
/** @brief Set the home location */
void setHome(double lat, double lon, double alt);
/** @brief Set the home location interactively in the UI */
void setHome();
/** @brief Move the view to a latitude / longitude position */
void moveToPosition();
/** @brief Allow waypoint editing */
void enableEditMode(bool mode);
/** @brief Enable daylight/night */
void enableDaylight(bool enable);
/** @brief Enable atmosphere */
void enableAtmosphere(bool enable);
/** @brief Set camera view range to aircraft in meters */
void setViewRange(float range);
/** @brief Set the distance mode - either to ground or to MAV */
void setDistanceMode(int mode);
/** @brief Set the view mode */
void setViewMode(VIEW_MODE mode);
/** @brief Toggle through the different view modes */
void toggleViewMode();
/** @brief Set camera view range to aircraft in centimeters */
void setViewRangeScaledInt(int range);
/** @brief Reset Google Earth View */
void reloadHTML();
/** @brief Initialize Google Earth */
void initializeGoogleEarth();
/** @brief Print a Windows exception */
void printWinException(int no, QString str1, QString str2, QString str3);
public:
/** @brief Execute java script inside the Google Earth window */
QVariant javaScript(QString javascript);
/** @brief Get a document element */
QVariant documentElement(QString name);
signals:
void visibilityChanged(bool visible);
protected:
void changeEvent(QEvent *e);
QTimer* updateTimer;
int refreshRateMs;
UASInterface* mav;
bool followCamera;
bool trailEnabled;
bool waypointsEnabled;
bool webViewInitialized;
bool jScriptInitialized;
bool gEarthInitialized;
VIEW_MODE currentViewMode;
#ifdef _MSC_VER
QGCWebAxWidget* webViewWin;
QAxObject* jScriptWin;
QAxObject* documentWin;
#endif
#if (defined Q_OS_MAC)
QWebView* webViewMac;
#endif
/** @brief Start widget updating */
void showEvent(QShowEvent* event);
/** @brief Stop widget updating */
void hideEvent(QHideEvent* event);
private:
#ifdef _MSC_VER
Ui::QGCGoogleEarthView* ui;
#else
Ui::QGCGoogleEarthView* ui;
#endif
};
#endif // QGCGOOGLEEARTHVIEW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QGCGoogleEarthView</class>
<widget class="QWidget" name="QGCGoogleEarthView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1409</width>
<height>302</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,10,10,10,10,5,10,1000,10,10,10,10,10,5,2,2,0,0">
<property name="horizontalSpacing">
<number>4</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item row="0" column="0" colspan="18">
<layout class="QVBoxLayout" name="webViewLayout"/>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="goHomeButton">
<property name="toolTip">
<string>Go to home location</string>
</property>
<property name="statusTip">
<string>Go to home location</string>
</property>
<property name="whatsThis">
<string>Go to home location</string>
</property>
<property name="text">
<string>Home</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="setHomeButton">
<property name="text">
<string>Set Home</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="editButton">
<property name="toolTip">
<string>Enable waypoint and home location edit mode</string>
</property>
<property name="statusTip">
<string>Enable waypoint and home location edit mode</string>
</property>
<property name="text">
<string>Edit</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QCheckBox" name="trailCheckbox">
<property name="toolTip">
<string>Show MAV trajectories</string>
</property>
<property name="statusTip">
<string>Show MAV trajectories</string>
</property>
<property name="whatsThis">
<string>Show MAV trajectories</string>
</property>
<property name="text">
<string>Trails</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QComboBox" name="camDistanceComboBox">
<property name="toolTip">
<string>Select the MAV to chase</string>
</property>
<property name="statusTip">
<string>Select the MAV to chase</string>
</property>
<property name="whatsThis">
<string>Select the MAV to chase</string>
</property>
<item>
<property name="text">
<string>MAV Distance</string>
</property>
</item>
<item>
<property name="text">
<string>Ground Distance</string>
</property>
</item>
</widget>
</item>
<item row="1" column="7">
<widget class="QSlider" name="camDistanceSlider">
<property name="toolTip">
<string>Distance of the chase camera to the MAV</string>
</property>
<property name="statusTip">
<string>Distance of the chase camera to the MAV</string>
</property>
<property name="whatsThis">
<string>Distance of the chase camera to the MAV</string>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>20000</number>
</property>
<property name="value">
<number>3000</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="8">
<widget class="QCheckBox" name="followAirplaneCheckbox">
<property name="toolTip">
<string>Chase the MAV</string>
</property>
<property name="statusTip">
<string>Chase the MAV</string>
</property>
<property name="whatsThis">
<string>Chase the MAV</string>
</property>
<property name="text">
<string>Follow</string>
</property>
</widget>
</item>
<item row="1" column="9">
<widget class="QPushButton" name="changeViewButton">
<property name="text">
<string>Overhead</string>
</property>
</widget>
</item>
<item row="1" column="10">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="1" column="11">
<widget class="QPushButton" name="clearTrailsButton">
<property name="toolTip">
<string>Delete all waypoints</string>
</property>
<property name="statusTip">
<string>Delete all waypoints</string>
</property>
<property name="whatsThis">
<string>Delete all waypoints</string>
</property>
<property name="text">
<string>Clear Trails</string>
</property>
</widget>
</item>
<item row="1" column="12">
<widget class="QPushButton" name="resetButton">
<property name="text">
<string>Reset</string>
</property>
</widget>
</item>
<item row="1" column="13">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="14">
<widget class="QCheckBox" name="atmosphereCheckBox">
<property name="toolTip">
<string>Enable the atmosphere visualization. Not recommended for mission execution, only for visualization</string>
</property>
<property name="statusTip">
<string>Enable the atmosphere visualization. Not recommended for mission execution, only for visualization</string>
</property>
<property name="text">
<string>Sky</string>
</property>
</widget>
</item>
<item row="1" column="15">
<widget class="QCheckBox" name="daylightCheckBox">
<property name="toolTip">
<string>Enable day/night light. Not recommended for mission execution, only for visualization.</string>
</property>
<property name="statusTip">
<string>Enable day/night light. Not recommended for mission execution, only for visualization.</string>
</property>
<property name="text">
<string>Day/Night</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="toLatLonButton">
<property name="text">
<string>Lat/Lon</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
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