summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt1
-rw-r--r--gnuradio-core/CMakeLists.txt3
-rw-r--r--gnuradio-core/gnuradio-core.pc.in2
-rw-r--r--gnuradio-core/src/lib/CMakeLists.txt6
-rw-r--r--gnuradio-core/src/lib/general/CMakeLists.txt3
-rw-r--r--gnuradio-core/src/lib/general/general.i6
-rw-r--r--gnuradio-core/src/lib/general/gr_squash_ff.i34
-rw-r--r--gnuradio-core/src/lib/general/gr_wvps_ff.i29
-rw-r--r--gr-fcd/grc/fcd_source_c.xml15
-rw-r--r--gr-fcd/include/fcd/fcd_source_c.h47
-rw-r--r--gr-fcd/lib/CMakeLists.txt2
-rw-r--r--gr-fcd/lib/fcd_source_c.cc236
-rw-r--r--gr-fcd/lib/fcd_source_c_impl.cc238
-rw-r--r--gr-fcd/lib/fcd_source_c_impl.h50
-rw-r--r--gr-fcd/swig/CMakeLists.txt3
-rw-r--r--gr-fcd/swig/fcd_source_c.i21
-rw-r--r--gr-fcd/swig/fcd_swig.i10
-rwxr-xr-xgr-uhd/apps/uhd_fft26
-rw-r--r--gr-uhd/apps/uhd_siggen_base.py26
-rwxr-xr-xgr-uhd/apps/uhd_siggen_gui6
-rw-r--r--gr-uhd/include/gr_uhd_usrp_sink.h19
-rw-r--r--gr-uhd/include/gr_uhd_usrp_source.h16
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_sink.cc12
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_source.cc12
-rw-r--r--gr-uhd/swig/__init__.py2
-rw-r--r--gr-uhd/swig/uhd_swig.i10
-rw-r--r--gr-wavelet/CMakeLists.txt109
-rw-r--r--gr-wavelet/gnuradio-wavelet.pc.in11
-rw-r--r--gr-wavelet/include/wavelet/CMakeLists.txt31
-rw-r--r--gr-wavelet/include/wavelet/wavelet_api.h (renamed from gnuradio-core/src/lib/general/gr_wavelet_ff.i)34
-rw-r--r--gr-wavelet/include/wavelet/wavelet_squash_ff.h45
-rw-r--r--gr-wavelet/include/wavelet/wavelet_wavelet_ff.h46
-rw-r--r--gr-wavelet/include/wavelet/wavelet_wvps_ff.h44
-rw-r--r--gr-wavelet/lib/CMakeLists.txt54
-rw-r--r--gr-wavelet/lib/wavelet_squash_ff_impl.cc (renamed from gnuradio-core/src/lib/general/gr_squash_ff.cc)24
-rw-r--r--gr-wavelet/lib/wavelet_squash_ff_impl.h (renamed from gnuradio-core/src/lib/general/gr_squash_ff.h)38
-rw-r--r--gr-wavelet/lib/wavelet_wavelet_ff_impl.cc (renamed from gnuradio-core/src/lib/general/gr_wavelet_ff.cc)28
-rw-r--r--gr-wavelet/lib/wavelet_wavelet_ff_impl.h (renamed from gnuradio-core/src/lib/general/gr_wavelet_ff.h)50
-rw-r--r--gr-wavelet/lib/wavelet_wvps_ff_impl.cc (renamed from gnuradio-core/src/lib/general/gr_wvps_ff.cc)18
-rw-r--r--gr-wavelet/lib/wavelet_wvps_ff_impl.h (renamed from gnuradio-core/src/lib/general/gr_wvps_ff.h)34
-rw-r--r--gr-wavelet/python/CMakeLists.txt47
-rw-r--r--gr-wavelet/python/__init__.py28
-rwxr-xr-xgr-wavelet/python/qa_classify.py (renamed from gnuradio-core/src/python/gnuradio/gr/qa_classify.py)8
-rw-r--r--gr-wavelet/swig/CMakeLists.txt50
-rw-r--r--gr-wavelet/swig/wavelet_swig.i48
-rw-r--r--gruel/src/include/gruel/pmt.h19
-rw-r--r--gruel/src/lib/pmt/pmt.cc14
-rw-r--r--gruel/src/lib/pmt/pmt_int.h9
49 files changed, 1106 insertions, 519 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..b25c15b81
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*~
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 04a6b5964..90f3c0b17 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -235,6 +235,7 @@ add_subdirectory(gr-utils)
add_subdirectory(gr-video-sdl)
add_subdirectory(gr-vocoder)
add_subdirectory(gr-fcd)
+add_subdirectory(gr-wavelet)
add_subdirectory(gr-wxgui)
#finalize cpack after subdirs processed
diff --git a/gnuradio-core/CMakeLists.txt b/gnuradio-core/CMakeLists.txt
index c05c6404f..13965f3db 100644
--- a/gnuradio-core/CMakeLists.txt
+++ b/gnuradio-core/CMakeLists.txt
@@ -22,8 +22,6 @@
########################################################################
include(GrBoost)
-find_package(GSL)
-
find_package(FFTW3f)
include(GrPython) #used for code generation
@@ -41,7 +39,6 @@ GR_REGISTER_COMPONENT("gnuradio-core" ENABLE_GR_CORE
ENABLE_GRUEL
ENABLE_VOLK
Boost_FOUND
- GSL_FOUND
FFTW3F_FOUND
PYTHONINTERP_FOUND
)
diff --git a/gnuradio-core/gnuradio-core.pc.in b/gnuradio-core/gnuradio-core.pc.in
index 5d743a4e9..2de9a32e7 100644
--- a/gnuradio-core/gnuradio-core.pc.in
+++ b/gnuradio-core/gnuradio-core.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@/gnuradio
Name: gnuradio-core
Description: GNU Software Radio toolkit
-Requires: gruel fftw3f gsl
+Requires: gruel fftw3f
Version: @LIBVER@
Libs.private: @BOOST_LDFLAGS@ @BOOST_THREAD_LIB@ @BOOST_DATE_TIME_LIB@
Libs: -L${libdir} -lgnuradio-core
diff --git a/gnuradio-core/src/lib/CMakeLists.txt b/gnuradio-core/src/lib/CMakeLists.txt
index 86f88242c..73002ec7b 100644
--- a/gnuradio-core/src/lib/CMakeLists.txt
+++ b/gnuradio-core/src/lib/CMakeLists.txt
@@ -47,10 +47,6 @@ include_directories(${VOLK_INCLUDE_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
-add_definitions(${GSL_DEFINITIONS})
-include_directories(${GSL_INCLUDE_DIRS})
-link_directories(${GSL_LIBRARY_DIRS})
-
include_directories(${FFTW3F_INCLUDE_DIRS})
link_directories(${FFTW3F_LIBRARY_DIRS})
@@ -60,7 +56,6 @@ link_directories(${FFTW3F_LIBRARY_DIRS})
list(APPEND gnuradio_core_libs
gruel
${Boost_LIBRARIES}
- ${GSL_LIBRARIES}
${FFTW3F_LIBRARIES}
)
@@ -80,7 +75,6 @@ list(APPEND gnuradio_core_libs volk)
add_library(gnuradio-core SHARED ${gnuradio_core_sources})
target_link_libraries(gnuradio-core ${gnuradio_core_libs})
GR_LIBRARY_FOO(gnuradio-core RUNTIME_COMPONENT "core_runtime" DEVEL_COMPONENT "core_devel")
-#avoid fftw and gsl link in dependent libraries:
set_target_properties(gnuradio-core PROPERTIES LINK_INTERFACE_LIBRARIES "gruel")
########################################################################
diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt
index ee6e4c4e6..1d1da247c 100644
--- a/gnuradio-core/src/lib/general/CMakeLists.txt
+++ b/gnuradio-core/src/lib/general/CMakeLists.txt
@@ -267,7 +267,6 @@ set(gr_core_general_triple_threats
gr_simple_framer
gr_simple_squelch_cc
gr_skiphead
- gr_squash_ff
gr_squelch_base_cc
gr_squelch_base_ff
gr_stream_mux
@@ -285,8 +284,6 @@ set(gr_core_general_triple_threats
gr_vector_to_stream
gr_vector_to_streams
gr_unpack_k_bits_bb
- gr_wavelet_ff
- gr_wvps_ff
gr_descrambler_bb
gr_scrambler_bb
gr_probe_mpsk_snr_c
diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i
index fcf60c927..bf8bc163f 100644
--- a/gnuradio-core/src/lib/general/general.i
+++ b/gnuradio-core/src/lib/general/general.i
@@ -128,10 +128,7 @@
#include <gr_probe_mpsk_snr_c.h>
#include <gr_probe_density_b.h>
#include <gr_rail_ff.h>
-#include <gr_squash_ff.h>
#include <gr_stretch_ff.h>
-#include <gr_wavelet_ff.h>
-#include <gr_wvps_ff.h>
#include <gr_copy.h>
#include <gr_additive_scrambler_bb.h>
#include <complex_vec_test.h>
@@ -249,10 +246,7 @@
%include "gr_probe_mpsk_snr_c.i"
%include "gr_probe_density_b.i"
%include "gr_rail_ff.i"
-%include "gr_squash_ff.i"
%include "gr_stretch_ff.i"
-%include "gr_wavelet_ff.i"
-%include "gr_wvps_ff.i"
%include "gr_copy.i"
%include "gr_additive_scrambler_bb.i"
%include "complex_vec_test.i"
diff --git a/gnuradio-core/src/lib/general/gr_squash_ff.i b/gnuradio-core/src/lib/general/gr_squash_ff.i
deleted file mode 100644
index c89b1c28d..000000000
--- a/gnuradio-core/src/lib/general/gr_squash_ff.i
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-GR_SWIG_BLOCK_MAGIC(gr,squash_ff);
-
-gr_squash_ff_sptr gr_make_squash_ff(const std::vector<float> &igrid,
- const std::vector<float> &ogrid);
-
-class gr_squash_ff : public gr_sync_block
-{
-private:
- gr_squash_ff(const std::vector<float> &igrid,
- const std::vector<float> &ogrid);
-
-};
-
diff --git a/gnuradio-core/src/lib/general/gr_wvps_ff.i b/gnuradio-core/src/lib/general/gr_wvps_ff.i
deleted file mode 100644
index 877126fb2..000000000
--- a/gnuradio-core/src/lib/general/gr_wvps_ff.i
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-GR_SWIG_BLOCK_MAGIC(gr,wvps_ff);
-
-gr_wvps_ff_sptr gr_make_wvps_ff(int ilen);
-
-class gr_wvps_ff : public gr_sync_block
-{
-private:
- gr_wvps_ff(int ilen);
-};
diff --git a/gr-fcd/grc/fcd_source_c.xml b/gr-fcd/grc/fcd_source_c.xml
index 8572e6da1..7c55239aa 100644
--- a/gr-fcd/grc/fcd_source_c.xml
+++ b/gr-fcd/grc/fcd_source_c.xml
@@ -9,6 +9,9 @@
#if $lna() != 20.0
self.$(id).set_lna_gain($lna)
#end if
+#if $mixer() != +12.0
+self.$(id).set_mixer_gain($mixer)
+#end if
#if $ppm() != 115
self.$(id).set_freq_corr($ppm)
#end if
@@ -22,6 +25,7 @@ self.$(id).set_freq($freq)
</make>
<callback>set_freq($freq)</callback>
<callback>set_lna_gain($lna)</callback>
+ <callback>set_mixer_gain($mixer)</callback>
<callback>set_freq_corr($ppm)</callback>
<callback>set_dc_corr($dci,$dcq)</callback>
<callback>set_iq_corr($iq_gain,$iq_phase)</callback>
@@ -45,6 +49,12 @@ self.$(id).set_freq($freq)
<type>real</type>
</param>
<param>
+ <name>Mixer Gain (dB)</name>
+ <key>mixer</key>
+ <value>+12</value>
+ <type>real</type>
+ </param>
+ <param>
<name>Frequency corr. (ppm)</name>
<key>ppm</key>
<value>-120</value>
@@ -94,7 +104,10 @@ To find the device name on Linux type:
The LNA gain is a set of discrete values between -5 to 30 dB with 2.5 dB step, but you can \
use any float value and it will be rounded to the nearest valid value.
-
+
+The Mixer gain can be set either to +4 or +12 dB, but you can use any float value \
+and it will be rounded to the nearest valid value.
+
The FCD block can autmatically apply frequency correction:
- For FCD v1.0 you can leave at -120 ppm
- For FCD v1.1 with serial number 810 or greater use -12 ppm
diff --git a/gr-fcd/include/fcd/fcd_source_c.h b/gr-fcd/include/fcd/fcd_source_c.h
index 1649d0862..988925c2e 100644
--- a/gr-fcd/include/fcd/fcd_source_c.h
+++ b/gr-fcd/include/fcd/fcd_source_c.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2011 Free Software Foundation, Inc.
+ * Copyright 2011-2012 Free Software Foundation, Inc.
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,14 +23,11 @@
#include <fcd_api.h>
#include <gr_hier_block2.h>
-#include <gr_audio_source.h>
class fcd_source_c;
-
typedef boost::shared_ptr<fcd_source_c> fcd_source_c_sptr;
-
/*!
* \brief Return a shared_ptr to a new instance of fcd_source_c.
*
@@ -50,12 +47,9 @@ FCD_API fcd_source_c_sptr fcd_make_source_c(const std::string device_name = "");
* interface to work properly. As of early 2011, FCDs still come with firmware
* 18b. You can use qthid 2.2 (not 3) to upgrade the firmware: http://qthid.sf.net
*/
-class FCD_API fcd_source_c : public gr_hier_block2
+class FCD_API fcd_source_c : virtual public gr_hier_block2
{
-
public:
- ~fcd_source_c();
-
/*! \brief Set frequency with Hz resolution.
* \param freq The frequency in Hz
*
@@ -64,7 +58,7 @@ public:
*
* \see set_freq_khz()
*/
- void set_freq(int freq);
+ virtual void set_freq(int freq) = 0;
/*! \brief Set frequency with Hz resolution.
* \param freq The frequency in Hz
@@ -74,7 +68,7 @@ public:
*
* \see set_freq_khz()
*/
- void set_freq(float freq);
+ virtual void set_freq(float freq) = 0;
/*! \brief Set frequency with kHz resolution.
* \param freq The frequency in kHz
@@ -84,7 +78,7 @@ public:
*
* \see set_freq()
*/
- void set_freq_khz(int freq);
+ virtual void set_freq_khz(int freq) = 0;
/*! \brief Set LNA gain.
* \param gain The new gain in dB.
@@ -94,10 +88,20 @@ public:
* 2.5 dB steps, you can can call this method with any float value
* and it will be rounded to the nearest valid value.
*
- * By default the FCD is set to 20 dB and this is a good value for most
- * cases. In noisy areas you may try to reduce the gain.
+ * By default the LNA gain is set to 20 dB and this is a good value for
+ * most cases. In noisy areas you may try to reduce the gain.
*/
- void set_lna_gain(float gain);
+ virtual void set_lna_gain(float gain) = 0;
+
+ /*! \brief Set mixer gain.
+ * \param gain The new gain in dB.
+ *
+ * Set the mixer gain in the FCD. Valid values are +4 and +12 dB.
+ *
+ * By default the mixer gain is set to +12 dB and this is a good value for
+ * most cases. In noisy areas you may try to reduce the gain.
+ */
+ virtual void set_mixer_gain(float gain) = 0;
/*! \brief Set new frequency correction.
* \param ppm The new frequency correction in parts per million
@@ -107,7 +111,7 @@ public:
*
* Ref: http://www.funcubedongle.com/?p=617
*/
- void set_freq_corr(int ppm);
+ virtual void set_freq_corr(int ppm) = 0;
/*! \brief Set DC offset correction.
* \param _dci DC correction for I component (-1.0 to 1.0)
@@ -115,7 +119,7 @@ public:
*
* Set DC offset correction in the device. Default is 0.0.
*/
- void set_dc_corr(double _dci, double _dcq);
+ virtual void set_dc_corr(double _dci, double _dcq) = 0;
/*! \brief Set IQ phase and gain balance.
* \param _gain The gain correction (-1.0 to 1.0)
@@ -124,16 +128,7 @@ public:
* Set IQ phase and gain balance in the device. The default values
* are 0.0 for phase and 1.0 for gain.
*/
- void set_iq_corr(double _gain, double _phase);
-
-private:
- fcd_source_c(const std::string device_name = "");
- friend FCD_API fcd_source_c_sptr
- fcd_make_source_c(const std::string device_name);
-
- audio_source::sptr fcd; /*!< The audio input source */
- int d_freq_corr; /*!< The frequency correction in ppm */
- int d_freq_req; /*!< The latest requested frequency in Hz */
+ virtual void set_iq_corr(double _gain, double _phase) = 0;
};
#endif /* INCLUDED_FCD_SOURCE_C_H */
diff --git a/gr-fcd/lib/CMakeLists.txt b/gr-fcd/lib/CMakeLists.txt
index 0e1f2aa01..cfca8b81b 100644
--- a/gr-fcd/lib/CMakeLists.txt
+++ b/gr-fcd/lib/CMakeLists.txt
@@ -39,7 +39,7 @@ link_directories(${Boost_LIBRARY_DIRS})
# Setup library
########################################################################
list(APPEND gr_fcd_sources
- fcd_source_c.cc
+ fcd_source_c_impl.cc
)
list(APPEND fcd_libs
diff --git a/gr-fcd/lib/fcd_source_c.cc b/gr-fcd/lib/fcd_source_c.cc
deleted file mode 100644
index 75bdd3162..000000000
--- a/gr-fcd/lib/fcd_source_c.cc
+++ /dev/null
@@ -1,236 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2011 Free Software Foundation, Inc.
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-
-#include <fcd_source_c.h>
-#include <fcd.h>
-#include <fcdhidcmd.h> // needed for extended API
-#include <gr_io_signature.h>
-#include <gr_audio_source.h>
-#include <gr_float_to_complex.h>
-#include <gruel/attributes.h>
-
-//#include <iostream>
-//using namespace std;
-
-/*
- * Create a new instance of fcd_source_c and return
- * a boost shared_ptr. This is effectively the public constructor.
- */
-fcd_source_c_sptr fcd_make_source_c(const std::string device_name)
-{
- return gnuradio::get_initial_sptr(new fcd_source_c(device_name));
-}
-
-
-static const int MIN_IN = 0; /*!< Mininum number of input streams. */
-static const int MAX_IN = 0; /*!< Maximum number of input streams. */
-static const int MIN_OUT = 1; /*!< Minimum number of output streams. */
-static const int MAX_OUT = 1; /*!< Maximum number of output streams. */
-
-
-fcd_source_c::fcd_source_c(const std::string device_name)
- : gr_hier_block2 ("fcd_source_c",
- gr_make_io_signature (MIN_IN, MAX_IN, sizeof (gr_complex)),
- gr_make_io_signature (MIN_OUT, MAX_OUT, sizeof (gr_complex))),
- d_freq_corr(-120),
- d_freq_req(0)
-{
- gr_float_to_complex_sptr f2c;
-
- /* Audio source; sample rate fixed at 96kHz */
- fcd = audio_make_source(96000, device_name, true);
-
- /* block to convert stereo audio to a complex stream */
- f2c = gr_make_float_to_complex(1);
-
- connect(fcd, 0, f2c, 0);
- connect(fcd, 1, f2c, 1);
- connect(f2c, 0, self(), 0);
-
-}
-
-
-fcd_source_c::~fcd_source_c ()
-{
-
-}
-
-// Set frequency with Hz resolution
-void fcd_source_c::set_freq(int freq)
-{
- FCD_MODE_ENUM __GR_ATTR_UNUSED fme;
- double f = (double)freq;
-
- /* valid range 50 MHz - 2.0 GHz */
- if ((freq < 50000000) || (freq > 2000000000)) {
- return;
- }
-
- d_freq_req = freq;
- f *= 1.0 + d_freq_corr/1000000.0;
-
- fme = fcdAppSetFreq((int)f);
- /* TODO: check fme */
-}
-
-// Set frequency with Hz resolution (type float)
-void fcd_source_c::set_freq(float freq)
-{
- FCD_MODE_ENUM __GR_ATTR_UNUSED fme;
- double f = (double)freq;
-
- /* valid range 50 MHz - 2.0 GHz */
- if ((freq < 50.0e6) || (freq > 2.0e9)) {
- return;
- }
-
- d_freq_req = (int)freq;
- f *= 1.0 + d_freq_corr/1000000.0;
-
- fme = fcdAppSetFreq((int)f);
- /* TODO: check fme */
-}
-
-
-// Set frequency with kHz resolution.
-void fcd_source_c::set_freq_khz(int freq)
-{
- FCD_MODE_ENUM __GR_ATTR_UNUSED fme;
- double f = freq*1000.0;
-
- /* valid range 50 MHz - 2.0 GHz */
- if ((freq < 50000) || (freq > 2000000)) {
- return;
- }
-
- d_freq_req = freq*1000;
- f *= 1.0 + d_freq_corr/1000000.0;
-
- fme = fcdAppSetFreqkHz((int)(f/1000.0));
- /* TODO: check fme */
-}
-
-
-// Set LNA gain
-void fcd_source_c::set_lna_gain(float gain)
-{
- FCD_MODE_ENUM __GR_ATTR_UNUSED fme;
- unsigned char g;
-
- /* convert to nearest discrete value */
- if (gain > 27.5) {
- g = 14; // 30.0 dB
- }
- else if (gain > 22.5) {
- g = 13; // 25.0 dB
- }
- else if (gain > 18.75) {
- g = 12; // 20.0 dB
- }
- else if (gain > 16.25) {
- g = 11; // 17.5 dB
- }
- else if (gain > 13.75) {
- g = 10; // 15.0 dB
- }
- else if (gain > 11.25) {
- g = 9; // 12.5 dB
- }
- else if (gain > 8.75) {
- g = 8; // 10.0 dB
- }
- else if (gain > 6.25) {
- g = 7; // 7.5 dB
- }
- else if (gain > 3.75) {
- g = 6; // 5.0 dB
- }
- else if (gain > 1.25) {
- g = 5; // 2.5 dB
- }
- else if (gain > -1.25) {
- g = 4; // 0.0 dB
- }
- else if (gain > -3.75) {
- g = 1; // -2.5 dB
- }
- else {
- g = 0; // -5.0 dB
- }
-
- fme = fcdAppSetParam(FCD_CMD_APP_SET_LNA_GAIN, &g, 1);
- /* TODO: check fme */
-}
-
-// Set new frequency correction
-void fcd_source_c::set_freq_corr(int ppm)
-{
- d_freq_corr = ppm;
- // re-tune with new correction value
- set_freq(d_freq_req);
-}
-
-
-// Set DC offset correction.
-void fcd_source_c::set_dc_corr(double _dci, double _dcq)
-{
- union {
- unsigned char auc[4];
- struct {
- signed short dci; // equivalent of qint16 which should be 16 bit everywhere
- signed short dcq;
- };
- } dcinfo;
-
- if ((_dci < -1.0) || (_dci > 1.0) || (_dcq < -1.0) || (_dcq > 1.0))
- return;
-
- dcinfo.dci = static_cast<signed short>(_dci*32768.0);
- dcinfo.dcq = static_cast<signed short>(_dcq*32768.0);
-
- fcdAppSetParam(FCD_CMD_APP_SET_DC_CORR, dcinfo.auc, 4);
-
-}
-
-
-// Set IQ phase and gain balance.
-void fcd_source_c::set_iq_corr(double _gain, double _phase)
-{
- union {
- unsigned char auc[4];
- struct {
- signed short phase;
- signed short gain;
- };
- } iqinfo;
-
- if ((_gain < -1.0) || (_gain > 1.0) || (_phase < -1.0) || (_phase > 1.0))
- return;
-
- iqinfo.phase = static_cast<signed short>(_phase*32768.0);
- iqinfo.gain = static_cast<signed short>(_gain*32768.0);
-
- fcdAppSetParam(FCD_CMD_APP_SET_IQ_CORR, iqinfo.auc, 4);
-
-}
diff --git a/gr-fcd/lib/fcd_source_c_impl.cc b/gr-fcd/lib/fcd_source_c_impl.cc
new file mode 100644
index 000000000..ca370d9f3
--- /dev/null
+++ b/gr-fcd/lib/fcd_source_c_impl.cc
@@ -0,0 +1,238 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011-2012 Free Software Foundation, Inc.
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
+#include <fcd_source_c_impl.h>
+#include <fcd.h>
+#include <fcdhidcmd.h> // needed for extended API
+#include <gr_io_signature.h>
+#include <gr_float_to_complex.h>
+#include <gruel/attributes.h>
+
+//#include <iostream>
+//using namespace std;
+
+/*
+ * Create a new instance of fcd_source_c_impl and return
+ * an upcasted boost shared_ptr. This is effectively the public constructor.
+ */
+fcd_source_c_sptr fcd_make_source_c(const std::string device_name)
+{
+ return gnuradio::get_initial_sptr(new fcd_source_c_impl(device_name));
+}
+
+static const int MIN_IN = 0; /*!< Mininum number of input streams. */
+static const int MAX_IN = 0; /*!< Maximum number of input streams. */
+static const int MIN_OUT = 1; /*!< Minimum number of output streams. */
+static const int MAX_OUT = 1; /*!< Maximum number of output streams. */
+
+fcd_source_c_impl::fcd_source_c_impl(const std::string device_name)
+ : gr_hier_block2 ("fcd_source_c",
+ gr_make_io_signature (MIN_IN, MAX_IN, sizeof (gr_complex)),
+ gr_make_io_signature (MIN_OUT, MAX_OUT, sizeof (gr_complex))),
+ d_freq_corr(-120),
+ d_freq_req(0)
+{
+ gr_float_to_complex_sptr f2c;
+
+ /* Audio source; sample rate fixed at 96kHz */
+ fcd = audio_make_source(96000, device_name, true);
+
+ /* block to convert stereo audio to a complex stream */
+ f2c = gr_make_float_to_complex(1);
+
+ connect(fcd, 0, f2c, 0);
+ connect(fcd, 1, f2c, 1);
+ connect(f2c, 0, self(), 0);
+}
+
+// Set frequency with Hz resolution
+void fcd_source_c_impl::set_freq(int freq)
+{
+ FCD_MODE_ENUM __GR_ATTR_UNUSED fme;
+ double f = (double)freq;
+
+ /* valid range 50 MHz - 2.0 GHz */
+ if ((freq < 50000000) || (freq > 2000000000)) {
+ return;
+ }
+
+ d_freq_req = freq;
+ f *= 1.0 + d_freq_corr/1000000.0;
+
+ fme = fcdAppSetFreq((int)f);
+ /* TODO: check fme */
+}
+
+// Set frequency with Hz resolution (type float)
+void fcd_source_c_impl::set_freq(float freq)
+{
+ FCD_MODE_ENUM __GR_ATTR_UNUSED fme;
+ double f = (double)freq;
+
+ /* valid range 50 MHz - 2.0 GHz */
+ if ((freq < 50.0e6) || (freq > 2.0e9)) {
+ return;
+ }
+
+ d_freq_req = (int)freq;
+ f *= 1.0 + d_freq_corr/1000000.0;
+
+ fme = fcdAppSetFreq((int)f);
+ /* TODO: check fme */
+}
+
+
+// Set frequency with kHz resolution.
+void fcd_source_c_impl::set_freq_khz(int freq)
+{
+ FCD_MODE_ENUM __GR_ATTR_UNUSED fme;
+ double f = freq*1000.0;
+
+ /* valid range 50 MHz - 2.0 GHz */
+ if ((freq < 50000) || (freq > 2000000)) {
+ return;
+ }
+
+ d_freq_req = freq*1000;
+ f *= 1.0 + d_freq_corr/1000000.0;
+
+ fme = fcdAppSetFreqkHz((int)(f/1000.0));
+ /* TODO: check fme */
+}
+
+
+// Set LNA gain
+void fcd_source_c_impl::set_lna_gain(float gain)
+{
+ FCD_MODE_ENUM __GR_ATTR_UNUSED fme;
+ unsigned char g;
+
+ /* convert to nearest discrete value */
+ if (gain > 27.5) {
+ g = 14; // 30.0 dB
+ }
+ else if (gain > 22.5) {
+ g = 13; // 25.0 dB
+ }
+ else if (gain > 18.75) {
+ g = 12; // 20.0 dB
+ }
+ else if (gain > 16.25) {
+ g = 11; // 17.5 dB
+ }
+ else if (gain > 13.75) {
+ g = 10; // 15.0 dB
+ }
+ else if (gain > 11.25) {
+ g = 9; // 12.5 dB
+ }
+ else if (gain > 8.75) {
+ g = 8; // 10.0 dB
+ }
+ else if (gain > 6.25) {
+ g = 7; // 7.5 dB
+ }
+ else if (gain > 3.75) {
+ g = 6; // 5.0 dB
+ }
+ else if (gain > 1.25) {
+ g = 5; // 2.5 dB
+ }
+ else if (gain > -1.25) {
+ g = 4; // 0.0 dB
+ }
+ else if (gain > -3.75) {
+ g = 1; // -2.5 dB
+ }
+ else {
+ g = 0; // -5.0 dB
+ }
+
+ fme = fcdAppSetParam(FCD_CMD_APP_SET_LNA_GAIN, &g, 1);
+ /* TODO: check fme */
+}
+
+// Set mixer gain
+void fcd_source_c_impl::set_mixer_gain(float gain)
+{
+ FCD_MODE_ENUM fme;
+ unsigned char g;
+
+ if ( gain > 4.0 ) {
+ g = TMGE_P12_0DB;
+ } else {
+ g = TMGE_P4_0DB;
+ }
+
+ fme = fcdAppSetParam(FCD_CMD_APP_SET_MIXER_GAIN, &g, 1);
+ /* TODO: check fme */
+}
+
+// Set new frequency correction
+void fcd_source_c_impl::set_freq_corr(int ppm)
+{
+ d_freq_corr = ppm;
+ // re-tune with new correction value
+ set_freq(d_freq_req);
+}
+
+// Set DC offset correction.
+void fcd_source_c_impl::set_dc_corr(double _dci, double _dcq)
+{
+ union {
+ unsigned char auc[4];
+ struct {
+ signed short dci; // equivalent of qint16 which should be 16 bit everywhere
+ signed short dcq;
+ };
+ } dcinfo;
+
+ if ((_dci < -1.0) || (_dci > 1.0) || (_dcq < -1.0) || (_dcq > 1.0))
+ return;
+
+ dcinfo.dci = static_cast<signed short>(_dci*32768.0);
+ dcinfo.dcq = static_cast<signed short>(_dcq*32768.0);
+
+ fcdAppSetParam(FCD_CMD_APP_SET_DC_CORR, dcinfo.auc, 4);
+}
+
+// Set IQ phase and gain balance.
+void fcd_source_c_impl::set_iq_corr(double _gain, double _phase)
+{
+ union {
+ unsigned char auc[4];
+ struct {
+ signed short phase;
+ signed short gain;
+ };
+ } iqinfo;
+
+ if ((_gain < -1.0) || (_gain > 1.0) || (_phase < -1.0) || (_phase > 1.0))
+ return;
+
+ iqinfo.phase = static_cast<signed short>(_phase*32768.0);
+ iqinfo.gain = static_cast<signed short>(_gain*32768.0);
+
+ fcdAppSetParam(FCD_CMD_APP_SET_IQ_CORR, iqinfo.auc, 4);
+}
diff --git a/gr-fcd/lib/fcd_source_c_impl.h b/gr-fcd/lib/fcd_source_c_impl.h
new file mode 100644
index 000000000..d082ecc1e
--- /dev/null
+++ b/gr-fcd/lib/fcd_source_c_impl.h
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011-2012 Free Software Foundation, Inc.
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_FCD_SOURCE_C_IMPL_H
+#define INCLUDED_FCD_SOURCE_C_IMPL_H
+
+#include <fcd_source_c.h>
+#include <gr_audio_source.h>
+
+class FCD_API fcd_source_c_impl : public fcd_source_c
+{
+public:
+ /* Public API functions documented in include/fcd_source_c.h */
+ void set_freq(int freq);
+ void set_freq(float freq);
+ void set_freq_khz(int freq);
+ void set_lna_gain(float gain);
+ void set_mixer_gain(float gain);
+ void set_freq_corr(int ppm);
+ void set_dc_corr(double _dci, double _dcq);
+ void set_iq_corr(double _gain, double _phase);
+
+private:
+ fcd_source_c_impl(const std::string device_name = "");
+ friend FCD_API fcd_source_c_sptr
+ fcd_make_source_c(const std::string device_name);
+
+ audio_source::sptr fcd; /*!< The audio input source */
+ int d_freq_corr; /*!< The frequency correction in ppm */
+ int d_freq_req; /*!< The latest requested frequency in Hz */
+};
+
+#endif /* INCLUDED_FCD_SOURCE_C_IMPL_H */
diff --git a/gr-fcd/swig/CMakeLists.txt b/gr-fcd/swig/CMakeLists.txt
index 7d881c0b4..f715c4785 100644
--- a/gr-fcd/swig/CMakeLists.txt
+++ b/gr-fcd/swig/CMakeLists.txt
@@ -23,6 +23,8 @@
include(GrPython)
include(GrSwig)
+#set(GR_SWIG_FLAGS -DGR_HAVE_FCD) #needed to parse fcd_swig.i
+
set(GR_SWIG_INCLUDE_DIRS
${GR_FCD_INCLUDE_DIRS}
${GNURADIO_CORE_SWIG_INCLUDE_DIRS}
@@ -45,7 +47,6 @@ GR_SWIG_INSTALL(
install(
FILES
fcd_swig.i
- fcd_source_c.i
${CMAKE_CURRENT_BINARY_DIR}/fcd_swig_doc.i
DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
COMPONENT "fcd_swig"
diff --git a/gr-fcd/swig/fcd_source_c.i b/gr-fcd/swig/fcd_source_c.i
deleted file mode 100644
index 3438ab74d..000000000
--- a/gr-fcd/swig/fcd_source_c.i
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * First arg is the package prefix.
- * Second arg is the name of the class minus the prefix.
- *
- * This does some behind-the-scenes magic so we can
- * access fcd_source_c from python as fcd.source_c
- */
-GR_SWIG_BLOCK_MAGIC(fcd,source_c);
-
-fcd_source_c_sptr fcd_make_source_c (const std::string device_name = "");
-
-class fcd_source_c : public gr_hier_block2
-{
-public:
- void set_freq(float freq);
- void set_freq_khz(int freq);
- void set_lna_gain(float gain);
- void set_freq_corr(int ppm);
- void set_dc_corr(double dci, double dcq);
- void set_iq_corr(double gain, double phase);
-};
diff --git a/gr-fcd/swig/fcd_swig.i b/gr-fcd/swig/fcd_swig.i
index f00ceb421..d75e57b85 100644
--- a/gr-fcd/swig/fcd_swig.i
+++ b/gr-fcd/swig/fcd_swig.i
@@ -20,6 +20,11 @@
* Boston, MA 02110-1301, USA.
*/
+#define FCD_API
+
+//suppress 319. No access specifier given for base class name (ignored).
+#pragma SWIG nowarn=319
+
%include "gnuradio.i"
//load generated python docstrings
@@ -29,4 +34,7 @@
#include "fcd_source_c.h"
%}
-%include "fcd_source_c.i"
+%include "fcd_source_c.h"
+
+GR_SWIG_BLOCK_MAGIC(fcd,source_c);
+fcd_source_c_sptr fcd_make_source_c (const std::string device_name = "");
diff --git a/gr-uhd/apps/uhd_fft b/gr-uhd/apps/uhd_fft
index 39ba3838e..9e2554768 100755
--- a/gr-uhd/apps/uhd_fft
+++ b/gr-uhd/apps/uhd_fft
@@ -31,6 +31,7 @@ import numpy
try:
from gnuradio.wxgui import stdgui2, form, slider
+ from gnuradio.wxgui import forms
from gnuradio.wxgui import fftsink2, waterfallsink2, scopesink2
import wx
except ImportError:
@@ -194,6 +195,26 @@ class app_top_block(stdgui2.std_top_block):
min=int(glow), max=int(ghigh),
callback=self.set_gain)
+ try:
+ usrp_config_val = "%s (%s), %s (%s, %s, %s)" % (self.u.get_usrp_rx_info().get("mboard_id").split(" ")[0], self.u.get_usrp_rx_info().get("mboard_serial"),
+ self.u.get_usrp_rx_info().get("rx_id").split(" ")[0].split(",")[0], self.u.get_usrp_rx_info().get("rx_serial"), self.u.get_subdev_spec(), self.u.get_antenna())
+ except:
+ usrp_config_val = "Not implemented in this version."
+
+ uhd_box = forms.static_box_sizer(parent=self.panel,
+ label="UHD (%s)" % (uhd.get_version_string()),
+ orient=wx.HORIZONTAL,
+ bold=True)
+ usrp_config_form = forms.static_text(
+ parent=self.panel,
+ sizer=uhd_box,
+ value=usrp_config_val,
+ label="USRP",
+ converter=forms.str_converter(),
+ )
+ vbox.Add(uhd_box, 0, wx.EXPAND)
+ vbox.AddSpacer(5)
+
hbox.Add((5,0), 0, 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -231,8 +252,10 @@ class app_top_block(stdgui2.std_top_block):
myform['dspfreq'] = form.static_float_field(
parent=panel, sizer=hbox, label="DSP Freq.")
- hbox.Add((5,0), 0)
+ vbox.AddSpacer(5)
+
vbox.Add(hbox, 0, wx.EXPAND)
+ vbox.AddSpacer(5)
def set_freq(self, target_freq):
"""
@@ -247,6 +270,7 @@ class app_top_block(stdgui2.std_top_block):
self.myform['freq'].set_value(self.u.get_center_freq())
self.myform['rffreq'].set_value(r.actual_rf_freq)
self.myform['dspfreq'].set_value(r.actual_dsp_freq)
+
if not self.options.oscilloscope:
self.scope.set_baseband_freq(target_freq)
return True
diff --git a/gr-uhd/apps/uhd_siggen_base.py b/gr-uhd/apps/uhd_siggen_base.py
index 5ec4fc5fb..02f98facf 100644
--- a/gr-uhd/apps/uhd_siggen_base.py
+++ b/gr-uhd/apps/uhd_siggen_base.py
@@ -107,12 +107,32 @@ class top_block(gr.top_block, pubsub):
if(options.antenna):
self._u.set_antenna(options.antenna, 0)
- self.publish(DESC_KEY, lambda: str(self._u))
+ # Setup USRP Configuration value
+ try:
+ usrp_info = self._u.get_usrp_tx_info()
+ usrp_mb = usrp_info.get("mboard_id").split(" ")[0]
+ usrp_mbs = usrp_info.get("mboard_serial")
+ usrp_db = usrp_info.get("tx_id").split(" ")[0]
+ usrp_dbs = usrp_info.get("tx_serial")
+ usrp_sd = self._u.get_subdev_spec()
+ usrp_ant = self._u.get_antenna()
+
+ desc_key_str = "Motherboard: %s [%s]\n" % (usrp_mb, usrp_mbs)
+ desc_key_str += "Daughterboard: %s [%s]\n" % (usrp_db, usrp_dbs)
+ desc_key_str += "Subdev: %s\n" % usrp_sd
+ desc_key_str += "Antenna: %s" % usrp_ant
+ except:
+ desc_key_str = "USRP configuration output not implemented in this version"
+
+ self.publish(DESC_KEY, lambda: desc_key_str)
self.publish(FREQ_RANGE_KEY, self._u.get_freq_range)
self.publish(GAIN_RANGE_KEY, self._u.get_gain_range)
self.publish(GAIN_KEY, self._u.get_gain)
- if self._verbose:
- print str(self._u)
+
+ print "UHD Signal Generator"
+ print "Version: %s" % uhd.get_version_string()
+ print "\nUsing USRP configuration:"
+ print desc_key_str + "\n"
# Direct asynchronous notifications to callback function
if options.show_async_msg:
diff --git a/gr-uhd/apps/uhd_siggen_gui b/gr-uhd/apps/uhd_siggen_gui
index 861f18944..7e0fdc041 100755
--- a/gr-uhd/apps/uhd_siggen_gui
+++ b/gr-uhd/apps/uhd_siggen_gui
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2009,2011 Free Software Foundation, Inc.
+# Copyright 2009,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,7 +21,7 @@
#
import wx
-from gnuradio import gr
+from gnuradio import gr, uhd
from gnuradio.gr.pubsub import pubsub
from gnuradio.wxgui import gui, forms
from gnuradio.uhd import uhd_siggen_base as uhd_siggen
@@ -269,7 +269,7 @@ class app_gui(pubsub):
# UHD status
##################################################
u2_hbox = forms.static_box_sizer(parent=self.panel,
- label="UHD Status",
+ label="UHD (%s)" % (uhd.get_version_string()),
orient=wx.HORIZONTAL,
bold=True)
self.vbox.Add(u2_hbox, 0, wx.EXPAND)
diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h
index ff4856f9b..fff567438 100644
--- a/gr-uhd/include/gr_uhd_usrp_sink.h
+++ b/gr-uhd/include/gr_uhd_usrp_sink.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2011 Free Software Foundation, Inc.
+ * Copyright 2010-2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -131,12 +131,29 @@ public:
virtual void set_start_time(const uhd::time_spec_t &time) = 0;
/*!
+ * Returns identifying information about this USRP's configuration.
+ * Returns motherboard ID, name, and serial.
+ * Returns daughterboard TX ID, subdev name, and serial.
+ * \param chan channel index 0 to N-1
+ * \return TX info
+ */
+ virtual uhd::dict<std::string, std::string> get_usrp_tx_info(size_t chan = 0) = 0;
+
+ /*!
* Set the frontend specification.
* \param spec the subdev spec markup string
* \param mboard the motherboard index 0 to M-1
*/
virtual void set_subdev_spec(const std::string &spec, size_t mboard = 0) = 0;
+
+ /*!
+ * Get the TX frontend specification.
+ * \param mboard the motherboard index 0 to M-1
+ * \return the frontend specification in use
+ */
+ virtual std::string get_subdev_spec (size_t mboard = 0) = 0;
+
/*!
* Set the sample rate for the usrp device.
* \param rate a new rate in Sps
diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h
index 415503bc1..0dde4b194 100644
--- a/gr-uhd/include/gr_uhd_usrp_source.h
+++ b/gr-uhd/include/gr_uhd_usrp_source.h
@@ -123,6 +123,15 @@ public:
virtual void set_start_time(const uhd::time_spec_t &time) = 0;
/*!
+ * Returns identifying information about this USRP's configuration.
+ * Returns motherboard ID, name, and serial.
+ * Returns daughterboard RX ID, subdev name, and serial.
+ * \param chan channel index 0 to N-1
+ * \return RX info
+ */
+ virtual uhd::dict<std::string, std::string> get_usrp_rx_info(size_t chan = 0) = 0;
+
+ /*!
* Set the frontend specification.
* \param spec the subdev spec markup string
* \param mboard the motherboard index 0 to M-1
@@ -130,6 +139,13 @@ public:
virtual void set_subdev_spec(const std::string &spec, size_t mboard = 0) = 0;
/*!
+ * Get the RX frontend specification.
+ * \param mboard the motherboard index 0 to M-1
+ * \return the frontend specification in use
+ */
+ virtual std::string get_subdev_spec(size_t mboard = 0) = 0;
+
+ /*!
* Set the sample rate for the usrp device.
* \param rate a new rate in Sps
*/
diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc
index 7e7875898..d86165f65 100644
--- a/gr-uhd/lib/gr_uhd_usrp_sink.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc
@@ -66,10 +66,22 @@ public:
_dev = uhd::usrp::multi_usrp::make(device_addr);
}
+ uhd::dict<std::string, std::string> get_usrp_tx_info(size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_GET_USRP_INFO_API
+ return _dev->get_usrp_tx_info(chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
void set_subdev_spec(const std::string &spec, size_t mboard){
return _dev->set_tx_subdev_spec(spec, mboard);
}
+ std::string get_subdev_spec(size_t mboard){
+ return _dev->get_tx_subdev_spec(mboard).to_string();
+ }
+
void set_samp_rate(double rate){
_dev->set_tx_rate(rate);
_sample_rate = this->get_samp_rate();
diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc
index bd7f4e21d..49558cee6 100644
--- a/gr-uhd/lib/gr_uhd_usrp_source.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_source.cc
@@ -70,10 +70,22 @@ public:
_dev = uhd::usrp::multi_usrp::make(device_addr);
}
+ uhd::dict<std::string, std::string> get_usrp_rx_info(size_t chan){
+ #ifdef UHD_USRP_MULTI_USRP_GET_USRP_INFO_API
+ return _dev->get_usrp_rx_info(chan);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
void set_subdev_spec(const std::string &spec, size_t mboard){
return _dev->set_rx_subdev_spec(spec, mboard);
}
+ std::string get_subdev_spec(size_t mboard){
+ return _dev->get_rx_subdev_spec(mboard).to_string();
+ }
+
void set_samp_rate(double rate){
_dev->set_rx_rate(rate);
}
diff --git a/gr-uhd/swig/__init__.py b/gr-uhd/swig/__init__.py
index 82dbdd9e7..b4045e77f 100644
--- a/gr-uhd/swig/__init__.py
+++ b/gr-uhd/swig/__init__.py
@@ -1,5 +1,5 @@
#
-# Copyright 2010-2011 Free Software Foundation, Inc.
+# Copyright 2010-2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i
index 053f4a999..cb74b3dce 100644
--- a/gr-uhd/swig/uhd_swig.i
+++ b/gr-uhd/swig/uhd_swig.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010-2011 Free Software Foundation, Inc.
+ * Copyright 2010-2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -125,4 +125,12 @@ static const size_t ALL_MBOARDS = uhd::usrp::multi_usrp::ALL_MBOARDS;
%}
static const size_t ALL_MBOARDS;
+%{
+#include <uhd/version.hpp>
+std::string get_version_string(void){
+ return uhd::get_version_string();
+}
+%}
+std::string get_version_string(void);
+
#endif /* GR_HAVE_UHD */
diff --git a/gr-wavelet/CMakeLists.txt b/gr-wavelet/CMakeLists.txt
new file mode 100644
index 000000000..c37e55282
--- /dev/null
+++ b/gr-wavelet/CMakeLists.txt
@@ -0,0 +1,109 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+# Setup dependencies
+########################################################################
+include(GrBoost)
+
+find_package(GSL)
+
+########################################################################
+# Register component
+########################################################################
+include(GrComponent)
+
+GR_REGISTER_COMPONENT("gr-wavelet" ENABLE_GR_WAVELET
+ Boost_FOUND
+ ENABLE_GR_CORE
+ GSL_FOUND
+)
+
+GR_SET_GLOBAL(GR_WAVELET_INCLUDE_DIRS
+ ${CMAKE_CURRENT_SOURCE_DIR}/lib
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/wavelet
+)
+
+########################################################################
+# Begin conditional configuration
+########################################################################
+if(ENABLE_GR_WAVELET)
+
+########################################################################
+# Setup CPack components
+########################################################################
+include(GrPackage)
+CPACK_SET(CPACK_COMPONENT_GROUP_WAVELET_DESCRIPTION "GNU Radio Wavelet Blocks")
+
+CPACK_COMPONENT("wavelet_runtime"
+ GROUP "WAVELET"
+ DISPLAY_NAME "Runtime"
+ DESCRIPTION "Runtime"
+ DEPENDS "core_runtime"
+)
+
+CPACK_COMPONENT("wavelet_devel"
+ GROUP "WAVELET"
+ DISPLAY_NAME "Development"
+ DESCRIPTION "C++ headers, package config, import libraries"
+ DEPENDS "core_devel"
+)
+
+CPACK_COMPONENT("wavelet_python"
+ GROUP "WAVELET"
+ DISPLAY_NAME "Python"
+ DESCRIPTION "Python modules for runtime; GRC xml files"
+ DEPENDS "core_python;wavelet_runtime"
+)
+
+CPACK_COMPONENT("wavelet_swig"
+ GROUP "WAVELET"
+ DISPLAY_NAME "SWIG"
+ DESCRIPTION "SWIG development .i files"
+ DEPENDS "core_swig;wavelet_python;wavelet_devel"
+)
+
+########################################################################
+# Add subdirectories
+########################################################################
+add_subdirectory(include/wavelet)
+add_subdirectory(lib)
+if(ENABLE_PYTHON)
+ add_subdirectory(swig)
+ add_subdirectory(python)
+# add_subdirectory(grc)
+endif(ENABLE_PYTHON)
+#add_subdirectory(examples)
+#add_subdirectory(doc)
+
+########################################################################
+# Create Pkg Config File
+########################################################################
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-wavelet.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-wavelet.pc
+@ONLY)
+
+install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-wavelet.pc
+ DESTINATION ${GR_LIBRARY_DIR}/pkgconfig
+ COMPONENT "wavelet_devel"
+)
+
+endif(ENABLE_GR_WAVELET)
diff --git a/gr-wavelet/gnuradio-wavelet.pc.in b/gr-wavelet/gnuradio-wavelet.pc.in
new file mode 100644
index 000000000..998ae9056
--- /dev/null
+++ b/gr-wavelet/gnuradio-wavelet.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: gnuradio-wavelet
+Description: Wavelet signal processing blocks for GNU Radio
+Requires: gnuradio-core
+Version: @LIBVER@
+Libs: -L${libdir} -lgnuradio-wavelet
+Cflags: -I${includedir}
diff --git a/gr-wavelet/include/wavelet/CMakeLists.txt b/gr-wavelet/include/wavelet/CMakeLists.txt
new file mode 100644
index 000000000..a37a3b0cd
--- /dev/null
+++ b/gr-wavelet/include/wavelet/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+# Install header files
+########################################################################
+install(FILES
+ wavelet_api.h
+ wavelet_squash_ff.h
+ wavelet_wavelet_ff.h
+ wavelet_wvps_ff.h
+ DESTINATION ${GR_INCLUDE_DIR}/gnuradio
+ COMPONENT "wavelet_devel"
+)
+
diff --git a/gnuradio-core/src/lib/general/gr_wavelet_ff.i b/gr-wavelet/include/wavelet/wavelet_api.h
index 9d4264170..68b2c04d7 100644
--- a/gnuradio-core/src/lib/general/gr_wavelet_ff.i
+++ b/gr-wavelet/include/wavelet/wavelet_api.h
@@ -1,31 +1,33 @@
-/* -*- c++ -*- */
/*
- * Copyright 2008 Free Software Foundation, Inc.
- *
+ * Copyright 2012 Free Software Foundation, Inc.
+ *
* This file is part of GNU Radio
- *
+ *
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
- *
+ *
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(gr,wavelet_ff);
+#ifndef INCLUDED_WAVELET_API_H
+#define INCLUDED_WAVELET_API_H
-gr_wavelet_ff_sptr gr_make_wavelet_ff(int size, int order, bool forward);
+#include <gruel/attributes.h>
-class gr_wavelet_ff : public gr_sync_block
-{
-private:
- gr_wavelet_ff(int size, int order, bool forward);
-};
+#ifdef gnuradio_wavelet_EXPORTS
+# define WAVELET_API __GR_ATTR_EXPORT
+#else
+# define WAVELET_API __GR_ATTR_IMPORT
+#endif
+#endif /* INCLUDED_WAVELET_API_H */
diff --git a/gr-wavelet/include/wavelet/wavelet_squash_ff.h b/gr-wavelet/include/wavelet/wavelet_squash_ff.h
new file mode 100644
index 000000000..c79f513c6
--- /dev/null
+++ b/gr-wavelet/include/wavelet/wavelet_squash_ff.h
@@ -0,0 +1,45 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008,2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_WAVELET_SQUASH_FF_H
+#define INCLUDED_WAVELET_SQUASH_FF_H
+
+#include <wavelet_api.h>
+#include <gr_sync_block.h>
+
+/*!
+ * \brief implements cheap resampling of spectrum directly from
+ * spectral points, using gsl interpolation
+ * \ingroup misc
+ */
+class wavelet_squash_ff;
+typedef boost::shared_ptr<wavelet_squash_ff> wavelet_squash_ff_sptr;
+
+WAVELET_API wavelet_squash_ff_sptr wavelet_make_squash_ff(const std::vector<float> &igrid,
+ const std::vector<float> &ogrid);
+
+class WAVELET_API wavelet_squash_ff : virtual public gr_sync_block
+{
+ // No public API methods visible
+};
+
+#endif
diff --git a/gr-wavelet/include/wavelet/wavelet_wavelet_ff.h b/gr-wavelet/include/wavelet/wavelet_wavelet_ff.h
new file mode 100644
index 000000000..ef920f163
--- /dev/null
+++ b/gr-wavelet/include/wavelet/wavelet_wavelet_ff.h
@@ -0,0 +1,46 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008,2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+#ifndef INCLUDED_WAVELET_WAVELET_FF_H
+#define INCLUDED_WAVELET_WAVELET_FF_H
+
+#include <wavelet_api.h>
+#include <gr_sync_block.h>
+
+class wavelet_wavelet_ff;
+typedef boost::shared_ptr<wavelet_wavelet_ff> wavelet_wavelet_ff_sptr;
+
+WAVELET_API wavelet_wavelet_ff_sptr
+wavelet_make_wavelet_ff(int size = 1024,
+ int order = 20,
+ bool forward = true);
+
+/*!
+ * \brief compute wavelet transform using gsl routines
+ * \ingroup wavelet_blk
+ */
+
+class WAVELET_API wavelet_wavelet_ff : virtual public gr_sync_block
+{
+ // No public API methods visible
+};
+
+#endif /* INCLUDED_WAVELET_WAVELET_FF_H */
diff --git a/gr-wavelet/include/wavelet/wavelet_wvps_ff.h b/gr-wavelet/include/wavelet/wavelet_wvps_ff.h
new file mode 100644
index 000000000..061f42323
--- /dev/null
+++ b/gr-wavelet/include/wavelet/wavelet_wvps_ff.h
@@ -0,0 +1,44 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008,2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_WAVELET_WVPS_FF_H
+#define INCLUDED_WAVELET_WVPS_FF_H
+
+#include <wavelet_api.h>
+#include <gr_sync_decimator.h>
+
+class wavelet_wvps_ff;
+typedef boost::shared_ptr<wavelet_wvps_ff> wavelet_wvps_ff_sptr;
+
+WAVELET_API wavelet_wvps_ff_sptr
+wavelet_make_wvps_ff(int ilen);
+
+/*!
+ * \brief computes the Wavelet Power Spectrum from a set of wavelet coefficients
+ * \ingroup wavelet_blk
+ */
+class WAVELET_API wavelet_wvps_ff : virtual public gr_sync_block
+{
+ // No public API methods visible
+};
+
+#endif /* INCLUDED_WAVELET_WVPS_FF_H */
diff --git a/gr-wavelet/lib/CMakeLists.txt b/gr-wavelet/lib/CMakeLists.txt
new file mode 100644
index 000000000..dd5e1500d
--- /dev/null
+++ b/gr-wavelet/lib/CMakeLists.txt
@@ -0,0 +1,54 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+# Setup the include and linker paths
+########################################################################
+include_directories(
+ ${GNURADIO_CORE_INCLUDE_DIRS}
+ ${GR_WAVELET_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+include_directories(${WAVELET_INCLUDE_DIRS})
+link_directories(${WAVELET_LIBRARY_DIRS})
+
+include_directories(${Boost_INCLUDE_DIRS})
+link_directories(${Boost_LIBRARY_DIRS})
+
+########################################################################
+# Setup library
+########################################################################
+list(APPEND gr_wavelet_sources
+ wavelet_squash_ff_impl.cc
+ wavelet_wavelet_ff_impl.cc
+ wavelet_wvps_ff_impl.cc
+)
+
+list(APPEND wavelet_libs
+ gnuradio-core
+ ${Boost_LIBRARIES}
+ ${WAVELET_LIBRARIES}
+ ${GSL_LIBRARIES}
+)
+
+add_library(gnuradio-wavelet SHARED ${gr_wavelet_sources})
+target_link_libraries(gnuradio-wavelet ${wavelet_libs})
+GR_LIBRARY_FOO(gnuradio-wavelet RUNTIME_COMPONENT "wavelet_runtime" DEVEL_COMPONENT "wavelet_devel")
diff --git a/gnuradio-core/src/lib/general/gr_squash_ff.cc b/gr-wavelet/lib/wavelet_squash_ff_impl.cc
index 479204fdb..23f1a5e2f 100644
--- a/gnuradio-core/src/lib/general/gr_squash_ff.cc
+++ b/gr-wavelet/lib/wavelet_squash_ff_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2008,2010 Free Software Foundation, Inc.
+ * Copyright 2008,2010,2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -25,21 +25,21 @@
#endif
#include <stdexcept>
-#include <gr_squash_ff.h>
+#include <wavelet_squash_ff_impl.h>
#include <gr_io_signature.h>
// expect input vector of igrid.size y-values,
// produce output vector of ogrid.size y-values
-gr_squash_ff_sptr
-gr_make_squash_ff(const std::vector<float> &igrid,
- const std::vector<float> &ogrid)
+wavelet_squash_ff_sptr
+wavelet_make_squash_ff(const std::vector<float> &igrid,
+ const std::vector<float> &ogrid)
{
- return gnuradio::get_initial_sptr(new gr_squash_ff(igrid, ogrid));
+ return gnuradio::get_initial_sptr(new wavelet_squash_ff_impl(igrid, ogrid));
}
-gr_squash_ff::gr_squash_ff(const std::vector<float> &igrid,
- const std::vector<float> &ogrid)
+wavelet_squash_ff_impl::wavelet_squash_ff_impl(const std::vector<float> &igrid,
+ const std::vector<float> &ogrid)
: gr_sync_block("squash_ff",
gr_make_io_signature(1, 1, sizeof(float) * igrid.size()),
gr_make_io_signature(1, 1, sizeof(float) * ogrid.size()))
@@ -58,7 +58,7 @@ gr_squash_ff::gr_squash_ff(const std::vector<float> &igrid,
d_spline = gsl_spline_alloc(gsl_interp_cspline, d_inum); // FIXME check w/ Frank
}
-gr_squash_ff::~gr_squash_ff()
+wavelet_squash_ff_impl::~wavelet_squash_ff_impl()
{
free((char *) d_igrid);
free((char *) d_iwork);
@@ -68,9 +68,9 @@ gr_squash_ff::~gr_squash_ff()
}
int
-gr_squash_ff::work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+wavelet_squash_ff_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
diff --git a/gnuradio-core/src/lib/general/gr_squash_ff.h b/gr-wavelet/lib/wavelet_squash_ff_impl.h
index f7fea1648..806f13e40 100644
--- a/gnuradio-core/src/lib/general/gr_squash_ff.h
+++ b/gr-wavelet/lib/wavelet_squash_ff_impl.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,31 +20,17 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GR_SQUASH_FF_H_
-# define INCLUDED_GR_SQUASH_FF_H_
+#ifndef INCLUDED_WAVELET_SQUASH_FF_IMPL_H
+#define INCLUDED_WAVELET_SQUASH_FF_IMPL_H
-#include <gr_core_api.h>
-#include <gr_sync_block.h>
+#include <wavelet_api.h>
+#include <wavelet_squash_ff.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_interp.h>
#include <gsl/gsl_spline.h>
-/*!
- * \brief implements cheap resampling of spectrum directly from
- * spectral points, using gsl interpolation
- * \ingroup misc
- */
-
-class gr_squash_ff;
-typedef boost::shared_ptr<gr_squash_ff> gr_squash_ff_sptr;
-
-GR_CORE_API gr_squash_ff_sptr gr_make_squash_ff(const std::vector<float> &igrid,
- const std::vector<float> &ogrid);
-class GR_CORE_API gr_squash_ff : public gr_sync_block
+class WAVELET_API wavelet_squash_ff_impl : public wavelet_squash_ff
{
- friend GR_CORE_API gr_squash_ff_sptr gr_make_squash_ff(const std::vector<float> &igrid,
- const std::vector<float> &ogrid);
-
size_t d_inum;
size_t d_onum;
double *d_igrid;
@@ -54,15 +40,19 @@ class GR_CORE_API gr_squash_ff : public gr_sync_block
gsl_interp_accel *d_accel;
gsl_spline *d_spline;
- gr_squash_ff(const std::vector<float> &igrid,
- const std::vector<float> &ogrid);
+ wavelet_squash_ff_impl(const std::vector<float> &igrid,
+ const std::vector<float> &ogrid);
+
+ friend WAVELET_API wavelet_squash_ff_sptr
+ wavelet_make_squash_ff(const std::vector<float> &igrid,
+ const std::vector<float> &ogrid);
public:
- ~gr_squash_ff();
+ ~wavelet_squash_ff_impl();
int work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};
-#endif
+#endif /* INCLUDED_WAVELET_WAVELET_FF_IMPL_H */
diff --git a/gnuradio-core/src/lib/general/gr_wavelet_ff.cc b/gr-wavelet/lib/wavelet_wavelet_ff_impl.cc
index f77c96e99..719f4b53f 100644
--- a/gnuradio-core/src/lib/general/gr_wavelet_ff.cc
+++ b/gr-wavelet/lib/wavelet_wavelet_ff_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2008,2010 Free Software Foundation, Inc.
+ * Copyright 2008,2010,2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -25,7 +25,7 @@
#endif
#include <stdexcept>
-#include <gr_wavelet_ff.h>
+#include <wavelet_wavelet_ff_impl.h>
#include <gr_io_signature.h>
#include <stdio.h>
@@ -33,19 +33,15 @@
// NB in this version, only Daubechies wavelets
// order is wavelet length, even, 2...20
-gr_wavelet_ff_sptr
-gr_make_wavelet_ff(int size,
- int order,
- bool forward)
+wavelet_wavelet_ff_sptr
+wavelet_make_wavelet_ff(int size,
+ int order,
+ bool forward)
{
- return gnuradio::get_initial_sptr(new gr_wavelet_ff(size,
- order,
- forward));
+ return gnuradio::get_initial_sptr(new wavelet_wavelet_ff_impl(size, order, forward));
}
-gr_wavelet_ff::gr_wavelet_ff(int size,
- int order,
- bool forward)
+wavelet_wavelet_ff_impl::wavelet_wavelet_ff_impl(int size, int order, bool forward)
: gr_sync_block("wavelet_ff",
gr_make_io_signature(1, 1, size * sizeof(float)),
gr_make_io_signature(1, 1, size * sizeof(float))),
@@ -64,7 +60,7 @@ gr_wavelet_ff::gr_wavelet_ff(int size,
throw std::runtime_error("can't allocate wavelet double conversion temp");
}
-gr_wavelet_ff::~gr_wavelet_ff()
+wavelet_wavelet_ff_impl::~wavelet_wavelet_ff_impl()
{
gsl_wavelet_free(d_wavelet);
gsl_wavelet_workspace_free(d_workspace);
@@ -72,9 +68,9 @@ gr_wavelet_ff::~gr_wavelet_ff()
}
int
-gr_wavelet_ff::work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+wavelet_wavelet_ff_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
diff --git a/gnuradio-core/src/lib/general/gr_wavelet_ff.h b/gr-wavelet/lib/wavelet_wavelet_ff_impl.h
index 107a50fe2..8ad3ef0bf 100644
--- a/gnuradio-core/src/lib/general/gr_wavelet_ff.h
+++ b/gr-wavelet/lib/wavelet_wavelet_ff_impl.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2008,2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -19,30 +19,14 @@
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GR_WAVELET_FF_H
-#define INCLUDED_GR_WAVELET_FF_H
-
-#include <gr_core_api.h>
-#include <iostream>
-#include <gr_sync_block.h>
+#ifndef INCLUDED_WAVELET_WAVELET_FF_IMPL_H
+#define INCLUDED_WAVELET_WAVELET_FF_IMPL_H
+#include <wavelet_wavelet_ff.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_wavelet.h>
-class gr_wavelet_ff;
-typedef boost::shared_ptr<gr_wavelet_ff> gr_wavelet_ff_sptr;
-
-GR_CORE_API gr_wavelet_ff_sptr
-gr_make_wavelet_ff(int size = 1024,
- int order = 20,
- bool forward = true);
-
-/*!
- * \brief compute wavelet transform using gsl routines
- * \ingroup wavelet_blk
- */
-
-class GR_CORE_API gr_wavelet_ff : public gr_sync_block
+class WAVELET_API wavelet_wavelet_ff_impl : public wavelet_wavelet_ff
{
int d_size;
int d_order;
@@ -51,21 +35,21 @@ class GR_CORE_API gr_wavelet_ff : public gr_sync_block
gsl_wavelet_workspace *d_workspace;
double *d_temp;
- friend GR_CORE_API gr_wavelet_ff_sptr
- gr_make_wavelet_ff(int size,
- int order,
- bool forward);
+ friend WAVELET_API wavelet_wavelet_ff_sptr
+ wavelet_make_wavelet_ff(int size,
+ int order,
+ bool forward);
- gr_wavelet_ff(int size,
- int order,
- bool forward);
+ wavelet_wavelet_ff_impl(int size,
+ int order,
+ bool forward);
public:
- ~gr_wavelet_ff();
+ ~wavelet_wavelet_ff_impl();
- int work (int noutput_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_GR_WAVELET_FF_H */
+#endif /* INCLUDED_WAVELET_WAVELET_FF_IMPL_H */
diff --git a/gnuradio-core/src/lib/general/gr_wvps_ff.cc b/gr-wavelet/lib/wavelet_wvps_ff_impl.cc
index 8a8dc56ac..f2507adc8 100644
--- a/gnuradio-core/src/lib/general/gr_wvps_ff.cc
+++ b/gr-wavelet/lib/wavelet_wvps_ff_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2010 Free Software Foundation, Inc.
+ * Copyright 2004,2010,2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -24,7 +24,7 @@
#include "config.h"
#endif
-#include <gr_wvps_ff.h>
+#include <wavelet_wvps_ff_impl.h>
#include <gr_io_signature.h>
#include <string.h>
@@ -36,13 +36,13 @@ ceil_log2(int k)
return m;
}
-gr_wvps_ff_sptr
-gr_make_wvps_ff(int ilen)
+wavelet_wvps_ff_sptr
+wavelet_make_wvps_ff(int ilen)
{
- return gnuradio::get_initial_sptr(new gr_wvps_ff(ilen));
+ return gnuradio::get_initial_sptr(new wavelet_wvps_ff_impl(ilen));
}
-gr_wvps_ff::gr_wvps_ff(int ilen)
+wavelet_wvps_ff_impl::wavelet_wvps_ff_impl(int ilen)
: gr_sync_block("wvps_ff",
gr_make_io_signature(1, 1, sizeof(float) * ilen),
gr_make_io_signature(1, 1, sizeof(float) * ceil_log2(ilen))),
@@ -53,9 +53,9 @@ gr_wvps_ff::gr_wvps_ff(int ilen)
// input vector assumed to be output from gsl wavelet computation
int
-gr_wvps_ff::work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+wavelet_wvps_ff_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
diff --git a/gnuradio-core/src/lib/general/gr_wvps_ff.h b/gr-wavelet/lib/wavelet_wvps_ff_impl.h
index 7c8f26066..30877e3fd 100644
--- a/gnuradio-core/src/lib/general/gr_wvps_ff.h
+++ b/gr-wavelet/lib/wavelet_wvps_ff_impl.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,39 +20,25 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GR_WVPS_FF_H
-#define INCLUDED_GR_WVPS_FF_H
+#ifndef INCLUDED_WAVELET_WVPS_FF_IMPL_H
+#define INCLUDED_WAVELET_WVPS_FF_IMPL_H
-#include <gr_core_api.h>
-#include <gr_sync_decimator.h>
+#include <wavelet_wvps_ff.h>
-class gr_wvps_ff;
-typedef boost::shared_ptr<gr_wvps_ff> gr_wvps_ff_sptr;
-
-GR_CORE_API gr_wvps_ff_sptr
-gr_make_wvps_ff(int ilen);
-
-
-/*!
- * \brief computes the Wavelet Power Spectrum from a set of wavelet coefficients
- * \ingroup wavelet_blk
- */
-class GR_CORE_API gr_wvps_ff : public gr_sync_block
+class WAVELET_API wavelet_wvps_ff_impl : public wavelet_wvps_ff
{
- friend GR_CORE_API gr_wvps_ff_sptr
- gr_make_wvps_ff(int ilen);
-
int d_ilen;
int d_olen;
- protected:
- gr_wvps_ff(int ilen);
+ friend WAVELET_API wavelet_wvps_ff_sptr
+ wavelet_make_wvps_ff(int ilen);
+
+ wavelet_wvps_ff_impl(int ilen);
public:
int work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
-
};
-#endif /* INCLUDED_GR_WVPS_FF_H */
+#endif /* INCLUDED_WAVELET_WVPS_FF_IMPL_H */
diff --git a/gr-wavelet/python/CMakeLists.txt b/gr-wavelet/python/CMakeLists.txt
new file mode 100644
index 000000000..9ddcb7ea9
--- /dev/null
+++ b/gr-wavelet/python/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+include(GrPython)
+
+GR_PYTHON_INSTALL(
+ FILES
+ __init__.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/wavelet
+ COMPONENT "wavelet_python"
+)
+
+########################################################################
+# Handle the unit tests
+########################################################################
+if(ENABLE_TESTING)
+include(GrTest)
+file(GLOB py_qa_test_files "qa_*.py")
+foreach(py_qa_test_file ${py_qa_test_files})
+ get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE)
+ set(GR_TEST_PYTHON_DIRS
+ ${CMAKE_BINARY_DIR}/gnuradio-core/src/python
+ ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig
+ ${CMAKE_BINARY_DIR}/gr-wavelet/python
+ ${CMAKE_BINARY_DIR}/gr-wavelet/swig
+ )
+ set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-wavelet)
+ GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file})
+endforeach(py_qa_test_file)
+endif(ENABLE_TESTING)
diff --git a/gr-wavelet/python/__init__.py b/gr-wavelet/python/__init__.py
new file mode 100644
index 000000000..ce63ed37c
--- /dev/null
+++ b/gr-wavelet/python/__init__.py
@@ -0,0 +1,28 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+'''
+This is the gr-wavelet package. This package provides GNU Radio
+processing blocks for wavelet transforms.
+'''
+
+from wavelet_swig import *
+
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_classify.py b/gr-wavelet/python/qa_classify.py
index ac5b53b57..157d6b8c6 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_classify.py
+++ b/gr-wavelet/python/qa_classify.py
@@ -25,7 +25,7 @@ from gnuradio import gr, gr_unittest
import copy
#import pygsl.wavelet as wavelet # FIXME: pygsl not checked for in config
import math
-
+import wavelet_swig
def sqr(x):
return x*x
@@ -106,7 +106,7 @@ class test_classify(gr_unittest.TestCase):
src_data = (0.0, 1.0, 0.0, 1.0, 0.0)
src = gr.vector_source_f(src_data, False, len(src_grid))
- sq = gr.squash_ff(src_grid, trg_grid)
+ sq = wavelet_swig.squash_ff(src_grid, trg_grid)
dst = gr.vector_sink_f(len(trg_grid))
self.tb.connect(src, sq)
self.tb.connect(sq, dst)
@@ -132,7 +132,7 @@ class test_classify(gr_unittest.TestCase):
# d = w.transform_inverse(c, ws)
#
# src = gr.vector_source_f(b, False, n)
-# wv = gr.wavelet_ff(n, o, True)
+# wv = wavelet_swig.wavelet_ff(n, o, True)
#
# dst = gr.vector_sink_f(n)
# self.tb.connect(src, wv)
@@ -161,7 +161,7 @@ class test_classify(gr_unittest.TestCase):
k += 01<<e
src = gr.vector_source_f(src_data, False, len(src_data))
- kon = gr.wvps_ff(len(src_data))
+ kon = wavelet_swig.wvps_ff(len(src_data))
dst = gr.vector_sink_f(int(math.ceil(math.log(len(src_data), 2))))
self.tb.connect(src, kon)
diff --git a/gr-wavelet/swig/CMakeLists.txt b/gr-wavelet/swig/CMakeLists.txt
new file mode 100644
index 000000000..e91915d86
--- /dev/null
+++ b/gr-wavelet/swig/CMakeLists.txt
@@ -0,0 +1,50 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+# Setup swig generation
+########################################################################
+include(GrPython)
+include(GrSwig)
+
+set(GR_SWIG_INCLUDE_DIRS
+ ${GR_WAVELET_INCLUDE_DIRS}
+ ${GNURADIO_CORE_SWIG_INCLUDE_DIRS}
+)
+
+set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/wavelet_swig_doc.i)
+set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../lib)
+
+set(GR_SWIG_LIBRARIES gnuradio-wavelet)
+
+GR_SWIG_MAKE(wavelet_swig wavelet_swig.i)
+
+GR_SWIG_INSTALL(
+ TARGETS wavelet_swig
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/wavelet
+ COMPONENT "wavelet_python"
+)
+
+install(
+ FILES
+ wavelet_swig.i
+ ${CMAKE_CURRENT_BINARY_DIR}/wavelet_swig_doc.i
+ DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
+ COMPONENT "wavelet_swig"
+)
diff --git a/gr-wavelet/swig/wavelet_swig.i b/gr-wavelet/swig/wavelet_swig.i
new file mode 100644
index 000000000..577bd04df
--- /dev/null
+++ b/gr-wavelet/swig/wavelet_swig.i
@@ -0,0 +1,48 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#define WAVELET_API
+
+%include "gnuradio.i"
+
+//load generated python docstrings
+%include "wavelet_swig_doc.i"
+
+%{
+#include "wavelet_squash_ff.h"
+#include "wavelet_wavelet_ff.h"
+#include "wavelet_wvps_ff.h"
+%}
+
+%include "wavelet_squash_ff.h"
+%include "wavelet_wavelet_ff.h"
+%include "wavelet_wvps_ff.h"
+
+GR_SWIG_BLOCK_MAGIC(wavelet,squash_ff);
+wavelet_squash_ff_sptr wavelet_make_squash_ff(const std::vector<float> &igrid,
+ const std::vector<float> &ogrid);
+
+GR_SWIG_BLOCK_MAGIC(wavelet,wavelet_ff);
+wavelet_wavelet_ff_sptr wavelet_make_wavelet_ff(int size, int order, bool forward);
+
+GR_SWIG_BLOCK_MAGIC(wavelet,wvps_ff);
+wavelet_wvps_ff_sptr wavelet_make_wvps_ff(int ilen);
diff --git a/gruel/src/include/gruel/pmt.h b/gruel/src/include/gruel/pmt.h
index 58533e54e..f904d37e1 100644
--- a/gruel/src/include/gruel/pmt.h
+++ b/gruel/src/include/gruel/pmt.h
@@ -32,6 +32,7 @@
#include <stdint.h>
#include <iosfwd>
#include <stdexcept>
+#include <boost/function.hpp>
namespace gruel {
class msg_accepter;
@@ -805,6 +806,24 @@ GRUEL_API std::string pmt_serialize_str(pmt_t obj);
*/
GRUEL_API pmt_t pmt_deserialize_str(std::string str);
+/*
+ * ------------------------------------------------------------------------
+ * advanced
+ * ------------------------------------------------------------------------
+ */
+
+#define GRUEL_PMT_HAVE_PMT_SET_DELETER
+
+/*!
+ * Set a deleter function to be called when the PMT dereferences.
+ * User beware! This function is for extremely advanced use.
+ * Use boost bind to bind extra parameters into the deleter function.
+ * Set an empty function type to reset the PMT to the default deleter.
+ * \param obj the pmt object in which to set the deleter function
+ * \param deleter a function that gets an opaque PMT pointer type
+ */
+GRUEL_API void pmt_set_deleter(pmt_t obj, boost::function<void(pmt_base *)> &deleter);
+
} /* namespace pmt */
#include <gruel/pmt_sugar.h>
diff --git a/gruel/src/lib/pmt/pmt.cc b/gruel/src/lib/pmt/pmt.cc
index f9cf6b4bf..57b66b1a4 100644
--- a/gruel/src/lib/pmt/pmt.cc
+++ b/gruel/src/lib/pmt/pmt.cc
@@ -58,7 +58,7 @@ pmt_base::operator delete(void *p, size_t size)
#endif
void intrusive_ptr_add_ref(pmt_base* p) { ++(p->count_); }
-void intrusive_ptr_release(pmt_base* p) { if (--(p->count_) == 0 ) delete p; }
+void intrusive_ptr_release(pmt_base* p) { if (--(p->count_) == 0 ) p->deleter_(p); }
pmt_base::~pmt_base()
{
@@ -1383,4 +1383,16 @@ pmt_dump_sizeof()
printf("sizeof(pmt_uniform_vector) = %3zd\n", sizeof(pmt_uniform_vector));
}
+/*
+ * ------------------------------------------------------------------------
+ * advanced
+ * ------------------------------------------------------------------------
+ */
+
+void
+pmt_set_deleter(pmt_t obj, boost::function<void(pmt_base *)> &deleter)
+{
+ obj->deleter_ = (deleter)? deleter : &pmt_base::default_deleter;
+}
+
} /* namespace pmt */
diff --git a/gruel/src/lib/pmt/pmt_int.h b/gruel/src/lib/pmt/pmt_int.h
index 3a5cd382b..745dbc666 100644
--- a/gruel/src/lib/pmt/pmt_int.h
+++ b/gruel/src/lib/pmt/pmt_int.h
@@ -38,8 +38,15 @@ namespace pmt {
class GRUEL_API pmt_base : boost::noncopyable {
mutable boost::detail::atomic_count count_;
+public:
+ static void default_deleter(pmt_base *p){
+ delete p;
+ }
+
+ boost::function<void(pmt_base *)> deleter_;
+
protected:
- pmt_base() : count_(0) {};
+ pmt_base() : count_(0), deleter_(&pmt::pmt_base::default_deleter) {};
virtual ~pmt_base();
public: