GNU Radio 3.7.0 C++ API
waterfall_sink_c.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2012 Free Software Foundation, Inc.
00004  *
00005  * This file is part of GNU Radio
00006  *
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  *
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef INCLUDED_QTGUI_WATERFALL_SINK_C_H
00024 #define INCLUDED_QTGUI_WATERFALL_SINK_C_H
00025 
00026 #include <Python.h>
00027 #include <gnuradio/qtgui/api.h>
00028 #include <gnuradio/sync_block.h>
00029 #include <qapplication.h>
00030 #include <gnuradio/filter/firdes.h>
00031 
00032 namespace gr {
00033   namespace qtgui {
00034 
00035     /*!
00036      * \brief A graphical sink to display multiple signals on a
00037      * waterfall (spectrogram) plot.
00038      * \ingroup instrumentation_blk
00039      * \ingroup qtgui_blk
00040      *
00041      * \details
00042      * This is a QT-based graphical sink the takes set of a complex
00043      * streams and plots a waterfall (spectrogram) plot.
00044      *
00045      * Note that unlike the other qtgui sinks, this one does not
00046      * support multiple input streams. We have yet to figure out a
00047      * good way to display multiple, independent signals on this kind
00048      * of a plot. If there are any suggestions or examples of this, we
00049      * would love to see them. Otherwise, to display multiple signals
00050      * here, it's probably best to sum the signals together and
00051      * connect that here.
00052      */
00053     class QTGUI_API waterfall_sink_c : virtual public sync_block
00054     {
00055     public:
00056       // gr::qtgui::waterfall_sink_c::sptr
00057       typedef boost::shared_ptr<waterfall_sink_c> sptr;
00058 
00059 
00060       /*!
00061        * \brief Build a complex waterfall sink.
00062        *
00063        * \param size size of the FFT to compute and display
00064        * \param wintype type of window to apply (see gnuradio/filter/firdes.h)
00065        * \param fc center frequency of signal (use for x-axis labels)
00066        * \param bw bandwidth of signal (used to set x-axis labels)
00067        * \param name title for the plot
00068        * \param nconnections number of signals to be connected to the sink
00069        * \param parent a QWidget parent object, if any
00070        */
00071       static sptr make(int size, int wintype,
00072                        double fc, double bw,
00073                        const std::string &name,
00074                        int nconnections=1,
00075                        QWidget *parent=NULL);
00076 
00077       virtual void exec_() = 0;
00078       virtual PyObject* pyqwidget() = 0;
00079 
00080       virtual void clear_data() = 0;
00081       
00082       virtual void set_fft_size(const int fftsize) = 0;
00083       virtual int fft_size() const = 0;
00084       virtual void set_fft_average(const float fftavg) = 0;
00085       virtual float fft_average() const = 0;
00086       virtual void set_fft_window(const gr::filter::firdes::win_type win) = 0;
00087       virtual gr::filter::firdes::win_type fft_window() = 0;
00088 
00089       virtual void set_frequency_range(const double centerfreq,
00090                                        const double bandwidth) = 0;
00091       virtual void set_intensity_range(const double min,
00092                                        const double max) = 0;
00093 
00094       virtual void set_update_time(double t) = 0;
00095       virtual void set_title(const std::string &title) = 0;
00096       virtual void set_line_label(int which, const std::string &line) = 0;
00097       virtual void set_line_alpha(int which, double alpha) = 0;
00098       virtual void set_color_map(int which, const int color) = 0;
00099 
00100       virtual std::string title() = 0;
00101       virtual std::string line_label(int which) = 0;
00102       virtual double line_alpha(int which) = 0;
00103       virtual int color_map(int which) = 0;
00104 
00105       virtual void set_size(int width, int height) = 0;
00106 
00107       virtual void auto_scale() = 0;
00108       virtual double min_intensity(int which) = 0;
00109       virtual double max_intensity(int which) = 0;
00110 
00111       virtual void enable_menu(bool en=true) = 0;
00112       virtual void enable_grid(bool en=true) = 0;
00113 
00114       QApplication *d_qApplication;
00115     };
00116 
00117   } /* namespace qtgui */
00118 } /* namespace gr */
00119 
00120 #endif /* INCLUDED_QTGUI_WATERFALL_SINK_C_H */