Created
July 24, 2018 16:30
-
-
Save haakov/fb381bf3de1dd6a02b697c9d92d7dae5 to your computer and use it in GitHub Desktop.
Multiply Const block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id: blocks_multiply_const_vxx | |
label: Multiply Const | |
parameters: | |
- id: type | |
label: IO Type | |
dtype: enum | |
options: [complex, float, int, short] | |
option_attributes: | |
const_type: [complex_vector, real_vector, int_vector, int_vector] | |
fcn: [cc, ff, ii, ss] | |
hide: part | |
- id: const | |
label: Constant | |
dtype: ${ type.const_type } | |
default: '0' | |
- id: vlen | |
label: Vec Length | |
dtype: int | |
default: '1' | |
hide: ${ 'part' if vlen == 1 else 'none' } | |
inputs: | |
- domain: stream | |
dtype: ${ type } | |
vlen: ${ vlen } | |
outputs: | |
- domain: stream | |
dtype: ${ type } | |
vlen: ${ vlen } | |
asserts: | |
- ${ (len(const) == vlen) if str(const).strip().startswith('[') else (vlen == 1) } | |
- ${ vlen > 0 } | |
templates: | |
imports: from gnuradio import blocks | |
make: blocks.multiply_const_v${type.fcn}(${ str(const) if str(const).strip().startswith('[') else ('[' + str(const) + ']') }) | |
callbacks: | |
- set_k(${const}) | |
file_format: 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Okay so I've found the problem.
This namespace property ignores the option_attributes. This is why
type
is recognized but nottype.const_type
.