3 * Copyright 2008,2009 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
23 #ifndef INCLUDED_QTGUI_SINK_F_H
24 #define INCLUDED_QTGUI_SINK_F_H
27 #include <gr_firdes.h>
29 #include <qapplication.h>
32 #include "SpectrumGUIClass.h"
35 typedef boost::shared_ptr<qtgui_sink_f> qtgui_sink_f_sptr;
37 qtgui_sink_f_sptr qtgui_make_sink_f (int fftsize, int wintype,
38 double fc=0, double bw=1.0,
39 const std::string &name="Spectrum Display",
40 bool plotfreq=true, bool plotwaterfall=true,
41 bool plotwaterfall3d=true, bool plottime=true,
44 QWidget *parent=NULL);
46 class qtgui_sink_f : public gr_block
49 friend qtgui_sink_f_sptr qtgui_make_sink_f (int fftsize, int wintype,
51 const std::string &name,
52 bool plotfreq, bool plotwaterfall,
53 bool plotwaterfall3d, bool plottime,
57 qtgui_sink_f (int fftsize, int wintype,
59 const std::string &name,
60 bool plotfreq, bool plotwaterfall,
61 bool plotwaterfall3d, bool plottime,
66 void forecast(int noutput_items, gr_vector_int &ninput_items_required);
68 void initialize(const bool opengl=true);
71 gr_firdes::win_type d_wintype;
72 std::vector<float> d_window;
77 pthread_mutex_t d_pmutex;
80 gri_fft_complex *d_fft;
85 bool d_plotfreq, d_plotwaterfall, d_plotwaterfall3d, d_plottime, d_plotconst;
90 SpectrumGUIClass *d_main_gui;
95 void fft(const float *data_in, int size);
103 PyObject* pyqwidget();
105 void set_frequency_range(const double centerfreq,
106 const double bandwidth);
108 void set_time_domain_axis(double min, double max);
109 void set_constellation_axis(double xmin, double xmax,
110 double ymin, double ymax);
111 void set_constellation_pen_size(int size);
112 void set_frequency_axis(double min, double max);
114 void set_update_time(double t);
116 QApplication *d_qApplication;
119 int general_work (int noutput_items,
120 gr_vector_int &ninput_items,
121 gr_vector_const_void_star &input_items,
122 gr_vector_void_star &output_items);
125 #endif /* INCLUDED_QTGUI_SINK_F_H */