summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/python/gnuradio/modulation_utils2.py
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2011-07-17 17:25:57 -0400
committerTom Rondeau <trondeau@vt.edu>2011-07-17 17:25:57 -0400
commitf7b9a0c6922c86cd54c1300ab45209d8e2db13df (patch)
tree5ede528cd302e85bc40edcad876525659f4e1ed2 /gnuradio-core/src/python/gnuradio/modulation_utils2.py
parentcaa4af889f54a696d3a533c77c5016df82f2987c (diff)
parent04409d2ba42ac5b372a7b6bb7e9c8de5722d76d7 (diff)
Merge branch '8psk' into next
Conflicts: gr-msdd6000/src/Makefile.swig.gen
Diffstat (limited to 'gnuradio-core/src/python/gnuradio/modulation_utils2.py')
-rw-r--r--gnuradio-core/src/python/gnuradio/modulation_utils2.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/gnuradio-core/src/python/gnuradio/modulation_utils2.py b/gnuradio-core/src/python/gnuradio/modulation_utils2.py
index c5dba3e791..f30055f4ac 100644
--- a/gnuradio-core/src/python/gnuradio/modulation_utils2.py
+++ b/gnuradio-core/src/python/gnuradio/modulation_utils2.py
@@ -47,6 +47,15 @@ def type_1_demods():
def add_type_1_demod(name, demod_class):
_type_1_demodulators[name] = demod_class
+# Also record the constellation making functions of the modulations
+_type_1_constellations = {}
+
+def type_1_constellations():
+ return _type_1_constellations
+
+def add_type_1_constellation(name, constellation):
+ _type_1_constellations[name] = constellation
+
def extract_kwargs_from_options(function, excluded_args, options):
"""
@@ -79,3 +88,14 @@ def extract_kwargs_from_options(function, excluded_args, options):
if getattr(options, kw) is not None:
d[kw] = getattr(options, kw)
return d
+
+def extract_kwargs_from_options_for_class(cls, options):
+ """
+ Given command line options, create dictionary suitable for passing to __init__
+ """
+ d = extract_kwargs_from_options(
+ cls.__init__, ('self',), options)
+ for base in cls.__bases__:
+ if hasattr(base, 'extract_kwargs_from_options'):
+ d.update(base.extract_kwargs_from_options(options))
+ return d