GNU Radio Manual and C++ API Reference 3.7.14.0
The Free & Open Software Radio Ecosystem
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
29#include <qwt_plot_spectrogram.h>
30#include <stdint.h>
31#include <cstdio>
32#include <vector>
33
34#if QWT_VERSION < 0x060000
36#else
37// clang-format off
38#include <qwt_point_3d.h> // doesn't seem necessary, but is...
39#include <qwt_compat.h>
40// clang-format on
41#endif
42
43/*!
44 * \brief QWidget for displaying waterfall (spectrogram) plots.
45 * \ingroup qtgui_blk
46 */
48{
49 Q_OBJECT
50
53 Q_PROPERTY(QColor low_intensity_color READ getUserDefinedLowIntensityColor WRITE
59
60
61public:
62 WaterfallDisplayPlot(int nplots, QWidget*);
64
65 void resetAxis();
66
67 void setFrequencyRange(const double,
68 const double,
69 const double units = 1000.0,
70 const std::string& strunits = "kHz");
71 double getStartFrequency() const;
72 double getStopFrequency() const;
73
74 void plotNewData(const std::vector<double*> dataPoints,
75 const int64_t numDataPoints,
76 const double timePerFFT,
77 const gr::high_res_timer_type timestamp,
78 const int droppedFrames);
79
80 // to be removed
81 void plotNewData(const double* dataPoints,
82 const int64_t numDataPoints,
83 const double timePerFFT,
84 const gr::high_res_timer_type timestamp,
85 const int droppedFrames);
86
87 void setIntensityRange(const double minIntensity, const double maxIntensity);
88 double getMinIntensity(int which) const;
89 double getMaxIntensity(int which) const;
90
91 void replot(void);
92 void clearData();
93
97 const QColor getUserDefinedLowIntensityColor() const;
99
100 int getAlpha(int which);
101 void setAlpha(int which, int alpha);
102
103 int getNumRows() const;
104
105public slots:
106 void setIntensityColorMapType(const int, const int, const QColor, const QColor);
111 void setPlotPosHalf(bool half);
114 void enableLegend(bool en);
115 void setNumRows(int nrows);
116
117signals:
118 void updatedLowerIntensityLevel(const double);
119 void updatedUpperIntensityLevel(const double);
120
121private:
122 void _updateIntensityRangeDisplay();
123
124 double d_start_frequency;
125 double d_stop_frequency;
126 double d_center_frequency;
127 int d_xaxis_multiplier;
128 bool d_half_freq;
129 bool d_legend_enabled;
130 int d_nrows;
131
132 std::vector<WaterfallData*> d_data;
133
134#if QWT_VERSION < 0x060000
135 std::vector<PlotWaterfall*> d_spectrogram;
136#else
137 std::vector<QwtPlotSpectrogram*> d_spectrogram;
138#endif
139
140 std::vector<int> d_intensity_color_map_type;
141 QColor d_user_defined_low_intensity_color;
142 QColor d_user_defined_high_intensity_color;
143 int d_color_bar_title_font_size;
144};
145
146#endif /* WATERFALL_DISPLAY_PLOT_H */
QWidget base plot to build QTGUI plotting tools.
Definition: DisplayPlot.h:65
QWidget for displaying waterfall (spectrogram) plots.
Definition: WaterfallDisplayPlot.h:48
int getColorMapTitleFontSize() const
void setNumRows(int nrows)
void setIntensityRange(const double minIntensity, const double maxIntensity)
double getStopFrequency() const
void setPlotPosHalf(bool half)
const QColor getUserDefinedLowIntensityColor() const
int getNumRows() const
int getIntensityColorMapType1() const
int color_map_title_font_size
Definition: WaterfallDisplayPlot.h:58
double getMaxIntensity(int which) const
void setIntensityColorMapType1(int)
void updatedLowerIntensityLevel(const double)
void setUserDefinedHighIntensityColor(QColor)
int getAlpha(int which)
const QColor getUserDefinedHighIntensityColor() const
int getIntensityColorMapType(int) const
void setAlpha(int which, int alpha)
QColor high_intensity_color
Definition: WaterfallDisplayPlot.h:56
void setColorMapTitleFontSize(int tfs)
int intensity_color_map_type1
Definition: WaterfallDisplayPlot.h:52
void setUserDefinedLowIntensityColor(QColor)
void plotNewData(const std::vector< double * > dataPoints, const int64_t numDataPoints, const double timePerFFT, const gr::high_res_timer_type timestamp, const int droppedFrames)
void setFrequencyRange(const double, const double, const double units=1000.0, const std::string &strunits="kHz")
QColor low_intensity_color
Definition: WaterfallDisplayPlot.h:54
void enableLegend(bool en)
double getMinIntensity(int which) const
virtual ~WaterfallDisplayPlot()
WaterfallDisplayPlot(int nplots, QWidget *)
void plotNewData(const double *dataPoints, const int64_t numDataPoints, const double timePerFFT, const gr::high_res_timer_type timestamp, const int droppedFrames)
double getStartFrequency() const
void setIntensityColorMapType(const int, const int, const QColor, const QColor)
void updatedUpperIntensityLevel(const double)
signed long long high_res_timer_type
Typedef for the timer tick count.
Definition: high_res_timer.h:49