GNU Radio Manual and C++ API Reference  3.7.4.1
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
WaterfallDisplayPlot.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008-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_PLOT_H
24 #define WATERFALL_DISPLAY_PLOT_H
25 
26 #include <stdint.h>
27 #include <cstdio>
28 #include <vector>
29 #include <qwt_plot_spectrogram.h>
33 
34 #if QWT_VERSION < 0x060000
36 #else
37 #include <qwt_compat.h>
38 #endif
39 
40 /*!
41  * \brief QWidget for displaying waterfall (spectrogram) plots.
42  * \ingroup qtgui_blk
43  */
45 {
46  Q_OBJECT
47 
51 
52 
53 public:
54  WaterfallDisplayPlot(int nplots, QWidget*);
55  virtual ~WaterfallDisplayPlot();
56 
57  void resetAxis();
58 
59  void setFrequencyRange(const double, const double,
60  const double units=1000.0,
61  const std::string &strunits = "kHz");
62  double getStartFrequency() const;
63  double getStopFrequency() const;
64 
65  void plotNewData(const std::vector<double*> dataPoints,
66  const int64_t numDataPoints,
67  const double timePerFFT,
68  const gr::high_res_timer_type timestamp,
69  const int droppedFrames);
70 
71  // to be removed
72  void plotNewData(const double* dataPoints,
73  const int64_t numDataPoints,
74  const double timePerFFT,
75  const gr::high_res_timer_type timestamp,
76  const int droppedFrames);
77 
78  void setIntensityRange(const double minIntensity, const double maxIntensity);
79  double getMinIntensity(int which) const;
80  double getMaxIntensity(int which) const;
81 
82  void replot(void);
83  void clearData();
84 
85  int getIntensityColorMapType(int) const;
86  int getIntensityColorMapType1() const;
87  const QColor getUserDefinedLowIntensityColor() const;
88  const QColor getUserDefinedHighIntensityColor() const;
89 
90  int getAlpha(int which);
91  void setAlpha(int which, int alpha);
92 
93 public slots:
94  void setIntensityColorMapType(const int, const int, const QColor, const QColor);
95  void setIntensityColorMapType1(int);
98 
99 signals:
100  void updatedLowerIntensityLevel(const double);
101  void updatedUpperIntensityLevel(const double);
102 
103 private:
104  void _updateIntensityRangeDisplay();
105 
106  double d_start_frequency;
107  double d_stop_frequency;
108  int d_xaxis_multiplier;
109 
110  std::vector<WaterfallData*> d_data;
111 
112 #if QWT_VERSION < 0x060000
113  std::vector<PlotWaterfall*> d_spectrogram;
114 #else
115  std::vector<QwtPlotSpectrogram*> d_spectrogram;
116 #endif
117 
118  std::vector<int> d_intensity_color_map_type;
119  QColor d_user_defined_low_intensity_color;
120  QColor d_user_defined_high_intensity_color;
121 };
122 
123 #endif /* WATERFALL_DISPLAY_PLOT_H */
QWidget for displaying waterfall (spectrogram) plots.
Definition: WaterfallDisplayPlot.h:44
void setIntensityColorMapType1(int)
QColor low_intensity_color
Definition: WaterfallDisplayPlot.h:49
void setUserDefinedLowIntensityColor(QColor)
QWidget base plot to build QTGUI plotting tools.
Definition: DisplayPlot.h:53
const QColor getUserDefinedLowIntensityColor() const
void setIntensityRange(const double minIntensity, const double maxIntensity)
void plotNewData(const std::vector< double * > dataPoints, const int64_t numDataPoints, const double timePerFFT, const gr::high_res_timer_type timestamp, const int droppedFrames)
Definition: waterfallGlobalData.h:34
double getMaxIntensity(int which) const
double getStartFrequency() const
void setAlpha(int which, int alpha)
double getStopFrequency() const
void updatedUpperIntensityLevel(const double)
void setIntensityColorMapType(const int, const int, const QColor, const QColor)
void setFrequencyRange(const double, const double, const double units=1000.0, const std::string &strunits="kHz")
int getAlpha(int which)
int intensity_color_map_type1
Definition: WaterfallDisplayPlot.h:48
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition: high_res_timer.h:49
double getMinIntensity(int which) const
int getIntensityColorMapType1() const
signed __int64 int64_t
Definition: stdint.h:89
void updatedLowerIntensityLevel(const double)
void setUserDefinedHighIntensityColor(QColor)
QColor high_intensity_color
Definition: WaterfallDisplayPlot.h:50
const QColor getUserDefinedHighIntensityColor() const
int getIntensityColorMapType(int) const