2019-08-04 19:56:29 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2019 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/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2020-04-30 08:42:57 -04:00
|
|
|
#ifndef SDRBASE_DSP_GLSPECTRUMSETTNGS_H
|
|
|
|
#define SDRBASE_DSP_GLSPECTRUMSETTNGS_H
|
|
|
|
|
2019-08-04 19:56:29 -04:00
|
|
|
#include <QByteArray>
|
|
|
|
|
|
|
|
#include "export.h"
|
|
|
|
#include "dsp/dsptypes.h"
|
2020-04-30 08:42:57 -04:00
|
|
|
#include "dsp/fftwindow.h"
|
2019-08-07 12:50:26 -04:00
|
|
|
#include "settings/serializable.h"
|
2019-08-04 19:56:29 -04:00
|
|
|
|
2019-08-07 12:50:26 -04:00
|
|
|
class SDRBASE_API GLSpectrumSettings : public Serializable
|
2019-08-04 19:56:29 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum AveragingMode
|
|
|
|
{
|
|
|
|
AvgModeNone,
|
|
|
|
AvgModeMoving,
|
|
|
|
AvgModeFixed,
|
|
|
|
AvgModeMax
|
|
|
|
};
|
|
|
|
|
2021-02-08 17:40:28 -05:00
|
|
|
int m_fftSize;
|
2019-08-04 19:56:29 -04:00
|
|
|
int m_fftOverlap;
|
2020-04-30 08:42:57 -04:00
|
|
|
FFTWindow::Function m_fftWindow;
|
2019-08-04 19:56:29 -04:00
|
|
|
Real m_refLevel;
|
|
|
|
Real m_powerRange;
|
2021-02-11 18:53:18 -05:00
|
|
|
int m_fpsPeriodMs; //!< FPS capping period in ms FPS = 1000/m_fpsPeriodMs. If zero: no limit.
|
2019-08-04 19:56:29 -04:00
|
|
|
int m_decay;
|
|
|
|
int m_decayDivisor;
|
|
|
|
int m_histogramStroke;
|
|
|
|
int m_displayGridIntensity;
|
|
|
|
int m_displayTraceIntensity;
|
|
|
|
bool m_displayWaterfall;
|
|
|
|
bool m_invertedWaterfall;
|
|
|
|
Real m_waterfallShare;
|
|
|
|
bool m_displayMaxHold;
|
|
|
|
bool m_displayCurrent;
|
|
|
|
bool m_displayHistogram;
|
|
|
|
bool m_displayGrid;
|
|
|
|
AveragingMode m_averagingMode;
|
|
|
|
int m_averagingIndex;
|
2020-11-10 10:38:12 -05:00
|
|
|
unsigned int m_averagingValue;
|
2019-08-04 19:56:29 -04:00
|
|
|
bool m_linear; //!< linear else logarithmic scale
|
2020-11-09 11:14:17 -05:00
|
|
|
bool m_ssb; //!< SSB display with spectrum center at start of array or display - else spectrum center is on center
|
|
|
|
bool m_usb; //!< USB display with increasing frequencies towads the right - else decreasing frequencies
|
2020-05-01 05:06:56 -04:00
|
|
|
QString m_wsSpectrumAddress;
|
|
|
|
uint16_t m_wsSpectrumPort;
|
2019-08-04 19:56:29 -04:00
|
|
|
|
|
|
|
GLSpectrumSettings();
|
2019-08-07 12:50:26 -04:00
|
|
|
virtual ~GLSpectrumSettings();
|
2019-08-04 19:56:29 -04:00
|
|
|
void resetToDefaults();
|
|
|
|
|
2019-08-07 12:50:26 -04:00
|
|
|
virtual QByteArray serialize() const;
|
|
|
|
virtual bool deserialize(const QByteArray& data);
|
2019-08-04 19:56:29 -04:00
|
|
|
|
|
|
|
static int getAveragingMaxScale(AveragingMode averagingMode);
|
|
|
|
static int getAveragingValue(int averagingIndex, AveragingMode averagingMode);
|
|
|
|
static int getAveragingIndex(int averagingValue, AveragingMode averagingMode);
|
|
|
|
};
|
2020-04-30 08:42:57 -04:00
|
|
|
|
|
|
|
#endif // SDRBASE_DSP_GLSPECTRUMSETTNGS_H
|