summaryrefslogtreecommitdiff
path: root/gr-blocks/grc/blocks_moving_average_xx.block.yml
blob: 6618a8f79000f8eed4481d5c1c63a36fc389408e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
id: blocks_moving_average_xx
label: Moving Average
flags: [ python, cpp ]

parameters:
-   id: type
    label: Type
    dtype: enum
    options: [complex, float, int, short]
    option_attributes:
        fcn: [cc, ff, ii, ss]
        scale: [complex, real, int, int]
    hide: part
-   id: length
    label: Length
    dtype: int
    default: '1000'
-   id: scale
    label: Scale
    dtype: ${ type.scale }
    default: '1'
-   id: max_iter
    label: Max Iter
    dtype: int
    default: '4000'
-   id: vlen
    label: Length of Vectors
    dtype: int
    default: 1

inputs:
-   domain: stream
    dtype: ${ type }
    vlen: ${ vlen }

outputs:
-   domain: stream
    dtype: ${ type }
    vlen: ${ vlen }

asserts:
- ${ vlen > 0 }

templates:
    imports: from gnuradio import blocks
    make: blocks.moving_average_${type.fcn}(${length}, ${scale}, ${max_iter}, ${vlen})
    callbacks:
    - set_length_and_scale(${length}, ${scale})

cpp_templates:
    includes: ['#include <gnuradio/blocks/moving_average.h>']
    declarations: 'blocks::moving_average_${type.fcn}::sptr ${id};'
    make: 'this->${id} = blocks::moving_average_${type.fcn}::make(${length}, ${scale}, ${max_iter}, ${vlen});'
    callbacks:
    - set_length_and_scale(${length}, ${scale})

file_format: 1