sdrangel/sdrgui/gui/glspectrumgui.h

132 wiersze
4.9 KiB
C
Czysty Zwykły widok Historia

2020-05-01 01:12:01 +00:00
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2016-2020 F4EXB //
// written by Edouard Griffiths //
// //
// OpenGL interface modernization. //
// See: http://doc.qt.io/qt-5/qopenglshaderprogram.html //
// //
// 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_GLSPECTRUMGUI_H
#define INCLUDE_GLSPECTRUMGUI_H
#include <QWidget>
2020-05-01 01:12:01 +00:00
#include "dsp/dsptypes.h"
#include "dsp/spectrumsettings.h"
#include "export.h"
2017-10-01 15:54:48 +00:00
#include "settings/serializable.h"
#include "util/messagequeue.h"
namespace Ui {
class GLSpectrumGUI;
}
class SpectrumVis;
class GLSpectrum;
2018-03-03 19:23:38 +00:00
class SDRGUI_API GLSpectrumGUI : public QWidget, public Serializable {
Q_OBJECT
public:
2018-06-30 20:30:42 +00:00
enum AveragingMode
{
AvgModeNone,
2018-06-30 20:30:42 +00:00
AvgModeMoving,
AvgModeFixed,
AvgModeMax
2018-06-30 20:30:42 +00:00
};
explicit GLSpectrumGUI(QWidget* parent = NULL);
~GLSpectrumGUI();
void setBuddies(SpectrumVis* spectrumVis, GLSpectrum* glSpectrum);
void setFFTSize(int log2FFTSize);
void resetToDefaults();
2017-10-01 15:54:48 +00:00
virtual QByteArray serialize() const;
virtual bool deserialize(const QByteArray& data);
virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const;
virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject);
void updateSettings();
private:
Ui::GLSpectrumGUI* ui;
SpectrumVis* m_spectrumVis;
GLSpectrum* m_glSpectrum;
MessageQueue m_messageQueue;
SpectrumSettings m_settings;
2020-05-01 01:12:01 +00:00
bool m_doApplySettings;
Real m_calibrationShiftdB;
static const int m_fpsMs[];
2020-05-01 01:12:01 +00:00
void blockApplySettings(bool block);
void applySettings();
void applySpectrumSettings();
2020-05-01 01:12:01 +00:00
void displaySettings();
void setAveragingCombo();
void setNumberStr(int n, QString& s);
void setNumberStr(float v, int decimalPlaces, QString& s);
void setAveragingToolitp();
void setFFTSizeToolitp();
2021-02-09 06:12:32 +00:00
void setMaximumOverlap();
bool handleMessage(const Message& message);
private slots:
void on_fftWindow_currentIndexChanged(int index);
void on_fftSize_currentIndexChanged(int index);
2021-02-09 06:12:32 +00:00
void on_fftOverlap_valueChanged(int value);
void on_autoscale_clicked(bool checked);
void on_refLevel_valueChanged(int value);
void on_levelRange_valueChanged(int value);
void on_fps_currentIndexChanged(int index);
void on_decay_valueChanged(int index);
void on_decayDivisor_valueChanged(int index);
void on_stroke_valueChanged(int index);
2022-06-18 11:35:44 +00:00
void on_spectrogramStyle_currentIndexChanged(int index);
void on_spectrogramColorMap_currentIndexChanged(int index);
void on_gridIntensity_valueChanged(int index);
void on_traceIntensity_valueChanged(int index);
2018-06-30 20:30:42 +00:00
void on_averagingMode_currentIndexChanged(int index);
void on_averaging_currentIndexChanged(int index);
2018-07-04 21:11:28 +00:00
void on_linscale_toggled(bool checked);
void on_wsSpectrum_toggled(bool checked);
2021-07-31 20:57:31 +00:00
void on_markers_clicked(bool checked);
void on_waterfall_toggled(bool checked);
2022-06-18 11:35:44 +00:00
void on_spectrogram_toggled(bool checked);
void on_histogram_toggled(bool checked);
void on_maxHold_toggled(bool checked);
void on_current_toggled(bool checked);
2020-11-10 15:38:12 +00:00
void on_invertWaterfall_toggled(bool checked);
void on_grid_toggled(bool checked);
2015-07-23 23:09:03 +00:00
void on_clearSpectrum_clicked(bool checked);
2020-07-05 08:03:41 +00:00
void on_freeze_toggled(bool checked);
void on_calibration_toggled(bool checked);
void handleInputMessages();
void openWebsocketSpectrumSettingsDialog(const QPoint& p);
void openCalibrationPointsDialog(const QPoint& p);
2021-08-01 08:03:58 +00:00
void updateHistogramMarkers();
void updateWaterfallMarkers();
2022-01-20 23:18:41 +00:00
void updateAnnotationMarkers();
void updateMarkersDisplay();
void updateCalibrationPoints();
};
#endif // INCLUDE_GLSPECTRUMGUI_H