# auto-generated by grc.converter

id: foo_valve
label: Valve
category: '[Foo]'

parameters:
-   id: type
    label: Type
    dtype: enum
    options: [complex, float, int, short, byte]
    option_attributes:
        size: [gr.sizeof_gr_complex, gr.sizeof_float, gr.sizeof_int, gr.sizeof_short,
            gr.sizeof_char]
    hide: part
-   id: open
    label: Open
    dtype: raw
    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:
- ${ vlen > 0 }

templates:
    imports: import foo
    make: foo.valve(item_size=${type.size}*${vlen}, open=bool(${open}))
    callbacks:
    - set_open(bool(${open}))

documentation: |-
    Connect output to input when valve is closed (not open).

file_format: 1
