Commit 812ee272 authored by Don Gagne's avatar Don Gagne

Cut over 100% to new Map/Mission code

- Delete all old map code
parent 782af62d
......@@ -166,23 +166,8 @@ FORMS += \
src/ui/Linechart.ui \
src/ui/LogReplayLinkConfigurationWidget.ui \
src/ui/MainWindow.ui \
src/ui/map/QGCMapTool.ui \
src/ui/map/QGCMapToolBar.ui \
src/ui/mavlink/QGCMAVLinkMessageSender.ui \
src/ui/MAVLinkSettingsWidget.ui \
src/ui/mission/QGCMissionConditionDelay.ui \
src/ui/mission/QGCMissionDoFinishSearch.ui \
src/ui/mission/QGCMissionDoJump.ui \
src/ui/mission/QGCMissionDoStartSearch.ui \
src/ui/mission/QGCMissionNavLand.ui \
src/ui/mission/QGCMissionNavLoiterTime.ui \
src/ui/mission/QGCMissionNavLoiterTurns.ui \
src/ui/mission/QGCMissionNavLoiterUnlim.ui \
src/ui/mission/QGCMissionNavReturnToLaunch.ui \
src/ui/mission/QGCMissionNavSweep.ui \
src/ui/mission/QGCMissionNavTakeoff.ui \
src/ui/mission/QGCMissionNavWaypoint.ui \
src/ui/mission/QGCMissionOther.ui \
src/ui/QGCCommConfiguration.ui \
src/ui/QGCDataPlot2D.ui \
src/ui/QGCLinkConfiguration.ui \
......@@ -195,7 +180,6 @@ FORMS += \
src/ui/QGCUASFileView.ui \
src/ui/QGCUASFileViewMulti.ui \
src/ui/QGCUDPLinkConfiguration.ui \
src/ui/QGCWaypointListMulti.ui \
src/ui/SettingsDialog.ui \
src/ui/uas/QGCUnconnectedInfoWidget.ui \
src/ui/uas/UASMessageView.ui \
......@@ -203,9 +187,6 @@ FORMS += \
src/ui/uas/UASQuickViewItemSelect.ui \
src/ui/UASInfo.ui \
src/ui/UASRawStatusView.ui \
src/ui/WaypointEditableView.ui \
src/ui/WaypointList.ui \
src/ui/WaypointViewOnlyView.ui \
!iOSBuild {
FORMS += \
......@@ -272,7 +253,6 @@ HEADERS += \
src/uas/UAS.h \
src/uas/UASInterface.h \
src/uas/UASMessageHandler.h \
src/uas/UASWaypointManager.h \
src/ui/linechart/ChartPlot.h \
src/ui/linechart/IncrementalPlot.h \
src/ui/linechart/LinechartPlot.h \
......@@ -283,27 +263,9 @@ HEADERS += \
src/ui/LogReplayLinkConfigurationWidget.h \
src/ui/MainWindow.h \
src/ui/map/MAV2DIcon.h \
src/ui/map/QGCMapTool.h \
src/ui/map/QGCMapToolBar.h \
src/ui/map/QGCMapWidget.h \
src/ui/map/Waypoint2DIcon.h \
src/ui/mapdisplay/QGCMapDisplay.h \
src/ui/mavlink/QGCMAVLinkMessageSender.h \
src/ui/MAVLinkDecoder.h \
src/ui/MAVLinkSettingsWidget.h \
src/ui/mission/QGCMissionConditionDelay.h \
src/ui/mission/QGCMissionDoFinishSearch.h \
src/ui/mission/QGCMissionDoJump.h \
src/ui/mission/QGCMissionDoStartSearch.h \
src/ui/mission/QGCMissionNavLand.h \
src/ui/mission/QGCMissionNavLoiterTime.h \
src/ui/mission/QGCMissionNavLoiterTurns.h \
src/ui/mission/QGCMissionNavLoiterUnlim.h \
src/ui/mission/QGCMissionNavReturnToLaunch.h \
src/ui/mission/QGCMissionNavSweep.h \
src/ui/mission/QGCMissionNavTakeoff.h \
src/ui/mission/QGCMissionNavWaypoint.h \
src/ui/mission/QGCMissionOther.h \
src/ui/QGCCommConfiguration.h \
src/ui/QGCDataPlot2D.h \
src/ui/QGCLinkConfiguration.h \
......@@ -317,7 +279,6 @@ HEADERS += \
src/ui/QGCUASFileView.h \
src/ui/QGCUASFileViewMulti.h \
src/ui/QGCUDPLinkConfiguration.h \
src/ui/QGCWaypointListMulti.h \
src/ui/SettingsDialog.h \
src/ui/toolbar/MainToolBar.h \
src/ui/uas/QGCUnconnectedInfoWidget.h \
......@@ -329,9 +290,6 @@ HEADERS += \
src/ui/uas/UASQuickViewItemSelect.h \
src/ui/uas/UASQuickViewTextItem.h \
src/ui/UASRawStatusView.h \
src/ui/WaypointEditableView.h \
src/ui/WaypointList.h \
src/ui/WaypointViewOnlyView.h \
src/ViewWidgets/CustomCommandWidget.h \
src/ViewWidgets/CustomCommandWidgetController.h \
src/ViewWidgets/ViewWidgetController.h \
......@@ -401,7 +359,6 @@ SOURCES += \
src/uas/FileManager.cc \
src/uas/UAS.cc \
src/uas/UASMessageHandler.cc \
src/uas/UASWaypointManager.cc \
src/ui/linechart/ChartPlot.cc \
src/ui/linechart/IncrementalPlot.cc \
src/ui/linechart/LinechartPlot.cc \
......@@ -411,28 +368,9 @@ SOURCES += \
src/ui/linechart/ScrollZoomer.cc \
src/ui/LogReplayLinkConfigurationWidget.cc \
src/ui/MainWindow.cc \
src/ui/map/MAV2DIcon.cc \
src/ui/map/QGCMapTool.cc \
src/ui/map/QGCMapToolBar.cc \
src/ui/map/QGCMapWidget.cc \
src/ui/map/Waypoint2DIcon.cc \
src/ui/mapdisplay/QGCMapDisplay.cc \
src/ui/mavlink/QGCMAVLinkMessageSender.cc \
src/ui/MAVLinkDecoder.cc \
src/ui/MAVLinkSettingsWidget.cc \
src/ui/mission/QGCMissionConditionDelay.cc \
src/ui/mission/QGCMissionDoFinishSearch.cc \
src/ui/mission/QGCMissionDoJump.cc \
src/ui/mission/QGCMissionDoStartSearch.cc \
src/ui/mission/QGCMissionNavLand.cc \
src/ui/mission/QGCMissionNavLoiterTime.cc \
src/ui/mission/QGCMissionNavLoiterTurns.cc \
src/ui/mission/QGCMissionNavLoiterUnlim.cc \
src/ui/mission/QGCMissionNavReturnToLaunch.cc \
src/ui/mission/QGCMissionNavSweep.cc \
src/ui/mission/QGCMissionNavTakeoff.cc \
src/ui/mission/QGCMissionNavWaypoint.cc \
src/ui/mission/QGCMissionOther.cc \
src/ui/QGCCommConfiguration.cc \
src/ui/QGCDataPlot2D.cc \
src/ui/QGCLinkConfiguration.cc \
......@@ -446,7 +384,6 @@ SOURCES += \
src/ui/QGCUASFileView.cc \
src/ui/QGCUASFileViewMulti.cc \
src/ui/QGCUDPLinkConfiguration.cc \
src/ui/QGCWaypointListMulti.cc \
src/ui/SettingsDialog.cc \
src/ui/toolbar/MainToolBar.cc \
src/ui/uas/QGCUnconnectedInfoWidget.cc \
......@@ -458,9 +395,6 @@ SOURCES += \
src/ui/uas/UASQuickViewItemSelect.cc \
src/ui/uas/UASQuickViewTextItem.cc \
src/ui/UASRawStatusView.cpp \
src/ui/WaypointEditableView.cc \
src/ui/WaypointList.cc \
src/ui/WaypointViewOnlyView.cc \
src/ViewWidgets/CustomCommandWidget.cc \
src/ViewWidgets/CustomCommandWidgetController.cc \
src/ViewWidgets/ViewWidgetController.cc \
......
......@@ -61,16 +61,6 @@ exists($$MAVLINKPATH/common) {
INCLUDEPATH += libs/eigen
DEFINES += NOMINMAX
#
# [REQUIRED] OPMapControl library from OpenPilot. Provides 2D mapping functionality.
#
include(libs/opmapcontrol/opmapcontrol_external.pri)
INCLUDEPATH += \
libs/utils \
libs \
libs/opmapcontrol
#
# [REQUIRED] QWT plotting library dependency. Provides plotting capabilities.
#
......
#include "src/mapwidget/opmapwidget.h"
LIBS *= -l$$qtLibraryTarget(opmapwidget)
TEMPLATE = subdirs
SUBDIRS = src \
######################################################################
# Automatically generated by qmake (2.01a) Sa. Mrz 19 17:12:54 2011
######################################################################
# HACK! BIG TIME!
DEFINES += EXTERNAL_USE
DEPENDPATH += $$PWD/src/core $$PWD/src/internals $$PWD/src/mapwidget $$PWD/src/internals/projections
INCLUDEPATH += $$PWD/src/core $$PWD/src/internals $$PWD/src/internals/projections $$PWD/src/mapwidget
# Input
HEADERS += $$PWD/opmapcontrol.h \
$$PWD/src/core/accessmode.h \
$$PWD/src/core/alllayersoftype.h \
$$PWD/src/core/cache.h \
$$PWD/src/core/cacheitemqueue.h \
$$PWD/src/core/debugheader.h \
$$PWD/src/core/diagnostics.h \
$$PWD/src/core/geodecoderstatus.h \
$$PWD/src/core/kibertilecache.h \
$$PWD/src/core/languagetype.h \
$$PWD/src/core/maptype.h \
$$PWD/src/core/memorycache.h \
$$PWD/src/core/opmaps.h \
$$PWD/src/core/placemark.h \
$$PWD/src/core/point.h \
$$PWD/src/core/providerstrings.h \
$$PWD/src/core/pureimage.h \
$$PWD/src/core/pureimagecache.h \
$$PWD/src/core/rawtile.h \
$$PWD/src/core/size.h \
$$PWD/src/core/tilecachequeue.h \
$$PWD/src/core/urlfactory.h \
$$PWD/src/internals/copyrightstrings.h \
$$PWD/src/internals/core.h \
$$PWD/src/internals/debugheader.h \
$$PWD/src/internals/loadtask.h \
$$PWD/src/internals/mousewheelzoomtype.h \
$$PWD/src/internals/pointlatlng.h \
$$PWD/src/internals/pureprojection.h \
$$PWD/src/internals/rectangle.h \
$$PWD/src/internals/rectlatlng.h \
$$PWD/src/internals/sizelatlng.h \
$$PWD/src/internals/tile.h \
$$PWD/src/internals/tilematrix.h \
$$PWD/src/mapwidget/configuration.h \
$$PWD/src/mapwidget/gpsitem.h \
$$PWD/src/mapwidget/homeitem.h \
$$PWD/src/mapwidget/mapgraphicitem.h \
$$PWD/src/mapwidget/mapripform.h \
$$PWD/src/mapwidget/mapripper.h \
$$PWD/src/mapwidget/opmapwidget.h \
$$PWD/src/mapwidget/trailitem.h \
$$PWD/src/mapwidget/traillineitem.h \
$$PWD/src/mapwidget/uavitem.h \
$$PWD/src/mapwidget/uavmapfollowtype.h \
$$PWD/src/mapwidget/uavtrailtype.h \
$$PWD/src/mapwidget/waypointitem.h \
$$PWD/src/internals/projections/lks94projection.h \
$$PWD/src/internals/projections/mercatorprojection.h \
$$PWD/src/internals/projections/mercatorprojectionyandex.h \
$$PWD/src/internals/projections/platecarreeprojection.h \
$$PWD/src/internals/projections/platecarreeprojectionpergo.h \
$$PWD/src/mapwidget/waypointlineitem.h
FORMS += $$PWD/src/mapwidget/mapripform.ui
SOURCES += $$PWD/src/core/alllayersoftype.cpp \
$$PWD/src/core/cache.cpp \
$$PWD/src/core/cacheitemqueue.cpp \
$$PWD/src/core/diagnostics.cpp \
$$PWD/src/core/kibertilecache.cpp \
$$PWD/src/core/languagetype.cpp \
$$PWD/src/core/memorycache.cpp \
$$PWD/src/core/opmaps.cpp \
$$PWD/src/core/placemark.cpp \
$$PWD/src/core/point.cpp \
$$PWD/src/core/providerstrings.cpp \
$$PWD/src/core/pureimage.cpp \
$$PWD/src/core/pureimagecache.cpp \
$$PWD/src/core/rawtile.cpp \
$$PWD/src/core/size.cpp \
$$PWD/src/core/tilecachequeue.cpp \
$$PWD/src/core/urlfactory.cpp \
$$PWD/src/internals/core.cpp \
$$PWD/src/internals/loadtask.cpp \
$$PWD/src/internals/MouseWheelZoomType.cpp \
$$PWD/src/internals/pointlatlng.cpp \
$$PWD/src/internals/pureprojection.cpp \
$$PWD/src/internals/rectangle.cpp \
$$PWD/src/internals/rectlatlng.cpp \
$$PWD/src/internals/sizelatlng.cpp \
$$PWD/src/internals/tile.cpp \
$$PWD/src/internals/tilematrix.cpp \
$$PWD/src/mapwidget/configuration.cpp \
$$PWD/src/mapwidget/gpsitem.cpp \
$$PWD/src/mapwidget/homeitem.cpp \
$$PWD/src/mapwidget/mapgraphicitem.cpp \
$$PWD/src/mapwidget/mapripform.cpp \
$$PWD/src/mapwidget/mapripper.cpp \
$$PWD/src/mapwidget/opmapwidget.cpp \
$$PWD/src/mapwidget/trailitem.cpp \
$$PWD/src/mapwidget/traillineitem.cpp \
$$PWD/src/mapwidget/uavitem.cpp \
$$PWD/src/mapwidget/waypointitem.cpp \
$$PWD/src/internals/projections/lks94projection.cpp \
$$PWD/src/internals/projections/mercatorprojection.cpp \
$$PWD/src/internals/projections/mercatorprojectionyandex.cpp \
$$PWD/src/internals/projections/platecarreeprojection.cpp \
$$PWD/src/internals/projections/platecarreeprojectionpergo.cpp \
$$PWD/src/mapwidget/waypointlineitem.cpp
RESOURCES += $$PWD/src/mapwidget/mapresources.qrc
DESTDIR = ../build
QT += network
QT += sql
CONFIG += staticlib
TEMPLATE = lib
UI_DIR = uics
MOC_DIR = mocs
OBJECTS_DIR = objs
INCLUDEPATH +=../../../../libs/
/**
******************************************************************************
*
* @file accessmode.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget
* @{
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef ACCESSMODE_H
#define ACCESSMODE_H
#include "debugheader.h"
#include <QObject>
#include <QMetaObject>
#include <QMetaEnum>
#include <QStringList>
namespace core {
class AccessMode:public QObject
{
Q_OBJECT
Q_ENUMS(Types)
public:
enum Types
{
/// <summary>
/// access only server
/// </summary>
ServerOnly,
/// <summary>
/// access first server and caches localy
/// </summary>
ServerAndCache,
/// <summary>
/// access only cache
/// </summary>
CacheOnly
};
static QString StrByType(Types const& value)
{
QMetaObject metaObject = AccessMode().staticMetaObject;
QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
QString s=metaEnum.valueToKey(value);
return s;
}
static Types TypeByStr(QString const& value)
{
QMetaObject metaObject = AccessMode().staticMetaObject;
QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
Types s=(Types)metaEnum.keyToValue(value.toLatin1());
return s;
}
static QStringList TypesList()
{
QStringList ret;
QMetaObject metaObject = AccessMode().staticMetaObject;
QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
for(int x=0;x<metaEnum.keyCount();++x)
{
ret.append(metaEnum.key(x));
}
return ret;
}
};
}
#endif // ACCESSMODE_H
/**
******************************************************************************
*
* @file alllayersoftype.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget
* @{
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "alllayersoftype.h"
namespace core {
AllLayersOfType::AllLayersOfType()
{
}
QVector<MapType::Types> AllLayersOfType::GetAllLayersOfType(const MapType::Types &type)
{
QVector<MapType::Types> types;
{
switch(type)
{
case MapType::GoogleHybrid:
{
types.append(MapType::GoogleSatellite);
types.append(MapType::GoogleLabels);
}
break;
case MapType::GoogleHybridChina:
{
types.append(MapType::GoogleSatelliteChina);
types.append(MapType::GoogleLabelsChina);
}
break;
case MapType::GoogleHybridKorea:
{
types.append(MapType::GoogleSatelliteKorea);
types.append(MapType::GoogleLabelsKorea);
}
break;
case MapType::YahooHybrid:
{
types.append(MapType::YahooSatellite);
types.append(MapType::YahooLabels);
}
break;
case MapType::ArcGIS_MapsLT_Map_Hybrid:
{
types.append(MapType::ArcGIS_MapsLT_OrtoFoto);
types.append(MapType::ArcGIS_MapsLT_Map_Labels);
}
break;
default:
{
types.append(type);
}
break;
}
}
return types;
}
}
/**
******************************************************************************
*
* @file alllayersoftype.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget
* @{
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef ALLLAYERSOFTYPE_H
#define ALLLAYERSOFTYPE_H
#include "maptype.h"
#include <QList>
#include <QVector>
namespace core {
class AllLayersOfType
{
public:
AllLayersOfType();
QVector<MapType::Types> GetAllLayersOfType(const MapType::Types &type);
};
}
#endif // ALLLAYERSOFTYPE_H
/**
******************************************************************************
*
* @file cache.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget
* @{
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "cache.h"
#include <QSettings>
namespace core {
Cache* Cache::m_pInstance=0;
Cache* Cache::Instance()
{
if(!m_pInstance)
m_pInstance=new Cache;
return m_pInstance;
}
void Cache::setCacheLocation(const QString& value)
{
cache=value;
routeCache = cache + "RouteCache/";
geoCache = cache + "GeocoderCache/";
placemarkCache = cache + "PlacemarkCache/";
ImageCache.setGtileCache(value);
}
QString Cache::CacheLocation()
{
return cache;
}
Cache::Cache()
{
if(cache.isNull()|cache.isEmpty())
{
cache = QDir::homePath() + "/mapscache/";
setCacheLocation(cache);
}
}
QString Cache::GetGeocoderFromCache(const QString &urlEnd)
{
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"Entered GetGeocoderFromCache";
#endif
QString ret=QString::null;
QString filename=geoCache+QString(urlEnd)+".geo";
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"GetGeocoderFromCache: Does file exist?:"<<filename;
#endif
QFileInfo File(filename);
if (File .exists())
{
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"GetGeocoderFromCache:File exists!!";
#endif
QFile file(filename);
if (file.open(QIODevice::ReadOnly))
{
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream>>ret;
}
}
#ifdef DEBUG_GetGeocoderFromCache
qDebug()<<"GetGeocoderFromCache:Returning:"<<ret;
#endif
return ret;
}
void Cache::CacheGeocoder(const QString &urlEnd, const QString &content)
{
QString ret=QString::null;
QString filename=geoCache+QString(urlEnd)+".geo";
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: Filename:"<<filename;
#endif //DEBUG_CACHE
QFileInfo File(filename);;
QDir dir=File.absoluteDir();
QString path=dir.absolutePath();
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: Path:"<<path;
#endif //DEBUG_CACHE
if(!dir.exists())
{
#ifdef DEBUG_CACHE
qDebug()<<"CacheGeocoder: Cache path doesn't exist, try to create";
#endif //DEBUG_CACHE
if(!dir.mkpath(path))
{
#ifdef DEBUG_CACHE
qDebug()<<"GetGeocoderFromCache: Could not create path";