GNU Radio 3.7.0 C++ API
ConstellationDisplayPlot.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2008-2012 Free Software Foundation, Inc.
00004  *
00005  * This file is part of GNU Radio
00006  *
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  *
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef CONSTELLATION_DISPLAY_PLOT_H
00024 #define CONSTELLATION_DISPLAY_PLOT_H
00025 
00026 #include <stdint.h>
00027 #include <cstdio>
00028 #include <vector>
00029 #include <gnuradio/qtgui/DisplayPlot.h>
00030 
00031 /*!
00032  * \brief QWidget for displaying constellaton (I&Q) plots.
00033  * \ingroup qtgui_blk
00034  */
00035 class ConstellationDisplayPlot : public DisplayPlot
00036 {
00037   Q_OBJECT
00038 
00039 public:
00040   ConstellationDisplayPlot(int nplots, QWidget*);
00041   virtual ~ConstellationDisplayPlot();
00042 
00043   void plotNewData(const std::vector<double*> realDataPoints,
00044                    const std::vector<double*> imagDataPoints,
00045                    const int64_t numDataPoints,
00046                    const double timeInterval);
00047 
00048   // Old method to be removed
00049   void plotNewData(const double* realDataPoints,
00050                    const double* imagDataPoints,
00051                    const int64_t numDataPoints,
00052                    const double timeInterval);
00053 
00054   void replot();
00055 
00056   void set_xaxis(double min, double max);
00057   void set_yaxis(double min, double max);
00058   void set_axis(double xmin, double xmax,
00059                 double ymin, double ymax);
00060   void set_pen_size(int size);
00061 
00062 public slots:
00063   void setAutoScale(bool state);
00064 
00065 private:
00066   void _autoScale(double bottom, double top);
00067 
00068   std::vector<double*> _realDataPoints;
00069   std::vector<double*> _imagDataPoints;
00070 
00071   int64_t _penSize;
00072 };
00073 
00074 #endif /* CONSTELLATION_DISPLAY_PLOT_H */