GNU Radio 3.7.1 C++ API
|
00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2008,2009,2011,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 INCLUDED_QTGUI_SINK_C_H 00024 #define INCLUDED_QTGUI_SINK_C_H 00025 00026 #include <Python.h> 00027 #include <gnuradio/qtgui/api.h> 00028 #include <gnuradio/block.h> 00029 #include <qapplication.h> 00030 #include <qwt_symbol.h> 00031 00032 00033 namespace gr { 00034 namespace qtgui { 00035 00036 /*! 00037 * \brief A graphical sink to display freq, spec, time, and const plots. 00038 * \ingroup instrumentation_blk 00039 * \ingroup qtgui_blk 00040 * 00041 * \details 00042 * This is a QT-based graphical sink the takes a complex stream and 00043 * plots it. The default action is to plot the signal as a PSD (FFT), 00044 * spectrogram (waterfall), time domain I&Q, and constellation (I 00045 * vs. Q) plots. The plots may be turned off by setting the 00046 * appropriate boolean value in the constructor to False. 00047 */ 00048 00049 class QTGUI_API sink_c : virtual public block 00050 { 00051 public: 00052 // gr::qtgui::sink_c::sptr 00053 typedef boost::shared_ptr<sink_c> sptr; 00054 00055 /*! 00056 * \brief Build a complex qtgui sink. 00057 * 00058 * \param fftsize size of the FFT to compute and display 00059 * \param wintype type of window to apply (see gnuradio/filter/firdes.h) 00060 * \param fc center frequency of signal (use for x-axis labels) 00061 * \param bw bandwidth of signal (used to set x-axis labels) 00062 * \param name title for the plot 00063 * \param plotfreq Toggle frequency plot on/off 00064 * \param plotwaterfall Toggle waterfall plot on/off 00065 * \param plottime Toggle time plot on/off 00066 * \param plotconst Toggle constellation plot on/off 00067 * \param parent a QWidget parent object, if any 00068 */ 00069 static sptr make(int fftsize, int wintype, 00070 double fc, double bw, 00071 const std::string &name, 00072 bool plotfreq, bool plotwaterfall, 00073 bool plottime, bool plotconst, 00074 QWidget *parent=NULL); 00075 00076 virtual void exec_() = 0; 00077 virtual PyObject* pyqwidget() = 0; 00078 00079 virtual void set_fft_size(const int fftsize) = 0; 00080 virtual int fft_size() const = 0; 00081 00082 virtual void set_frequency_range(const double centerfreq, 00083 const double bandwidth) = 0; 00084 virtual void set_fft_power_db(double min, double max) = 0; 00085 00086 //void set_time_domain_axis(double min, double max); 00087 //void set_constellation_axis(double xmin, double xmax, 00088 // double ymin, double ymax); 00089 //void set_constellation_pen_size(int size); 00090 00091 virtual void set_update_time(double t) = 0; 00092 00093 QApplication *d_qApplication; 00094 }; 00095 00096 } /* namespace qtgui */ 00097 } /* namespace gr */ 00098 00099 #endif /* INCLUDED_QTGUI_SINK_C_H */