GNU Radio Manual and C++ API Reference 3.9.8.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 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef SPECTRUM_GUI_CLASS_HPP
12#define SPECTRUM_GUI_CLASS_HPP
13
16#include <qapplication.h>
17#include <qlabel.h>
18#include <qslider.h>
19#include <qwidget.h>
20
23
24#include <cmath>
25
26#include <complex>
27#include <string>
28#include <vector>
29
30/*!
31 * \brief QWidget class for controlling plotting.
32 * \ingroup qtgui_blk
33 */
35{
36public:
37 SpectrumGUIClass(const uint64_t maxDataSize,
38 const uint64_t fftSize,
39 const double newCenterFrequency,
40 const double newStartFrequency,
41 const double newStopFrequency);
43 void reset();
44
45 void openSpectrumWindow(QWidget*,
46 const bool frequency = true,
47 const bool waterfall = true,
48 const bool time = true,
49 const bool constellation = true);
50 void setDisplayTitle(const std::string);
51
53 void setWindowOpenFlag(const bool);
54
55 void setFrequencyRange(const double, const double, const double);
59
60 void updateWindow(const bool,
61 const float*,
62 const uint64_t,
63 const float*,
64 const uint64_t,
65 const float*,
66 const uint64_t,
68 const bool);
69
71 void setPowerValue(const float);
72
74 void setWindowType(const int);
75
78 void setFFTSize(const int);
79
82
87
88 static const long MAX_FFT_SIZE;
89 static const long MIN_FFT_SIZE;
90 static const long DEFAULT_FFT_SIZE;
91
92 QWidget* qwidget();
93
94 void setTimeDomainAxis(double min, double max);
95 void setConstellationAxis(double xmin, double xmax, double ymin, double ymax);
97 void setFrequencyAxis(double min, double max);
98
99 void setUpdateTime(double t);
100
101 void enableRFFreq(bool en);
102
105
106protected:
107private:
108 gr::thread::mutex d_mutex;
109 int64_t _dataPoints;
110 std::string _title;
111 double _centerFrequency;
112 double _startFrequency;
113 double _stopFrequency;
114 float _powerValue;
115 bool _windowOpennedFlag;
116 int _windowType;
117 int64_t _lastDataPointCount;
118 int _fftSize;
119 gr::high_res_timer_type _lastGUIUpdateTime;
120 unsigned int _pendingGUIUpdateEventsCount;
121 int _droppedEntriesCount;
122 bool _fftBuffersCreatedFlag;
123 double _updateTime = 0.5;
124
125 SpectrumDisplayForm* _spectrumDisplayForm;
126
127 float* _fftPoints;
128 double* _realTimeDomainPoints;
129 double* _imagTimeDomainPoints;
130};
131
132#endif /* SPECTRUM_GUI_CLASS_HPP */
Definition: spectrumdisplayform.h:30
QWidget class for controlling plotting.
Definition: SpectrumGUIClass.h:35
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()
static const long DEFAULT_FFT_SIZE
Definition: SpectrumGUIClass.h:90
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:89
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:88
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:37
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition: high_res_timer.h:39