GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
waterfalldisplayform.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2012 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 WATERFALL_DISPLAY_FORM_H
24 #define WATERFALL_DISPLAY_FORM_H
25 
28 #include <QtGui/QtGui>
29 #include <vector>
30 #include <gnuradio/filter/firdes.h>
31 
33 
34 /*!
35  * \brief DisplayForm child for managing waterfall (spectrogram) plots.
36  * \ingroup qtgui_blk
37  */
39 {
40  Q_OBJECT
41 
42  public:
43  WaterfallDisplayForm(int nplots=1, QWidget* parent = 0);
45 
47 
48  int getFFTSize() const;
49  double getTimePerFFT();
50  float getFFTAverage() const;
52 
53  int getColorMap(int which);
54  int getAlpha(int which);
55  double getMinIntensity(int which);
56  double getMaxIntensity(int which);
57 
58  void clearData();
59 
60  // returns the frequency that was last double-clicked on by the user
61  float getClickedFreq() const;
62 
63  // checks if there was a double-click event; reset if there was
64  bool checkClicked();
65 
66 public slots:
67  void customEvent(QEvent *e);
68  void setTimeTitle(const std::string);
69  void setSampleRate(const QString &samprate);
70  void setFFTSize(const int);
71  void setFFTAverage(const float);
73 
74  void setFrequencyRange(const double centerfreq,
75  const double bandwidth);
76 
77  void setIntensityRange(const double minIntensity,
78  const double maxIntensity);
79  void setMaxIntensity(const QString &m);
80  void setMinIntensity(const QString &m);
81 
82  void setAlpha(int which, int alpha);
83 
84  void setColorMap(int which,
85  const int newType,
86  const QColor lowColor=QColor("white"),
87  const QColor highColor=QColor("white"));
88 
89  void autoScale(bool en=false);
90  void setPlotPosHalf(bool half);
91  void setTimePerFFT(double t);
92  void setUpdateTime(double t);
93 
94 private slots:
95  void newData(const QEvent *updateEvent);
96  void onPlotPointSelected(const QPointF p);
97 
98 private:
99  QIntValidator* d_int_validator;
100 
101  double d_samp_rate, d_center_freq;
102  int d_fftsize;
103  double d_time_per_fft;
104  float d_fftavg;
105  gr::filter::firdes::win_type d_fftwintype;
106  double d_units;
107 
108  bool d_clicked;
109  double d_clicked_freq;
110 
111  double d_min_val, d_cur_min_val;
112  double d_max_val, d_cur_max_val;
113 
114  FFTSizeMenu *d_sizemenu;
115  FFTAverageMenu *d_avgmenu;
116  FFTWindowMenu *d_winmenu;
117 };
118 
119 #endif /* WATERFALL_DISPLAY_FORM_H */
QWidget for displaying waterfall (spectrogram) plots.
Definition: WaterfallDisplayPlot.h:44
Base class for setting up and managing QTGUI plot forms.
Definition: displayform.h:41
void setMaxIntensity(const QString &m)
void setTimeTitle(const std::string)
void setUpdateTime(double t)
void setFFTAverage(const float)
gr::filter::firdes::win_type getFFTWindowType() const
float getFFTAverage() const
float getClickedFreq() const
void setSampleRate(const QString &samprate)
void customEvent(QEvent *e)
void setFrequencyRange(const double centerfreq, const double bandwidth)
void setColorMap(int which, const int newType, const QColor lowColor=QColor("white"), const QColor highColor=QColor("white"))
void setAlpha(int which, int alpha)
Definition: form_menus.h:864
void setFFTSize(const int)
void setTimePerFFT(double t)
Definition: form_menus.h:627
void setFFTWindowType(const gr::filter::firdes::win_type)
int getColorMap(int which)
Definition: form_menus.h:878
void setIntensityRange(const double minIntensity, const double maxIntensity)
WaterfallDisplayForm(int nplots=1, QWidget *parent=0)
DisplayForm child for managing waterfall (spectrogram) plots.
Definition: waterfalldisplayform.h:38
win_type
Definition: firdes.h:45
WaterfallDisplayPlot * getPlot()
void autoScale(bool en=false)
void setPlotPosHalf(bool half)
double getMinIntensity(int which)
double getMaxIntensity(int which)
void setMinIntensity(const QString &m)
int getFFTSize() const
int getAlpha(int which)