GNU Radio Manual and C++ API Reference 3.9.4.0
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 <vector>
27
28class SpectrumDisplayForm : public QWidget, public Ui::SpectrumDisplayForm
29{
30 Q_OBJECT
31
32public:
33 SpectrumDisplayForm(QWidget* parent = 0);
35
36 void setSystem(SpectrumGUIClass* newSystem,
37 const uint64_t numFFTDataPoints,
38 const uint64_t numTimeDomainDataPoints);
39
41 void setAverageCount(const int newCount);
42 void reset();
44 void resizeBuffers(const uint64_t numFFTDataPoints,
45 const uint64_t numTimeDomainDataPoints);
46
47 // returns the frequency that was last double-clicked on by the user
48 float getClickedFreq() const;
49
50 // checks if there was a double-click event; reset if there was
52
53public slots:
54 void resizeEvent(QResizeEvent* e) override;
55 void customEvent(QEvent* e) override;
56 void avgLineEdit_valueChanged(int valueString);
57 void maxHoldCheckBox_toggled(bool newState);
58 void minHoldCheckBox_toggled(bool newState);
61 void tabChanged(int index);
62
63 void setFrequencyRange(const double newCenterFrequency,
64 const double newStartFrequency,
65 const double newStopFrequency);
66 void closeEvent(QCloseEvent* e) override;
67 void windowTypeChanged(int newItem);
68 void useRFFrequenciesCB(bool useRFFlag);
69 void toggleRFFrequencies(bool en);
74 void fftComboBoxSelectedCB(const QString&);
75
76 void toggleTabFrequency(const bool state);
77 void toggleTabWaterfall(const bool state);
78 void toggleTabTime(const bool state);
79 void toggleTabConstellation(const bool state);
80
81 void setTimeDomainAxis(double min, double max);
82 void setConstellationAxis(double xmin, double xmax, double ymin, double ymax);
84 void setFrequencyAxis(double min, double max);
85 void setUpdateTime(double t);
86
87private slots:
88 void newFrequencyData(const SpectrumUpdateEvent*);
89 void updateGuiTimer();
90
91 void onFFTPlotPointSelected(const QPointF p);
92 void onWFallPlotPointSelected(const QPointF p);
93 void onTimePlotPointSelected(const QPointF p);
94 void onConstPlotPointSelected(const QPointF p);
95
96signals:
97 void plotPointSelected(const QPointF p, int type);
98
99private:
100 void _averageHistory(const double* newBuffer);
101
102 int _historyEntryCount;
103 int _historyEntry;
104 std::vector<double*>* _historyVector;
105 double* _averagedValues;
106 uint64_t _numRealDataPoints;
107 double* _realFFTDataPoints;
108 QIntValidator* _intValidator;
109 FrequencyDisplayPlot* _frequencyDisplayPlot;
110 WaterfallDisplayPlot* _waterfallDisplayPlot;
111 TimeDomainDisplayPlot* _timeDomainDisplayPlot;
112 ConstellationDisplayPlot* _constellationDisplayPlot;
113 SpectrumGUIClass* _system;
114 bool _systemSpecifiedFlag;
115 double _centerFrequency;
116 double _startFrequency;
117 double _noiseFloorAmplitude;
118 double _peakFrequency;
119 double _peakAmplitude;
120 double _stopFrequency;
121
122 double d_units;
123 bool d_clicked;
124 double d_clicked_freq;
125
126 // SpectrumUpdateEvent _lastSpectrumEvent;
127
128 // whether or not to use a particular display
129 int d_plot_fft;
130 int d_plot_waterfall;
131 int d_plot_time;
132 int d_plot_constellation;
133
134 QTimer* displayTimer;
135 double d_update_time;
136};
137
138#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:29
void closeEvent(QCloseEvent *e) override
void setConstellationAxis(double xmin, double xmax, double ymin, double ymax)
void waterfallMinimumIntensityChangedCB(double)
void toggleRFFrequencies(bool en)
~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)
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
QWidget class for controlling plotting.
Definition: SpectrumGUIClass.h:35
Definition: spectrumUpdateEvents.h:29
QWidget for displaying time domain plots.
Definition: TimeDomainDisplayPlot.h:25
QWidget for displaying waterfall (spectrogram) plots.
Definition: WaterfallDisplayPlot.h:33
float min(float a, float b)