2013-04-05 23:46:56 +03:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* @file opmapgadgetconfiguration.h
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
|
|
|
* @addtogroup GCSPlugins GCS Plugins
|
|
|
|
* @{
|
|
|
|
* @addtogroup OPMapPlugin OpenPilot Map Plugin
|
|
|
|
* @{
|
2013-05-19 17:37:30 +03:00
|
|
|
* @brief The OpenPilot Map plugin
|
2013-04-05 23:46:56 +03:00
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* 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 OPMAP_GADGETCONFIGURATION_H
|
|
|
|
#define OPMAP_GADGETCONFIGURATION_H
|
|
|
|
|
|
|
|
#include <coreplugin/iuavgadgetconfiguration.h>
|
|
|
|
#include <QtCore/QString>
|
|
|
|
|
|
|
|
using namespace Core;
|
|
|
|
|
2013-05-19 17:37:30 +03:00
|
|
|
class OPMapGadgetConfiguration : public IUAVGadgetConfiguration {
|
|
|
|
Q_OBJECT Q_PROPERTY(QString mapProvider READ mapProvider WRITE setMapProvider)
|
|
|
|
Q_PROPERTY(int zoommo READ zoom WRITE setZoom)
|
|
|
|
Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
|
|
|
|
Q_PROPERTY(double longitude READ longitude WRITE setLongitude)
|
|
|
|
Q_PROPERTY(bool useOpenGL READ useOpenGL WRITE setUseOpenGL)
|
|
|
|
Q_PROPERTY(bool showTileGridLines READ showTileGridLines WRITE setShowTileGridLines)
|
|
|
|
Q_PROPERTY(QString accessMode READ accessMode WRITE setAccessMode)
|
|
|
|
Q_PROPERTY(bool useMemoryCache READ useMemoryCache WRITE setUseMemoryCache)
|
|
|
|
Q_PROPERTY(QString cacheLocation READ cacheLocation WRITE setCacheLocation)
|
|
|
|
Q_PROPERTY(QString uavSymbol READ uavSymbol WRITE setUavSymbol)
|
|
|
|
Q_PROPERTY(int maxUpdateRate READ maxUpdateRate WRITE setMaxUpdateRate)
|
|
|
|
Q_PROPERTY(qreal overlayOpacity READ opacity WRITE setOpacity)
|
2013-04-05 23:46:56 +03:00
|
|
|
|
|
|
|
public:
|
2013-05-19 17:37:30 +03:00
|
|
|
explicit OPMapGadgetConfiguration(QString classId, QSettings *qSettings = 0, QObject *parent = 0);
|
2013-04-05 23:46:56 +03:00
|
|
|
|
2013-05-19 17:37:30 +03:00
|
|
|
void saveConfig(QSettings *settings) const;
|
2013-04-05 23:46:56 +03:00
|
|
|
IUAVGadgetConfiguration *clone();
|
|
|
|
|
2013-05-19 17:37:30 +03:00
|
|
|
QString mapProvider() const
|
|
|
|
{
|
|
|
|
return m_mapProvider;
|
|
|
|
}
|
|
|
|
int zoom() const
|
|
|
|
{
|
|
|
|
return m_defaultZoom;
|
|
|
|
}
|
|
|
|
double latitude() const
|
|
|
|
{
|
|
|
|
return m_defaultLatitude;
|
|
|
|
}
|
|
|
|
double longitude() const
|
|
|
|
{
|
|
|
|
return m_defaultLongitude;
|
|
|
|
}
|
|
|
|
bool useOpenGL() const
|
|
|
|
{
|
|
|
|
return m_useOpenGL;
|
|
|
|
}
|
|
|
|
bool showTileGridLines() const
|
|
|
|
{
|
|
|
|
return m_showTileGridLines;
|
|
|
|
}
|
|
|
|
QString accessMode() const
|
|
|
|
{
|
|
|
|
return m_accessMode;
|
|
|
|
}
|
|
|
|
bool useMemoryCache() const
|
|
|
|
{
|
|
|
|
return m_useMemoryCache;
|
|
|
|
}
|
|
|
|
QString cacheLocation() const
|
|
|
|
{
|
|
|
|
return m_cacheLocation;
|
|
|
|
}
|
|
|
|
QString uavSymbol() const
|
|
|
|
{
|
|
|
|
return m_uavSymbol;
|
|
|
|
}
|
|
|
|
int maxUpdateRate() const
|
|
|
|
{
|
|
|
|
return m_maxUpdateRate;
|
|
|
|
}
|
|
|
|
qreal opacity() const
|
|
|
|
{
|
|
|
|
return m_opacity;
|
|
|
|
}
|
2013-04-05 23:46:56 +03:00
|
|
|
void saveConfig() const;
|
|
|
|
public slots:
|
2013-05-19 17:37:30 +03:00
|
|
|
void setMapProvider(QString provider)
|
|
|
|
{
|
|
|
|
m_mapProvider = provider;
|
|
|
|
}
|
|
|
|
void setZoom(int zoom)
|
|
|
|
{
|
|
|
|
m_defaultZoom = zoom;
|
|
|
|
}
|
|
|
|
void setLatitude(double latitude)
|
|
|
|
{
|
|
|
|
m_defaultLatitude = latitude;
|
|
|
|
}
|
|
|
|
void setOpacity(qreal value)
|
|
|
|
{
|
|
|
|
m_opacity = value;
|
|
|
|
}
|
|
|
|
void setLongitude(double longitude)
|
|
|
|
{
|
|
|
|
m_defaultLongitude = longitude;
|
|
|
|
}
|
|
|
|
void setUseOpenGL(bool useOpenGL)
|
|
|
|
{
|
|
|
|
m_useOpenGL = useOpenGL;
|
|
|
|
}
|
|
|
|
void setShowTileGridLines(bool showTileGridLines)
|
|
|
|
{
|
|
|
|
m_showTileGridLines = showTileGridLines;
|
|
|
|
}
|
|
|
|
void setAccessMode(QString accessMode)
|
|
|
|
{
|
|
|
|
m_accessMode = accessMode;
|
|
|
|
}
|
|
|
|
void setUseMemoryCache(bool useMemoryCache)
|
|
|
|
{
|
|
|
|
m_useMemoryCache = useMemoryCache;
|
|
|
|
}
|
2013-04-05 23:46:56 +03:00
|
|
|
void setCacheLocation(QString cacheLocation);
|
2013-05-19 17:37:30 +03:00
|
|
|
void setUavSymbol(QString symbol)
|
|
|
|
{
|
|
|
|
m_uavSymbol = symbol;
|
|
|
|
}
|
|
|
|
void setMaxUpdateRate(int update_rate)
|
|
|
|
{
|
|
|
|
m_maxUpdateRate = update_rate;
|
|
|
|
}
|
2013-04-05 23:46:56 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_mapProvider;
|
|
|
|
int m_defaultZoom;
|
|
|
|
double m_defaultLatitude;
|
|
|
|
double m_defaultLongitude;
|
|
|
|
bool m_useOpenGL;
|
|
|
|
bool m_showTileGridLines;
|
|
|
|
QString m_accessMode;
|
|
|
|
bool m_useMemoryCache;
|
|
|
|
QString m_cacheLocation;
|
|
|
|
QString m_uavSymbol;
|
2013-05-19 17:37:30 +03:00
|
|
|
int m_maxUpdateRate;
|
|
|
|
QSettings *m_settings;
|
2013-04-05 23:46:56 +03:00
|
|
|
qreal m_opacity;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // OPMAP_GADGETCONFIGURATION_H
|