GNU Radio C++ API Reference: const_sink_c.h Source File

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
const_sink_c.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2012,2014-2015 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDED_QTGUI_CONST_SINK_C_H
12#define INCLUDED_QTGUI_CONST_SINK_C_H
13
14#include <gnuradio/filter/firdes.h>
15#include <gnuradio/qtgui/api.h>
16#include <gnuradio/qtgui/trigger_mode.h>
17#include <gnuradio/sync_block.h>
18#include <qapplication.h>
19
20namespace gr {
21namespace qtgui {
22
23/*!
24 * \brief A graphical sink to display the IQ constellation of multiple signals.
25 * \ingroup instrumentation_blk
26 * \ingroup qtgui_blk
27 *
28 * \details
29 * This is a QT-based graphical sink the takes set of a complex
30 * streams and plots them on an IQ constellation plot.
31 *
32 * The sink supports plotting streaming complex data or
33 * messages. The message port is named "in". The two modes cannot
34 * be used simultaneously, and \p nconnections should be set to 0
35 * when using the message mode. GRC handles this issue by
36 * providing the "Complex Message" type that removes the streaming
37 * port(s).
38 *
39 * This sink can plot messages that contain either uniform vectors
40 * of complex 32 values (pmt::is_c32vector) or PDUs where the data
41 * is a uniform vector of complex 32 values.
42 */
43 class QTGUI_API const_sink_c : virtual public sync_block
44{
45public:
46 // gr::qtgui::const_sink_c::sptr
47 typedef std::shared_ptr<const_sink_c> sptr;
48
49 /*!
50 * \brief Build a constellation plot sink.
51 *
52 * \param size number of points to plot at once
53 * \param name title for the plot
54 * \param nconnections number of signals connected to sink
55 * \param parent a QWidget parent object, if any
56 */
57 static sptr
58 make(int size, const std::string& name, int nconnections = 1, QWidget* parent = NULL);
59
60 virtual void exec_() = 0;
61 virtual QWidget* qwidget() = 0;
62
63 virtual void set_y_axis(double min, double max) = 0;
64 virtual void set_x_axis(double min, double max) = 0;
65
66 virtual void set_update_time(double t) = 0;
67 virtual void set_title(const std::string& title) = 0;
68 virtual void set_line_label(unsigned int which, const std::string& label) = 0;
69 virtual void set_line_color(unsigned int which, const std::string& color) = 0;
70 virtual void set_line_width(unsigned int which, int width) = 0;
71 virtual void set_line_style(unsigned int which, int style) = 0;
72 virtual void set_line_marker(unsigned int which, int marker) = 0;
73 virtual void set_nsamps(const int newsize) = 0;
74 virtual void set_line_alpha(unsigned int which, double alpha) = 0;
75
76 /*!
77 * Set up a trigger for the sink to know when to start
78 * plotting. Useful to isolate events and avoid noise.
79 *
80 * The trigger modes are Free, Auto, Normal, and Tag (see
81 * gr::qtgui::trigger_mode). The first three are like a normal
82 * oscope trigger function. Free means free running with no
83 * trigger, auto will trigger if the trigger event is seen, but
84 * will still plot otherwise, and normal will hold until the
85 * trigger event is observed. The Tag trigger mode allows us to
86 * trigger off a specific stream tag. The tag trigger is based
87 * only on the name of the tag, so when a tag of the given name
88 * is seen, the trigger is activated.
89 *
90 * In auto and normal mode, we look for the slope of the
91 * magnitude of the signal. As a constellation sink, this only
92 * takes in complex numbers to plot. Given a
93 * gr::qtgui::trigger_slope as either Positive or Negative, if
94 * the magnitude between two samples moves in the given
95 * direction (x[1] > x[0] for Positive or x[1] < x[0] for
96 * Negative), then the trigger is activated.
97 *
98 * \param mode The trigger_mode: free, auto, normal, or tag.
99 * \param slope The trigger_slope: positive or negative. Only
100 * used for auto and normal modes.
101 * \param level The magnitude of the trigger even for auto or normal modes.
102 * \param channel Which input channel to use for the trigger events.
103 * \param tag_key The name (as a string) of the tag to trigger off
104 * of if using the tag mode.
105 */
106 virtual void set_trigger_mode(trigger_mode mode,
107 trigger_slope slope,
108 float level,
109 int channel,
110 const std::string& tag_key = "") = 0;
111
112 virtual std::string title() = 0;
113 virtual std::string line_label(unsigned int which) = 0;
114 virtual std::string line_color(unsigned int which) = 0;
115 virtual int line_width(unsigned int which) = 0;
116 virtual int line_style(unsigned int which) = 0;
117 virtual int line_marker(unsigned int which) = 0;
118 virtual double line_alpha(unsigned int which) = 0;
119
120 virtual void set_size(int width, int height) = 0;
121
122 virtual void enable_menu(bool en = true) = 0;
123 virtual void enable_autoscale(bool en) = 0;
124 virtual void enable_grid(bool en) = 0;
125 virtual void enable_axis_labels(bool en = true) = 0;
126 virtual void disable_legend() = 0;
127 virtual int nsamps() const = 0;
128 virtual void reset() = 0;
129
130 // Disallow copy/move because of the pointer.
131 const_sink_c(const const_sink_c&) = delete;
132 const_sink_c& operator=(const const_sink_c&) = delete;
133 const_sink_c(const_sink_c&&) = delete;
134 const_sink_c& operator=(const_sink_c&&) = delete;
135
136 QApplication* d_qApplication;
137
138protected:
139 const_sink_c() = default;
140};
141
142} /* namespace qtgui */
143} /* namespace gr */
144
145#endif /* INCLUDED_QTGUI_CONST_SINK_C_H */
gr::basic_block::color
vcolor color() const
Definition basic_block.h:122
gr::basic_block::name
std::string name() const
Definition basic_block.h:168
gr::qtgui::const_sink_c::nsamps
virtual int nsamps() const =0
gr::qtgui::const_sink_c::reset
virtual void reset()=0
gr::qtgui::const_sink_c::set_line_width
virtual void set_line_width(unsigned int which, int width)=0
gr::qtgui::const_sink_c::exec_
virtual void exec_()=0
gr::qtgui::const_sink_c::line_marker
virtual int line_marker(unsigned int which)=0
gr::qtgui::const_sink_c::set_x_axis
virtual void set_x_axis(double min, double max)=0
gr::qtgui::const_sink_c::line_color
virtual std::string line_color(unsigned int which)=0
gr::qtgui::const_sink_c::d_qApplication
QApplication * d_qApplication
Definition const_sink_c.h:136
gr::qtgui::const_sink_c::line_alpha
virtual double line_alpha(unsigned int which)=0
gr::qtgui::const_sink_c::operator=
const_sink_c & operator=(const const_sink_c &)=delete
gr::qtgui::const_sink_c::set_line_style
virtual void set_line_style(unsigned int which, int style)=0
gr::qtgui::const_sink_c::const_sink_c
const_sink_c(const_sink_c &&)=delete
gr::qtgui::const_sink_c::line_style
virtual int line_style(unsigned int which)=0
gr::qtgui::const_sink_c::set_size
virtual void set_size(int width, int height)=0
gr::qtgui::const_sink_c::set_trigger_mode
virtual void set_trigger_mode(trigger_mode mode, trigger_slope slope, float level, int channel, const std::string &tag_key="")=0
gr::qtgui::const_sink_c::sptr
std::shared_ptr< const_sink_c > sptr
Definition const_sink_c.h:47
gr::qtgui::const_sink_c::set_nsamps
virtual void set_nsamps(const int newsize)=0
gr::qtgui::const_sink_c::enable_grid
virtual void enable_grid(bool en)=0
gr::qtgui::const_sink_c::qwidget
virtual QWidget * qwidget()=0
gr::qtgui::const_sink_c::const_sink_c
const_sink_c()=default
gr::qtgui::const_sink_c::enable_menu
virtual void enable_menu(bool en=true)=0
gr::qtgui::const_sink_c::set_y_axis
virtual void set_y_axis(double min, double max)=0
gr::qtgui::const_sink_c::set_title
virtual void set_title(const std::string &title)=0
gr::qtgui::const_sink_c::title
virtual std::string title()=0
gr::qtgui::const_sink_c::set_update_time
virtual void set_update_time(double t)=0
gr::qtgui::const_sink_c::set_line_color
virtual void set_line_color(unsigned int which, const std::string &color)=0
gr::qtgui::const_sink_c::make
static sptr make(int size, const std::string &name, int nconnections=1, QWidget *parent=NULL)
Build a constellation plot sink.
gr::qtgui::const_sink_c::enable_axis_labels
virtual void enable_axis_labels(bool en=true)=0
gr::qtgui::const_sink_c::set_line_alpha
virtual void set_line_alpha(unsigned int which, double alpha)=0
gr::qtgui::const_sink_c::line_label
virtual std::string line_label(unsigned int which)=0
gr::qtgui::const_sink_c::disable_legend
virtual void disable_legend()=0
gr::qtgui::const_sink_c::set_line_marker
virtual void set_line_marker(unsigned int which, int marker)=0
gr::qtgui::const_sink_c::const_sink_c
const_sink_c(const const_sink_c &)=delete
gr::qtgui::const_sink_c::operator=
const_sink_c & operator=(const_sink_c &&)=delete
gr::qtgui::const_sink_c::set_line_label
virtual void set_line_label(unsigned int which, const std::string &label)=0
gr::qtgui::const_sink_c::line_width
virtual int line_width(unsigned int which)=0
gr::qtgui::const_sink_c::enable_autoscale
virtual void enable_autoscale(bool en)=0
gr::sync_block::sync_block
sync_block(void)
Definition sync_block.h:28
firdes.h
api.h
QTGUI_API
#define QTGUI_API
Definition gr-qtgui/include/gnuradio/qtgui/api.h:18
gr::qtgui
Definition ber_sink_b.h:20
gr::qtgui::trigger_mode
trigger_mode
Definition trigger_mode.h:17
gr::qtgui::trigger_slope
trigger_slope
Definition trigger_mode.h:24
gr
GNU Radio logging wrapper.
Definition basic_block.h:29
sync_block.h
trigger_mode.h