2020-11-29 19:30:18 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2017 Edouard Griffiths, F4EXB. //
|
|
|
|
// Copyright (C) 2020 Jon Beniston, M7RCE //
|
|
|
|
// //
|
|
|
|
// 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_VORLOCALIZERSETTINGS_H
|
|
|
|
#define INCLUDE_VORLOCALIZERSETTINGS_H
|
|
|
|
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QHash>
|
|
|
|
|
|
|
|
class Serializable;
|
2020-12-07 13:32:43 -05:00
|
|
|
class ChannelAPI;
|
2020-11-29 19:30:18 -05:00
|
|
|
|
|
|
|
// Number of columns in the table
|
|
|
|
|
|
|
|
struct VORLocalizerSubChannelSettings {
|
|
|
|
int m_id; //!< Unique VOR identifier (from database)
|
|
|
|
int m_frequency; //!< Frequency the VOR is on
|
|
|
|
bool m_audioMute; //!< Mute the audio from this VOR
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VORLocalizerSettings
|
|
|
|
{
|
2020-12-07 13:32:43 -05:00
|
|
|
struct VORChannel
|
|
|
|
{
|
|
|
|
int m_subChannelId; //!< Unique VOR identifier (from database)
|
|
|
|
int m_frequency; //!< Frequency the VOR is on
|
|
|
|
bool m_audioMute; //!< Mute the audio from this VOR
|
|
|
|
|
|
|
|
VORChannel() = default;
|
|
|
|
VORChannel(const VORChannel&) = default;
|
|
|
|
VORChannel& operator=(const VORChannel&) = default;
|
|
|
|
|
|
|
|
bool operator<(const VORChannel& other) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct AvailableChannel
|
2020-11-29 19:30:18 -05:00
|
|
|
{
|
|
|
|
int m_deviceSetIndex;
|
|
|
|
int m_channelIndex;
|
2020-12-07 13:32:43 -05:00
|
|
|
ChannelAPI *m_channelAPI;
|
|
|
|
quint64 m_deviceCenterFrequency;
|
|
|
|
int m_basebandSampleRate;
|
|
|
|
int m_navId;
|
|
|
|
|
|
|
|
AvailableChannel() = default;
|
|
|
|
AvailableChannel(const AvailableChannel&) = default;
|
|
|
|
AvailableChannel& operator=(const AvailableChannel&) = default;
|
2020-11-29 19:30:18 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
quint32 m_rgbColor;
|
|
|
|
QString m_title;
|
|
|
|
bool m_magDecAdjust; //!< Adjust for magnetic declination when drawing radials on the map
|
2020-12-07 13:32:43 -05:00
|
|
|
int m_rrTime; //!< Round robin turn time in seconds
|
2020-12-08 02:28:55 -05:00
|
|
|
bool m_forceRRAveraging; //!< Force radial and signal magnitude averaging over RR turn
|
2020-12-07 13:32:43 -05:00
|
|
|
int m_centerShift; //!< Center frequency shift to apply to move away from DC
|
2020-11-29 19:30:18 -05:00
|
|
|
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-04-05 10:26:57 -04:00
|
|
|
int m_workspaceIndex;
|
|
|
|
QByteArray m_geometryBytes;
|
2022-09-30 10:59:51 -04:00
|
|
|
QString m_mapProvider;
|
2020-11-29 19:30:18 -05:00
|
|
|
|
2022-05-03 09:53:56 -04:00
|
|
|
static const int VORDEMOD_COLUMNS = 10;
|
2020-11-29 19:30:18 -05:00
|
|
|
static const int VOR_COL_NAME = 0;
|
|
|
|
static const int VOR_COL_FREQUENCY = 1;
|
2022-05-03 09:53:56 -04:00
|
|
|
static const int VOR_COL_IDENT = 2;
|
|
|
|
static const int VOR_COL_MORSE = 3;
|
|
|
|
static const int VOR_COL_RX_IDENT = 4;
|
|
|
|
static const int VOR_COL_RX_MORSE = 5;
|
|
|
|
static const int VOR_COL_RADIAL = 6;
|
|
|
|
static const int VOR_COL_REF_MAG = 7;
|
|
|
|
static const int VOR_COL_VAR_MAG = 8;
|
|
|
|
static const int VOR_COL_MUTE = 9;
|
2020-11-29 19:30:18 -05:00
|
|
|
|
|
|
|
int m_columnIndexes[VORDEMOD_COLUMNS];//!< How the columns are ordered in the table
|
|
|
|
int m_columnSizes[VORDEMOD_COLUMNS]; //!< Size of the coumns in the table
|
|
|
|
|
2020-12-07 13:32:43 -05:00
|
|
|
QHash<int, VORLocalizerSubChannelSettings> m_subChannelSettings;
|
2020-11-29 19:30:18 -05:00
|
|
|
|
|
|
|
VORLocalizerSettings();
|
|
|
|
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-11-30 16:00:26 -05:00
|
|
|
void applySettings(const QStringList& settingsKeys, const VORLocalizerSettings& settings);
|
|
|
|
QString getDebugString(const QStringList& settingsKeys, bool force=false) const;
|
2020-11-29 19:30:18 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* INCLUDE_VORLOCALIZERSETTINGS_H */
|