GNU Radio 3.7.1 C++ API
|
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 WATERFALL_DISPLAY_FORM_H 00024 #define WATERFALL_DISPLAY_FORM_H 00025 00026 #include <gnuradio/qtgui/spectrumUpdateEvents.h> 00027 #include <gnuradio/qtgui/WaterfallDisplayPlot.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 waterfall (spectrogram) plots. 00036 * \ingroup qtgui_blk 00037 */ 00038 class WaterfallDisplayForm : public DisplayForm 00039 { 00040 Q_OBJECT 00041 00042 public: 00043 WaterfallDisplayForm(int nplots=1, QWidget* parent = 0); 00044 ~WaterfallDisplayForm(); 00045 00046 WaterfallDisplayPlot* getPlot(); 00047 00048 int getFFTSize() const; 00049 float getFFTAverage() const; 00050 gr::filter::firdes::win_type getFFTWindowType() const; 00051 00052 int getColorMap(int which); 00053 int getAlpha(int which); 00054 double getMinIntensity(int which); 00055 double getMaxIntensity(int which); 00056 00057 void clearData(); 00058 00059 public slots: 00060 void customEvent(QEvent *e); 00061 00062 void setSampleRate(const QString &samprate); 00063 void setFFTSize(const int); 00064 void setFFTAverage(const float); 00065 void setFFTWindowType(const gr::filter::firdes::win_type); 00066 00067 void setFrequencyRange(const double centerfreq, 00068 const double bandwidth); 00069 00070 void setIntensityRange(const double minIntensity, 00071 const double maxIntensity); 00072 00073 void setAlpha(int which, int alpha); 00074 00075 void setColorMap(int which, 00076 const int newType, 00077 const QColor lowColor=QColor("white"), 00078 const QColor highColor=QColor("white")); 00079 00080 void autoScale(bool en=false); 00081 00082 private slots: 00083 void newData(const QEvent *updateEvent); 00084 00085 private: 00086 uint64_t _numRealDataPoints; 00087 QIntValidator* _intValidator; 00088 00089 double _samp_rate, _center_freq; 00090 int _fftsize; 00091 float _fftavg; 00092 gr::filter::firdes::win_type _fftwintype; 00093 00094 double _min_val; 00095 double _max_val; 00096 }; 00097 00098 #endif /* WATERFALL_DISPLAY_FORM_H */