dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
opmapgadgetconfiguration.h
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
28 #ifndef OPMAP_GADGETCONFIGURATION_H
29 #define OPMAP_GADGETCONFIGURATION_H
30 
32 #include <QtCore/QString>
33 
34 using namespace Core;
35 
37 {
38  Q_OBJECT
39 
40  Q_PROPERTY(QString mapProvider READ mapProvider WRITE setMapProvider)
41  Q_PROPERTY(QString geoLanguage READ geoLanguage WRITE setGeoLanguage)
42  Q_PROPERTY(int zoommo READ zoom WRITE setZoom)
43  Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
44  Q_PROPERTY(double longitude READ longitude WRITE setLongitude)
45  Q_PROPERTY(bool showTileGridLines READ showTileGridLines WRITE setShowTileGridLines)
46  Q_PROPERTY(QString accessMode READ accessMode WRITE setAccessMode)
47  Q_PROPERTY(bool useMemoryCache READ useMemoryCache WRITE setUseMemoryCache)
48  Q_PROPERTY(QString cacheLocation READ cacheLocation WRITE setCacheLocation)
49  Q_PROPERTY(QString uavSymbol READ uavSymbol WRITE setUavSymbol)
50  Q_PROPERTY(int maxUpdateRate READ maxUpdateRate WRITE setMaxUpdateRate)
51  Q_PROPERTY(qreal overlayOpacity READ opacity WRITE setOpacity)
52 
53 public:
54  explicit OPMapGadgetConfiguration(QString classId, QSettings *qSettings = nullptr,
55  QObject *parent = nullptr);
56 
57  void saveConfig(QSettings *settings) const;
59 
60  QString geoLanguage() const { return m_geoLanguage; }
61  QString mapProvider() const { return m_mapProvider; }
62  int zoom() const { return m_defaultZoom; }
63  double latitude() const { return m_defaultLatitude; }
64  double longitude() const { return m_defaultLongitude; }
65  bool showTileGridLines() const { return m_showTileGridLines; }
66  QString accessMode() const { return m_accessMode; }
67  bool useMemoryCache() const { return m_useMemoryCache; }
68  QString cacheLocation() const { return m_cacheLocation; }
69  QString uavSymbol() const { return m_uavSymbol; }
70  int maxUpdateRate() const { return m_maxUpdateRate; }
71  qreal opacity() const { return m_opacity; }
72  void saveConfig() const;
73 
74  QString getUserImageLocation() { return m_userImageLocation; }
75  float getUserImageHorizontalScale() { return m_userImageHorizontalScale; }
76  float getUserImageVerticalScale() { return m_userImageVerticalScale; }
77 
78 public slots:
79  void setMapProvider(QString provider) { m_mapProvider = provider; }
80  void setZoom(int zoom) { m_defaultZoom = zoom; }
81  void setLatitude(double latitude) { m_defaultLatitude = latitude; }
82  void setOpacity(qreal value) { m_opacity = value; }
83  void setLongitude(double longitude) { m_defaultLongitude = longitude; }
84  void setShowTileGridLines(bool showTileGridLines) { m_showTileGridLines = showTileGridLines; }
85  void setAccessMode(QString accessMode) { m_accessMode = accessMode; }
86  void setUseMemoryCache(bool useMemoryCache) { m_useMemoryCache = useMemoryCache; }
87  void setCacheLocation(QString cacheLocation) { m_cacheLocation = cacheLocation; }
88  void setUavSymbol(QString symbol) { m_uavSymbol = symbol; }
89  void setMaxUpdateRate(int update_rate) { m_maxUpdateRate = update_rate; }
90  void setUserImageLocation(QString userImageLocation)
91  {
92  m_userImageLocation = userImageLocation;
93  }
94  void setUserImageHorizontalScale(float userImageHorizontalScale)
95  {
96  m_userImageHorizontalScale = userImageHorizontalScale;
97  }
98  void setUserImageVerticalScale(float userImageVerticalScale)
99  {
100  m_userImageVerticalScale = userImageVerticalScale;
101  }
102  void setGeoLanguage(QString language) { m_geoLanguage = language; }
103 private:
104  QString m_mapProvider;
105  int m_defaultZoom;
106  double m_defaultLatitude;
107  double m_defaultLongitude;
108  bool m_showTileGridLines;
109  QString m_accessMode;
110  bool m_useMemoryCache;
111  QString m_cacheLocation;
112  QString m_uavSymbol;
113  int m_maxUpdateRate;
114  QSettings *m_settings;
115  qreal m_opacity;
116  QString m_userImageLocation;
117  float m_userImageHorizontalScale;
118  float m_userImageVerticalScale;
119  QString m_geoLanguage;
120 };
121 
122 #endif // OPMAP_GADGETCONFIGURATION_H
void setCacheLocation(QString cacheLocation)
void setGeoLanguage(QString language)
void setUserImageLocation(QString userImageLocation)
void setUserImageHorizontalScale(float userImageHorizontalScale)
void setUavSymbol(QString symbol)
void setLatitude(double latitude)
void setUseMemoryCache(bool useMemoryCache)
void setUserImageVerticalScale(float userImageVerticalScale)
void setShowTileGridLines(bool showTileGridLines)
void setLongitude(double longitude)
void setMapProvider(QString provider)
void setAccessMode(QString accessMode)
void setMaxUpdateRate(int update_rate)
UAVDataObject * clone(quint32 instID)