GNU Radio 3.4.0 C++ API
ConstellationDisplayPlot.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2008,2009,2010,2011 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_HPP
00024 #define CONSTELLATION_DISPLAY_PLOT_HPP
00025 
00026 #include <stdint.h>
00027 #include <cstdio>
00028 #include <qwt_plot.h>
00029 #include <qwt_painter.h>
00030 #include <qwt_plot_canvas.h>
00031 #include <qwt_plot_curve.h>
00032 #include <qwt_scale_engine.h>
00033 #include <qwt_scale_widget.h>
00034 #include <qwt_plot_zoomer.h>
00035 #include <qwt_plot_panner.h>
00036 #include <qwt_plot_marker.h>
00037 #include <gruel/high_res_timer.h>
00038 #include <qwt_symbol.h>
00039 #include <qtgui_util.h>
00040 
00041 class ConstellationDisplayPlot : public QwtPlot
00042 {
00043   Q_OBJECT
00044 
00045 public:
00046   ConstellationDisplayPlot(QWidget*);
00047   virtual ~ConstellationDisplayPlot();
00048 
00049   void PlotNewData(const double* realDataPoints, 
00050                    const double* imagDataPoints, 
00051                    const int64_t numDataPoints,
00052                    const double timeInterval);
00053     
00054   virtual 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 resizeSlot( QSize *s );
00064 
00065   void OnPickerPointSelected(const QwtDoublePoint & p);
00066 
00067 signals:
00068   void plotPointSelected(const QPointF p);
00069 
00070 protected slots:
00071   void LegendEntryChecked(QwtPlotItem *plotItem, bool on);
00072 
00073 protected:
00074 
00075 private:
00076   QwtPlotCurve* _plot_curve;
00077 
00078   QwtPlotPanner* _panner;
00079   QwtPlotZoomer* _zoomer;
00080   
00081   QwtDblClickPlotPicker *_picker;
00082 
00083   double* _realDataPoints;
00084   double* _imagDataPoints;
00085 
00086   gruel::high_res_timer_type _lastReplot;
00087 
00088   int64_t _numPoints;
00089   int64_t _penSize;
00090 };
00091 
00092 #endif /* CONSTELLATION_DISPLAY_PLOT_HPP */