GNU Radio 3.7.1 C++ API
time_raster_sink_b.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2012,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_TIME_RASTER_SINK_B_H
00024 #define INCLUDED_QTGUI_TIME_RASTER_SINK_B_H
00025 
00026 #include <Python.h>
00027 #include <gnuradio/qtgui/api.h>
00028 #include <gnuradio/sync_block.h>
00029 #include <qapplication.h>
00030 #include <qwt_symbol.h>
00031 
00032 namespace gr {
00033   namespace qtgui {
00034 
00035     /*!
00036      * \brief A graphical sink to display multiple signals on a
00037      * time_raster plot.
00038      * \ingroup instrumentation_blk
00039      * \ingroup qtgui_blk
00040      *
00041      * \details
00042      * This is a QT-based graphical sink that takes in byte
00043      * streams and plots a time_raster (spectrogram) plot.
00044      *
00045      * Input stream: This expects a bit stream (0, 1 in the LSB of a
00046      * byte). It will display packed bytes but the display will have
00047      * to be autoscaled.
00048      */
00049     class QTGUI_API time_raster_sink_b : virtual public sync_block
00050     {
00051     public:
00052       // gr::qtgui::time_raster_sink_b::sptr
00053       typedef boost::shared_ptr<time_raster_sink_b> sptr;
00054 
00055       /*!
00056        * \brief Build a bit time raster sink.
00057        *
00058        * \param samp_rate sample rate of signal
00059        * \param cols number of cols to plot
00060        * \param rows number of rows to plot
00061        * \param mult vector of floats as a scaling multiplier for each input stream
00062        * \param offset vector of floats as an offset for each input stream
00063        * \param name title for the plot
00064        * \param nconnections number of streams connected
00065        * \param parent a QWidget parent object, if any
00066        */
00067       static sptr make(double samp_rate,
00068                        double rows, double cols,
00069                        const std::vector<float> &mult,
00070                        const std::vector<float> &offset,
00071                        const std::string &name,
00072                        int nconnections=1,
00073                        QWidget *parent=NULL);
00074 
00075       virtual void exec_() = 0;
00076       virtual PyObject* pyqwidget() = 0;
00077 
00078       virtual void set_update_time(double t) = 0;
00079       virtual void set_title(const std::string &title) = 0;
00080       virtual void set_line_label(int which, const std::string &lable) = 0;
00081       virtual void set_line_color(int which, const std::string &color) = 0;
00082       virtual void set_line_width(int which, int width) = 0;
00083       virtual void set_line_style(int which, Qt::PenStyle style) = 0;
00084       virtual void set_line_marker(int which, QwtSymbol::Style marker) = 0;
00085       virtual void set_line_alpha(int which, double alpha) = 0;
00086       virtual void set_color_map(int which, const int color) = 0;
00087 
00088       virtual std::string title() = 0;
00089       virtual std::string line_label(int which) = 0;
00090       virtual std::string line_color(int which) = 0;
00091       virtual int line_width(int which) = 0;
00092       virtual int line_style(int which) = 0;
00093       virtual int line_marker(int which) = 0;
00094       virtual double line_alpha(int which) = 0;
00095       virtual int color_map(int which) = 0;
00096 
00097       virtual void set_size(int width, int height) = 0;
00098 
00099       virtual void set_samp_rate(const double samp_rate) = 0;
00100       virtual void set_num_rows(double rows) = 0;
00101       virtual void set_num_cols(double cols) = 0;
00102 
00103       virtual double num_rows() = 0;
00104       virtual double num_cols() = 0;
00105 
00106       virtual void set_multiplier(const std::vector<float> &mult) = 0;
00107       virtual void set_offset(const std::vector<float> &offset) = 0;
00108 
00109       virtual void set_intensity_range(float min, float max) = 0;
00110 
00111       virtual void enable_menu(bool en) = 0;
00112       virtual void enable_grid(bool en) = 0;
00113       virtual void enable_autoscale(bool en) = 0;
00114       virtual void reset() = 0;
00115 
00116       QApplication *d_qApplication;
00117     };
00118 
00119   } /* namespace qtgui */
00120 } /* namespace gr */
00121 
00122 #endif /* INCLUDED_QTGUI_TIME_RASTER_SINK_B_H */