GNU Radio Manual and C++ API Reference  3.9.1.0
The Free & Open Software Radio Ecosystem
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 
15 #include <gnuradio/thread/thread.h>
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 {
36 public:
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 
52  bool getWindowOpenFlag();
53  void setWindowOpenFlag(const bool);
54 
55  void setFrequencyRange(const double, const double, const double);
56  double getStartFrequency();
57  double getStopFrequency();
58  double getCenterFrequency();
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 
70  float getPowerValue();
71  void setPowerValue(const float);
72 
73  int getWindowType();
74  void setWindowType(const int);
75 
76  int getFFTSize();
77  int getFFTSizeIndex();
78  void setFFTSize(const int);
79 
82 
83  unsigned int getPendingGUIUpdateEvents();
87 
88  static const long MAX_FFT_SIZE;
89  static const long MIN_FFT_SIZE;
90 
91  QWidget* qwidget();
92 
93  void setTimeDomainAxis(double min, double max);
94  void setConstellationAxis(double xmin, double xmax, double ymin, double ymax);
95  void setConstellationPenSize(int size);
96  void setFrequencyAxis(double min, double max);
97 
98  void setUpdateTime(double t);
99 
100  void enableRFFreq(bool en);
101 
102  bool checkClicked();
103  float getClickedFreq();
104 
105 protected:
106 private:
107  gr::thread::mutex d_mutex;
108  int64_t _dataPoints;
109  std::string _title;
110  double _centerFrequency;
111  double _startFrequency;
112  double _stopFrequency;
113  float _powerValue;
114  bool _windowOpennedFlag;
115  int _windowType;
116  int64_t _lastDataPointCount;
117  int _fftSize;
118  gr::high_res_timer_type _lastGUIUpdateTime;
119  unsigned int _pendingGUIUpdateEventsCount;
120  int _droppedEntriesCount;
121  bool _fftBuffersCreatedFlag;
122  double _updateTime;
123 
124  SpectrumDisplayForm* _spectrumDisplayForm;
125 
126  float* _fftPoints;
127  double* _realTimeDomainPoints;
128  double* _imagTimeDomainPoints;
129 };
130 
131 #endif /* SPECTRUM_GUI_CLASS_HPP */
SpectrumGUIClass::getClickedFreq
float getClickedFreq()
SpectrumGUIClass::MIN_FFT_SIZE
static const long MIN_FFT_SIZE
Definition: SpectrumGUIClass.h:89
SpectrumGUIClass::setDisplayTitle
void setDisplayTitle(const std::string)
SpectrumGUIClass::setUpdateTime
void setUpdateTime(double t)
SpectrumGUIClass::reset
void reset()
SpectrumGUIClass::setPowerValue
void setPowerValue(const float)
SpectrumGUIClass::~SpectrumGUIClass
~SpectrumGUIClass()
SpectrumGUIClass::enableRFFreq
void enableRFFreq(bool en)
gr::trellis::min
float min(float a, float b)
SpectrumGUIClass::setConstellationPenSize
void setConstellationPenSize(int size)
SpectrumGUIClass::getWindowOpenFlag
bool getWindowOpenFlag()
SpectrumGUIClass::SpectrumGUIClass
SpectrumGUIClass(const uint64_t maxDataSize, const uint64_t fftSize, const double newCenterFrequency, const double newStartFrequency, const double newStopFrequency)
SpectrumGUIClass::updateWindow
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)
SpectrumGUIClass::setFrequencyAxis
void setFrequencyAxis(double min, double max)
SpectrumGUIClass::MAX_FFT_SIZE
static const long MAX_FFT_SIZE
Definition: SpectrumGUIClass.h:88
SpectrumGUIClass::setConstellationAxis
void setConstellationAxis(double xmin, double xmax, double ymin, double ymax)
spectrumdisplayform.h
SpectrumGUIClass::getWindowType
int getWindowType()
SpectrumGUIClass::setWindowOpenFlag
void setWindowOpenFlag(const bool)
SpectrumGUIClass::resetPendingGUIUpdateEvents
void resetPendingGUIUpdateEvents()
gr::thread::mutex
boost::mutex mutex
Definition: thread.h:37
SpectrumGUIClass::getLastGUIUpdateTime
gr::high_res_timer_type getLastGUIUpdateTime()
SpectrumGUIClass::getPowerValue
float getPowerValue()
SpectrumGUIClass::getStopFrequency
double getStopFrequency()
SpectrumGUIClass::setTimeDomainAxis
void setTimeDomainAxis(double min, double max)
SpectrumGUIClass::decrementPendingGUIUpdateEvents
void decrementPendingGUIUpdateEvents()
spectrumUpdateEvents.h
SpectrumGUIClass::setWindowType
void setWindowType(const int)
gr::high_res_timer_type
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition: high_res_timer.h:38
SpectrumGUIClass
QWidget class for controlling plotting.
Definition: SpectrumGUIClass.h:34
SpectrumGUIClass::getCenterFrequency
double getCenterFrequency()
SpectrumGUIClass::setFrequencyRange
void setFrequencyRange(const double, const double, const double)
SpectrumGUIClass::qwidget
QWidget * qwidget()
SpectrumGUIClass::getPendingGUIUpdateEvents
unsigned int getPendingGUIUpdateEvents()
SpectrumGUIClass::checkClicked
bool checkClicked()
SpectrumGUIClass::getFFTSize
int getFFTSize()
SpectrumGUIClass::getStartFrequency
double getStartFrequency()
SpectrumGUIClass::incrementPendingGUIUpdateEvents
void incrementPendingGUIUpdateEvents()
thread.h
SpectrumDisplayForm
Definition: spectrumdisplayform.h:28
SpectrumGUIClass::openSpectrumWindow
void openSpectrumWindow(QWidget *, const bool frequency=true, const bool waterfall=true, const bool time=true, const bool constellation=true)
SpectrumGUIClass::setLastGUIUpdateTime
void setLastGUIUpdateTime(const gr::high_res_timer_type)
SpectrumGUIClass::getFFTSizeIndex
int getFFTSizeIndex()
SpectrumGUIClass::setFFTSize
void setFFTSize(const int)