GNU Radio 3.7.1 C++ API
histogram_sink_f.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2013 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_HISTOGRAM_SINK_F_H
00024 #define INCLUDED_QTGUI_HISTOGRAM_SINK_F_H
00025 
00026 #include <Python.h>
00027 #include <gnuradio/qtgui/api.h>
00028 #include <gnuradio/sync_block.h>
00029 #include <qapplication.h>
00030 
00031 namespace gr {
00032   namespace qtgui {
00033     
00034     /*!
00035      * \brief A graphical sink to display a histogram.
00036      * \ingroup instrumentation_blk
00037      * \ingroup qtgui_blk
00038      *
00039      * \details
00040      * This is a QT-based graphical sink the displays a histogram of
00041      * the data.
00042      */
00043     class QTGUI_API histogram_sink_f : virtual public sync_block
00044     {
00045     public:
00046       // gr::qtgui::histogram_sink_f::sptr
00047       typedef boost::shared_ptr<histogram_sink_f> sptr;
00048 
00049       /*!
00050        * \brief Build floating point histogram sink
00051        *
00052        * \param size number of points to plot at once
00053        * \param bins number of bins to sort the data into
00054        * \param xmin minimum x-axis value
00055        * \param xmax maximum x-axis value
00056        * \param name title for the plot
00057        * \param nconnections number of signals connected to sink
00058        * \param parent a QWidget parent object, if any
00059        */
00060       static sptr make(int size, int bins,
00061                        double xmin, double xmax,
00062                        const std::string &name,
00063                        int nconnections=1,
00064                        QWidget *parent=NULL);
00065 
00066       virtual void exec_() = 0;
00067       virtual PyObject* pyqwidget() = 0;
00068 
00069       virtual void set_y_axis(double min, double max) = 0;
00070       virtual void set_x_axis(double min, double max) = 0;
00071       virtual void set_update_time(double t) = 0;
00072       virtual void set_title(const std::string &title) = 0;
00073       virtual void set_line_label(int which, const std::string &line) = 0;
00074       virtual void set_line_color(int which, const std::string &color) = 0;
00075       virtual void set_line_width(int which, int width) = 0;
00076       virtual void set_line_style(int which, int style) = 0;
00077       virtual void set_line_marker(int which, int marker) = 0;
00078       virtual void set_line_alpha(int which, double alpha) = 0;
00079       virtual void set_nsamps(const int newsize) = 0;
00080       virtual void set_bins(const int bins) = 0;
00081 
00082       virtual std::string title() = 0;
00083       virtual std::string line_label(int which) = 0;
00084       virtual std::string line_color(int which) = 0;
00085       virtual int line_width(int which) = 0;
00086       virtual int line_style(int which) = 0;
00087       virtual int line_marker(int which) = 0;
00088       virtual double line_alpha(int which) = 0;
00089 
00090       virtual void set_size(int width, int height) = 0;
00091 
00092       virtual void enable_menu(bool en=true) = 0;
00093       virtual void enable_grid(bool en=true) = 0;
00094       virtual void enable_autoscale(bool en=true) = 0;
00095       virtual void enable_semilogx(bool en=true) = 0;
00096       virtual void enable_semilogy(bool en=true) = 0;
00097       virtual void enable_accumulate(bool en=true) = 0;
00098       virtual int nsamps() const = 0;
00099       virtual int bins() const = 0;
00100       virtual void reset() = 0;
00101 
00102       QApplication *d_qApplication;
00103     };
00104 
00105   } /* namespace qtgui */
00106 } /* namespace gr */
00107 
00108 #endif /* INCLUDED_QTGUI_HISTOGRAM_SINK_F_H */