Loading...
Searching...
No Matches
matrix_sink.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2023 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef INCLUDED_QTGUI_MATRIX_SINK_H
#define INCLUDED_QTGUI_MATRIX_SINK_H
#include <gnuradio/qtgui/api.h>
#include <gnuradio/sync_block.h>
#include <qapplication.h>
#include <QWidget>
namespace gr {
namespace qtgui {
/*!
* \brief A graphical sink that displays a matrix.
* \ingroup qtgui
* \ingroup qtgui_blk
*
* \details
* This block displays a matrix as a 2D plot. The matrix is
* displayed as a contour plot, with the color of each contour
* determined by the value of the matrix at that point.
*
* The matrix is displayed as a 2D plot, with the x and y axes
* corresponding to the row and column indices of the matrix,
* respectively. The z axis corresponds to the value of the
* matrix at that point.
*
*/
class QTGUI_API matrix_sink : virtual public gr::sync_block
{
public:
// gr::qtgui::matrix_sink::sptr
typedef std::shared_ptr<matrix_sink> sptr;
/*!
* \brief Build a matrix sink block.
*
* \param name The name of the block.
* \param num_cols The number of columns in the matrix.
* \param vlen The vector length of the matrix.
* \param contour Whether or not to display the matrix as a contour plot.
* \param color_map The color map to use for the contour plot.
* \param interpolation The interpolation method to use for the contour plot.
* \param x_start The starting value of the x axis.
* \param x_end The ending value of the x axis.
* \param y_start The starting value of the y axis.
* \param y_end The ending value of the y axis.
* \param z_max The maximum value of the z axis.
* \param z_min The minimum value of the z axis.
* \param x_axis_label The label for the x axis.
* \param y_axis_label The label for the y axis.
* \param z_axis_label The label for the z axis.
* \param parent The parent QWidget.
*/
static sptr make(const std::string& name,
unsigned int num_cols,
unsigned int vlen,
bool contour,
const std::string& color_map,
const std::string& interpolation,
QWidget* parent = nullptr);
virtual void exec_() = 0;
virtual QWidget* qwidget() = 0;
virtual void set_x_start(double x_start) = 0;
virtual void set_x_end(double x_end) = 0;
virtual void set_y_start(double y_start) = 0;
virtual void set_y_end(double y_end) = 0;
virtual void set_z_max(double z_max) = 0;
virtual void set_z_min(double z_min) = 0;
virtual void set_x_axis_label(const std::string& x_axis_label) = 0;
virtual void set_y_axis_label(const std::string& y_axis_label) = 0;
virtual void set_z_axis_label(const std::string& z_axis_label) = 0;
};
} // namespace qtgui
} // namespace gr
#endif /* INCLUDED_QTGUI_MATRIX_SINK_H */
gr::basic_block::name
std::string name() const
Definition basic_block.h:168
gr::qtgui::matrix_sink
A graphical sink that displays a matrix.
Definition matrix_sink.h:38
gr::qtgui::matrix_sink::set_z_max
virtual void set_z_max(double z_max)=0
gr::qtgui::matrix_sink::set_z_axis_label
virtual void set_z_axis_label(const std::string &z_axis_label)=0
gr::qtgui::matrix_sink::set_y_axis_label
virtual void set_y_axis_label(const std::string &y_axis_label)=0
gr::qtgui::matrix_sink::set_y_start
virtual void set_y_start(double y_start)=0
gr::qtgui::matrix_sink::set_x_start
virtual void set_x_start(double x_start)=0
gr::qtgui::matrix_sink::sptr
std::shared_ptr< matrix_sink > sptr
Definition matrix_sink.h:41
gr::qtgui::matrix_sink::set_z_min
virtual void set_z_min(double z_min)=0
gr::qtgui::matrix_sink::set_x_axis_label
virtual void set_x_axis_label(const std::string &x_axis_label)=0
gr::qtgui::matrix_sink::qwidget
virtual QWidget * qwidget()=0
gr::qtgui::matrix_sink::set_x_end
virtual void set_x_end(double x_end)=0
gr::qtgui::matrix_sink::set_y_end
virtual void set_y_end(double y_end)=0
gr::qtgui::matrix_sink::make
static sptr make(const std::string &name, unsigned int num_cols, unsigned int vlen, bool contour, const std::string &color_map, const std::string &interpolation, QWidget *parent=nullptr)
Build a matrix sink block.
gr::qtgui::matrix_sink::exec_
virtual void exec_()=0
gr::sync_block
synchronous 1:1 input to output with history
Definition sync_block.h:26
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
GNU Radio logging wrapper.
Definition basic_block.h:29
sync_block.h