diff options
author | Josh Blum | 2011-01-05 12:46:39 -0800 |
---|---|---|
committer | Josh Blum | 2011-01-19 22:24:56 -0800 |
commit | 5e00de56713729b7c366884d3a1e31ffa3423b13 (patch) | |
tree | 21c531d5c6714de3022b71b6cbafb05abffd0151 /gr-uhd/swig | |
parent | f0d2f41a77107fd5e194e196f93ecba4d6fe2df9 (diff) | |
download | gnuradio-5e00de56713729b7c366884d3a1e31ffa3423b13.tar.gz gnuradio-5e00de56713729b7c366884d3a1e31ffa3423b13.tar.bz2 gnuradio-5e00de56713729b7c366884d3a1e31ffa3423b13.zip |
uhd: removed ranges template stuff, added some python polish in __init__.py
Diffstat (limited to 'gr-uhd/swig')
-rw-r--r-- | gr-uhd/swig/__init__.py | 6 | ||||
-rw-r--r-- | gr-uhd/swig/uhd_swig.i | 11 |
2 files changed, 6 insertions, 11 deletions
diff --git a/gr-uhd/swig/__init__.py b/gr-uhd/swig/__init__.py index 0fdacb796..6d09f19f0 100644 --- a/gr-uhd/swig/__init__.py +++ b/gr-uhd/swig/__init__.py @@ -30,6 +30,12 @@ from uhd_swig import * # Add other content from pure-Python modules here ######################################################################## +#make the meta-range printable in python +meta_range_t.__str__ = lambda s: s.to_pp_string().strip() + +class freq_range_t(meta_range_t): pass #a typedef for the user +class gain_range_t(meta_range_t): pass #a typedef for the user + class tune_request_t(tune_request_t, float): """ Make the python tune request object inherit from float diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i index 76f44a491..cf4ecf920 100644 --- a/gr-uhd/swig/uhd_swig.i +++ b/gr-uhd/swig/uhd_swig.i @@ -73,17 +73,6 @@ namespace std { %include <uhd/types/time_spec.hpp> %include <uhd/types/clock_config.hpp> -//Re-create range typedefs here with %template as they are not imported. -//Replicate all the levels of templated inheritance so swig understands. - -%template(float_range_t) uhd::range_t<float>; -%template(_float_range_vector_t) std::vector<uhd::range_t<float> >; -%template(gain_range_t) uhd::meta_range_t<float>; - -%template(double_range_t) uhd::range_t<double>; -%template(_double_range_vector_t) std::vector<uhd::range_t<double> >; -%template(freq_range_t) uhd::meta_range_t<double>; - //////////////////////////////////////////////////////////////////////// // block magic //////////////////////////////////////////////////////////////////////// |