diff options
author | Tom Rondeau <tom@trondeau.com> | 2014-05-19 21:27:40 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2014-05-19 21:27:40 -0400 |
commit | eebc74a7d6e37a61bc7c3f21c4aa1b94b8d28be3 (patch) | |
tree | 81b48289c9b8f6ca4e0cca82ec482583d3c0656d /gr-fec/python/fec/capillary_threaded_encoder.py | |
parent | fbbde8d01ab43b7a3ffd5ca9d65cf50a84e2a7be (diff) |
fec: wip: adding qa code.
capillary threaded encoders and decoders check to make sure dimension is a power of 2 for proper threading.
Diffstat (limited to 'gr-fec/python/fec/capillary_threaded_encoder.py')
-rw-r--r-- | gr-fec/python/fec/capillary_threaded_encoder.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gr-fec/python/fec/capillary_threaded_encoder.py b/gr-fec/python/fec/capillary_threaded_encoder.py index 377250fb23..21d4af62ca 100644 --- a/gr-fec/python/fec/capillary_threaded_encoder.py +++ b/gr-fec/python/fec/capillary_threaded_encoder.py @@ -32,6 +32,11 @@ class capillary_threaded_encoder(gr.hier_block2): self.encoder_list_0 = encoder_list_0 + check = math.log10(len(self.encoder_list_0)) / math.log10(2.0) + if(abs(check - int(check)) > 0.0): + gr.log.info("fec.capillary_threaded_encoder: number of encoders must be a power of 2.") + raise AttributeError + self.deinterleaves_0 = []; for i in range(int(math.log(len(encoder_list_0), 2))): for j in range(int(math.pow(2, i))): |