diff options
Diffstat (limited to 'gr-qtgui')
-rw-r--r-- | gr-qtgui/grc/qtgui_sink_x.xml | 20 | ||||
-rw-r--r-- | gr-qtgui/lib/qtgui_time_sink_c.cc | 30 | ||||
-rw-r--r-- | gr-qtgui/lib/qtgui_time_sink_c.h | 25 | ||||
-rw-r--r-- | gr-qtgui/lib/qtgui_time_sink_f.cc | 28 | ||||
-rw-r--r-- | gr-qtgui/lib/qtgui_time_sink_f.h | 13 | ||||
-rw-r--r-- | gr-qtgui/swig/qtgui_time_sink_c.i | 2 | ||||
-rw-r--r-- | gr-qtgui/swig/qtgui_time_sink_f.i | 2 |
7 files changed, 59 insertions, 61 deletions
diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml index 8c470a1a5..83d6ec287 100644 --- a/gr-qtgui/grc/qtgui_sink_x.xml +++ b/gr-qtgui/grc/qtgui_sink_x.xml @@ -57,6 +57,26 @@ $(gui_hint()($win))</make> <name>Blackman-harris</name> <key>firdes.WIN_BLACKMAN_hARRIS</key> </option> + <option> + <name>Hamming</name> + <key>firdes.WIN_HAMMING</key> + </option> + <option> + <name>Hann</name> + <key>firdes.WIN_HANN</key> + </option> + <option> + <name>Blackman</name> + <key>firdes.WIN_BLACKMAN</key> + </option> + <option> + <name>Rectangular</name> + <key>firdes.WIN_RECTANGULAR</key> + </option> + <option> + <name>Kaiser</name> + <key>firdes.WIN_KAISER</key> + </option> </param> <param> <name>Center Frequency (Hz)</name> diff --git a/gr-qtgui/lib/qtgui_time_sink_c.cc b/gr-qtgui/lib/qtgui_time_sink_c.cc index 3d38419b2..207d4a924 100644 --- a/gr-qtgui/lib/qtgui_time_sink_c.cc +++ b/gr-qtgui/lib/qtgui_time_sink_c.cc @@ -44,9 +44,9 @@ qtgui_time_sink_c::qtgui_time_sink_c (int size, double bw, const std::string &name, int nconnections, QWidget *parent) - : gr_block ("time_sink_c", - gr_make_io_signature (nconnections, nconnections, sizeof(gr_complex)), - gr_make_io_signature (0, 0, 0)), + : gr_sync_block ("time_sink_c", + gr_make_io_signature (nconnections, nconnections, sizeof(gr_complex)), + gr_make_io_signature (0, 0, 0)), d_size(size), d_bandwidth(bw), d_name(name), d_nconnections(2*nconnections), d_parent(parent) { @@ -59,6 +59,7 @@ qtgui_time_sink_c::qtgui_time_sink_c (int size, double bw, } initialize(); + set_output_multiple(d_size); } qtgui_time_sink_c::~qtgui_time_sink_c() @@ -70,15 +71,6 @@ qtgui_time_sink_c::~qtgui_time_sink_c() } void -qtgui_time_sink_c::forecast(int noutput_items, gr_vector_int &ninput_items_required) -{ - unsigned int ninputs = ninput_items_required.size(); - for (unsigned int i = 0; i < ninputs; i++) { - ninput_items_required[i] = std::min(d_size, 8191); - } -} - -void qtgui_time_sink_c::initialize() { if(qApp != NULL) { @@ -144,10 +136,9 @@ qtgui_time_sink_c::set_color(int which, const std::string &color) } int -qtgui_time_sink_c::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) +qtgui_time_sink_c::work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { int n=0, j=0, idx=0; const gr_complex *in = (const gr_complex*)input_items[idx]; @@ -181,7 +172,9 @@ qtgui_time_sink_c::general_work (int noutput_items, j += resid; } // Otherwise, copy what we received into the residbufs for next time + // because we set the output_multiple, this should never need to be called else { + assert(0); for(n = 0; n < d_nconnections; n+=2) { in = (const gr_complex*)input_items[idx++]; for(unsigned int k = 0; k < resid; k++) { @@ -193,7 +186,6 @@ qtgui_time_sink_c::general_work (int noutput_items, j += datasize; } } - - consume_each(j); - return j; + + return noutput_items; } diff --git a/gr-qtgui/lib/qtgui_time_sink_c.h b/gr-qtgui/lib/qtgui_time_sink_c.h index 459423c40..51d5ad183 100644 --- a/gr-qtgui/lib/qtgui_time_sink_c.h +++ b/gr-qtgui/lib/qtgui_time_sink_c.h @@ -25,7 +25,7 @@ #include <Python.h> #include <gr_qtgui_api.h> -#include <gr_block.h> +#include <gr_sync_block.h> #include <gr_firdes.h> #include <gri_fft.h> #include <qapplication.h> @@ -35,24 +35,22 @@ class qtgui_time_sink_c; typedef boost::shared_ptr<qtgui_time_sink_c> qtgui_time_sink_c_sptr; GR_QTGUI_API qtgui_time_sink_c_sptr qtgui_make_time_sink_c(int size, double bw, - const std::string &name, - int nconnectons=1, - QWidget *parent=NULL); + const std::string &name, + int nconnectons=1, + QWidget *parent=NULL); -class GR_QTGUI_API qtgui_time_sink_c : public gr_block +class GR_QTGUI_API qtgui_time_sink_c : public gr_sync_block { private: friend GR_QTGUI_API qtgui_time_sink_c_sptr qtgui_make_time_sink_c(int size, double bw, - const std::string &name, - int nconnections, - QWidget *parent); + const std::string &name, + int nconnections, + QWidget *parent); qtgui_time_sink_c(int size, double bw, const std::string &name, int nconnections, QWidget *parent=NULL); - void forecast(int noutput_items, gr_vector_int &ninput_items_required); - void initialize(); int d_size; @@ -84,10 +82,9 @@ public: QApplication *d_qApplication; - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif /* INCLUDED_QTGUI_TIME_SINK_C_H */ diff --git a/gr-qtgui/lib/qtgui_time_sink_f.cc b/gr-qtgui/lib/qtgui_time_sink_f.cc index 58cc7a38a..2fe99f43c 100644 --- a/gr-qtgui/lib/qtgui_time_sink_f.cc +++ b/gr-qtgui/lib/qtgui_time_sink_f.cc @@ -44,9 +44,9 @@ qtgui_time_sink_f::qtgui_time_sink_f (int size, double bw, const std::string &name, int nconnections, QWidget *parent) - : gr_block ("time_sink_f", - gr_make_io_signature (nconnections, nconnections, sizeof(float)), - gr_make_io_signature (0, 0, 0)), + : gr_sync_block ("time_sink_f", + gr_make_io_signature (nconnections, nconnections, sizeof(float)), + gr_make_io_signature (0, 0, 0)), d_size(size), d_bandwidth(bw), d_name(name), d_nconnections(nconnections), d_parent(parent) { @@ -59,6 +59,7 @@ qtgui_time_sink_f::qtgui_time_sink_f (int size, double bw, } initialize(); + set_output_multiple(d_size); } qtgui_time_sink_f::~qtgui_time_sink_f() @@ -70,15 +71,6 @@ qtgui_time_sink_f::~qtgui_time_sink_f() } void -qtgui_time_sink_f::forecast(int noutput_items, gr_vector_int &ninput_items_required) -{ - unsigned int ninputs = ninput_items_required.size(); - for (unsigned int i = 0; i < ninputs; i++) { - ninput_items_required[i] = std::min(d_size, 8191); - } -} - -void qtgui_time_sink_f::initialize() { if(qApp != NULL) { @@ -144,10 +136,9 @@ qtgui_time_sink_f::set_color(int which, const std::string &color) } int -qtgui_time_sink_f::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) +qtgui_time_sink_f::work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { int n=0, j=0, idx=0; const float *in = (const float*)input_items[idx]; @@ -180,7 +171,9 @@ qtgui_time_sink_f::general_work (int noutput_items, j += resid; } // Otherwise, copy what we received into the residbufs for next time + // because we set the output_multiple, this should never need to be called else { + assert(0); for(n = 0; n < d_nconnections; n++) { in = (const float*)input_items[idx++]; for(unsigned int k = 0; k < resid; k++) { @@ -192,6 +185,5 @@ qtgui_time_sink_f::general_work (int noutput_items, } } - consume_each(j); - return j; + return noutput_items; } diff --git a/gr-qtgui/lib/qtgui_time_sink_f.h b/gr-qtgui/lib/qtgui_time_sink_f.h index 632246c6e..a69d32877 100644 --- a/gr-qtgui/lib/qtgui_time_sink_f.h +++ b/gr-qtgui/lib/qtgui_time_sink_f.h @@ -25,7 +25,7 @@ #include <Python.h> #include <gr_qtgui_api.h> -#include <gr_block.h> +#include <gr_sync_block.h> #include <gr_firdes.h> #include <gri_fft.h> #include <qapplication.h> @@ -39,7 +39,7 @@ GR_QTGUI_API qtgui_time_sink_f_sptr qtgui_make_time_sink_f(int size, double bw, int nconnectons=1, QWidget *parent=NULL); -class GR_QTGUI_API qtgui_time_sink_f : public gr_block +class GR_QTGUI_API qtgui_time_sink_f : public gr_sync_block { private: friend GR_QTGUI_API qtgui_time_sink_f_sptr qtgui_make_time_sink_f(int size, double bw, @@ -51,8 +51,6 @@ private: int nconnections, QWidget *parent=NULL); - void forecast(int noutput_items, gr_vector_int &ninput_items_required); - void initialize(); int d_size; @@ -84,10 +82,9 @@ public: QApplication *d_qApplication; - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); }; #endif /* INCLUDED_QTGUI_TIME_SINK_F_H */ diff --git a/gr-qtgui/swig/qtgui_time_sink_c.i b/gr-qtgui/swig/qtgui_time_sink_c.i index 8f5c9f4f0..e7240aa69 100644 --- a/gr-qtgui/swig/qtgui_time_sink_c.i +++ b/gr-qtgui/swig/qtgui_time_sink_c.i @@ -33,7 +33,7 @@ qtgui_time_sink_c_sptr qtgui_make_time_sink_c(int size, double bw, int nconnections=1, QWidget *parent=NULL); -class qtgui_time_sink_c : public gr_block +class qtgui_time_sink_c : public gr_sync_block { private: friend qtgui_time_sink_c_sptr qtgui_make_time_sink_c(int size, double bw, diff --git a/gr-qtgui/swig/qtgui_time_sink_f.i b/gr-qtgui/swig/qtgui_time_sink_f.i index b92efe7be..06af42da3 100644 --- a/gr-qtgui/swig/qtgui_time_sink_f.i +++ b/gr-qtgui/swig/qtgui_time_sink_f.i @@ -33,7 +33,7 @@ qtgui_time_sink_f_sptr qtgui_make_time_sink_f(int size, double bw, int nconnections=1, QWidget *parent=NULL); -class qtgui_time_sink_f : public gr_block +class qtgui_time_sink_f : public gr_sync_block { private: friend qtgui_time_sink_f_sptr qtgui_make_time_sink_f(int size, double bw, |