summaryrefslogtreecommitdiff
path: root/gr-uhd/swig
diff options
context:
space:
mode:
authorJosh Blum2010-10-28 13:24:23 -0700
committerJosh Blum2010-10-28 13:24:23 -0700
commit3dab5d93a45928baa4fb23878d644751e06943a0 (patch)
tree0abc8b35d44d2453e5f6888714bf9318ede45c1a /gr-uhd/swig
parent5a2de999da86d48cd7f005d08cc48965cb8c7a65 (diff)
downloadgnuradio-3dab5d93a45928baa4fb23878d644751e06943a0.tar.gz
gnuradio-3dab5d93a45928baa4fb23878d644751e06943a0.tar.bz2
gnuradio-3dab5d93a45928baa4fb23878d644751e06943a0.zip
uhd: make a tune_request_t that inherits from float for GRC, added docs
Diffstat (limited to 'gr-uhd/swig')
-rw-r--r--gr-uhd/swig/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/gr-uhd/swig/__init__.py b/gr-uhd/swig/__init__.py
index 2fed17e57..0fdacb796 100644
--- a/gr-uhd/swig/__init__.py
+++ b/gr-uhd/swig/__init__.py
@@ -21,8 +21,20 @@
# The presence of this file turns this directory into a Python package
+########################################################################
# Add SWIG generated code to this namespace
+########################################################################
from uhd_swig import *
+########################################################################
# Add other content from pure-Python modules here
+########################################################################
+class tune_request_t(tune_request_t, float):
+ """
+ Make the python tune request object inherit from float
+ so that it can be passed in GRC as a frequency parameter.
+ The type checking in GRC will accept the tune request.
+ """
+ def __new__(self, *args): return float.__new__(self)
+ def __float__(self): return self.target_freq