diff options
Diffstat (limited to 'gr-digital/python/digital/modulation_utils.py')
-rw-r--r-- | gr-digital/python/digital/modulation_utils.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gr-digital/python/digital/modulation_utils.py b/gr-digital/python/digital/modulation_utils.py index 59809ae1d8..1d57e1c9ba 100644 --- a/gr-digital/python/digital/modulation_utils.py +++ b/gr-digital/python/digital/modulation_utils.py @@ -1,8 +1,8 @@ # # Copyright 2010 Free Software Foundation, Inc. -# +# # This file is part of GNU Radio -# +# # SPDX-License-Identifier: GPL-3.0-or-later # @@ -17,9 +17,11 @@ import inspect # Type 1 modulators accept a stream of bytes on their input and produce complex baseband output _type_1_modulators = {} + def type_1_mods(): return _type_1_modulators + def add_type_1_mod(name, mod_class): _type_1_modulators[name] = mod_class @@ -29,18 +31,23 @@ def add_type_1_mod(name, mod_class): # to resolve phase or polarity ambiguities. _type_1_demodulators = {} + def type_1_demods(): return _type_1_demodulators + 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 @@ -67,7 +74,7 @@ def extract_kwargs_from_options(function, excluded_args, options): excluded_args: function arguments that are NOT to be added to the dictionary (sequence of strings) options: result of command argument parsing (optparse.Values) """ - + # Try this in C++ ;) spec = inspect.getfullargspec(function) d = {} @@ -77,6 +84,7 @@ def extract_kwargs_from_options(function, excluded_args, options): 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__ |