summaryrefslogtreecommitdiff
path: root/gr-analog/grc/analog_sig_source_x.block.yml
blob: 2fbc853a9b6634c1ade9257a3940324f4096104c (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: analog_sig_source_x
label: Signal Source

parameters:
-   id: type
    label: Output Type
    dtype: enum
    options: [complex, float, int, short]
    option_attributes:
        fcn: [c, f, i, s]
        offset_type: [complex, real, int, int]
    hide: part
-   id: samp_rate
    label: Sample Rate
    dtype: real
    default: samp_rate
-   id: waveform
    label: Waveform
    dtype: int
    default: analog.GR_COS_WAVE
    options: [analog.GR_CONST_WAVE, analog.GR_SIN_WAVE, analog.GR_COS_WAVE, analog.GR_SQR_WAVE,
        analog.GR_TRI_WAVE, analog.GR_SAW_WAVE]
    option_labels: [Constant, Sine, Cosine, Square, Triangle, Saw Tooth]
-   id: freq
    label: Frequency
    dtype: real
    default: '1000'
-   id: amp
    label: Amplitude
    dtype: real
    default: '1'
-   id: offset
    label: Offset
    dtype: ${ type.offset_type }
    default: '0'

inputs:
-   domain: message
    id: freq
    optional: true

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

templates:
    imports: from gnuradio import analog
    make: analog.sig_source_${type.fcn}(${samp_rate}, ${waveform}, ${freq}, ${amp},
        ${offset})
    callbacks:
    - set_sampling_freq(${samp_rate})
    - set_waveform(${waveform})
    - set_frequency(${freq})
    - set_amplitude(${amp})
    - set_offset(${offset})

file_format: 1