GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
spectrumdisplayform.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2008-2011 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef SPECTRUM_DISPLAY_FORM_H
12#define SPECTRUM_DISPLAY_FORM_H
13
14#include <spectrumdisplayform.ui.h>
15
18
24#include <QTimer>
25#include <QValidator>
26#include <deque>
27#include <vector>
28
29class SpectrumDisplayForm : public QWidget, public Ui::SpectrumDisplayForm
30{
31 Q_OBJECT
32
33public:
34 SpectrumDisplayForm(QWidget* parent = 0);
36
37 // Disable copy/move because of QT raw pointers.
42
43 void setSystem(SpectrumGUIClass* newSystem,
44 const uint64_t numFFTDataPoints,
45 const uint64_t numTimeDomainDataPoints);
46
48 void setAverageCount(const int newCount);
49 void reset();
51 void resizeBuffers(const uint64_t numFFTDataPoints,
52 const uint64_t numTimeDomainDataPoints);
53
54 // returns the frequency that was last double-clicked on by the user
55 float getClickedFreq() const;
56
57 // checks if there was a double-click event; reset if there was
59
60public slots:
61 void resizeEvent(QResizeEvent* e) override;
62 void customEvent(QEvent* e) override;
63 void avgLineEdit_valueChanged(int valueString);
64 void maxHoldCheckBox_toggled(bool newState);
65 void minHoldCheckBox_toggled(bool newState);
68 void tabChanged(int index);
69
70 void setFrequencyRange(const double newCenterFrequency,
71 const double newStartFrequency,
72 const double newStopFrequency);
73 void closeEvent(QCloseEvent* e) override;
74 void windowTypeChanged(int newItem);
75 void useRFFrequenciesCB(bool useRFFlag);
76 void toggleRFFrequencies(bool en);
81 void fftComboBoxSelectedCB(const QString&);
82
83 void toggleTabFrequency(const bool state);
84 void toggleTabWaterfall(const bool state);
85 void toggleTabTime(const bool state);
86 void toggleTabConstellation(const bool state);
87
88 void setTimeDomainAxis(double min, double max);
89 void setConstellationAxis(double xmin, double xmax, double ymin, double ymax);
91 void setFrequencyAxis(double min, double max);
92 void setUpdateTime(double t);
93
94private slots:
95 void newFrequencyData(const SpectrumUpdateEvent*);
96 void updateGuiTimer();
97
98 void onFFTPlotPointSelected(const QPointF p);
99 void onWFallPlotPointSelected(const QPointF p);
100 void onTimePlotPointSelected(const QPointF p);
101 void onConstPlotPointSelected(const QPointF p);
102
103signals:
104 void plotPointSelected(const QPointF p, int type);
105
106private:
107 void _averageHistory(const std::vector<double>& newBuffer);
108
109 int _historyEntryCount = 0;
110 int _historyEntry = 0;
111 std::deque<std::vector<double>> _historyVector;
112 std::vector<double> _averagedValues;
113 std::vector<double> _realFFTDataPoints;
114 QIntValidator _intValidator;
115 FrequencyDisplayPlot* _frequencyDisplayPlot;
116 WaterfallDisplayPlot* _waterfallDisplayPlot;
117 TimeDomainDisplayPlot* _timeDomainDisplayPlot;
118 ConstellationDisplayPlot* _constellationDisplayPlot;
119 SpectrumGUIClass* _system;
120 bool _systemSpecifiedFlag = false;
121 double _centerFrequency;
122 double _startFrequency;
123 double _noiseFloorAmplitude;
124 double _peakFrequency = 0;
125 double _peakAmplitude;
126 double _stopFrequency;
127
128 double d_units;
129 bool d_clicked = false;
130 double d_clicked_freq = 0;
131
132 // SpectrumUpdateEvent _lastSpectrumEvent;
133
134 // whether or not to use a particular display
135 int d_plot_fft;
136 int d_plot_waterfall;
137 int d_plot_time;
138 int d_plot_constellation;
139
140 QTimer displayTimer;
141 double d_update_time;
142};
143
144#endif /* SPECTRUM_DISPLAY_FORM_H */
QWidget for displaying constellaton (I&Q) plots.
Definition: ConstellationDisplayPlot.h:24
QWidget for displaying frequency domain (PSD) plots.
Definition: FrequencyDisplayPlot.h:24
Definition: spectrumdisplayform.h:30
void closeEvent(QCloseEvent *e) override
void setConstellationAxis(double xmin, double xmax, double ymin, double ymax)
void waterfallMinimumIntensityChangedCB(double)
void toggleRFFrequencies(bool en)
SpectrumDisplayForm(SpectrumDisplayForm &&)=delete
SpectrumDisplayForm & operator=(SpectrumDisplayForm &&)=delete
~SpectrumDisplayForm() override
void waterfallAutoScaleBtnCB()
void useRFFrequenciesCB(bool useRFFlag)
void tabChanged(int index)
void toggleTabWaterfall(const bool state)
void resizeBuffers(const uint64_t numFFTDataPoints, const uint64_t numTimeDomainDataPoints)
void setSystem(SpectrumGUIClass *newSystem, const uint64_t numFFTDataPoints, const uint64_t numTimeDomainDataPoints)
void fftComboBoxSelectedCB(const QString &)
void setFrequencyAxis(double min, double max)
void maxHoldCheckBox_toggled(bool newState)
void setUpdateTime(double t)
void maxHoldResetBtn_clicked()
void setAverageCount(const int newCount)
void toggleTabTime(const bool state)
void toggleTabConstellation(const bool state)
SpectrumDisplayForm & operator=(const SpectrumDisplayForm &)=delete
void avgLineEdit_valueChanged(int valueString)
void customEvent(QEvent *e) override
void waterfallMaximumIntensityChangedCB(double)
void waterfallIntensityColorTypeChanged(int)
void toggleTabFrequency(const bool state)
void setFrequencyRange(const double newCenterFrequency, const double newStartFrequency, const double newStopFrequency)
void windowTypeChanged(int newItem)
void setConstellationPenSize(int size)
void minHoldCheckBox_toggled(bool newState)
float getClickedFreq() const
void plotPointSelected(const QPointF p, int type)
void setTimeDomainAxis(double min, double max)
void minHoldResetBtn_clicked()
SpectrumDisplayForm(QWidget *parent=0)
void resizeEvent(QResizeEvent *e) override
SpectrumDisplayForm(const SpectrumDisplayForm &)=delete
QWidget class for controlling plotting.
Definition: SpectrumGUIClass.h:35
Definition: spectrumUpdateEvents.h:30
QWidget for displaying time domain plots.
Definition: TimeDomainDisplayPlot.h:25
QWidget for displaying waterfall (spectrogram) plots.
Definition: WaterfallDisplayPlot.h:29
float min(float a, float b)