GNU Radio Manual and C++ API Reference 3.8.5.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
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 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
10 * any later version.
11 *
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
21 */
22
23#ifndef SPECTRUM_DISPLAY_FORM_H
24#define SPECTRUM_DISPLAY_FORM_H
25
26#include <spectrumdisplayform.ui.h>
27
30
36#include <QTimer>
37#include <QValidator>
38#include <vector>
39
40class SpectrumDisplayForm : public QWidget, public Ui::SpectrumDisplayForm
41{
42 Q_OBJECT
43
44public:
45 SpectrumDisplayForm(QWidget* parent = 0);
47
48 void setSystem(SpectrumGUIClass* newSystem,
49 const uint64_t numFFTDataPoints,
50 const uint64_t numTimeDomainDataPoints);
51
53 void setAverageCount(const int newCount);
54 void reset();
56 void resizeBuffers(const uint64_t numFFTDataPoints,
57 const uint64_t numTimeDomainDataPoints);
58
59 // returns the frequency that was last double-clicked on by the user
60 float getClickedFreq() const;
61
62 // checks if there was a double-click event; reset if there was
64
65public slots:
66 void resizeEvent(QResizeEvent* e);
67 void customEvent(QEvent* e);
68 void avgLineEdit_valueChanged(int valueString);
69 void maxHoldCheckBox_toggled(bool newState);
70 void minHoldCheckBox_toggled(bool newState);
73 void tabChanged(int index);
74
75 void setFrequencyRange(const double newCenterFrequency,
76 const double newStartFrequency,
77 const double newStopFrequency);
78 void closeEvent(QCloseEvent* e);
79 void windowTypeChanged(int newItem);
80 void useRFFrequenciesCB(bool useRFFlag);
81 void toggleRFFrequencies(bool en);
86 void fftComboBoxSelectedCB(const QString&);
87
88 void toggleTabFrequency(const bool state);
89 void toggleTabWaterfall(const bool state);
90 void toggleTabTime(const bool state);
91 void toggleTabConstellation(const bool state);
92
93 void setTimeDomainAxis(double min, double max);
94 void setConstellationAxis(double xmin, double xmax, double ymin, double ymax);
96 void setFrequencyAxis(double min, double max);
97 void setUpdateTime(double t);
98
99private slots:
100 void newFrequencyData(const SpectrumUpdateEvent*);
101 void updateGuiTimer();
102
103 void onFFTPlotPointSelected(const QPointF p);
104 void onWFallPlotPointSelected(const QPointF p);
105 void onTimePlotPointSelected(const QPointF p);
106 void onConstPlotPointSelected(const QPointF p);
107
108signals:
109 void plotPointSelected(const QPointF p, int type);
110
111private:
112 void _averageHistory(const double* newBuffer);
113
114 int _historyEntryCount;
115 int _historyEntry;
116 std::vector<double*>* _historyVector;
117 double* _averagedValues;
118 uint64_t _numRealDataPoints;
119 double* _realFFTDataPoints;
120 QIntValidator* _intValidator;
121 FrequencyDisplayPlot* _frequencyDisplayPlot;
122 WaterfallDisplayPlot* _waterfallDisplayPlot;
123 TimeDomainDisplayPlot* _timeDomainDisplayPlot;
124 ConstellationDisplayPlot* _constellationDisplayPlot;
125 SpectrumGUIClass* _system;
126 bool _systemSpecifiedFlag;
127 double _centerFrequency;
128 double _startFrequency;
129 double _noiseFloorAmplitude;
130 double _peakFrequency;
131 double _peakAmplitude;
132 double _stopFrequency;
133
134 double d_units;
135 bool d_clicked;
136 double d_clicked_freq;
137
138 // SpectrumUpdateEvent _lastSpectrumEvent;
139
140 // whether or not to use a particular display
141 int d_plot_fft;
142 int d_plot_waterfall;
143 int d_plot_time;
144 int d_plot_constellation;
145
146 QTimer* displayTimer;
147 double d_update_time;
148};
149
150#endif /* SPECTRUM_DISPLAY_FORM_H */
QWidget for displaying constellaton (I&Q) plots.
Definition ConstellationDisplayPlot.h:36
QWidget for displaying frequency domain (PSD) plots.
Definition FrequencyDisplayPlot.h:36
Definition spectrumdisplayform.h:41
void setConstellationAxis(double xmin, double xmax, double ymin, double ymax)
void waterfallMinimumIntensityChangedCB(double)
void toggleRFFrequencies(bool en)
void waterfallAutoScaleBtnCB()
void resizeEvent(QResizeEvent *e)
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 waterfallMaximumIntensityChangedCB(double)
void waterfallIntensityColorTypeChanged(int)
void toggleTabFrequency(const bool state)
void setFrequencyRange(const double newCenterFrequency, const double newStartFrequency, const double newStopFrequency)
void closeEvent(QCloseEvent *e)
void windowTypeChanged(int newItem)
void setConstellationPenSize(int size)
void customEvent(QEvent *e)
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)
QWidget class for controlling plotting.
Definition SpectrumGUIClass.h:47
Definition spectrumUpdateEvents.h:41
QWidget for displaying time domain plots.
Definition TimeDomainDisplayPlot.h:37
QWidget for displaying waterfall (spectrogram) plots.
Definition WaterfallDisplayPlot.h:47