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_C_H
24 #define INCLUDED_QTGUI_SINK_C_H
27 #include <gr_firdes.h>
29 #include <qapplication.h>
32 #include "SpectrumGUIClass.h"
35 typedef boost::shared_ptr<qtgui_sink_c> qtgui_sink_c_sptr;
37 qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype,
38 double fc=0, double bandwidth=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_c : public gr_block
49 friend qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype,
51 const std::string &name,
52 bool plotfreq, bool plotwaterfall,
53 bool plotwaterfall3d, bool plottime,
57 qtgui_sink_c (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 // use opengl to force OpenGL on or off
69 // this might be necessary for sessions over SSH
70 void initialize(const bool opengl=true);
73 gr_firdes::win_type d_wintype;
74 std::vector<float> d_window;
79 pthread_mutex_t d_pmutex;
82 gri_fft_complex *d_fft;
85 gr_complex *d_residbuf;
87 bool d_plotfreq, d_plotwaterfall, d_plotwaterfall3d, d_plottime, d_plotconst;
90 SpectrumGUIClass *d_main_gui;
95 void fft(const gr_complex *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 QApplication *d_qApplication;
117 int general_work (int noutput_items,
118 gr_vector_int &ninput_items,
119 gr_vector_const_void_star &input_items,
120 gr_vector_void_star &output_items);
123 #endif /* INCLUDED_QTGUI_SINK_C_H */