Statistics
| Branch: | Tag: | Revision:

root / gr-qtgui / include / qtgui / waterfall_sink_f.h @ 14f4e314

History | View | Annotate | Download (3.4 kB)

1
/* -*- c++ -*- */
2
/*
3
 * Copyright 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 INCLUDED_QTGUI_WATERFALL_SINK_F_H
24
#define INCLUDED_QTGUI_WATERFALL_SINK_F_H
25
26
#include <qtgui/api.h>
27
#include <gr_sync_block.h>
28
29
#include <Python.h>
30
#include <qapplication.h>
31
#include <qwt_symbol.h>
32
33
namespace gr {
34
  namespace qtgui {
35
36
    /*!
37
     * \brief A graphical sink to display multiple signals on a
38
     * waterfall (spectrogram) plot.
39
     * \ingroup qtgui_blk
40
     *
41
     * This is a QT-based graphical sink the takes set of a floating
42
     * point streams and plots a waterfall (spectrogram) plot.
43
     *
44
     * Note that unlike the other qtgui sinks, this one does not
45
     * support multiple input streams. We have yet to figure out a
46
     * good way to display multiple, independent signals on this kind
47
     * of a plot. If there are any suggestions or examples of this, we
48
     * would love to see them. Otherwise, to display multiple signals
49
     * here, it's probably best to sum the signals together and
50
     * connect that here.
51
     */
52
    class QTGUI_API waterfall_sink_f : virtual public gr_sync_block
53
    {
54
    public:
55
      // gr::qtgui::waterfall_sink_f::sptr
56
      typedef boost::shared_ptr<waterfall_sink_f> sptr;
57
58
      /*!
59
       * \brief Build a floating point waterfall sink.
60
       *
61
       * \param size size of the FFT to compute and display
62
       * \param wintype type of window to apply (see filter/firdes.h)
63
       * \param fc center frequency of signal (use for x-axis labels)
64
       * \param bw bandwidth of signal (used to set x-axis labels)
65
       * \param name title for the plot
66
       * \param parent a QWidget parent object, if any
67
       */
68
      static sptr make(int size, int wintype,
69
                       double fc, double bw,
70
                       const std::string &name,
71
                       QWidget *parent=NULL);
72
73
      virtual void exec_() = 0;
74
      virtual PyObject* pyqwidget() = 0;
75
76
      virtual void set_fft_size(const int fftsize) = 0;
77
      virtual int fft_size() const = 0;
78
      virtual void set_fft_average(const float fftavg) = 0;
79
      virtual float fft_average() const = 0;
80
81
      virtual void set_frequency_range(const double centerfreq,
82
                                       const double bandwidth) = 0;
83
84
      virtual void set_update_time(double t) = 0;
85
      virtual void set_title(const std::string &title) = 0;
86
      virtual void set_color(const std::string &color) = 0;
87
      virtual void set_line_width(int width) = 0;
88
      virtual void set_line_style(Qt::PenStyle style) = 0;
89
      virtual void set_line_marker(QwtSymbol::Style marker) = 0;
90
91
      virtual void set_size(int width, int height) = 0;
92
93
      QApplication *d_qApplication;
94
    };
95
96
  } /* namespace qtgui */
97
} /* namespace gr */
98
99
#endif /* INCLUDED_QTGUI_WATERFALL_SINK_F_H */