GNU Radio 3.7.1 C++ API
HistogramDisplayPlot.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2013 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 HISTOGRAM_DISPLAY_PLOT_H
00024 #define HISTOGRAM_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 HistogramDisplayPlot: public DisplayPlot
00036 {
00037   Q_OBJECT
00038 
00039 public:
00040   HistogramDisplayPlot(int nplots, QWidget*);
00041   virtual ~HistogramDisplayPlot();
00042 
00043   void plotNewData(const std::vector<double*> dataPoints,
00044                    const int64_t numDataPoints, const double timeInterval);
00045 
00046   void replot();
00047 
00048 public slots:
00049   void setAutoScale(bool state);
00050   void setSemilogx(bool en);
00051   void setSemilogy(bool en);
00052   void setAccumulate(bool en);
00053 
00054   void setMarkerAlpha(int which, int alpha);
00055   int getMarkerAlpha(int which) const;
00056   void setLineColor(int which, QColor color);
00057 
00058   void setNumBins(int bins);
00059 
00060 private:
00061   void _resetXAxisPoints(double bottom, double top);
00062   void _autoScale(double bottom, double top);
00063 
00064   double* _xAxisPoints;
00065   std::vector<double*> _yDataPoints;
00066 
00067   int _bins;
00068   bool _accum;
00069 
00070   bool d_semilogx;
00071   bool d_semilogy;
00072 };
00073 
00074 #endif /* HISTOGRAM_DISPLAY_PLOT_H */