2021-01-13 15:07:28 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2021 Jon Beniston, M7RCE //
|
|
|
|
// Copyright (C) 2020 Edouard Griffiths, F4EXB //
|
|
|
|
// //
|
|
|
|
// 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 as 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 V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef INCLUDE_FEATURE_MAPSETTINGS_H_
|
|
|
|
#define INCLUDE_FEATURE_MAPSETTINGS_H_
|
|
|
|
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QString>
|
2022-02-04 15:40:43 -05:00
|
|
|
#include <QHash>
|
2021-01-13 15:07:28 -05:00
|
|
|
|
|
|
|
class Serializable;
|
|
|
|
|
|
|
|
struct MapSettings
|
|
|
|
{
|
2022-02-04 15:40:43 -05:00
|
|
|
struct MapItemSettings {
|
|
|
|
QString m_group; // Name of the group the settings apply to
|
|
|
|
bool m_enabled; // Whether enabled at all on 2D or 3D map
|
|
|
|
bool m_display2DIcon; // Display image 2D map
|
|
|
|
bool m_display2DLabel; // Display label on 2D map
|
|
|
|
bool m_display2DTrack; // Display tracks on 2D map
|
|
|
|
quint32 m_2DTrackColor;
|
|
|
|
int m_2DMinZoom;
|
|
|
|
bool m_display3DModel; // Draw 3D model for item
|
|
|
|
bool m_display3DLabel; // Display a label next to this item on the 3D map
|
|
|
|
bool m_display3DPoint; // Draw a point for this item on the 3D map
|
|
|
|
quint32 m_3DPointColor;
|
|
|
|
bool m_display3DTrack; // Display a ground track for this item on the 3D map
|
|
|
|
quint32 m_3DTrackColor;
|
|
|
|
int m_3DModelMinPixelSize;
|
2022-02-09 11:41:40 -05:00
|
|
|
float m_3DLabelScale;
|
2022-02-04 15:40:43 -05:00
|
|
|
|
|
|
|
MapItemSettings(const QString& group, const QColor color, bool display3DPoint=true, int minZoom=11, int modelMinPixelSize=0);
|
|
|
|
MapItemSettings(const QByteArray& data);
|
|
|
|
void resetToDefaults();
|
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
|
|
|
};
|
|
|
|
|
2022-03-29 14:12:15 -04:00
|
|
|
struct AvailableChannelOrFeature
|
|
|
|
{
|
|
|
|
QString m_kind; //!< "R" for channel, "F" for feature
|
|
|
|
int m_superIndex;
|
|
|
|
int m_index;
|
|
|
|
QString m_type;
|
|
|
|
QObject *m_source;
|
|
|
|
|
|
|
|
AvailableChannelOrFeature() = default;
|
|
|
|
AvailableChannelOrFeature(const AvailableChannelOrFeature&) = default;
|
|
|
|
AvailableChannelOrFeature& operator=(const AvailableChannelOrFeature&) = default;
|
|
|
|
bool operator==(const AvailableChannelOrFeature& a) const {
|
|
|
|
return (m_kind == a.m_kind)
|
|
|
|
&& (m_superIndex == a.m_superIndex)
|
|
|
|
&& (m_index == a.m_index)
|
|
|
|
&& (m_type == a.m_type)
|
|
|
|
&& (m_source == a.m_source);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-01-13 15:07:28 -05:00
|
|
|
bool m_displayNames;
|
2021-01-22 09:54:22 -05:00
|
|
|
QString m_mapProvider;
|
2021-11-23 11:44:07 -05:00
|
|
|
QString m_thunderforestAPIKey;
|
|
|
|
QString m_maptilerAPIKey;
|
|
|
|
QString m_mapBoxAPIKey;
|
|
|
|
QString m_osmURL;
|
2021-01-22 09:54:22 -05:00
|
|
|
QString m_mapBoxStyles;
|
2021-02-26 15:30:59 -05:00
|
|
|
bool m_displayAllGroundTracks;
|
|
|
|
bool m_displaySelectedGroundTracks;
|
2021-01-13 15:07:28 -05:00
|
|
|
QString m_title;
|
|
|
|
quint32 m_rgbColor;
|
|
|
|
bool m_useReverseAPI;
|
|
|
|
QString m_reverseAPIAddress;
|
|
|
|
uint16_t m_reverseAPIPort;
|
|
|
|
uint16_t m_reverseAPIFeatureSetIndex;
|
|
|
|
uint16_t m_reverseAPIFeatureIndex;
|
2022-01-08 23:27:12 -05:00
|
|
|
Serializable *m_rollupState;
|
2022-02-04 15:40:43 -05:00
|
|
|
bool m_map2DEnabled;
|
|
|
|
QString m_mapType; // "Street Map", "Satellite Map", etc.. as selected in combobox
|
2022-04-05 10:26:57 -04:00
|
|
|
int m_workspaceIndex;
|
|
|
|
QByteArray m_geometryBytes;
|
2022-02-04 15:40:43 -05:00
|
|
|
|
|
|
|
// 3D Map settings
|
|
|
|
bool m_map3DEnabled;
|
|
|
|
QString m_terrain; // "Ellipsoid" or "Cesium World Terrain"
|
|
|
|
QString m_buildings; // "None" or "Cesium OSM Buildings"
|
|
|
|
QString m_modelURL; // Base URL for 3D models (Not user settable, as depends on web server port)
|
|
|
|
QString m_modelDir; // Directory to store 3D models (not customizable for now, as ADS-B plugin needs to know)
|
|
|
|
bool m_sunLightEnabled; // Light globe from direction of Sun
|
|
|
|
bool m_eciCamera; // Use ECI instead of ECEF for camera
|
|
|
|
QString m_cesiumIonAPIKey;
|
|
|
|
QString m_antiAliasing;
|
|
|
|
|
2022-07-20 12:41:11 -04:00
|
|
|
bool m_displayMUF; // Plot MUF contours
|
|
|
|
bool m_displayfoF2; // Plot foF2 contours
|
|
|
|
|
2022-02-04 15:40:43 -05:00
|
|
|
// Per source settings
|
|
|
|
QHash<QString, MapItemSettings *> m_itemSettings;
|
2021-01-13 15:07:28 -05:00
|
|
|
|
|
|
|
MapSettings();
|
2022-02-04 15:40:43 -05:00
|
|
|
~MapSettings();
|
2021-01-13 15:07:28 -05:00
|
|
|
void resetToDefaults();
|
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
2022-01-08 23:27:12 -05:00
|
|
|
void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; }
|
2022-02-04 15:40:43 -05:00
|
|
|
QByteArray serializeItemSettings(QHash<QString, MapItemSettings *> itemSettings) const;
|
|
|
|
void deserializeItemSettings(const QByteArray& data, QHash<QString, MapItemSettings *>& itemSettings);
|
2021-01-13 15:07:28 -05:00
|
|
|
|
|
|
|
static const QStringList m_pipeTypes;
|
|
|
|
static const QStringList m_pipeURIs;
|
2021-01-22 09:54:22 -05:00
|
|
|
|
|
|
|
static const QStringList m_mapProviders;
|
2021-01-13 15:07:28 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_FEATURE_MAPSETTINGS_H_
|