GNU Radio 3.6.5.1 C++ API
qtgui_time_sink_c.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2011 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_TIME_SINK_C_H
24 #define INCLUDED_QTGUI_TIME_SINK_C_H
25 
26 #include <Python.h>
27 #include <gr_qtgui_api.h>
28 #include <gr_sync_block.h>
29 #include <gr_firdes.h>
30 #include <gri_fft.h>
31 #include <qapplication.h>
32 #include <timedisplayform.h>
33 
34 class qtgui_time_sink_c;
36 
38  const std::string &name,
39  int nconnectons=1,
40  QWidget *parent=NULL);
41 
42 /*!
43  * \brief A graphical sink to display multiple signals in time.
44  * \ingroup instrumentation_blk
45  * \ingroup qtgui_blk
46  *
47  * \details
48  * This is a QT-based graphical sink the takes set of a complex
49  * streams and plots them in the time domain. For each signal, both
50  * the signal's I and Q parts are plotted, and they are all plotted
51  * with a different color, and the \a set_title and \a set_color
52  * functions can be used to change the lable and color for a given
53  * input number.
54  */
56 {
57 private:
59  const std::string &name,
60  int nconnections,
61  QWidget *parent);
62  qtgui_time_sink_c(int size, double bw,
63  const std::string &name,
64  int nconnections,
65  QWidget *parent=NULL);
66 
67  void initialize();
68 
69  int d_size;
70  double d_bandwidth;
71  std::string d_name;
72  int d_nconnections;
73 
74  int d_index;
75  std::vector<double*> d_residbufs;
76 
77  double d_update_time;
78 
79  QWidget *d_parent;
80  TimeDisplayForm *d_main_gui;
81 
82  gruel::high_res_timer_type d_current_time;
83  gruel::high_res_timer_type d_last_time;
84 
85 public:
87  void exec_();
88  QWidget* qwidget();
89  PyObject* pyqwidget();
90 
91  void set_time_domain_axis(double min, double max);
92  void set_update_time(double t);
93  void set_title(int which, const std::string &title);
94  void set_color(int which, const std::string &color);
95 
96  QApplication *d_qApplication;
97 
98  int work (int noutput_items,
99  gr_vector_const_void_star &input_items,
100  gr_vector_void_star &output_items);
101 };
102 
103 #endif /* INCLUDED_QTGUI_TIME_SINK_C_H */