GNU Radio 3.7.0 C++ API
freqdisplayform.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 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 FREQ_DISPLAY_FORM_H
00024 #define FREQ_DISPLAY_FORM_H
00025 
00026 #include <gnuradio/qtgui/spectrumUpdateEvents.h>
00027 #include <gnuradio/qtgui/FrequencyDisplayPlot.h>
00028 #include <QtGui/QtGui>
00029 #include <vector>
00030 #include <gnuradio/filter/firdes.h>
00031 
00032 #include <gnuradio/qtgui/displayform.h>
00033 
00034 /*!
00035  * \brief DisplayForm child for managing frequency (PSD) plots.
00036  * \ingroup qtgui_blk
00037  */
00038 class FreqDisplayForm : public DisplayForm
00039 {
00040   Q_OBJECT
00041 
00042   public:
00043   FreqDisplayForm(int nplots=1, QWidget* parent = 0);
00044   ~FreqDisplayForm();
00045 
00046   FrequencyDisplayPlot* getPlot();
00047 
00048   int getFFTSize() const;
00049   float getFFTAverage() const;
00050   gr::filter::firdes::win_type getFFTWindowType() const;
00051 
00052 public slots:
00053   void customEvent(QEvent *e);
00054 
00055   void setSampleRate(const QString &samprate);
00056   void setFFTSize(const int);
00057   void setFFTAverage(const float);
00058   void setFFTWindowType(const gr::filter::firdes::win_type);
00059 
00060   void setFrequencyRange(const double centerfreq,
00061                          const double bandwidth);
00062   void setYaxis(double min, double max);
00063   void autoScale(bool en);
00064 
00065 private slots:
00066   void newData(const QEvent *updateEvent);
00067 
00068 private:
00069   uint64_t _numRealDataPoints;
00070   QIntValidator* _intValidator;
00071 
00072   double _samp_rate, _center_freq;
00073   int _fftsize;
00074   float _fftavg;
00075   gr::filter::firdes::win_type _fftwintype;
00076 };
00077 
00078 #endif /* FREQ_DISPLAY_FORM_H */