GNU Radio 3.6.3 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 qtgui_blk
45  *
46  * This is a QT-based graphical sink the takes set of a complex
47  * streams and plots them in the time domain. For each signal, both
48  * the signal's I and Q parts are plotted, and they are all plotted
49  * with a different color, and the \a set_title and \a set_color
50  * functions can be used to change the lable and color for a given
51  * input number.
52  */
54 {
55 private:
57  const std::string &name,
58  int nconnections,
59  QWidget *parent);
60  qtgui_time_sink_c(int size, double bw,
61  const std::string &name,
62  int nconnections,
63  QWidget *parent=NULL);
64 
65  void initialize();
66 
67  int d_size;
68  double d_bandwidth;
69  std::string d_name;
70  int d_nconnections;
71 
72  int d_index;
73  std::vector<double*> d_residbufs;
74 
75  double d_update_time;
76 
77  QWidget *d_parent;
78  TimeDisplayForm *d_main_gui;
79 
80  gruel::high_res_timer_type d_current_time;
81  gruel::high_res_timer_type d_last_time;
82 
83 public:
85  void exec_();
86  QWidget* qwidget();
87  PyObject* pyqwidget();
88 
89  void set_time_domain_axis(double min, double max);
90  void set_update_time(double t);
91  void set_title(int which, const std::string &title);
92  void set_color(int which, const std::string &color);
93 
94  QApplication *d_qApplication;
95 
96  int work (int noutput_items,
97  gr_vector_const_void_star &input_items,
98  gr_vector_void_star &output_items);
99 };
100 
101 #endif /* INCLUDED_QTGUI_TIME_SINK_C_H */