GNU Radio C++ API Reference: WaterfallDisplayPlot.h Source File

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
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 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef WATERFALL_DISPLAY_PLOT_H
12#define WATERFALL_DISPLAY_PLOT_H
13
14#include <gnuradio/high_res_timer.h>
15#include <gnuradio/qtgui/DisplayPlot.h>
16#include <gnuradio/qtgui/waterfallGlobalData.h>
17#include <qwt_plot_spectrogram.h>
18#include <cstdint>
19#include <cstdio>
20#include <vector>
21
22#include <qwt_interval.h>
23
24/*!
25 * \brief QWidget for displaying waterfall (spectrogram) plots.
26 * \ingroup qtgui_blk
27 */
28 class WaterfallDisplayPlot : public DisplayPlot
29{
30 Q_OBJECT
31
32 Q_PROPERTY(int intensity_color_map_type1 READ getIntensityColorMapType1 WRITE
33 setIntensityColorMapType1)
34 Q_PROPERTY(QColor low_intensity_color READ getUserDefinedLowIntensityColor WRITE
35 setUserDefinedLowIntensityColor)
36 Q_PROPERTY(QColor high_intensity_color READ getUserDefinedHighIntensityColor WRITE
37 setUserDefinedHighIntensityColor)
38 Q_PROPERTY(int color_map_title_font_size READ getColorMapTitleFontSize WRITE
39 setColorMapTitleFontSize)
40
41
42public:
43 WaterfallDisplayPlot(int nplots, QWidget*);
44 ~WaterfallDisplayPlot() override;
45
46 void resetAxis();
47
48 void setFrequencyRange(const double,
49 const double,
50 const double units = 1000.0,
51 const std::string& strunits = "kHz");
52 double getStartFrequency() const;
53 double getStopFrequency() const;
54
55 void plotNewData(const std::vector<const double*> dataPoints,
56 const int64_t numDataPoints,
57 const double timePerFFT,
58 const gr::high_res_timer_type timestamp,
59 const int droppedFrames);
60
61 // to be removed
62 void plotNewData(const double* dataPoints,
63 const int64_t numDataPoints,
64 const double timePerFFT,
65 const gr::high_res_timer_type timestamp,
66 const int droppedFrames);
67
68 void setIntensityRange(const double minIntensity, const double maxIntensity);
69 double getMinIntensity(unsigned int which) const;
70 double getMaxIntensity(unsigned int which) const;
71
72 void replot(void) override;
73 void clearData();
74
75 int getIntensityColorMapType(unsigned int) const;
76 int getIntensityColorMapType1() const;
77 int getColorMapTitleFontSize() const;
78 const QColor getUserDefinedLowIntensityColor() const;
79 const QColor getUserDefinedHighIntensityColor() const;
80
81 int getAlpha(unsigned int which);
82 void setAlpha(unsigned int which, int alpha);
83
84 int getNumRows() const;
85
86public slots:
87 void
88 setIntensityColorMapType(const unsigned int, const int, const QColor, const QColor);
89 void setIntensityColorMapType1(int);
90 void setColorMapTitleFontSize(int tfs);
91 void setUserDefinedLowIntensityColor(QColor);
92 void setUserDefinedHighIntensityColor(QColor);
93 void setPlotPosHalf(bool half);
94 void disableLegend() override;
95 void enableLegend();
96 void enableLegend(bool en);
97 void setNumRows(int nrows);
98
99signals:
100 void updatedLowerIntensityLevel(const double);
101 void updatedUpperIntensityLevel(const double);
102
103private:
104 void _updateIntensityRangeDisplay();
105
106 double d_start_frequency;
107 double d_stop_frequency;
108 double d_center_frequency;
109 int d_xaxis_multiplier;
110 bool d_half_freq;
111 bool d_legend_enabled;
112 int d_nrows;
113
114 std::vector<WaterfallData*> d_data;
115
116 std::vector<QwtPlotSpectrogram*> d_spectrogram;
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 int d_color_bar_title_font_size;
122};
123
124#endif /* WATERFALL_DISPLAY_PLOT_H */
DisplayPlot.h
DisplayPlot::DisplayPlot
DisplayPlot(int nplots, QWidget *)
WaterfallData
Definition waterfallGlobalData.h:20
WaterfallDisplayPlot::setAlpha
void setAlpha(unsigned int which, int alpha)
WaterfallDisplayPlot::getColorMapTitleFontSize
int getColorMapTitleFontSize() const
WaterfallDisplayPlot::plotNewData
void plotNewData(const std::vector< const double * > dataPoints, const int64_t numDataPoints, const double timePerFFT, const gr::high_res_timer_type timestamp, const int droppedFrames)
WaterfallDisplayPlot::setNumRows
void setNumRows(int nrows)
WaterfallDisplayPlot::setIntensityRange
void setIntensityRange(const double minIntensity, const double maxIntensity)
WaterfallDisplayPlot::getStopFrequency
double getStopFrequency() const
WaterfallDisplayPlot::setPlotPosHalf
void setPlotPosHalf(bool half)
WaterfallDisplayPlot::setIntensityColorMapType
void setIntensityColorMapType(const unsigned int, const int, const QColor, const QColor)
WaterfallDisplayPlot::getUserDefinedLowIntensityColor
const QColor getUserDefinedLowIntensityColor() const
WaterfallDisplayPlot::getNumRows
int getNumRows() const
WaterfallDisplayPlot::clearData
void clearData()
WaterfallDisplayPlot::getIntensityColorMapType1
int getIntensityColorMapType1() const
WaterfallDisplayPlot::color_map_title_font_size
int color_map_title_font_size
Definition WaterfallDisplayPlot.h:35
WaterfallDisplayPlot::setIntensityColorMapType1
void setIntensityColorMapType1(int)
WaterfallDisplayPlot::updatedLowerIntensityLevel
void updatedLowerIntensityLevel(const double)
WaterfallDisplayPlot::resetAxis
void resetAxis()
WaterfallDisplayPlot::disableLegend
void disableLegend() override
WaterfallDisplayPlot::setUserDefinedHighIntensityColor
void setUserDefinedHighIntensityColor(QColor)
WaterfallDisplayPlot::getMaxIntensity
double getMaxIntensity(unsigned int which) const
WaterfallDisplayPlot::getUserDefinedHighIntensityColor
const QColor getUserDefinedHighIntensityColor() const
WaterfallDisplayPlot::high_intensity_color
QColor high_intensity_color
Definition WaterfallDisplayPlot.h:34
WaterfallDisplayPlot::setColorMapTitleFontSize
void setColorMapTitleFontSize(int tfs)
WaterfallDisplayPlot::intensity_color_map_type1
int intensity_color_map_type1
Definition WaterfallDisplayPlot.h:32
WaterfallDisplayPlot::setUserDefinedLowIntensityColor
void setUserDefinedLowIntensityColor(QColor)
WaterfallDisplayPlot::getIntensityColorMapType
int getIntensityColorMapType(unsigned int) const
WaterfallDisplayPlot::setFrequencyRange
void setFrequencyRange(const double, const double, const double units=1000.0, const std::string &strunits="kHz")
WaterfallDisplayPlot::low_intensity_color
QColor low_intensity_color
Definition WaterfallDisplayPlot.h:33
WaterfallDisplayPlot::enableLegend
void enableLegend()
WaterfallDisplayPlot::getAlpha
int getAlpha(unsigned int which)
WaterfallDisplayPlot::WaterfallDisplayPlot
WaterfallDisplayPlot(int nplots, QWidget *)
WaterfallDisplayPlot::replot
void replot(void) override
WaterfallDisplayPlot::getMinIntensity
double getMinIntensity(unsigned int which) const
WaterfallDisplayPlot::getStartFrequency
double getStartFrequency() const
WaterfallDisplayPlot::updatedUpperIntensityLevel
void updatedUpperIntensityLevel(const double)
high_res_timer.h
gr
GNU Radio logging wrapper.
Definition basic_block.h:29
std
STL namespace.
waterfallGlobalData.h