summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blossom2010-11-16 21:40:55 -0800
committerEric Blossom2010-11-16 21:40:55 -0800
commit8c81cf7d318d99f508e81bffcfd4c12ba0a2966e (patch)
tree26952dd5223873cc64852f0ef16d0510993a62ca
parent8180bb1d7020e07c9b0a217820c68d07f0d98a74 (diff)
downloadgnuradio-8c81cf7d318d99f508e81bffcfd4c12ba0a2966e.tar.gz
gnuradio-8c81cf7d318d99f508e81bffcfd4c12ba0a2966e.tar.bz2
gnuradio-8c81cf7d318d99f508e81bffcfd4c12ba0a2966e.zip
Fix guile related problem with gr-usrp
-rw-r--r--Guile-TODO10
-rw-r--r--gr-usrp/src/usrp_base.i1
-rw-r--r--gr-usrp/src/usrp_swig.i3
-rw-r--r--usrp/host/include/usrp/db_base.i3
4 files changed, 11 insertions, 6 deletions
diff --git a/Guile-TODO b/Guile-TODO
index 68c1247e7..80d3d3bf9 100644
--- a/Guile-TODO
+++ b/Guile-TODO
@@ -18,11 +18,6 @@ In no particular order:
6) Fix printed representation of blocks in gr_block.i
-7) Fix gr-usrp so that it works. Probably related to
- warning received when generating python bindings.
- Making the swig/python warning go away will probably resolve the
- guile problem.
-
8) Fix gr_message_{sink,source} so that they work under guile.
(Not sure if I disabled one or both of these...)
@@ -86,3 +81,8 @@ These are done:
the constructors into the same name. E.g. audio_alsa_sink -> sink.
(Causes problem when multiple gr-* modules are used.)
+7) [DONE] Fix gr-usrp so that it works. Probably related to
+ warning received when generating python bindings.
+ Making the swig/python warning go away will probably resolve the
+ guile problem.
+
diff --git a/gr-usrp/src/usrp_base.i b/gr-usrp/src/usrp_base.i
index d0ece1fb2..0fd62911f 100644
--- a/gr-usrp/src/usrp_base.i
+++ b/gr-usrp/src/usrp_base.i
@@ -24,6 +24,7 @@
#include "usrp_base.h"
%}
+%ignore usrp_base;
class usrp_base : public gr_sync_block
{
protected:
diff --git a/gr-usrp/src/usrp_swig.i b/gr-usrp/src/usrp_swig.i
index 5ab594383..32f2cb41e 100644
--- a/gr-usrp/src/usrp_swig.i
+++ b/gr-usrp/src/usrp_swig.i
@@ -39,6 +39,7 @@
%include "usrp_sink_c.i"
%include "usrp_sink_s.i"
+#ifdef SWIGPYTHON
//---Allow a more Pythonic interface
%pythoncode %{
@@ -141,6 +142,8 @@ usrp_source_c_sptr.pick_rx_subdevice = __pick_rx_subdevice
usrp_source_s_sptr.pick_rx_subdevice = __pick_rx_subdevice
%}
+#endif
+
#if SWIGGUILE
%scheme %{
diff --git a/usrp/host/include/usrp/db_base.i b/usrp/host/include/usrp/db_base.i
index 78c72b8c3..fdabd4f99 100644
--- a/usrp/host/include/usrp/db_base.i
+++ b/usrp/host/include/usrp/db_base.i
@@ -91,6 +91,7 @@ typedef boost::shared_ptr<db_base> db_base_sptr;
%template(db_base_sptr_vector) std::vector<db_base_sptr>;
%template(db_base_sptr_vector_vector) std::vector<std::vector<db_base_sptr> >;
+#ifdef SWIGPYTHON
// Set better class name in Python
// Enable freq_range and gain_range from public methods of class not implemented in C++
// And create a dummy wrapper for backwards compatability with some of the example code
@@ -98,5 +99,5 @@ typedef boost::shared_ptr<db_base> db_base_sptr;
db_base_sptr.__repr__ = lambda self: "<db_base::%s>" % (self.name(),)
db_base_sptr.freq_range = lambda self: (self.freq_min(), self.freq_max(), 1)
db_base_sptr.gain_range = lambda self: (self.gain_min(), self.gain_max(), self.gain_db_per_step())
-
%}
+#endif