GNU Radio Manual and C++ API Reference 3.8.5.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
SpectrumGUIClass.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_GUI_CLASS_HPP
24#define SPECTRUM_GUI_CLASS_HPP
25
28#include <qapplication.h>
29#include <qlabel.h>
30#include <qslider.h>
31#include <qwidget.h>
32
35
36#include <cmath>
37
38#include <complex>
39#include <string>
40#include <vector>
41
42/*!
43 * \brief QWidget class for controlling plotting.
44 * \ingroup qtgui_blk
45 */
47{
48public:
49 SpectrumGUIClass(const uint64_t maxDataSize,
50 const uint64_t fftSize,
51 const double newCenterFrequency,
52 const double newStartFrequency,
53 const double newStopFrequency);
55 void reset();
56
57 void openSpectrumWindow(QWidget*,
58 const bool frequency = true,
59 const bool waterfall = true,
60 const bool time = true,
61 const bool constellation = true);
62 void setDisplayTitle(const std::string);
63
65 void setWindowOpenFlag(const bool);
66
67 void setFrequencyRange(const double, const double, const double);
71
72 void updateWindow(const bool,
73 const float*,
74 const uint64_t,
75 const float*,
76 const uint64_t,
77 const float*,
78 const uint64_t,
80 const bool);
81
83 void setPowerValue(const float);
84
86 void setWindowType(const int);
87
90 void setFFTSize(const int);
91
94
99
100 static const long MAX_FFT_SIZE;
101 static const long MIN_FFT_SIZE;
102
103 QWidget* qwidget();
104
105 void setTimeDomainAxis(double min, double max);
106 void setConstellationAxis(double xmin, double xmax, double ymin, double ymax);
108 void setFrequencyAxis(double min, double max);
109
110 void setUpdateTime(double t);
111
112 void enableRFFreq(bool en);
113
116
117protected:
118private:
119 gr::thread::mutex d_mutex;
120 int64_t _dataPoints;
121 std::string _title;
122 double _centerFrequency;
123 double _startFrequency;
124 double _stopFrequency;
125 float _powerValue;
126 bool _windowOpennedFlag;
127 int _windowType;
128 int64_t _lastDataPointCount;
129 int _fftSize;
130 gr::high_res_timer_type _lastGUIUpdateTime;
131 unsigned int _pendingGUIUpdateEventsCount;
132 int _droppedEntriesCount;
133 bool _fftBuffersCreatedFlag;
134 double _updateTime;
135
136 SpectrumDisplayForm* _spectrumDisplayForm;
137
138 float* _fftPoints;
139 double* _realTimeDomainPoints;
140 double* _imagTimeDomainPoints;
141};
142
143#endif /* SPECTRUM_GUI_CLASS_HPP */
Definition spectrumdisplayform.h:41
QWidget class for controlling plotting.
Definition SpectrumGUIClass.h:47
SpectrumGUIClass(const uint64_t maxDataSize, const uint64_t fftSize, const double newCenterFrequency, const double newStartFrequency, const double newStopFrequency)
void setFFTSize(const int)
void setWindowType(const int)
void setDisplayTitle(const std::string)
void setPowerValue(const float)
void resetPendingGUIUpdateEvents()
void setFrequencyAxis(double min, double max)
void setWindowOpenFlag(const bool)
void setConstellationPenSize(int size)
double getCenterFrequency()
float getClickedFreq()
void setLastGUIUpdateTime(const gr::high_res_timer_type)
void openSpectrumWindow(QWidget *, const bool frequency=true, const bool waterfall=true, const bool time=true, const bool constellation=true)
static const long MIN_FFT_SIZE
Definition SpectrumGUIClass.h:101
void incrementPendingGUIUpdateEvents()
bool getWindowOpenFlag()
gr::high_res_timer_type getLastGUIUpdateTime()
void setConstellationAxis(double xmin, double xmax, double ymin, double ymax)
void setFrequencyRange(const double, const double, const double)
QWidget * qwidget()
void decrementPendingGUIUpdateEvents()
static const long MAX_FFT_SIZE
Definition SpectrumGUIClass.h:100
void setTimeDomainAxis(double min, double max)
void enableRFFreq(bool en)
void updateWindow(const bool, const float *, const uint64_t, const float *, const uint64_t, const float *, const uint64_t, const gr::high_res_timer_type, const bool)
float getPowerValue()
double getStopFrequency()
void setUpdateTime(double t)
double getStartFrequency()
unsigned int getPendingGUIUpdateEvents()
boost::mutex mutex
Definition thread.h:48
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition high_res_timer.h:49