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