GNU Radio 3.7.0 C++ API
TimeDomainDisplayPlot.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 TIME_DOMAIN_DISPLAY_PLOT_H
00024 #define TIME_DOMAIN_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 time domain plots.
00033  * \ingroup qtgui_blk
00034  */
00035 class TimeDomainDisplayPlot: public DisplayPlot
00036 {
00037   Q_OBJECT
00038 
00039 public:
00040   TimeDomainDisplayPlot(int nplots, QWidget*);
00041   virtual ~TimeDomainDisplayPlot();
00042 
00043   void plotNewData(const std::vector<double*> dataPoints,
00044                    const int64_t numDataPoints, const double timeInterval);
00045 
00046   void replot();
00047 
00048   void stemPlot(bool en);
00049 
00050 public slots:
00051   void setSampleRate(double sr, double units,
00052                      const std::string &strunits);
00053 
00054   void setAutoScale(bool state);
00055   void setSemilogx(bool en);
00056   void setSemilogy(bool en);
00057 
00058 private:
00059   void _resetXAxisPoints();
00060   void _autoScale(double bottom, double top);
00061 
00062   std::vector<double*> _dataPoints;
00063   double* _xAxisPoints;
00064 
00065   double _sampleRate;
00066 
00067   bool d_semilogx;
00068   bool d_semilogy;
00069 };
00070 
00071 #endif /* TIME_DOMAIN_DISPLAY_PLOT_H */