GNU Radio Manual and C++ API Reference  3.7.8
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  int getNumRows() const;
94 
95 public slots:
96  void setIntensityColorMapType(const int, const int, const QColor, const QColor);
97  void setIntensityColorMapType1(int);
100  void setPlotPosHalf(bool half);
101  void disableLegend();
102  void enableLegend();
103  void enableLegend(bool en);
104  void setNumRows(int nrows);
105 
106 signals:
107  void updatedLowerIntensityLevel(const double);
108  void updatedUpperIntensityLevel(const double);
109 
110 private:
111  void _updateIntensityRangeDisplay();
112 
113  double d_start_frequency;
114  double d_stop_frequency;
115  double d_center_frequency;
116  int d_xaxis_multiplier;
117  bool d_half_freq;
118  bool d_legend_enabled;
119  int d_nrows;
120 
121  std::vector<WaterfallData*> d_data;
122 
123 #if QWT_VERSION < 0x060000
124  std::vector<PlotWaterfall*> d_spectrogram;
125 #else
126  std::vector<QwtPlotSpectrogram*> d_spectrogram;
127 #endif
128 
129  std::vector<int> d_intensity_color_map_type;
130  QColor d_user_defined_low_intensity_color;
131  QColor d_user_defined_high_intensity_color;
132 };
133 
134 #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:61
const QColor getUserDefinedLowIntensityColor() const
void setIntensityRange(const double minIntensity, const double maxIntensity)
int getNumRows() const
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
void setPlotPosHalf(bool half)
void updatedLowerIntensityLevel(const double)
void setUserDefinedHighIntensityColor(QColor)
QColor high_intensity_color
Definition: WaterfallDisplayPlot.h:50
void setNumRows(int nrows)
const QColor getUserDefinedHighIntensityColor() const
int getIntensityColorMapType(int) const