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_interval.h>
29#include <qwt_matrix_raster_data.h>
30#include <qwt_plot.h>
31#include <qwt_plot_spectrogram.h>
32#include <qwt_scale_widget.h>
33
34namespace gr {
35namespace radar {
36
37class spectrogram_plot : public QWidget
38{
39 Q_OBJECT
40
41public:
42 spectrogram_plot(int interval,
43 int vlen,
44 std::vector<float>* buffer,
45 std::string label_x,
46 std::string label_y,
47 std::string label,
48 std::vector<float> axis_x,
49 std::vector<float> axis_y,
50 std::vector<float> axis_z,
51 bool autoscale_z,
52 QWidget* parent = 0);
54
55private:
56 int d_interval, d_vlen;
57 std::vector<float> d_axis_x, d_axis_y, d_axis_z;
58 std::vector<float>* d_buffer;
59 bool d_autoscale_z;
60 QTimer* d_timer;
61
62 QwtPlot* d_plot;
63 QwtPlotSpectrogram* d_spectrogram;
64 QwtMatrixRasterData* d_data;
65 QwtLinearColorMap* d_colormap;
66 QwtScaleWidget* d_scale;
67
68 QVector<double> d_plot_data;
69
70protected:
71 void resizeEvent(QResizeEvent* event);
72
73public slots:
74 void refresh();
75};
76} // namespace radar
77} // namespace gr
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:29
Definition crop_matrix_vcvc.h:28