GNU Radio 3.5.3.2 C++ API
qtgui_time_sink_f.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_F_H
24 #define INCLUDED_QTGUI_TIME_SINK_F_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_f;
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 float streams
47  * and plots them in the time domain. Each signal is plotted with a
48  * different color, and the \a set_title and \a set_color functions
49  * can be used to change the lable and color for a given input number.
50  */
52 {
53 private:
55  const std::string &name,
56  int nconnections,
57  QWidget *parent);
58  qtgui_time_sink_f(int size, double bw,
59  const std::string &name,
60  int nconnections,
61  QWidget *parent=NULL);
62 
63  void initialize();
64 
65  int d_size;
66  double d_bandwidth;
67  std::string d_name;
68  int d_nconnections;
69 
70  int d_index;
71  std::vector<double*> d_residbufs;
72 
73  double d_update_time;
74 
75  QWidget *d_parent;
76  TimeDisplayForm *d_main_gui;
77 
78  gruel::high_res_timer_type d_current_time;
79  gruel::high_res_timer_type d_last_time;
80 
81 public:
83  void exec_();
84  QWidget* qwidget();
85  PyObject* pyqwidget();
86 
87  void set_time_domain_axis(double min, double max);
88  void set_update_time(double t);
89  void set_title(int which, const std::string &title);
90  void set_color(int which, const std::string &color);
91 
92  QApplication *d_qApplication;
93 
94  int work (int noutput_items,
95  gr_vector_const_void_star &input_items,
96  gr_vector_void_star &output_items);
97 };
98 
99 #endif /* INCLUDED_QTGUI_TIME_SINK_F_H */