GNU Radio 3.7.3 C++ API
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 
26 #include <gnuradio/thread/thread.h>
27 #include <qwidget.h>
28 #include <qapplication.h>
29 #include <qlabel.h>
30 #include <qslider.h>
32 
35 
36 #include <cmath>
37 
38 #include <complex>
39 #include <vector>
40 #include <string>
41 
42 /*!
43  * \brief QWidget class for controlling plotting.
44  * \ingroup qtgui_blk
45  */
47 {
48 public:
49  SpectrumGUIClass(const uint64_t maxDataSize, const uint64_t fftSize,
50  const double newCenterFrequency,
51  const double newStartFrequency,
52  const double newStopFrequency);
54  void reset();
55 
56  void openSpectrumWindow(QWidget*,
57  const bool frequency=true, const bool waterfall=true,
58  const bool time=true, const bool constellation=true);
59  void setDisplayTitle(const std::string);
60 
61  bool getWindowOpenFlag();
62  void setWindowOpenFlag(const bool);
63 
64  void setFrequencyRange(const double, const double, const double);
65  double getStartFrequency();
66  double getStopFrequency();
67  double getCenterFrequency();
68 
69  void updateWindow(const bool, const float*,
70  const uint64_t, const float*,
71  const uint64_t, const float*,
72  const uint64_t,
73  const gr::high_res_timer_type, const bool);
74 
75  float getPowerValue();
76  void setPowerValue(const float);
77 
78  int getWindowType();
79  void setWindowType(const int);
80 
81  int getFFTSize();
82  int getFFTSizeIndex();
83  void setFFTSize(const int);
84 
87 
88  unsigned int getPendingGUIUpdateEvents();
92 
93  static const long MAX_FFT_SIZE;
94  static const long MIN_FFT_SIZE;
95 
96  QWidget* qwidget();
97 
98  void setTimeDomainAxis(double min, double max);
99  void setConstellationAxis(double xmin, double xmax,
100  double ymin, double ymax);
101  void setConstellationPenSize(int size);
102  void setFrequencyAxis(double min, double max);
103 
104  void setUpdateTime(double t);
105 
106 protected:
107 
108 private:
109 
110  gr::thread::mutex d_mutex;
111  int64_t _dataPoints;
112  std::string _title;
113  double _centerFrequency;
114  double _startFrequency;
115  double _stopFrequency;
116  float _powerValue;
117  bool _windowOpennedFlag;
118  int _windowType;
119  int64_t _lastDataPointCount;
120  int _fftSize;
121  gr::high_res_timer_type _lastGUIUpdateTime;
122  unsigned int _pendingGUIUpdateEventsCount;
123  int _droppedEntriesCount;
124  bool _fftBuffersCreatedFlag;
125  double _updateTime;
126 
127  SpectrumDisplayForm* _spectrumDisplayForm;
128 
129  float* _fftPoints;
130  double* _realTimeDomainPoints;
131  double* _imagTimeDomainPoints;
132 };
133 
134 #endif /* SPECTRUM_GUI_CLASS_HPP */
void setWindowOpenFlag(const bool)
gr::high_res_timer_type getLastGUIUpdateTime()
float getPowerValue()
double getStopFrequency()
float min(float a, float b)
void setTimeDomainAxis(double min, double max)
void decrementPendingGUIUpdateEvents()
void setWindowType(const int)
Definition: spectrumdisplayform.h:40
double getCenterFrequency()
QWidget * qwidget()
unsigned int getPendingGUIUpdateEvents()
void setFrequencyRange(const double, const double, const double)
void openSpectrumWindow(QWidget *, const bool frequency=true, const bool waterfall=true, const bool time=true, const bool constellation=true)
double getStartFrequency()
void incrementPendingGUIUpdateEvents()
void setLastGUIUpdateTime(const gr::high_res_timer_type)
void setFFTSize(const int)
void setDisplayTitle(const std::string)
void setUpdateTime(double t)
unsigned __int64 uint64_t
Definition: stdint.h:90
static const long MIN_FFT_SIZE
Definition: SpectrumGUIClass.h:94
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition: high_res_timer.h:49
void setConstellationPenSize(int size)
void setPowerValue(const float)
bool getWindowOpenFlag()
SpectrumGUIClass(const uint64_t maxDataSize, const uint64_t fftSize, const double newCenterFrequency, const double newStartFrequency, const double newStopFrequency)
signed __int64 int64_t
Definition: stdint.h:89
QWidget class for controlling plotting.
Definition: SpectrumGUIClass.h:46
boost::mutex mutex
Definition: thread.h:46
static const long MAX_FFT_SIZE
Definition: SpectrumGUIClass.h:93
void setFrequencyAxis(double min, double max)
void setConstellationAxis(double xmin, double xmax, double ymin, double ymax)
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)
void resetPendingGUIUpdateEvents()