GNU Radio 3.6.5 C++ API

qtgui_time_sink_c.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2011 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_SINK_C_H
00024 #define INCLUDED_QTGUI_TIME_SINK_C_H
00025 
00026 #include <Python.h>
00027 #include <gr_qtgui_api.h>
00028 #include <gr_sync_block.h>
00029 #include <gr_firdes.h>
00030 #include <gri_fft.h>
00031 #include <qapplication.h>
00032 #include <timedisplayform.h>
00033 
00034 class qtgui_time_sink_c;
00035 typedef boost::shared_ptr<qtgui_time_sink_c> qtgui_time_sink_c_sptr;
00036 
00037 GR_QTGUI_API qtgui_time_sink_c_sptr qtgui_make_time_sink_c(int size, double bw,
00038                                                            const std::string &name,
00039                                                            int nconnectons=1,
00040                                                            QWidget *parent=NULL);
00041 
00042 /*!
00043  * \brief A graphical sink to display multiple signals in time.
00044  * \ingroup instrumentation_blk
00045  * \ingroup qtgui_blk
00046  *
00047  * \details
00048  * This is a QT-based graphical sink the takes set of a complex
00049  * streams and plots them in the time domain. For each signal, both
00050  * the signal's I and Q parts are plotted, and they are all plotted
00051  * with a different color, and the \a set_title and \a set_color
00052  * functions can be used to change the lable and color for a given
00053  * input number.
00054  */
00055 class GR_QTGUI_API qtgui_time_sink_c : public gr_sync_block
00056 {
00057 private:
00058   friend GR_QTGUI_API qtgui_time_sink_c_sptr qtgui_make_time_sink_c(int size, double bw,
00059                                                                     const std::string &name,
00060                                                                     int nconnections,
00061                                                                     QWidget *parent);
00062   qtgui_time_sink_c(int size, double bw,
00063                     const std::string &name,
00064                     int nconnections,
00065                     QWidget *parent=NULL);
00066 
00067   void initialize();
00068 
00069   int d_size;
00070   double d_bandwidth;
00071   std::string d_name;
00072   int d_nconnections;
00073 
00074   int d_index;
00075   std::vector<double*> d_residbufs;
00076 
00077   double d_update_time;
00078 
00079   QWidget *d_parent;
00080   TimeDisplayForm *d_main_gui;
00081 
00082   gruel::high_res_timer_type d_current_time;
00083   gruel::high_res_timer_type d_last_time;
00084 
00085 public:
00086   ~qtgui_time_sink_c();
00087   void exec_();
00088   QWidget*  qwidget();
00089   PyObject* pyqwidget();
00090 
00091   void set_time_domain_axis(double min, double max);
00092   void set_update_time(double t);
00093   void set_title(int which, const std::string &title);
00094   void set_color(int which, const std::string &color);
00095 
00096   QApplication *d_qApplication;
00097 
00098   int work (int noutput_items,
00099             gr_vector_const_void_star &input_items,
00100             gr_vector_void_star &output_items);
00101 };
00102 
00103 #endif /* INCLUDED_QTGUI_TIME_SINK_C_H */