GNU Radio Radar Toolbox
spectrogram_plot.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2014 Communications Engineering Lab, KIT.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#include <complex>
22
23#include <QApplication>
24#include <QTimer>
25#include <QWidget>
26
27#include <qwt_color_map.h>
28#include <qwt_matrix_raster_data.h>
29#include <qwt_plot.h>
30#include <qwt_plot_spectrogram.h>
31#include <qwt_scale_widget.h>
32
33namespace gr {
34namespace radar {
35
36class spectrogram_plot : public QWidget
37{
38 Q_OBJECT
39
40public:
41 spectrogram_plot(int interval,
42 int vlen,
43 std::vector<float>* buffer,
44 std::string label_x,
45 std::string label_y,
46 std::string label,
47 std::vector<float> axis_x,
48 std::vector<float> axis_y,
49 std::vector<float> axis_z,
50 bool autoscale_z,
51 QWidget* parent = 0);
53
54private:
55 int d_interval, d_vlen;
56 std::vector<float> d_axis_x, d_axis_y, d_axis_z;
57 std::vector<float>* d_buffer;
58 bool d_autoscale_z;
59 QTimer* d_timer;
60
61 QwtPlot* d_plot;
62 QwtPlotSpectrogram* d_spectrogram;
63 QwtMatrixRasterData* d_data;
64 QwtLinearColorMap* d_colormap;
65 QwtScaleWidget* d_scale;
66
67 QVector<double> d_plot_data;
68
69protected:
70 void resizeEvent(QResizeEvent* event);
71
72public slots:
73 void refresh();
74};
75} // namespace radar
76} // namespace gr
Definition spectrogram_plot.h:37
spectrogram_plot(int interval, int vlen, std::vector< float > *buffer, std::string label_x, std::string label_y, std::string label, std::vector< float > axis_x, std::vector< float > axis_y, std::vector< float > axis_z, bool autoscale_z, QWidget *parent=0)
void resizeEvent(QResizeEvent *event)
Definition crop_matrix_vcvc.h:28