GNU Radio Manual and C++ API Reference  3.7.4.1
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
number_sink.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2014 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_NUMBER_SINK_H
24 #define INCLUDED_QTGUI_NUMBER_SINK_H
25 
26 #ifdef ENABLE_PYTHON
27 #include <Python.h>
28 #endif
29 
30 #include <gnuradio/qtgui/api.h>
33 #include <gnuradio/sync_block.h>
34 #include <qapplication.h>
35 
36 namespace gr {
37  namespace qtgui {
38 
39  /*!
40  * \brief A graphical sink to display numerical values of input streams.
41  * \ingroup instrumentation_blk
42  * \ingroup qtgui_blk
43  *
44  * \details
45  * Number sink
46  */
47  class QTGUI_API number_sink : virtual public sync_block
48  {
49  public:
50 
51  // gr::qtgui::number_sink::sptr
53 
54  /*!
55  * \brief Build a number sink
56  *
57  * \param itemsize Size of input item stream
58  * \param average Averaging coefficient (0 - 1)
59  * \param graph_type Type of graph to use (number_sink::graph_t)
60  * \param nconnections number of signals connected to sink
61  * \param parent a QWidget parent object, if any
62  */
63  static sptr make(size_t itemsize,
64  float average=0,
65  graph_t graph_type=NUM_GRAPH_HORIZ,
66  int nconnections=1,
67  QWidget *parent=NULL);
68 
69  virtual void exec_() = 0;
70  virtual QWidget* qwidget() = 0;
71 
72 #ifdef ENABLE_PYTHON
73  virtual PyObject* pyqwidget() = 0;
74 #else
75  virtual void* pyqwidget() = 0;
76 #endif
77 
78  virtual void set_update_time(double t) = 0;
79  virtual void set_average(const float avg) = 0;
80  virtual void set_graph_type(const graph_t type) = 0;
81  virtual void set_color(int which,
82  const std::string &min,
83  const std::string &max) = 0;
84  virtual void set_color(int which, int min, int max) = 0;
85  virtual void set_label(int which, const std::string &label) = 0;
86  virtual void set_min(int which, float min) = 0;
87  virtual void set_max(int which, float max) = 0;
88 
89  virtual float average() const = 0;
90  virtual graph_t graph_type() const = 0;
91  virtual std::string color_min(int which) const = 0;
92  virtual std::string color_max(int which) const = 0;
93  virtual std::string label(int which) const = 0;
94  virtual float min(int which) const = 0;
95  virtual float max(int which) const = 0;
96 
97  virtual void enable_menu(bool en=true) = 0;
98  virtual void enable_autoscale(bool en=true) = 0;
99 
100  virtual void reset() = 0;
101 
102  QApplication *d_qApplication;
103  };
104 
105  } /* namespace qtgui */
106 } /* namespace gr */
107 
108 #endif /* INCLUDED_QTGUI_NUMBER_SINK_H */
Definition: qtgui_types.h:144
boost::shared_ptr< number_sink > sptr
Definition: number_sink.h:52
float min(float a, float b)
graph_t
Definition: qtgui_types.h:142
A graphical sink to display numerical values of input streams.
Definition: number_sink.h:47
#define QTGUI_API
Definition: gr-qtgui/include/gnuradio/qtgui/api.h:30
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
synchronous 1:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_block.h:37
QApplication * d_qApplication
Definition: number_sink.h:102
BLOCKS_API size_t itemsize(vector_type type)