diff options
207 files changed, 1487 insertions, 93 deletions
diff --git a/gr-analog/grc/analog_agc2_xx.block.yml b/gr-analog/grc/analog_agc2_xx.block.yml index 93990b5c3b..711d52ae9f 100644 --- a/gr-analog/grc/analog_agc2_xx.block.yml +++ b/gr-analog/grc/analog_agc2_xx.block.yml @@ -1,5 +1,6 @@ id: analog_agc2_xx label: AGC2 +flags: python, cpp parameters: - id: type @@ -50,4 +51,18 @@ templates: - set_gain(${gain}) - set_max_gain(${max_gain}) +cpp_templates: + includes: ['#include <gnuradio/analog/agc2_${type.fcn}.h>'] + declarations: 'analog::agc2_${type.fcn}::sptr ${id};' + make: |- + this->${id} = analog::agc2_${type.fcn}::make(${attack_rate}, ${decay_rate}, ${reference}, ${gain}); + this->${id}.set_max_gain(${max_gain}); + callbacks: + - set_attack_rate(${attack_rate}) + - set_decay_rate(${decay_rate}) + - set_reference(${reference}) + - set_gain(${gain}) + - set_max_gain(${max_gain}) + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_agc3_xx.block.yml b/gr-analog/grc/analog_agc3_xx.block.yml index 17a03f6771..3c9c8b6593 100644 --- a/gr-analog/grc/analog_agc3_xx.block.yml +++ b/gr-analog/grc/analog_agc3_xx.block.yml @@ -1,5 +1,6 @@ id: analog_agc3_xx label: AGC3 +flags: python, cpp parameters: - id: type @@ -54,4 +55,18 @@ templates: - set_gain(${gain}) - set_max_gain(${max_gain}) +cpp_templates: + includes: ['#include <gnuradio/analog/agc3_${type.fcn}.h>'] + declarations: 'analog::agc3_${type.fcn}::sptr ${id};' + make: |- + this->${id} = analog::agc3_${type.fcn}::make(${attack_rate}, ${decay_rate}, ${reference}, ${gain}, ${iir_update_decim}); + this->${id}.set_max_gain(${max_gain}); + callbacks: + - set_attack_rate(${attack_rate}) + - set_decay_rate(${decay_rate}) + - set_reference(${reference}) + - set_gain(${gain}) + - set_max_gain(${max_gain}) + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_agc_xx.block.yml b/gr-analog/grc/analog_agc_xx.block.yml index 52ef26f79f..8c03d28a42 100644 --- a/gr-analog/grc/analog_agc_xx.block.yml +++ b/gr-analog/grc/analog_agc_xx.block.yml @@ -1,5 +1,6 @@ id: analog_agc_xx label: AGC +flags: python, cpp parameters: - id: type @@ -45,4 +46,17 @@ templates: - set_gain(${gain}) - set_max_gain(${max_gain}) +cpp_templates: + includes: ['#include <gnuradio/analog/agc_${type.fcn}.h>'] + declarations: 'analog::agc_${type.fcn}::sptr ${id};' + make: |- + this->${id} = analog::agc_${type.fcn}::make(${rate}, ${reference}, ${gain}); + this->${id}.set_max_gain(${max_gain}); + callbacks: + - set_rate(${rate}) + - set_reference(${reference}) + - set_gain(${gain}) + - set_max_gain(${max_gain}) + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_am_demod_cf.block.yml b/gr-analog/grc/analog_am_demod_cf.block.yml index 8bc6cc1c31..a0d6a83578 100644 --- a/gr-analog/grc/analog_am_demod_cf.block.yml +++ b/gr-analog/grc/analog_am_demod_cf.block.yml @@ -1,5 +1,6 @@ id: analog_am_demod_cf label: AM Demod +flags: python parameters: - id: chan_rate diff --git a/gr-analog/grc/analog_const_source_x.block.yml b/gr-analog/grc/analog_const_source_x.block.yml index ac676b7ac4..c170330bbc 100644 --- a/gr-analog/grc/analog_const_source_x.block.yml +++ b/gr-analog/grc/analog_const_source_x.block.yml @@ -1,5 +1,6 @@ id: analog_const_source_x label: Constant Source +flags: python, cpp parameters: - id: type @@ -25,4 +26,11 @@ templates: callbacks: - set_offset(${const}) +cpp_templates: + includes: ['#include <gnuradio/analog/sig_source_${type.fcn}.h>'] + make: 'this->${id} = analog::sig_source_${type.fcn}::make(0, analog::GR_CONST_WAVE, 0, 0, ${const});' + callbacks: + - set_offset(${const}) + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_cpfsk_bc.block.yml b/gr-analog/grc/analog_cpfsk_bc.block.yml index c9ccbaac27..17d15e6465 100644 --- a/gr-analog/grc/analog_cpfsk_bc.block.yml +++ b/gr-analog/grc/analog_cpfsk_bc.block.yml @@ -1,6 +1,7 @@ id: analog_cpfsk_bc label: CPFSK category: '[Core]/Deprecated' +flags: python, cpp parameters: - id: k @@ -28,4 +29,12 @@ templates: callbacks: - set_amplitude(${amplitude}) +cpp_templates: + includes: ['#include <gnuradio/analog/cpfsk_bc.h>'] + make: 'this->${id} = analog::cpfsk_bc::make(${k}, ${amplitude}, ${samples_per_symbol});' + callbacks: + - set_amplitude(${amplitude}) + link: ['gnuradio-analog'] + + file_format: 1 diff --git a/gr-analog/grc/analog_ctcss_squelch_ff.block.yml b/gr-analog/grc/analog_ctcss_squelch_ff.block.yml index a3dd89f1f6..8fca766cf5 100644 --- a/gr-analog/grc/analog_ctcss_squelch_ff.block.yml +++ b/gr-analog/grc/analog_ctcss_squelch_ff.block.yml @@ -1,5 +1,6 @@ id: analog_ctcss_squelch_ff label: CTCSS Squelch +flags: python, cpp parameters: - id: rate @@ -42,4 +43,15 @@ templates: - set_level(${level}) - set_frequency(${freq}) +cpp_templates: + includes: ['#include <gnuradio/analog/ctcss_squelch_ff.h>'] + make: 'this->${id} = analog::ctcss_squelch_ff::make(${rate}, ${freq}, ${level}, ${len}, ${ramp}, ${gate});' + callbacks: + - set_level(${level}) + - set_frequency(${freq}) + link: ['gnuradio-analog'] + translations: + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-analog/grc/analog_dpll_bb.block.yml b/gr-analog/grc/analog_dpll_bb.block.yml index 289f3a283d..1d65c5c1b5 100644 --- a/gr-analog/grc/analog_dpll_bb.block.yml +++ b/gr-analog/grc/analog_dpll_bb.block.yml @@ -1,5 +1,6 @@ id: analog_dpll_bb label: Detect Peak +flags: python, cpp parameters: - id: period @@ -23,4 +24,11 @@ templates: callbacks: - set_gain(${gain}) +cpp_templates: + includes: ['#include <gnuradio/analog/dpll_bb.h>'] + make: 'this->${id} = analog::dpll_bb::make(${period}, ${gain});' + callbacks: + - set_gain(${gain}) + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_fastnoise_source_x.block.yml b/gr-analog/grc/analog_fastnoise_source_x.block.yml index 21c4366074..9d22665be5 100644 --- a/gr-analog/grc/analog_fastnoise_source_x.block.yml +++ b/gr-analog/grc/analog_fastnoise_source_x.block.yml @@ -1,5 +1,6 @@ id: analog_fastnoise_source_x label: Fast Noise Source +flags: python, cpp parameters: - id: type @@ -39,6 +40,16 @@ templates: - set_type(${noise_type}) - set_amplitude(${amp}) +cpp_templates: + includes: ['#include <gnuradio/analog/fastnoise_source_${type.fcn}.h>'] + make: 'this->${id} = analog::fastnoise_source_${type.fcn}::make(${noise_type}, ${amp}, ${seed}, ${samples});' + callbacks: + - set_type(${noise_type}) + - set_amplitude(${amp}) + link: ['gnuradio-analog'] + translations: + analog.: 'analog::' + documentation: |- The fast noise source works by pre-generating a pool of random variates taken from the specified distribution. At runtime, samples are then uniform randomly chosen from this pool which is a very fast operation. diff --git a/gr-analog/grc/analog_feedforward_agc_cc.block.yml b/gr-analog/grc/analog_feedforward_agc_cc.block.yml index fd49a654a8..33a9b301aa 100644 --- a/gr-analog/grc/analog_feedforward_agc_cc.block.yml +++ b/gr-analog/grc/analog_feedforward_agc_cc.block.yml @@ -1,5 +1,6 @@ id: analog_feedforward_agc_cc label: Feed Forward AGC +flags: python, cpp parameters: - id: num_samples @@ -23,4 +24,9 @@ templates: imports: from gnuradio import analog make: analog.feedforward_agc_cc(${num_samples}, ${reference}) +cpp_templates: + includes: ['#include <gnuradio/analog/feedforward_agc_cc.h>'] + make: 'this->${id} = analog::feedforward_agc_cc::make(${num_samples}, ${reference});' + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_fm_deemph.block.yml b/gr-analog/grc/analog_fm_deemph.block.yml index b9c11a6842..f038ad8263 100644 --- a/gr-analog/grc/analog_fm_deemph.block.yml +++ b/gr-analog/grc/analog_fm_deemph.block.yml @@ -1,5 +1,6 @@ id: analog_fm_deemph label: FM Deemphasis +flags: python parameters: - id: samp_rate diff --git a/gr-analog/grc/analog_fm_demod_cf.block.yml b/gr-analog/grc/analog_fm_demod_cf.block.yml index a558253a2c..7f8111851d 100644 --- a/gr-analog/grc/analog_fm_demod_cf.block.yml +++ b/gr-analog/grc/analog_fm_demod_cf.block.yml @@ -1,5 +1,6 @@ id: analog_fm_demod_cf label: FM Demod +flags: python parameters: - id: chan_rate diff --git a/gr-analog/grc/analog_fm_preemph.block.yml b/gr-analog/grc/analog_fm_preemph.block.yml index d3f05d3164..87b06d52c8 100644 --- a/gr-analog/grc/analog_fm_preemph.block.yml +++ b/gr-analog/grc/analog_fm_preemph.block.yml @@ -1,5 +1,6 @@ id: analog_fm_preemph label: FM Preemphasis +flags: python parameters: - id: samp_rate diff --git a/gr-analog/grc/analog_fmdet_cf.block.yml b/gr-analog/grc/analog_fmdet_cf.block.yml index ee8661b80f..a901fe1f6f 100644 --- a/gr-analog/grc/analog_fmdet_cf.block.yml +++ b/gr-analog/grc/analog_fmdet_cf.block.yml @@ -1,5 +1,6 @@ id: analog_fmdet_cf label: FM Detector +flags: python parameters: - id: samplerate diff --git a/gr-analog/grc/analog_frequency_modulator_fc.block.yml b/gr-analog/grc/analog_frequency_modulator_fc.block.yml index 09f3e807f3..13ee812df2 100644 --- a/gr-analog/grc/analog_frequency_modulator_fc.block.yml +++ b/gr-analog/grc/analog_frequency_modulator_fc.block.yml @@ -1,5 +1,6 @@ id: analog_frequency_modulator_fc label: Frequency Mod +flags: python, cpp parameters: - id: sensitivity @@ -20,4 +21,11 @@ templates: callbacks: - set_sensitivity(${sensitivity}) +cpp_templates: + includes: ['#include <gnuradio/analog/frequency_modulator_fc.h>'] + make: 'this->${id} = analog::frequency_modulator_fc::make(${sensitivity});' + callbacks: + - set_sensitivity(${sensitivity}) + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_nbfm_rx.block.yml b/gr-analog/grc/analog_nbfm_rx.block.yml index 8bb3da7684..04e09900d7 100644 --- a/gr-analog/grc/analog_nbfm_rx.block.yml +++ b/gr-analog/grc/analog_nbfm_rx.block.yml @@ -1,5 +1,6 @@ id: analog_nbfm_rx label: NBFM Receive +flags: python parameters: - id: audio_rate diff --git a/gr-analog/grc/analog_nbfm_tx.block.yml b/gr-analog/grc/analog_nbfm_tx.block.yml index 00f63f8d64..da0d9eefc8 100644 --- a/gr-analog/grc/analog_nbfm_tx.block.yml +++ b/gr-analog/grc/analog_nbfm_tx.block.yml @@ -1,5 +1,6 @@ id: analog_nbfm_tx label: NBFM Transmit +flags: python parameters: - id: audio_rate diff --git a/gr-analog/grc/analog_noise_source_x.block.yml b/gr-analog/grc/analog_noise_source_x.block.yml index bb3f67209e..feb092c08d 100644 --- a/gr-analog/grc/analog_noise_source_x.block.yml +++ b/gr-analog/grc/analog_noise_source_x.block.yml @@ -1,5 +1,6 @@ id: analog_noise_source_x label: Noise Source +flags: python, cpp parameters: - id: type @@ -35,4 +36,14 @@ templates: - set_type(${noise_type}) - set_amplitude(${amp}) +cpp_templates: + includes: ['#include <gnuradio/analog/noise_source_${type.fcn}.h>'] + make: 'this->${id} = analog::noise_source_${type.fcn}::make(${noise_type}, ${amp}, ${seed});' + callbacks: + - set_type(${noise_type}) + - set_amplitude(${amp}) + link: ['gnuradio-analog'] + translations: + analog.: 'analog::' + file_format: 1 diff --git a/gr-analog/grc/analog_phase_modulator_fc.block.yml b/gr-analog/grc/analog_phase_modulator_fc.block.yml index 6d38ddd010..ea46af34fe 100644 --- a/gr-analog/grc/analog_phase_modulator_fc.block.yml +++ b/gr-analog/grc/analog_phase_modulator_fc.block.yml @@ -1,5 +1,6 @@ id: analog_phase_modulator_fc label: Phase Mod +flags: python, cpp parameters: - id: sensitivity @@ -20,4 +21,11 @@ templates: callbacks: - set_sensitivity(${sensitivity}) +cpp_templates: + includes: ['#include <gnuradio/analog/phase_modulator_fc.h>'] + make: 'this->${id} = analog::phase_modulator_fc::make(${sensitivity});' + link: ['gnuradio-analog'] + callbacks: + - set_sensitivity(${sensitivity}) + file_format: 1 diff --git a/gr-analog/grc/analog_pll_carriertracking_cc.block.yml b/gr-analog/grc/analog_pll_carriertracking_cc.block.yml index 1a66aca0a7..346a302a83 100644 --- a/gr-analog/grc/analog_pll_carriertracking_cc.block.yml +++ b/gr-analog/grc/analog_pll_carriertracking_cc.block.yml @@ -1,5 +1,6 @@ id: analog_pll_carriertracking_cc label: PLL Carrier Tracking +flags: python, cpp parameters: - id: w @@ -28,4 +29,13 @@ templates: - set_max_freq(${max_freq}) - set_min_freq(${min_freq}) +cpp_templates: + includes: ['#include <gnuradio/analog/pll_carriertracking_${type.fcn}.h>'] + make: 'this->${id} = analog::pll_carriertracking_cc::make(${w}, ${max_freq}, ${min_freq});' + callbacks: + - set_loop_bandwidth(${w}) + - set_max_freq(${max_freq}) + - set_min_freq(${min_freq}) + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_pll_freqdet_cf.block.yml b/gr-analog/grc/analog_pll_freqdet_cf.block.yml index b9fe199dd2..43b3ab353d 100644 --- a/gr-analog/grc/analog_pll_freqdet_cf.block.yml +++ b/gr-analog/grc/analog_pll_freqdet_cf.block.yml @@ -1,5 +1,6 @@ id: analog_pll_freqdet_cf label: PLL Freq Det +flags: python, cpp parameters: - id: w @@ -28,4 +29,14 @@ templates: - set_max_freq(${max_freq}) - set_min_freq(${min_freq}) +cpp_templates: + includes: ['#include <gnuradio/analog/pll_freqdet_cf.h>'] + make: 'this->${id} = analog::pll_freqdet_cf::make(${w}, ${max_freq}, ${min_freq});' + callbacks: + - set_loop_bandwidth(${w}) + - set_max_freq(${max_freq}) + - set_min_freq(${min_freq}) + link: ['gnuradio-analog'] + + file_format: 1 diff --git a/gr-analog/grc/analog_pll_refout_cc.block.yml b/gr-analog/grc/analog_pll_refout_cc.block.yml index 5acd85c3b6..79c8723a1b 100644 --- a/gr-analog/grc/analog_pll_refout_cc.block.yml +++ b/gr-analog/grc/analog_pll_refout_cc.block.yml @@ -1,5 +1,6 @@ id: analog_pll_refout_cc label: PLL Ref Out +flags: python, cpp parameters: - id: w @@ -28,4 +29,13 @@ templates: - set_max_freq(${max_freq}) - set_min_freq(${min_freq}) +cpp_templates: + includes: ['#include <gnuradio/analog/pll_refout_cc.h>'] + make: 'this->${id} = analog::pll_refout_cc::make(${w}, ${max_freq}, ${min_freq});' + callbacks: + - set_loop_bandwidth(${w}) + - set_max_freq(${max_freq}) + - set_min_freq(${min_freq}) + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_probe_avg_mag_sqrd_x.block.yml b/gr-analog/grc/analog_probe_avg_mag_sqrd_x.block.yml index ad128c1521..091cbac98f 100644 --- a/gr-analog/grc/analog_probe_avg_mag_sqrd_x.block.yml +++ b/gr-analog/grc/analog_probe_avg_mag_sqrd_x.block.yml @@ -1,5 +1,6 @@ id: analog_probe_avg_mag_sqrd_x label: Probe Avg Mag^2 +flags: python parameters: - id: type diff --git a/gr-analog/grc/analog_pwr_squelch_xx.block.yml b/gr-analog/grc/analog_pwr_squelch_xx.block.yml index 20bcfa923e..eb780e4897 100644 --- a/gr-analog/grc/analog_pwr_squelch_xx.block.yml +++ b/gr-analog/grc/analog_pwr_squelch_xx.block.yml @@ -1,5 +1,6 @@ id: analog_pwr_squelch_xx label: Power Squelch +flags: python, cpp parameters: - id: type @@ -41,4 +42,15 @@ templates: - set_threshold(${threshold}) - set_alpha(${alpha}) +cpp_templates: + includes: ['#include <gnuradio/analog/pwr_squelch_${type.fcn}.h>'] + make: 'this->${id} = analog::pwr_squelch_${type.fcn}::make(${threshold}, ${alpha}, ${ramp}, ${gate});' + callbacks: + - set_threshold(${threshold}) + - set_alpha(${alpha}) + link: ['gnuradio-analog'] + translations: + True: true + False: false + file_format: 1 diff --git a/gr-analog/grc/analog_quadrature_demod_cf.block.yml b/gr-analog/grc/analog_quadrature_demod_cf.block.yml index 874b286c87..636e264b06 100644 --- a/gr-analog/grc/analog_quadrature_demod_cf.block.yml +++ b/gr-analog/grc/analog_quadrature_demod_cf.block.yml @@ -1,5 +1,6 @@ id: analog_quadrature_demod_cf label: Quadrature Demod +flags: python parameters: - id: gain diff --git a/gr-analog/grc/analog_rail_ff.block.yml b/gr-analog/grc/analog_rail_ff.block.yml index 8a2d2e8a54..df2be8f4c1 100644 --- a/gr-analog/grc/analog_rail_ff.block.yml +++ b/gr-analog/grc/analog_rail_ff.block.yml @@ -1,5 +1,6 @@ id: analog_rail_ff label: Rail +flags: python, cpp parameters: - id: lo @@ -24,4 +25,12 @@ templates: - set_lo(${lo}) - set_hi(${hi}) +cpp_templates: + includes: ['#include <gnuradio/analog/rail_ff.h>'] + make: 'this->${id} = analog::rail_ff::make(${lo}, ${hi});' + callbacks: + - set_lo(${lo}) + - set_hi(${hi}) + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_random_source_x.block.yml b/gr-analog/grc/analog_random_source_x.block.yml index 20fb31932f..0c0d36d726 100644 --- a/gr-analog/grc/analog_random_source_x.block.yml +++ b/gr-analog/grc/analog_random_source_x.block.yml @@ -1,5 +1,6 @@ id: analog_random_source_x label: Random Source +flags: python parameters: - id: type @@ -43,9 +44,9 @@ documentation: |- Generate num samples of random numbers of [min, max). Repeat samples if specified. Ex: With min=0 and max=2, the sequence 01110101... will be generated. - + This block wraps Vector Source, i.e. it creates a vector source using a vector filled with values returned from calling np.random.randint(min, max, num_samps) once If you would like a traditional random number generator, use Random Uniform Source instead - + file_format: 1 diff --git a/gr-analog/grc/analog_random_uniform_source_x.block.yml b/gr-analog/grc/analog_random_uniform_source_x.block.yml index d76bc903a5..7a538aacb2 100644 --- a/gr-analog/grc/analog_random_uniform_source_x.block.yml +++ b/gr-analog/grc/analog_random_uniform_source_x.block.yml @@ -1,5 +1,6 @@ id: analog_random_uniform_source_x label: Random Uniform Source +flags: python, cpp parameters: - id: type @@ -29,4 +30,9 @@ templates: imports: from gnuradio import analog make: analog.random_uniform_source_${type.fcn}(${minimum}, ${maximum}, ${seed}) +cpp_templates: + includes: ['#include <gnuradio/analog/random_uniform_source_${type.fcn}.h>'] + make: 'this->${id} = analog.random_uniform_source_${type.fcn}(${minimum}, ${maximum}, ${seed});' + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_sig_source_x.block.yml b/gr-analog/grc/analog_sig_source_x.block.yml index 2fbc853a9b..ec4fa726dc 100644 --- a/gr-analog/grc/analog_sig_source_x.block.yml +++ b/gr-analog/grc/analog_sig_source_x.block.yml @@ -1,5 +1,6 @@ id: analog_sig_source_x label: Signal Source +flags: python, cpp parameters: - id: type @@ -54,4 +55,18 @@ templates: - set_amplitude(${amp}) - set_offset(${offset}) +cpp_templates: + includes: ['#include <gnuradio/analog/sig_source_${type.fcn}.h>'] + declarations: 'analog::sig_source_${type.fcn}::sptr ${id};' + make: 'this->${id} = analog::sig_source_${type.fcn}::make(${samp_rate}, ${waveform}, ${freq}, ${amp}, ${offset});' + callbacks: + - set_sampling_freq(${samp_rate}) + - set_waveform(${waveform}) + - set_frequency(${freq}) + - set_amplitude(${amp}) + - set_offset(${offset}) + link: ['gnuradio-analog'] + translations: + analog.: 'analog::' + file_format: 1 diff --git a/gr-analog/grc/analog_simple_squelch_cc.block.yml b/gr-analog/grc/analog_simple_squelch_cc.block.yml index 17a98eb4ba..fd96ba5ca0 100644 --- a/gr-analog/grc/analog_simple_squelch_cc.block.yml +++ b/gr-analog/grc/analog_simple_squelch_cc.block.yml @@ -1,5 +1,6 @@ id: analog_simple_squelch_cc label: Simple Squelch +flags: python, cpp parameters: - id: threshold @@ -24,4 +25,12 @@ templates: - set_threshold(${threshold}) - set_alpha(${alpha}) +cpp_templates: + includes: ['#include <gnuradio/analog/simple_squelch_cc.h>'] + make: 'this->${id} = analog::simple_squelch_cc::make(${threshold}, ${alpha});' + callbacks: + - set_threshold(${threshold}) + - set_alpha(${alpha}) + link: ['gnuradio-analog'] + file_format: 1 diff --git a/gr-analog/grc/analog_standard_squelch.block.yml b/gr-analog/grc/analog_standard_squelch.block.yml index d753dfaf01..54ab6c24e8 100644 --- a/gr-analog/grc/analog_standard_squelch.block.yml +++ b/gr-analog/grc/analog_standard_squelch.block.yml @@ -1,5 +1,6 @@ id: analog_standard_squelch label: Standard Squelch +flags: python parameters: - id: audio_rate diff --git a/gr-analog/grc/analog_wfm_rcv.block.yml b/gr-analog/grc/analog_wfm_rcv.block.yml index eb3a84893e..bca69001a9 100644 --- a/gr-analog/grc/analog_wfm_rcv.block.yml +++ b/gr-analog/grc/analog_wfm_rcv.block.yml @@ -1,5 +1,6 @@ id: analog_wfm_rcv label: WBFM Receive +flags: python parameters: - id: quad_rate diff --git a/gr-analog/grc/analog_wfm_rcv_pll.block.yml b/gr-analog/grc/analog_wfm_rcv_pll.block.yml index e5e3d76ccc..363f86cf86 100644 --- a/gr-analog/grc/analog_wfm_rcv_pll.block.yml +++ b/gr-analog/grc/analog_wfm_rcv_pll.block.yml @@ -1,5 +1,6 @@ id: analog_wfm_rcv_pll label: WBFM Receive PLL +flags: python parameters: - id: quad_rate diff --git a/gr-analog/grc/analog_wfm_tx.block.yml b/gr-analog/grc/analog_wfm_tx.block.yml index 1e4346c41d..bf114e2fc5 100644 --- a/gr-analog/grc/analog_wfm_tx.block.yml +++ b/gr-analog/grc/analog_wfm_tx.block.yml @@ -1,5 +1,6 @@ id: analog_wfm_tx label: WBFM Transmit +flags: python parameters: - id: audio_rate diff --git a/gr-blocks/grc/blocks_abs_xx.block.yml b/gr-blocks/grc/blocks_abs_xx.block.yml index 12d9a8fc3a..5a3b18a3aa 100644 --- a/gr-blocks/grc/blocks_abs_xx.block.yml +++ b/gr-blocks/grc/blocks_abs_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_abs_xx label: Abs +flags: python, cpp parameters: - id: vlen @@ -29,4 +30,9 @@ templates: imports: from gnuradio import blocks make: blocks.abs_${type.fcn}(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/abs_${type.fcn}.h>'] + declarations: 'blocks::abs_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::abs_${type.fcn}::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_add_const_vxx.block.yml b/gr-blocks/grc/blocks_add_const_vxx.block.yml index a3ce37b9b5..768af08c83 100644 --- a/gr-blocks/grc/blocks_add_const_vxx.block.yml +++ b/gr-blocks/grc/blocks_add_const_vxx.block.yml @@ -1,5 +1,6 @@ id: blocks_add_const_vxx label: Add Const +flags: python, cpp parameters: - id: type @@ -41,4 +42,11 @@ templates: callbacks: - set_k(${const}) +cpp_templates: + includes: ['#include <gnuradio/blocks/add_const_${"v" if context.get("vlen")() > 1 else ""}${type.fcn}.h>'] + declarations: 'blocks::add_const_${"v" if context.get("vlen")() > 1 else ""}${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::add_const_${"v" if context.get("vlen")() > 1 else ""}${type.fcn}::make(${const});' + callbacks: + - set_k(${const}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_add_xx.block.yml b/gr-blocks/grc/blocks_add_xx.block.yml index 38df37a65b..fe69b56b77 100644 --- a/gr-blocks/grc/blocks_add_xx.block.yml +++ b/gr-blocks/grc/blocks_add_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_add_xx label: Add +flags: python, cpp parameters: - id: type @@ -39,4 +40,9 @@ templates: imports: from gnuradio import blocks make: blocks.add_v${type.fcn}(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/add_${type.fcn}.h>'] + declarations: 'blocks::add_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::add_${type.fcn}::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_and_const_xx.block.yml b/gr-blocks/grc/blocks_and_const_xx.block.yml index 459527260c..dce03d1612 100644 --- a/gr-blocks/grc/blocks_and_const_xx.block.yml +++ b/gr-blocks/grc/blocks_and_const_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_and_const_xx label: And Const +flags: python, cpp parameters: - id: type @@ -28,4 +29,11 @@ templates: callbacks: - set_k(${const}) +cpp_templates: + includes: ['#include <gnuradio/blocks/and_const_${type.fcn}.h>'] + declarations: 'blocks::and_const_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::and_const_${type.fcn}::make(${const});' + callbacks: + - set_k(${const}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_and_xx.block.yml b/gr-blocks/grc/blocks_and_xx.block.yml index a8bba020a5..291d48316a 100644 --- a/gr-blocks/grc/blocks_and_xx.block.yml +++ b/gr-blocks/grc/blocks_and_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_and_xx label: And +flags: python, cpp parameters: - id: type @@ -31,4 +32,9 @@ templates: imports: from gnuradio import blocks make: blocks.and_${type.fcn}() +cpp_templates: + includes: ['#include <gnuradio/blocks/and_${type.fcn}.h>'] + declarations: 'blocks::and_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::and_${type.fcn}::make();' + file_format: 1 diff --git a/gr-blocks/grc/blocks_argmax_xx.block.yml b/gr-blocks/grc/blocks_argmax_xx.block.yml index 723f3fed6a..2cb94bd373 100644 --- a/gr-blocks/grc/blocks_argmax_xx.block.yml +++ b/gr-blocks/grc/blocks_argmax_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_argmax_xx label: Argmax +flags: python, cpp parameters: - id: type @@ -42,4 +43,9 @@ templates: imports: from gnuradio import blocks make: blocks.argmax_${type.fcn}(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/argmax_${type.fcn}.h>'] + declarations: 'blocks::argmax_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::argmax_${type.fcn}::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_burst_tagger.block.yml b/gr-blocks/grc/blocks_burst_tagger.block.yml index 02d4f74835..cf991b6195 100644 --- a/gr-blocks/grc/blocks_burst_tagger.block.yml +++ b/gr-blocks/grc/blocks_burst_tagger.block.yml @@ -1,5 +1,6 @@ id: blocks_burst_tagger label: Burst Tagger +flags: python, cpp parameters: - id: type @@ -51,4 +52,17 @@ templates: - set_true_tag(${true_key},${true_value}) - set_false_tag(${false_key},${false_value}) +cpp_templates: + includes: ['#include <gnuradio/blocks/burst_tagger.h>'] + declarations: 'blocks::burst_tagger::sptr ${id};' + make: "this->${id} = blocks::burst_tagger::make(${type.size});\nthis->${id}.set_true_tag(${true_key},${true_value});\n\ + this->${id}.set_false_tag(${false_key},${false_value});\n\t" + callbacks: + - set_true_tag(${true_key},${true_value}) + - set_false_tag(${false_key},${false_value}) + translations: + gr.sizeof_: 'sizeof(' + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_char_to_float.block.yml b/gr-blocks/grc/blocks_char_to_float.block.yml index c0858b5c1d..e4f9d551c5 100644 --- a/gr-blocks/grc/blocks_char_to_float.block.yml +++ b/gr-blocks/grc/blocks_char_to_float.block.yml @@ -1,5 +1,6 @@ id: blocks_char_to_float label: Char To Float +flags: python, cpp parameters: - id: vlen @@ -28,4 +29,11 @@ templates: callbacks: - set_scale(${scale}) +cpp_templates: + includes: ['#include <gnuradio/blocks/char_to_float.h>'] + declarations: 'blocks::char_to_float::sptr ${id};' + make: 'this->${id} = blocks::char_to_float::make(${vlen}, ${scale});' + callbacks: + - set_scale(${scale}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_char_to_short.block.yml b/gr-blocks/grc/blocks_char_to_short.block.yml index f378e87e72..c7574b18c0 100644 --- a/gr-blocks/grc/blocks_char_to_short.block.yml +++ b/gr-blocks/grc/blocks_char_to_short.block.yml @@ -1,5 +1,6 @@ id: blocks_char_to_short label: Char To Short +flags: python, cpp parameters: - id: vlen @@ -22,4 +23,9 @@ templates: imports: from gnuradio import blocks make: blocks.char_to_short(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/char_to_short.h>'] + declarations: 'blocks::char_to_short::sptr ${id};' + make: 'this->${id} = blocks::char_to_short::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_complex_to_arg.block.yml b/gr-blocks/grc/blocks_complex_to_arg.block.yml index 4f44e4ae2c..1d1b873534 100644 --- a/gr-blocks/grc/blocks_complex_to_arg.block.yml +++ b/gr-blocks/grc/blocks_complex_to_arg.block.yml @@ -1,5 +1,6 @@ id: blocks_complex_to_arg label: Complex to Arg +flags: python, cpp parameters: - id: vlen @@ -25,4 +26,9 @@ templates: imports: from gnuradio import blocks make: blocks.complex_to_arg(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/complex_to_arg.h>'] + declarations: 'blocks::complex_to_arg::sptr ${id};' + make: 'this->${id} = blocks::complex_to_arg::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_complex_to_float.block.yml b/gr-blocks/grc/blocks_complex_to_float.block.yml index f7b35936c3..073e879071 100644 --- a/gr-blocks/grc/blocks_complex_to_float.block.yml +++ b/gr-blocks/grc/blocks_complex_to_float.block.yml @@ -1,5 +1,6 @@ id: blocks_complex_to_float label: Complex To Float +flags: python, cpp parameters: - id: vlen @@ -31,4 +32,9 @@ templates: imports: from gnuradio import blocks make: blocks.complex_to_float(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/complex_to_float.h>'] + declarations: 'blocks::complex_to_float::sptr ${id};' + make: 'this->${id} = blocks::complex_to_float::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_complex_to_imag.block.yml b/gr-blocks/grc/blocks_complex_to_imag.block.yml index 29e14046aa..6e024e8d0d 100644 --- a/gr-blocks/grc/blocks_complex_to_imag.block.yml +++ b/gr-blocks/grc/blocks_complex_to_imag.block.yml @@ -1,5 +1,6 @@ id: blocks_complex_to_imag label: Complex to Imag +flags: python, cpp parameters: - id: vlen @@ -25,4 +26,9 @@ templates: imports: from gnuradio import blocks make: blocks.complex_to_imag(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/complex_to_imag.h>'] + declarations: 'blocks::complex_to_imag::sptr ${id};' + make: 'this->${id} = blocks::complex_to_imag::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_complex_to_interleaved_char.block.yml b/gr-blocks/grc/blocks_complex_to_interleaved_char.block.yml index 06a75fc8d9..fe257af919 100644 --- a/gr-blocks/grc/blocks_complex_to_interleaved_char.block.yml +++ b/gr-blocks/grc/blocks_complex_to_interleaved_char.block.yml @@ -1,5 +1,6 @@ id: blocks_complex_to_interleaved_char label: Complex To IChar +flags: python, cpp parameters: - id: vector_output @@ -25,4 +26,12 @@ templates: imports: from gnuradio import blocks make: blocks.complex_to_interleaved_char(${vector_output}) +cpp_templates: + includes: ['#include <gnuradio/blocks/complex_to_interleaved_char.h>'] + declarations: 'blocks::complex_to_interleaved_char::sptr ${id};' + make: 'this->${id} = blocks::complex_to_interleaved_char::make(${vector_output});' + translations: + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_complex_to_interleaved_short.block.yml b/gr-blocks/grc/blocks_complex_to_interleaved_short.block.yml index 0b8aa53621..5ad7d3a91c 100644 --- a/gr-blocks/grc/blocks_complex_to_interleaved_short.block.yml +++ b/gr-blocks/grc/blocks_complex_to_interleaved_short.block.yml @@ -1,5 +1,6 @@ id: blocks_complex_to_interleaved_short label: Complex To IShort +flags: python, cpp parameters: - id: vector_output @@ -25,4 +26,12 @@ templates: imports: from gnuradio import blocks make: blocks.complex_to_interleaved_short(${vector_output}) +cpp_templates: + includes: ['#include <gnuradio/blocks/complex_to_interleaved_short.h>'] + declarations: 'blocks::complex_to_interleaved_short::sptr ${id};' + make: 'this->${id} = blocks::complex_to_interleaved_short::make(${vector_output});' + translations: + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_complex_to_mag.block.yml b/gr-blocks/grc/blocks_complex_to_mag.block.yml index d9582d1722..aaefeb39df 100644 --- a/gr-blocks/grc/blocks_complex_to_mag.block.yml +++ b/gr-blocks/grc/blocks_complex_to_mag.block.yml @@ -1,5 +1,6 @@ id: blocks_complex_to_mag label: Complex to Mag +flags: python, cpp parameters: - id: vlen @@ -25,4 +26,9 @@ templates: imports: from gnuradio import blocks make: blocks.complex_to_mag(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/complex_to_mag.h>'] + declarations: 'blocks::complex_to_mag::sptr ${id};' + make: 'this->${id} = blocks::complex_to_mag::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_complex_to_mag_squared.block.yml b/gr-blocks/grc/blocks_complex_to_mag_squared.block.yml index 815636d654..9dff52c2e4 100644 --- a/gr-blocks/grc/blocks_complex_to_mag_squared.block.yml +++ b/gr-blocks/grc/blocks_complex_to_mag_squared.block.yml @@ -1,5 +1,6 @@ id: blocks_complex_to_mag_squared label: Complex to Mag^2 +flags: python, cpp parameters: - id: vlen @@ -25,4 +26,9 @@ templates: imports: from gnuradio import blocks make: blocks.complex_to_mag_squared(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/complex_to_mag_squared.h>'] + declarations: 'blocks::complex_to_mag_squared::sptr ${id};' + make: 'this->${id} = blocks::complex_to_mag_squared::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_complex_to_magphase.block.yml b/gr-blocks/grc/blocks_complex_to_magphase.block.yml index 80420ac2a0..a572038a5f 100644 --- a/gr-blocks/grc/blocks_complex_to_magphase.block.yml +++ b/gr-blocks/grc/blocks_complex_to_magphase.block.yml @@ -1,5 +1,6 @@ id: blocks_complex_to_magphase label: Complex To Mag Phase +flags: python, cpp parameters: - id: vlen @@ -31,4 +32,9 @@ templates: imports: from gnuradio import blocks make: blocks.complex_to_magphase(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/complex_to_magphase.h>'] + declarations: 'blocks::complex_to_magphase::sptr ${id};' + make: 'this->${id} = blocks::complex_to_magphase::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_complex_to_real.block.yml b/gr-blocks/grc/blocks_complex_to_real.block.yml index 41fbbb33cc..dfbd94a4b4 100644 --- a/gr-blocks/grc/blocks_complex_to_real.block.yml +++ b/gr-blocks/grc/blocks_complex_to_real.block.yml @@ -1,5 +1,6 @@ id: blocks_complex_to_real label: Complex To Real +flags: python, cpp parameters: - id: vlen @@ -26,4 +27,9 @@ templates: imports: from gnuradio import blocks make: blocks.complex_to_real(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/complex_to_real.h>'] + declarations: 'blocks::complex_to_real::sptr ${id};' + make: 'this->${id} = blocks::complex_to_real::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_conjugate_cc.block.yml b/gr-blocks/grc/blocks_conjugate_cc.block.yml index a0d8b1a64c..69aaee99de 100644 --- a/gr-blocks/grc/blocks_conjugate_cc.block.yml +++ b/gr-blocks/grc/blocks_conjugate_cc.block.yml @@ -1,5 +1,6 @@ id: blocks_conjugate_cc label: Complex Conjugate +flags: python, cpp inputs: - domain: stream @@ -13,4 +14,8 @@ templates: imports: from gnuradio import blocks make: blocks.conjugate_cc() +cpp_templates: + includes: ['#include <gnuradio/blocks/conjugate_cc.h>'] + declarations: 'blocks::conjugate_cc::sptr ${id};' + make: 'this->${id} = blocks::conjugate_cc::make();' file_format: 1 diff --git a/gr-blocks/grc/blocks_copy.block.yml b/gr-blocks/grc/blocks_copy.block.yml index 9e2d6713a9..6e94d085aa 100644 --- a/gr-blocks/grc/blocks_copy.block.yml +++ b/gr-blocks/grc/blocks_copy.block.yml @@ -1,5 +1,6 @@ id: blocks_copy label: Copy +flags: python, cpp parameters: - id: type @@ -54,4 +55,17 @@ templates: callbacks: - set_enabled(${enabled}) +cpp_templates: + includes: ['#include <gnuradio/blocks/copy.h>'] + declarations: 'blocks::copy::sptr ${id};' + make: |- + this->${id} = blocks::copy::make(${type.size}*${vlen}); + self->${id}.set_enabled(${enabled}); + callbacks: + - set_enabled(${enabled}) + translations: + gr.sizeof_: 'sizeof(' + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_ctrlport_performance.block.yml b/gr-blocks/grc/blocks_ctrlport_performance.block.yml index 80f541a41b..80e112e63b 100644 --- a/gr-blocks/grc/blocks_ctrlport_performance.block.yml +++ b/gr-blocks/grc/blocks_ctrlport_performance.block.yml @@ -1,5 +1,6 @@ id: blocks_ctrlport_monitor_performance label: CtrlPort Performance Monitor +flags: python parameters: - id: en diff --git a/gr-blocks/grc/blocks_ctrlport_probe2_c.block.yml b/gr-blocks/grc/blocks_ctrlport_probe2_c.block.yml index 2b757718a6..4a74ae9e73 100644 --- a/gr-blocks/grc/blocks_ctrlport_probe2_c.block.yml +++ b/gr-blocks/grc/blocks_ctrlport_probe2_c.block.yml @@ -1,5 +1,6 @@ id: blocks_ctrlport_probe2_c label: Ctrlport Probe +flags: python, cpp parameters: - id: name @@ -32,6 +33,16 @@ templates: callbacks: - set_length(${len}) +cpp_templates: + includes: ['#include <gnuradio/blocks/ctrlport_probe2_c.h>'] + declarations: 'blocks::ctrlport_probe2_c::sptr ${id};' + make: 'this->${id} = blocks::ctrlport_probe2_c::make(${name}, ${desc}, ${len}, ${disp_mask});' + callbacks: + - set_length(${len}) + translations: + gr.: '' + + documentation: |- Place this in a graph to export vectors of samples to a GRCP port probe. diff --git a/gr-blocks/grc/blocks_ctrlport_probe2_x.block.yml b/gr-blocks/grc/blocks_ctrlport_probe2_x.block.yml index f2b8e0a781..ab5859da26 100644 --- a/gr-blocks/grc/blocks_ctrlport_probe2_x.block.yml +++ b/gr-blocks/grc/blocks_ctrlport_probe2_x.block.yml @@ -1,5 +1,6 @@ id: blocks_ctrlport_probe2_x label: Ctrlport Probe +flags: python, cpp parameters: - id: type @@ -39,6 +40,16 @@ templates: callbacks: - set_length(${len}) +cpp_templates: + includes: ['#include <gnuradio/blocks/ctrlport_probe2_${type.fcn}.h>'] + declarations: 'blocks::ctrlport_probe2_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::ctrlport_probe2_${type.fcn}::make(${name}, ${desc}, ${len}, ${disp_mask});' + callbacks: + - set_length(${len}) + translations: + gr.: '' + + documentation: |- Place this in a graph to export vectors of samples to a GRCP port probe. diff --git a/gr-blocks/grc/blocks_ctrlport_probe_c.block.yml b/gr-blocks/grc/blocks_ctrlport_probe_c.block.yml index 6f59f3e695..24d54b019b 100644 --- a/gr-blocks/grc/blocks_ctrlport_probe_c.block.yml +++ b/gr-blocks/grc/blocks_ctrlport_probe_c.block.yml @@ -1,5 +1,6 @@ id: blocks_ctrlport_probe_c label: Ctrlport Complex Probe +flags: python, cpp parameters: - id: name @@ -19,6 +20,12 @@ templates: imports: from gnuradio import blocks make: blocks.ctrlport_probe_c(${name}, ${desc}) +cpp_templates: + includes: ['#include <gnuradio/blocks/ctrlport_probe_c.h>'] + declarations: 'blocks::ctrlport_probe_c::sptr ${id};' + make: 'this->${id} = blocks::ctrlport_probe_c::make(${name}, ${desc});' + + documentation: |- Place this in a graph to export complex values to a GRCP port probe. diff --git a/gr-blocks/grc/blocks_ctrlport_viewer.block.yml b/gr-blocks/grc/blocks_ctrlport_viewer.block.yml index dc718aa975..110cf1ca7b 100644 --- a/gr-blocks/grc/blocks_ctrlport_viewer.block.yml +++ b/gr-blocks/grc/blocks_ctrlport_viewer.block.yml @@ -1,5 +1,6 @@ id: blocks_ctrlport_monitor label: CtrlPort Monitor +flags: python parameters: - id: en diff --git a/gr-blocks/grc/blocks_deinterleave.block.yml b/gr-blocks/grc/blocks_deinterleave.block.yml index 98761c4cc0..f18afefc62 100644 --- a/gr-blocks/grc/blocks_deinterleave.block.yml +++ b/gr-blocks/grc/blocks_deinterleave.block.yml @@ -1,5 +1,6 @@ id: blocks_deinterleave label: Deinterleave +flags: python, cpp parameters: - id: type @@ -45,4 +46,11 @@ templates: imports: from gnuradio import blocks make: blocks.deinterleave(${type.size}*${vlen}, ${blocksize}) +cpp_templates: + includes: ['#include <gnuradio/blocks/deinterleave.h>'] + declarations: 'blocks::deinterleave::sptr ${id};' + make: 'this->${id} = blocks::deinterleave::make(${type.size}*${vlen}, ${blocksize});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_delay.block.yml b/gr-blocks/grc/blocks_delay.block.yml index b9d63df586..d26f138016 100644 --- a/gr-blocks/grc/blocks_delay.block.yml +++ b/gr-blocks/grc/blocks_delay.block.yml @@ -1,5 +1,6 @@ id: blocks_delay label: Delay +flags: python, cpp parameters: - id: type @@ -47,4 +48,13 @@ templates: callbacks: - set_dly(${delay}) +cpp_templates: + includes: ['#include <gnuradio/blocks/delay.h>'] + declarations: 'blocks::delay::sptr ${id};' + make: 'this->${id} = blocks::delay::make(${type.size}*${vlen}, ${delay});' + callbacks: + - set_dly(${delay}) + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_divide_XX.block.yml b/gr-blocks/grc/blocks_divide_XX.block.yml index a98dfde5c7..5aeca9d741 100644 --- a/gr-blocks/grc/blocks_divide_XX.block.yml +++ b/gr-blocks/grc/blocks_divide_XX.block.yml @@ -1,5 +1,6 @@ id: blocks_divide_xx label: Divide +flags: python, cpp parameters: - id: type @@ -39,4 +40,9 @@ templates: imports: from gnuradio import blocks make: blocks.divide_${type.fcn}(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/divide_${type.fcn}.h>'] + declarations: 'blocks::divide_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::divide_${type.fcn}::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_endian_swap.block.yml b/gr-blocks/grc/blocks_endian_swap.block.yml index da2ef0c379..f47024e98e 100644 --- a/gr-blocks/grc/blocks_endian_swap.block.yml +++ b/gr-blocks/grc/blocks_endian_swap.block.yml @@ -1,5 +1,6 @@ id: blocks_endian_swap label: Endian Swap +flags: python, cpp parameters: - id: type @@ -23,4 +24,9 @@ templates: imports: from gnuradio import blocks make: blocks.endian_swap(${type.size}) +cpp_templates: + includes: ['#include <gnuradio/blocks/endian_swap.h>'] + declarations: 'blocks::endian_swap::sptr ${id};' + make: 'this->${id} = blocks::endian_swap::make(${type.size});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_exponentiate_const_cci.block.yml b/gr-blocks/grc/blocks_exponentiate_const_cci.block.yml index 10bef0d3cd..33ec28eed7 100644 --- a/gr-blocks/grc/blocks_exponentiate_const_cci.block.yml +++ b/gr-blocks/grc/blocks_exponentiate_const_cci.block.yml @@ -1,5 +1,6 @@ id: blocks_exponentiate_const_cci label: Exponentiate Const Int +flags: python, cpp parameters: - id: num_ports @@ -40,4 +41,12 @@ templates: callbacks: - set_exponent(${exponent}) +cpp_templates: + includes: ['#include <gnuradio/blocks/exponentiate_const_cci.h>'] + declarations: 'blocks::exponentiate_const_cci::sptr ${id};' + make: 'this->${id} = blocks::exponentiate_const_cci::make(${exponent}, ${vlen});' + callbacks: + - set_exponent(${exponent}) + + file_format: 1 diff --git a/gr-blocks/grc/blocks_file_descriptor_sink.block.yml b/gr-blocks/grc/blocks_file_descriptor_sink.block.yml index 24d88f67f9..d35bf4028a 100644 --- a/gr-blocks/grc/blocks_file_descriptor_sink.block.yml +++ b/gr-blocks/grc/blocks_file_descriptor_sink.block.yml @@ -1,5 +1,6 @@ id: blocks_file_descriptor_sink label: File Descriptor Sink +flags: python, cpp parameters: - id: fd @@ -31,4 +32,11 @@ templates: imports: from gnuradio import blocks make: blocks.file_descriptor_sink(${type.size}*${vlen}, ${fd}) +cpp_templates: + includes: ['#include <gnuradio/blocks/file_descriptor_sink.h>'] + declarations: 'blocks::file_descriptor_sink::sptr ${id};' + make: 'this->${id} = blocks::file_descriptor_sink::make(${type.size}*${vlen}, ${fd});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_file_descriptor_source.block.yml b/gr-blocks/grc/blocks_file_descriptor_source.block.yml index 84926661e4..e0117dd0e8 100644 --- a/gr-blocks/grc/blocks_file_descriptor_source.block.yml +++ b/gr-blocks/grc/blocks_file_descriptor_source.block.yml @@ -1,5 +1,6 @@ id: blocks_file_descriptor_source label: File Descriptor Source +flags: python, cpp parameters: - id: fd @@ -34,4 +35,13 @@ templates: imports: from gnuradio import blocks make: blocks.file_descriptor_source(${type.size}*${vlen}, ${fd}, ${repeat}) +cpp_templates: + includes: ['#include <gnuradio/blocks/file_descriptor_source.h>'] + declarations: 'blocks::file_descriptor_source::sptr ${id};' + make: 'this->${id} = blocks::file_descriptor_source::make(${type.size}*${vlen}, ${fd}, ${repeat});' + translations: + gr.sizeof_: 'sizeof(' + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_file_meta_sink.block.yml b/gr-blocks/grc/blocks_file_meta_sink.block.yml index 7512f23aae..d8d6737ca0 100644 --- a/gr-blocks/grc/blocks_file_meta_sink.block.yml +++ b/gr-blocks/grc/blocks_file_meta_sink.block.yml @@ -1,5 +1,6 @@ id: blocks_file_meta_sink label: File Meta Sink +flags: python parameters: - id: file diff --git a/gr-blocks/grc/blocks_file_meta_source.block.yml b/gr-blocks/grc/blocks_file_meta_source.block.yml index 016c2f62a5..f752677d4f 100644 --- a/gr-blocks/grc/blocks_file_meta_source.block.yml +++ b/gr-blocks/grc/blocks_file_meta_source.block.yml @@ -1,5 +1,6 @@ id: blocks_file_meta_source label: File Meta Source +flags: python parameters: - id: type diff --git a/gr-blocks/grc/blocks_file_sink.block.yml b/gr-blocks/grc/blocks_file_sink.block.yml index cf9782340f..77e8631286 100644 --- a/gr-blocks/grc/blocks_file_sink.block.yml +++ b/gr-blocks/grc/blocks_file_sink.block.yml @@ -1,5 +1,6 @@ id: blocks_file_sink label: File Sink +flags: python, cpp parameters: - id: file @@ -48,4 +49,15 @@ templates: - set_unbuffered(${unbuffered}) - open(${file}) +cpp_templates: + includes: ['#include <gnuradio/blocks/file_sink.h>'] + declarations: 'blocks::file_sink::sptr ${id};' + make: 'this->${id} = blocks::file_sink::make(${type.size})*${vlen}, ${file}, ${append});' + callbacks: + - open(${file}) + translations: + 'True': 'true' + 'False': 'false' + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_file_source.block.yml b/gr-blocks/grc/blocks_file_source.block.yml index 4aed206fbd..f10354145a 100644 --- a/gr-blocks/grc/blocks_file_source.block.yml +++ b/gr-blocks/grc/blocks_file_source.block.yml @@ -1,5 +1,6 @@ id: blocks_file_source label: File Source +flags: python, cpp parameters: - id: file @@ -56,4 +57,15 @@ templates: - open(${file}, ${repeat}) - self.${id}.set_begin_tag(${begin_tag}) +cpp_templates: + includes: ['#include <gnuradio/blocks/file_source.h>'] + declarations: 'blocks::file_source::sptr ${id};' + make: 'this->${id} =blocks::file_source::make(${type.size})*${vlen}, "${file[1:-1]}", ${repeat}, ${offset}, ${length});' + callbacks: + - open(${file}, ${repeat}) + translations: + 'True': 'true' + 'False': 'false' + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_float_to_char.block.yml b/gr-blocks/grc/blocks_float_to_char.block.yml index 4f6eeb7286..287c3800c7 100644 --- a/gr-blocks/grc/blocks_float_to_char.block.yml +++ b/gr-blocks/grc/blocks_float_to_char.block.yml @@ -1,5 +1,6 @@ id: blocks_float_to_char label: Float To Char +flags: python, cpp parameters: - id: vlen @@ -28,4 +29,11 @@ templates: callbacks: - set_scale(${scale}) +cpp_templates: + includes: ['#include <gnuradio/blocks/float_to_char.h>'] + declarations: 'blocks::float_to_char::sptr ${id};' + make: 'this->${id} = blocks::float_to_char::make(${vlen}, ${scale});' + callbacks: + - set_scale(${scale}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_float_to_complex.block.yml b/gr-blocks/grc/blocks_float_to_complex.block.yml index d592c4e461..0f1d5d257e 100644 --- a/gr-blocks/grc/blocks_float_to_complex.block.yml +++ b/gr-blocks/grc/blocks_float_to_complex.block.yml @@ -1,5 +1,6 @@ id: blocks_float_to_complex label: Float To Complex +flags: python, cpp parameters: - id: vlen @@ -31,4 +32,9 @@ templates: imports: from gnuradio import blocks make: blocks.float_to_complex(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/float_to_complex.h>'] + declarations: 'blocks::float_to_complex::sptr ${id};' + make: 'this->${id} = blocks::float_to_complex::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_float_to_int.block.yml b/gr-blocks/grc/blocks_float_to_int.block.yml index 4ed0e08718..4411955a4f 100644 --- a/gr-blocks/grc/blocks_float_to_int.block.yml +++ b/gr-blocks/grc/blocks_float_to_int.block.yml @@ -1,5 +1,6 @@ id: blocks_float_to_int label: Float To Int +flags: python, cpp parameters: - id: vlen @@ -28,4 +29,11 @@ templates: callbacks: - set_scale(${scale}) +cpp_templates: + includes: ['#include <gnuradio/blocks/float_to_int.h>'] + declarations: 'blocks::float_to_int::sptr ${id};' + make: 'this->${id} = blocks::float_to_int::make(${vlen}, ${scale});' + callbacks: + - set_scale(${scale}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_float_to_short.block.yml b/gr-blocks/grc/blocks_float_to_short.block.yml index 8b1c4e58b5..173d4e460c 100644 --- a/gr-blocks/grc/blocks_float_to_short.block.yml +++ b/gr-blocks/grc/blocks_float_to_short.block.yml @@ -1,5 +1,6 @@ id: blocks_float_to_short label: Float To Short +flags: python, cpp parameters: - id: vlen @@ -28,4 +29,11 @@ templates: callbacks: - set_scale(${scale}) +cpp_templates: + includes: ['#include <gnuradio/blocks/float_to_short.h>'] + declarations: 'blocks::float_to_short::sptr ${id};' + make: 'this->${id} = blocks::float_to_short::make(${vlen}, ${scale});' + callbacks: + - set_scale(${scale}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_float_uchar.block.yml b/gr-blocks/grc/blocks_float_uchar.block.yml index 33687978c2..759d5e0147 100644 --- a/gr-blocks/grc/blocks_float_uchar.block.yml +++ b/gr-blocks/grc/blocks_float_uchar.block.yml @@ -1,5 +1,6 @@ id: blocks_float_to_uchar label: Float To UChar +flags: python, cpp inputs: - domain: stream @@ -13,4 +14,9 @@ templates: imports: from gnuradio import blocks make: blocks.float_to_uchar() +cpp_templates: + includes: ['#include <gnuradio/blocks/float_to_uchar.h>'] + declarations: 'blocks::float_to_uchar::sptr ${id};' + make: 'this->${id} = blocks::float_to_uchar::make();' + file_format: 1 diff --git a/gr-blocks/grc/blocks_head.block.yml b/gr-blocks/grc/blocks_head.block.yml index c342e40067..50034836c8 100644 --- a/gr-blocks/grc/blocks_head.block.yml +++ b/gr-blocks/grc/blocks_head.block.yml @@ -1,5 +1,6 @@ id: blocks_head label: Head +flags: python, cpp parameters: - id: type @@ -39,4 +40,13 @@ templates: callbacks: - set_length(${num_items}) +cpp_templates: + includes: ['#include <gnuradio/blocks/head.h>'] + declarations: 'blocks::head::sptr ${id};' + make: 'this->${id} = blocks::head::make(${type.size}*${vlen}, ${num_items});' + callbacks: + - set_length(${num_items}) + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_int_to_float.block.yml b/gr-blocks/grc/blocks_int_to_float.block.yml index a6f3b3b92c..e0e83cef6b 100644 --- a/gr-blocks/grc/blocks_int_to_float.block.yml +++ b/gr-blocks/grc/blocks_int_to_float.block.yml @@ -1,5 +1,6 @@ id: blocks_int_to_float label: Int To Float +flags: python, cpp parameters: - id: vlen @@ -28,4 +29,12 @@ templates: callbacks: - set_scale(${scale}) +cpp_templates: + includes: ['#include <gnuradio/blocks/int_to_float.h>'] + declarations: 'blocks::int_to_float::sptr ${id};' + make: 'this->${id} = blocks::int_to_float::make(${vlen}, ${scale});' + callbacks: + - set_scale(${scale}) + + file_format: 1 diff --git a/gr-blocks/grc/blocks_integrate_xx.block.yml b/gr-blocks/grc/blocks_integrate_xx.block.yml index e8d3dd08cd..551c3bf4fe 100644 --- a/gr-blocks/grc/blocks_integrate_xx.block.yml +++ b/gr-blocks/grc/blocks_integrate_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_integrate_xx label: Integrate +flags: python, cpp parameters: - id: type @@ -32,4 +33,9 @@ templates: imports: from gnuradio import blocks make: blocks.integrate_${type.fcn}(${decim}, ${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/integrate_${type.fcn}.h>'] + declarations: 'blocks::integrate_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::integrate_${type.fcn}::make(${decim}, ${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_interleave.block.yml b/gr-blocks/grc/blocks_interleave.block.yml index e814e675b9..45f675c4fc 100644 --- a/gr-blocks/grc/blocks_interleave.block.yml +++ b/gr-blocks/grc/blocks_interleave.block.yml @@ -1,5 +1,6 @@ id: blocks_interleave label: Interleave +flags: python, cpp parameters: - id: type @@ -45,4 +46,11 @@ templates: imports: from gnuradio import blocks make: blocks.interleave(${type.size}*${vlen}, ${blocksize}) +cpp_templates: + includes: ['#include <gnuradio/blocks/interleave.h>'] + declarations: 'blocks::interleave::sptr ${id};' + make: 'this->${id} = blocks::interleave::make(${type.size}*${vlen}, ${blocksize});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_interleaved_char_to_complex.block.yml b/gr-blocks/grc/blocks_interleaved_char_to_complex.block.yml index 049f67b246..d5fe6a3bde 100644 --- a/gr-blocks/grc/blocks_interleaved_char_to_complex.block.yml +++ b/gr-blocks/grc/blocks_interleaved_char_to_complex.block.yml @@ -1,5 +1,6 @@ id: blocks_interleaved_char_to_complex label: IChar To Complex +flags: python, cpp parameters: - id: vector_input @@ -25,4 +26,12 @@ templates: imports: from gnuradio import blocks make: blocks.interleaved_char_to_complex(${vector_input}) +cpp_templates: + includes: ['#include <gnuradio/blocks/interleaved_char_to_complex.h>'] + declarations: 'blocks::interleaved_char_to_complex::sptr ${id};' + make: 'this->${id} = blocks::interleaved_char_to_complex::make(${vector_input});' + translations: + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_interleaved_short_to_complex.block.yml b/gr-blocks/grc/blocks_interleaved_short_to_complex.block.yml index 5c3ab76d4d..bf833b4e67 100644 --- a/gr-blocks/grc/blocks_interleaved_short_to_complex.block.yml +++ b/gr-blocks/grc/blocks_interleaved_short_to_complex.block.yml @@ -1,5 +1,6 @@ id: blocks_interleaved_short_to_complex label: IShort To Complex +flags: python, cpp parameters: - id: vector_input @@ -34,4 +35,14 @@ templates: callbacks: - set_swap(${swap}) +cpp_templates: + includes: ['#include <gnuradio/blocks/interleaved_short_to_complex.h>'] + declarations: 'blocks::interleaved_short_to_complex::sptr ${id};' + make: 'this->${id} = blocks::interleaved_short_to_complex::make(${vector_input}, ${swap});' + callbacks: + - set_swap(${swap}) + translations: + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_keep_m_in_n.block.yml b/gr-blocks/grc/blocks_keep_m_in_n.block.yml index 96cf25dde9..3c9d6326f8 100644 --- a/gr-blocks/grc/blocks_keep_m_in_n.block.yml +++ b/gr-blocks/grc/blocks_keep_m_in_n.block.yml @@ -1,5 +1,6 @@ id: blocks_keep_m_in_n label: Keep M in N +flags: python, cpp parameters: - id: type @@ -48,4 +49,15 @@ templates: - set_m(${m}) - set_n(${n}) +cpp_templates: + includes: ['#include <gnuradio/blocks/keep_m_in_n.h>'] + declarations: 'blocks::keep_m_in_n::sptr ${id};' + make: 'this->${id} = blocks::keep_m_in_n::make(${type.size}, ${m}, ${n}, ${offset});' + callbacks: + - set_offset(${offset}) + - set_m(${m}) + - set_n(${n}) + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_keep_one_in_n.block.yml b/gr-blocks/grc/blocks_keep_one_in_n.block.yml index d790557834..2dcfbd12d0 100644 --- a/gr-blocks/grc/blocks_keep_one_in_n.block.yml +++ b/gr-blocks/grc/blocks_keep_one_in_n.block.yml @@ -1,5 +1,6 @@ id: blocks_keep_one_in_n label: Keep 1 in N +flags: python, cpp parameters: - id: type @@ -41,4 +42,13 @@ templates: callbacks: - set_n(${n}) +cpp_templates: + includes: ['#include <gnuradio/blocks/keep_one_in_n.h>'] + declarations: 'blocks::keep_one_in_n::sptr ${id};' + make: 'this->${id} = blocks::keep_one_in_n::make(${type.size}*${vlen}, ${n});' + callbacks: + - set_n(${n}) + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_magphase_to_complex.block.yml b/gr-blocks/grc/blocks_magphase_to_complex.block.yml index 56f939d816..d643ba5489 100644 --- a/gr-blocks/grc/blocks_magphase_to_complex.block.yml +++ b/gr-blocks/grc/blocks_magphase_to_complex.block.yml @@ -1,5 +1,6 @@ id: blocks_magphase_to_complex label: Magnitude and Phase To Complex +flags: python, cpp parameters: - id: vlen @@ -31,4 +32,9 @@ templates: imports: from gnuradio import blocks make: blocks.magphase_to_complex(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/magphase_to_complex.h>'] + declarations: 'blocks::magphase_to_complex::sptr ${id};' + make: 'this->${id} = blocks::magphase_to_complex::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_max_xx.block.yml b/gr-blocks/grc/blocks_max_xx.block.yml index 8b7516de8e..a5fb91a0d6 100644 --- a/gr-blocks/grc/blocks_max_xx.block.yml +++ b/gr-blocks/grc/blocks_max_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_max_xx label: Max +flags: python, cpp parameters: - id: type @@ -42,6 +43,11 @@ asserts: templates: imports: from gnuradio import blocks - make: blocks.max_${type.fcn}(${vlen},${vlen_out}) + make: blocks.max_${type.fcn}(${vlen}, ${vlen_out}) + +cpp_templates: + includes: ['#include <gnuradio/blocks/max_${type.fcn}.h>'] + declarations: 'blocks::max_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::make_${type.fcn}::make(${vlen}, ${vlen_out});' file_format: 1 diff --git a/gr-blocks/grc/blocks_message_debug.block.yml b/gr-blocks/grc/blocks_message_debug.block.yml index 301320e884..0ffb37f8c5 100644 --- a/gr-blocks/grc/blocks_message_debug.block.yml +++ b/gr-blocks/grc/blocks_message_debug.block.yml @@ -1,5 +1,6 @@ id: blocks_message_debug label: Message Debug +flags: python, cpp inputs: - domain: message @@ -16,4 +17,9 @@ templates: imports: from gnuradio import blocks make: blocks.message_debug() +cpp_templates: + includes: ['#include <gnuradio/blocks/message_debug.h>'] + declarations: 'blocks::message_debug::sptr ${id};' + make: 'this->${id} = blocks::message_debug::make();' + file_format: 1 diff --git a/gr-blocks/grc/blocks_message_strobe.block.yml b/gr-blocks/grc/blocks_message_strobe.block.yml index 89264996b2..73baef498b 100644 --- a/gr-blocks/grc/blocks_message_strobe.block.yml +++ b/gr-blocks/grc/blocks_message_strobe.block.yml @@ -1,5 +1,6 @@ id: blocks_message_strobe label: Message Strobe +flags: python parameters: - id: msg diff --git a/gr-blocks/grc/blocks_message_strobe_random.block.yml b/gr-blocks/grc/blocks_message_strobe_random.block.yml index c0d6075892..bc08ccdf2d 100644 --- a/gr-blocks/grc/blocks_message_strobe_random.block.yml +++ b/gr-blocks/grc/blocks_message_strobe_random.block.yml @@ -1,5 +1,6 @@ id: blocks_message_strobe_random label: Message Strobe Random-Delay +flags: python parameters: - id: msg diff --git a/gr-blocks/grc/blocks_min_xx.block.yml b/gr-blocks/grc/blocks_min_xx.block.yml index 511d67c145..6fcd2664c0 100644 --- a/gr-blocks/grc/blocks_min_xx.block.yml +++ b/gr-blocks/grc/blocks_min_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_min_xx label: Min +flags: python, cpp parameters: - id: type @@ -44,4 +45,9 @@ templates: imports: from gnuradio import blocks make: blocks.min_${type.fcn}(${vlen},${vlen_out}) +cpp_templates: + includes: ['#include <gnuradio/blocks/min_${type.fcn}.h>'] + declarations: 'blocks::min_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::min_${type.fcn}::make(${vlen},${vlen_out});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_moving_average_xx.block.yml b/gr-blocks/grc/blocks_moving_average_xx.block.yml index 6b12355894..03c971ec1c 100644 --- a/gr-blocks/grc/blocks_moving_average_xx.block.yml +++ b/gr-blocks/grc/blocks_moving_average_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_moving_average_xx label: Moving Average +flags: python, cpp parameters: - id: type @@ -46,4 +47,11 @@ templates: callbacks: - set_length_and_scale(${length}, ${scale}) +cpp_templates: + includes: ['#include <gnuradio/blocks/moving_average_${type.fcn}.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 diff --git a/gr-blocks/grc/blocks_multiply_by_tag_value_cc.block.yml b/gr-blocks/grc/blocks_multiply_by_tag_value_cc.block.yml index f6b72edf36..84d20e8732 100644 --- a/gr-blocks/grc/blocks_multiply_by_tag_value_cc.block.yml +++ b/gr-blocks/grc/blocks_multiply_by_tag_value_cc.block.yml @@ -1,5 +1,6 @@ id: blocks_multiply_by_tag_value_cc label: Multiply by Tag Value +flags: python, cpp parameters: - id: tagname @@ -22,4 +23,9 @@ templates: imports: from gnuradio import blocks make: blocks.multiply_by_tag_value_cc(${tagname}, ${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/multiply_by_tag_value_cc.h>'] + declarations: 'blocks::multiply_by_tag_value_cc::sptr ${id};' + make: 'this->${id} = blocks::multiply_by_tag_value_cc::make(${tagname}, ${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_multiply_conjugate_cc.block.yml b/gr-blocks/grc/blocks_multiply_conjugate_cc.block.yml index aceabc643e..aff7c04991 100644 --- a/gr-blocks/grc/blocks_multiply_conjugate_cc.block.yml +++ b/gr-blocks/grc/blocks_multiply_conjugate_cc.block.yml @@ -1,5 +1,6 @@ id: blocks_multiply_conjugate_cc label: Multiply Conjugate +flags: python, cpp parameters: - id: vlen @@ -30,4 +31,9 @@ templates: imports: from gnuradio import blocks make: blocks.multiply_conjugate_cc(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/multiply_conjugate_cc.h>'] + declarations: 'blocks::multiply_conjugate_cc::sptr ${id};' + make: 'this->${id} = blocks::multiply_conjugate_cc::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_multiply_const_vxx.block.yml b/gr-blocks/grc/blocks_multiply_const_vxx.block.yml index 41dd9c9c68..6793ae134c 100644 --- a/gr-blocks/grc/blocks_multiply_const_vxx.block.yml +++ b/gr-blocks/grc/blocks_multiply_const_vxx.block.yml @@ -1,5 +1,6 @@ id: blocks_multiply_const_vxx label: Multiply Const +flags: python, cpp parameters: - id: type @@ -41,4 +42,11 @@ templates: callbacks: - set_k(${const}) +cpp_templates: + includes: ['#include <gnuradio/blocks/multiply_const_${"v" if context.get("vlen")() > 1 else "" }.h>'] + declarations: 'blocks::multiply_const_${"v" if context.get("vlen")() > 1 else "" }::sptr ${id};' + make: 'this->${id} = blocks::multiply_const_${"v" if context.get("vlen")() > 1 else "" }${type.fcn}::make(${const});' + callbacks: + - set_k(${const}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_multiply_const_xx.block.yml b/gr-blocks/grc/blocks_multiply_const_xx.block.yml index a239913802..561fccb17d 100644 --- a/gr-blocks/grc/blocks_multiply_const_xx.block.yml +++ b/gr-blocks/grc/blocks_multiply_const_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_multiply_const_xx label: Fast Multiply Const +flags: python, cpp parameters: - id: type @@ -39,4 +40,11 @@ templates: callbacks: - set_k(${const}) +cpp_templates: + includes: ['#include <gnuradio/multiply_const_${type.fcn}.h>'] + declarations: 'blocks::multiply_const_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::multiply_const_${type.fcn}::make(${const}, ${vlen});' + callbacks: + - set_k(${const}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_multiply_matrix_xx.block.yml b/gr-blocks/grc/blocks_multiply_matrix_xx.block.yml index 21a66b4f8e..6a4a467633 100644 --- a/gr-blocks/grc/blocks_multiply_matrix_xx.block.yml +++ b/gr-blocks/grc/blocks_multiply_matrix_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_multiply_matrix_xx label: Multiply by Matrix +flags: python parameters: - id: type @@ -44,4 +45,11 @@ templates: callbacks: - set_A(${A}) +cpp_templates: + includes: ['#include <gnuradio/blocks/multiply_matrix_${type.fcn}.h>'] + declarations: 'blocks::multiply_matrix_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::multiply_matrix_${type.fcn}::make(${A}, ${tag_propagation_policy});' + callbacks: + - set_A(${A}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_multiply_xx.block.yml b/gr-blocks/grc/blocks_multiply_xx.block.yml index 41c28458a8..6287ecdafe 100644 --- a/gr-blocks/grc/blocks_multiply_xx.block.yml +++ b/gr-blocks/grc/blocks_multiply_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_multiply_xx label: Multiply +flags: python, cpp parameters: - id: type @@ -39,4 +40,9 @@ templates: imports: from gnuradio import blocks make: blocks.multiply_v${type.fcn}(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/multiply_v.h>'] + declarations: 'blocks::multiply_v::sptr ${id};' + make: 'this->${id} = blocks::multiply_v${type.fcn}::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_mute_xx.block.yml b/gr-blocks/grc/blocks_mute_xx.block.yml index 8e36c568d1..7d1f9931e4 100644 --- a/gr-blocks/grc/blocks_mute_xx.block.yml +++ b/gr-blocks/grc/blocks_mute_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_mute_xx label: Mute +flags: python, cpp parameters: - id: type @@ -32,4 +33,14 @@ templates: callbacks: - set_mute(bool(${mute})) +cpp_templates: + includes: ['#include <gnuradio/blocks/mute_${type.fcn}.h>'] + declarations: 'blocks::mute_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::mute_${type.fcn}::(bool(${mute}));' + callbacks: + - set_mute(bool(${mute})) + translations: + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_nlog10_ff.block.yml b/gr-blocks/grc/blocks_nlog10_ff.block.yml index 004e72b4ec..f5396cd4ee 100644 --- a/gr-blocks/grc/blocks_nlog10_ff.block.yml +++ b/gr-blocks/grc/blocks_nlog10_ff.block.yml @@ -1,5 +1,6 @@ id: blocks_nlog10_ff label: Log10 +flags: python, cpp parameters: - id: n @@ -34,4 +35,10 @@ templates: imports: from gnuradio import blocks make: blocks.nlog10_ff(${n}, ${vlen}, ${k}) +cpp_templates: + includes: ['#include <gnuradio/blocks/nlog10_ff.h>'] + declarations: 'blocks::nlog10_ff::sptr ${id};' + make: 'this->${id} = blocks::nlog10_ff::make(${n}, ${vlen}, ${k});' + + file_format: 1 diff --git a/gr-blocks/grc/blocks_nop.block.yml b/gr-blocks/grc/blocks_nop.block.yml index 5e47e813ad..39578b0fc2 100644 --- a/gr-blocks/grc/blocks_nop.block.yml +++ b/gr-blocks/grc/blocks_nop.block.yml @@ -1,5 +1,6 @@ id: blocks_nop label: Nop +flags: python, cpp parameters: - id: type @@ -41,4 +42,11 @@ templates: imports: from gnuradio import blocks make: blocks.nop(${type.size}*${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/nop.h>'] + declarations: 'blocks::nop::sptr ${id};' + make: 'this->${id} = blocks::nop::make(${type.size}*${vlen});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_not_xx.block.yml b/gr-blocks/grc/blocks_not_xx.block.yml index 63ec98a42a..3de7ca5d75 100644 --- a/gr-blocks/grc/blocks_not_xx.block.yml +++ b/gr-blocks/grc/blocks_not_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_not_xx label: Not +flags: python, cpp parameters: - id: type @@ -22,4 +23,9 @@ templates: imports: from gnuradio import blocks make: blocks.not_${type.fcn}() +cpp_templates: + includes: ['#include <gnuradio/blocks/not_${type.fcn}.h>'] + declarations: 'blocks::not_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::not_${type.fcn}::make();' + file_format: 1 diff --git a/gr-blocks/grc/blocks_null_sink.block.yml b/gr-blocks/grc/blocks_null_sink.block.yml index c9530f99de..71d0b1867e 100644 --- a/gr-blocks/grc/blocks_null_sink.block.yml +++ b/gr-blocks/grc/blocks_null_sink.block.yml @@ -1,5 +1,6 @@ id: blocks_null_sink label: Null Sink +flags: python, cpp parameters: - id: type @@ -40,4 +41,11 @@ templates: imports: from gnuradio import blocks make: blocks.null_sink(${type.size}*${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/null_sink.h>'] + declarations: 'blocks::null_sink::sptr ${id};' + make: 'this->${id} = blocks::null_sink::make(${type.size})*${vlen});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_null_source.block.yml b/gr-blocks/grc/blocks_null_source.block.yml index 0678687a8d..da4335e8e3 100644 --- a/gr-blocks/grc/blocks_null_source.block.yml +++ b/gr-blocks/grc/blocks_null_source.block.yml @@ -1,5 +1,6 @@ id: blocks_null_source label: Null Source +flags: python, cpp parameters: - id: type @@ -36,4 +37,11 @@ templates: imports: from gnuradio import blocks make: blocks.null_source(${type.size}*${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/null_source.h>'] + declarations: 'blocks::null_source::sptr ${id};' + make: 'blocks::null_source::make(${type.size})*${vlen});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_or_xx.block.yml b/gr-blocks/grc/blocks_or_xx.block.yml index a28a951712..5604fb5e60 100644 --- a/gr-blocks/grc/blocks_or_xx.block.yml +++ b/gr-blocks/grc/blocks_or_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_or_xx label: Or +flags: python, cpp parameters: - id: type @@ -31,4 +32,9 @@ templates: imports: from gnuradio import blocks make: blocks.or_${type.fcn}() +cpp_templates: + includes: ['#include <gnuradio/blocks/or_${type.fcn}.h>'] + declarations: 'blocks::or_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::or_${type.fcn}::make();' + file_format: 1 diff --git a/gr-blocks/grc/blocks_pack_k_bits_bb.block.yml b/gr-blocks/grc/blocks_pack_k_bits_bb.block.yml index 904f382f0f..c8365afc41 100644 --- a/gr-blocks/grc/blocks_pack_k_bits_bb.block.yml +++ b/gr-blocks/grc/blocks_pack_k_bits_bb.block.yml @@ -1,5 +1,6 @@ id: blocks_pack_k_bits_bb label: Pack K Bits +flags: python, cpp parameters: - id: k @@ -18,6 +19,11 @@ templates: imports: from gnuradio import blocks make: blocks.pack_k_bits_bb(${k}) +cpp_templates: + includes: ['#include <gnuradio/blocks/pack_k_bits_bb.h>'] + declarations: 'blocks::pack_k_bits_bb::sptr ${id};' + make: 'this->${id} = blocks::pack_k_bits_bb::make(${k});' + documentation: |- Pack K unpacked bits (one bit per byte) into a single packed byte containing k bits and 8 - k zeros. diff --git a/gr-blocks/grc/blocks_packed_to_unpacked_xx.block.yml b/gr-blocks/grc/blocks_packed_to_unpacked_xx.block.yml index 5d49d1851c..696b668030 100644 --- a/gr-blocks/grc/blocks_packed_to_unpacked_xx.block.yml +++ b/gr-blocks/grc/blocks_packed_to_unpacked_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_packed_to_unpacked_xx label: Packed to Unpacked +flags: python, cpp parameters: - id: type @@ -41,4 +42,12 @@ templates: imports: from gnuradio import blocks make: blocks.packed_to_unpacked_${type.fcn}(${bits_per_chunk}, ${endianness}) + +cpp_templates: + includes: ['#include <gnuradio/blocks/packed_to_unpacked_${type.fcn}.h>'] + declarations: 'blocks::packed_to_unpacked_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::packed_to_unpacked_${type.fcn}::make(${bits_per_chunk}, ${endianness});' + translations: + gr.: '' + file_format: 1 diff --git a/gr-blocks/grc/blocks_patterned_interleaver.block.yml b/gr-blocks/grc/blocks_patterned_interleaver.block.yml index 97f170f97e..a8fa4bb89e 100644 --- a/gr-blocks/grc/blocks_patterned_interleaver.block.yml +++ b/gr-blocks/grc/blocks_patterned_interleaver.block.yml @@ -1,5 +1,6 @@ id: blocks_patterned_interleaver label: Patterned Interleaver +flags: python, cpp parameters: - id: type @@ -39,4 +40,11 @@ templates: imports: from gnuradio import blocks make: blocks.patterned_interleaver(${type.size}*${vlen}, ${pattern}) +cpp_templates: + includes: ['#include <gnuradio/blocks/patterned_interleaver.h>'] + declarations: 'blocks::patterned_interleaver::sptr ${id};' + make: 'this->${id} = blocks::patterned_interleaver::make(${type.size}*${vlen}, ${pattern});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_pdu_filter.block.yml b/gr-blocks/grc/blocks_pdu_filter.block.yml index 43d72b7480..d65405bb01 100644 --- a/gr-blocks/grc/blocks_pdu_filter.block.yml +++ b/gr-blocks/grc/blocks_pdu_filter.block.yml @@ -1,5 +1,6 @@ id: blocks_pdu_filter label: PDU Filter +flags: python parameters: - id: k diff --git a/gr-blocks/grc/blocks_pdu_remove.block.yml b/gr-blocks/grc/blocks_pdu_remove.block.yml index 4750ff22c4..a75f1ff3ac 100644 --- a/gr-blocks/grc/blocks_pdu_remove.block.yml +++ b/gr-blocks/grc/blocks_pdu_remove.block.yml @@ -1,5 +1,6 @@ id: blocks_pdu_remove label: PDU Remove +flags: python parameters: - id: k diff --git a/gr-blocks/grc/blocks_pdu_set.block.yml b/gr-blocks/grc/blocks_pdu_set.block.yml index 44a06a2e09..aa53e08f59 100644 --- a/gr-blocks/grc/blocks_pdu_set.block.yml +++ b/gr-blocks/grc/blocks_pdu_set.block.yml @@ -1,5 +1,6 @@ id: blocks_pdu_set label: PDU Set +flags: python parameters: - id: k diff --git a/gr-blocks/grc/blocks_pdu_to_tagged_stream.block.yml b/gr-blocks/grc/blocks_pdu_to_tagged_stream.block.yml index 3b44badd4b..295907a60a 100644 --- a/gr-blocks/grc/blocks_pdu_to_tagged_stream.block.yml +++ b/gr-blocks/grc/blocks_pdu_to_tagged_stream.block.yml @@ -1,5 +1,6 @@ id: blocks_pdu_to_tagged_stream label: PDU to Tagged Stream +flags: python, cpp parameters: - id: type @@ -26,4 +27,11 @@ templates: imports: from gnuradio import blocks make: blocks.pdu_to_tagged_stream(${type.tv}, ${tag}) +cpp_templates: + includes: ['#include <gnuradio/blocks/pdu_to_tagged_stream.h>'] + declarations: 'blocks::pdu_to_tagged_stream::sptr ${id};' + make: 'this->${id} = blocks::pdu_to_tagged_stream::make(${type.tv}, ${tag});' + translations: + blocks.: 'blocks::' + file_format: 1 diff --git a/gr-blocks/grc/blocks_peak_detector2_fb.block.yml b/gr-blocks/grc/blocks_peak_detector2_fb.block.yml index 0950640ae2..8b4eec97ca 100644 --- a/gr-blocks/grc/blocks_peak_detector2_fb.block.yml +++ b/gr-blocks/grc/blocks_peak_detector2_fb.block.yml @@ -1,5 +1,6 @@ id: blocks_peak_detector2_fb label: Peak Detector2 +flags: python, cpp parameters: - id: threshold_factor_rise @@ -35,4 +36,13 @@ templates: - set_look_ahead(${look_ahead}) - set_alpha(${alpha}) +cpp_templates: + includes: ['#include <gnuradio/blocks/peak_detector2_fb.h>'] + declarations: 'blocks::peak_detector2_fb::sptr ${id};' + make: 'this->${id} = blocks::peak_detector2_fb::make(${threshold_factor_rise}, ${look_ahead}, ${alpha});' + callbacks: + - set_threshold_factor_rise(${threshold_factor_rise}) + - set_look_ahead(${look_ahead}) + - set_alpha(${alpha}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_peak_detector_xb.block.yml b/gr-blocks/grc/blocks_peak_detector_xb.block.yml index be0f238391..6d1d91308e 100644 --- a/gr-blocks/grc/blocks_peak_detector_xb.block.yml +++ b/gr-blocks/grc/blocks_peak_detector_xb.block.yml @@ -1,5 +1,6 @@ id: blocks_peak_detector_xb label: Peak Detector +flags: python, cpp parameters: - id: type @@ -44,4 +45,15 @@ templates: - set_look_ahead(${look_ahead}) - set_alpha(${alpha}) +cpp_templates: + includes: ['#include <gnuradio/blocks/peak_detector_${type.fcn}b.h>'] + declarations: 'blocks::peak_detector_${type.fcn}b::sptr ${id};' + make: 'this->${id} = blocks::peak_detector_${type.fcn}b::make(${threshold_factor_rise}, ${threshold_factor_fall}, + ${look_ahead}, ${alpha});' + callbacks: + - set_threshold_factor_rise(${threshold_factor_rise}) + - set_threshold_factor_fall(${threshold_factor_fall}) + - set_look_ahead(${look_ahead}) + - set_alpha(${alpha}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_plateau_detector_fb.block.yml b/gr-blocks/grc/blocks_plateau_detector_fb.block.yml index 09ae10b340..972e9995e6 100644 --- a/gr-blocks/grc/blocks_plateau_detector_fb.block.yml +++ b/gr-blocks/grc/blocks_plateau_detector_fb.block.yml @@ -1,5 +1,6 @@ id: blocks_plateau_detector_fb label: Plateau Detector +flags: python, cpp parameters: - id: max_len @@ -21,7 +22,10 @@ outputs: templates: imports: from gnuradio import blocks make: blocks.plateau_detector_fb(${max_len}, ${threshold}) - callbacks: - - set_threshold(${threshold}) + +cpp_templates: + includes: ['#include <gnuradio/blocks/plateau_detector_fb.h>'] + declarations: 'blocks::plateau_detector_fb::sptr ${id};' + make: 'this->${id} = blocks::plateau_detector_fb::make(${max_len}, ${threshold});' file_format: 1 diff --git a/gr-blocks/grc/blocks_probe_rate.block.yml b/gr-blocks/grc/blocks_probe_rate.block.yml index 1f9ed65b2b..c7796213ec 100644 --- a/gr-blocks/grc/blocks_probe_rate.block.yml +++ b/gr-blocks/grc/blocks_probe_rate.block.yml @@ -1,5 +1,6 @@ id: blocks_probe_rate label: Probe Rate +flags: python, cpp parameters: - id: type @@ -41,4 +42,11 @@ templates: imports: from gnuradio import blocks make: blocks.probe_rate(${type.size}*${vlen}, ${mintime}, ${alpha}) +cpp_templates: + includes: ['#include <gnuradio/blocks/probe_rate.h>'] + declarations: 'blocks::probe_rate::sptr ${id};' + make: 'this->${id} = blocks::probe_rate::make(${type.size}*${vlen}, ${mintime}, ${alpha});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_probe_signal_vx.block.yml b/gr-blocks/grc/blocks_probe_signal_vx.block.yml index 2b486a55b2..b3be5c7cd3 100644 --- a/gr-blocks/grc/blocks_probe_signal_vx.block.yml +++ b/gr-blocks/grc/blocks_probe_signal_vx.block.yml @@ -1,5 +1,6 @@ id: blocks_probe_signal_vx label: Probe Signal Vector +flags: python, cpp parameters: - id: type @@ -27,6 +28,11 @@ templates: imports: from gnuradio import blocks make: blocks.probe_signal_v${type.fcn}(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/probe_signal_v${type.fcn}.h>'] + declarations: 'blocks::probe_signal_v${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::probe_signal_v${type.fcn}::make(${vlen});' + documentation: |- Available functions to probe: level() diff --git a/gr-blocks/grc/blocks_probe_signal_x.block.yml b/gr-blocks/grc/blocks_probe_signal_x.block.yml index 0991bde99f..84a249a883 100644 --- a/gr-blocks/grc/blocks_probe_signal_x.block.yml +++ b/gr-blocks/grc/blocks_probe_signal_x.block.yml @@ -1,5 +1,6 @@ id: blocks_probe_signal_x label: Probe Signal +flags: python, cpp parameters: - id: type @@ -18,6 +19,11 @@ templates: imports: from gnuradio import blocks make: blocks.probe_signal_${type.fcn}() +cpp_templates: + includes: ['#include <gnuradio/blocks/probe_signal_${type.fcn}.h>'] + declarations: 'blocks::probe_signal_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::probe_signal_${type.fcn}::make();' + documentation: |- Available functions to probe: level() diff --git a/gr-blocks/grc/blocks_random_pdu.block.yml b/gr-blocks/grc/blocks_random_pdu.block.yml index 831b7eb4c2..b12d4c5441 100644 --- a/gr-blocks/grc/blocks_random_pdu.block.yml +++ b/gr-blocks/grc/blocks_random_pdu.block.yml @@ -1,5 +1,6 @@ id: blocks_random_pdu label: Random PDU Generator +flags: python parameters: - id: minsize diff --git a/gr-blocks/grc/blocks_regenerate_bb.block.yml b/gr-blocks/grc/blocks_regenerate_bb.block.yml index 843e680a41..5b3a8b4879 100644 --- a/gr-blocks/grc/blocks_regenerate_bb.block.yml +++ b/gr-blocks/grc/blocks_regenerate_bb.block.yml @@ -1,5 +1,6 @@ id: blocks_regenerate_bb label: Regenerate +flags: python, cpp parameters: - id: period @@ -22,4 +23,9 @@ templates: imports: from gnuradio import blocks make: blocks.regenerate_bb(${period}, ${max_regen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/regenerate_bb.h>'] + declarations: 'blocks::regenerate_bb::sptr ${id};' + make: 'this->${id} = blocks::regenerate_bb::make(${period}, ${max_regen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_repack_bits_bb.block.yml b/gr-blocks/grc/blocks_repack_bits_bb.block.yml index 9d5a3ba9ca..8c1ca35a6c 100644 --- a/gr-blocks/grc/blocks_repack_bits_bb.block.yml +++ b/gr-blocks/grc/blocks_repack_bits_bb.block.yml @@ -1,5 +1,6 @@ id: blocks_repack_bits_bb label: Repack Bits +flags: python, cpp parameters: - id: k @@ -44,4 +45,14 @@ templates: callbacks: - set_k_and_l(${k},${l}) +cpp_templates: + includes: ['#include <gnuradio/blocks/repack_bits_bb.h>'] + declarations: 'blocks::repack_bits_bb::sptr ${id};' + make: 'this->${id} = blocks::repack_bits_bb::make(${k}, ${l}, ${len_tag_key}, ${align_output}, ${endianness});' + callbacks: + - set_k_and_l(${k},${l}) + translations: + gr.: '' + 'True': 'true' + 'False': 'false' file_format: 1 diff --git a/gr-blocks/grc/blocks_repeat.block.yml b/gr-blocks/grc/blocks_repeat.block.yml index 809231d293..d7f0e54a27 100644 --- a/gr-blocks/grc/blocks_repeat.block.yml +++ b/gr-blocks/grc/blocks_repeat.block.yml @@ -1,5 +1,6 @@ id: blocks_repeat label: Repeat +flags: python, cpp parameters: - id: type @@ -38,4 +39,13 @@ templates: callbacks: - set_interpolation(${interp}) +cpp_templates: + includes: ['#include <gnuradio/blocks/repeat.h>'] + declarations: 'blocks::repeat::sptr ${id};' + make: 'this->${id} = blocks::repeat::make(${type.size}*${vlen}, ${interp});' + callbacks: + - set_interpolation(${interp}) + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_rms_xx.block.yml b/gr-blocks/grc/blocks_rms_xx.block.yml index ca5e8df124..3750d937eb 100644 --- a/gr-blocks/grc/blocks_rms_xx.block.yml +++ b/gr-blocks/grc/blocks_rms_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_rms_xx label: RMS +flags: python, cpp parameters: - id: type @@ -28,4 +29,11 @@ templates: callbacks: - set_alpha(${alpha}) +cpp_templates: + includes: ['#include <gnuradio/blocks/rms_${type.fcn}f.h>'] + declarations: 'blocks::rms_${type.fcn}f::sptr ${id};' + make: 'this->${id} = blocks::rms_${type.fcn}f::make(${alpha});' + callbacks: + - set_alpha(${alpha}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_rotator_cc.block.yml b/gr-blocks/grc/blocks_rotator_cc.block.yml index d65fbd5997..2e6e75a3a5 100644 --- a/gr-blocks/grc/blocks_rotator_cc.block.yml +++ b/gr-blocks/grc/blocks_rotator_cc.block.yml @@ -1,5 +1,6 @@ id: blocks_rotator_cc label: Rotator +flags: python, cpp parameters: - id: phase_inc @@ -21,4 +22,11 @@ templates: callbacks: - set_phase_inc(${phase_inc}) +cpp_templates: + includes: ['#include <gnuradio/blocks/rotator_cc.h>'] + declarations: 'blocks::rotator_cc::sptr ${id};' + make: 'this->${id} = blocks::rotator_cc::make(${phase_inc});' + callbacks: + - set_phase_inc(${phase_inc}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_sample_and_hold_xx.block.yml b/gr-blocks/grc/blocks_sample_and_hold_xx.block.yml index 893e7862b2..d2001ce6c5 100644 --- a/gr-blocks/grc/blocks_sample_and_hold_xx.block.yml +++ b/gr-blocks/grc/blocks_sample_and_hold_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_sample_and_hold_xx label: Sample and Hold +flags: python, cpp parameters: - id: type @@ -25,4 +26,9 @@ templates: imports: from gnuradio import blocks make: blocks.sample_and_hold_${type.fcn}() +cpp_templates: + includes: ['#include <gnuradio/blocks/sample_and_hold_${type.fcn}.h>'] + declarations: 'blocks::sample_and_hold_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::sample_and_hold_${type.fcn}::make();' + file_format: 1 diff --git a/gr-blocks/grc/blocks_short_to_char.block.yml b/gr-blocks/grc/blocks_short_to_char.block.yml index d24df725da..adb2293494 100644 --- a/gr-blocks/grc/blocks_short_to_char.block.yml +++ b/gr-blocks/grc/blocks_short_to_char.block.yml @@ -1,5 +1,6 @@ id: blocks_short_to_char label: Short To Char +flags: python, cpp parameters: - id: vlen @@ -22,4 +23,9 @@ templates: imports: from gnuradio import blocks make: blocks.short_to_char(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/short_to_char.h>'] + declarations: 'blocks::short_to_char::sptr ${id};' + make: 'this->${id} = blocks::short_to_char::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_short_to_float.block.yml b/gr-blocks/grc/blocks_short_to_float.block.yml index 8ad5f7ed13..e8b28bbb1c 100644 --- a/gr-blocks/grc/blocks_short_to_float.block.yml +++ b/gr-blocks/grc/blocks_short_to_float.block.yml @@ -1,5 +1,6 @@ id: blocks_short_to_float label: Short To Float +flags: python, cpp parameters: - id: vlen @@ -28,4 +29,11 @@ templates: callbacks: - set_scale(${scale}) +cpp_templates: + includes: ['#include <gnuradio/blocks/short_to_float.h>'] + declarations: 'blocks::short_to_float::sptr ${id};' + make: 'this->${id} = blocks::short_to_float::make(${vlen}, ${scale});' + callbacks: + - set_scale(${scale}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_skiphead.block.yml b/gr-blocks/grc/blocks_skiphead.block.yml index c0f10eb2d1..97aab03754 100644 --- a/gr-blocks/grc/blocks_skiphead.block.yml +++ b/gr-blocks/grc/blocks_skiphead.block.yml @@ -1,5 +1,6 @@ id: blocks_skiphead label: Skip Head +flags: python, cpp parameters: - id: type @@ -37,4 +38,11 @@ templates: imports: from gnuradio import blocks make: blocks.skiphead(${type.size}*${vlen}, ${num_items}) +cpp_templates: + includes: ['#include <gnuradio/blocks/skiphead.h>'] + declarations: 'blocks::skiphead::sptr ${id};' + make: 'this->${id} = blocks::skiphead::make(${type.size}*${vlen}, ${num_items});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_socket_pdu.block.yml b/gr-blocks/grc/blocks_socket_pdu.block.yml index 537abac52e..377d20c048 100644 --- a/gr-blocks/grc/blocks_socket_pdu.block.yml +++ b/gr-blocks/grc/blocks_socket_pdu.block.yml @@ -1,5 +1,6 @@ id: blocks_socket_pdu label: Socket PDU +flags: python, cpp parameters: - id: type @@ -41,6 +42,14 @@ templates: imports: from gnuradio import blocks make: blocks.socket_pdu(${repr(type)}, ${host}, ${port}, ${mtu}, ${tcp_no_delay}) +cpp_templates: + includes: ['#include <gnuradio/blocks/socket_pdu.h>'] + declarations: 'blocks::socket_pdu::sptr ${id};' + make: 'this->${id} = blocks::socket_pdu::make(${type}, ${host}, ${port}, ${mtu}, ${tcp_no_delay});' + translations: + 'True': 'true' + 'False': 'false' + documentation: |- For server modes, leave Host blank to bind to all interfaces (equivalent to 0.0.0.0). diff --git a/gr-blocks/grc/blocks_stream_mux.block.yml b/gr-blocks/grc/blocks_stream_mux.block.yml index 27d3baf89f..177ec18dca 100644 --- a/gr-blocks/grc/blocks_stream_mux.block.yml +++ b/gr-blocks/grc/blocks_stream_mux.block.yml @@ -1,5 +1,6 @@ id: blocks_stream_mux label: Stream Mux +flags: python, cpp parameters: - id: type @@ -45,4 +46,11 @@ templates: imports: from gnuradio import blocks make: blocks.stream_mux(${type.size}*${vlen}, ${lengths}) +cpp_templates: + includes: ['#include <gnuradio/blocks/stream_mux.h>'] + declarations: 'blocks::stream_mux::sptr ${id};' + make: 'this->${id} = blocks::stream_mux::make(${type.size}*${vlen}, ${lengths});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_stream_to_streams.block.yml b/gr-blocks/grc/blocks_stream_to_streams.block.yml index 16adb159a3..43c35901ae 100644 --- a/gr-blocks/grc/blocks_stream_to_streams.block.yml +++ b/gr-blocks/grc/blocks_stream_to_streams.block.yml @@ -1,5 +1,6 @@ id: blocks_stream_to_streams label: Stream to Streams +flags: python, cpp parameters: - id: type @@ -40,4 +41,11 @@ templates: imports: from gnuradio import blocks make: blocks.stream_to_streams(${type.size}*${vlen}, ${num_streams}) +cpp_templates: + includes: ['#include <gnuradio/blocks/stream_to_streams.h>'] + declarations: 'blocks::stream_to_streams::sptr ${id};' + make: 'this->${id} = blocks::stream_to_streams::make(${type.size}*${vlen}, ${num_streams});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_stream_to_tagged_stream.block.yml b/gr-blocks/grc/blocks_stream_to_tagged_stream.block.yml index db75c20dd7..b9f277c39c 100644 --- a/gr-blocks/grc/blocks_stream_to_tagged_stream.block.yml +++ b/gr-blocks/grc/blocks_stream_to_tagged_stream.block.yml @@ -1,5 +1,6 @@ id: blocks_stream_to_tagged_stream label: Stream to Tagged Stream +flags: python, cpp parameters: - id: type @@ -40,4 +41,14 @@ templates: - set_packet_len(${packet_len}) - set_packet_len_pmt(${packet_len}) +cpp_templates: + includes: ['#include <gnuradio/blocks/stream_to_tagged_stream.h>'] + declarations: 'blocks::stream_to_tagged_stream::sptr ${id};' + make: 'this->${id} = blocks::stream_to_tagged_stream::make(${type.size}, ${vlen}, ${packet_len}, ${len_tag_key});' + callbacks: + - set_packet_len(${packet_len}) + - set_packet_len_pmt(${packet_len}) + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_stream_to_vector.block.yml b/gr-blocks/grc/blocks_stream_to_vector.block.yml index 73e177d0c7..94c53b42c7 100644 --- a/gr-blocks/grc/blocks_stream_to_vector.block.yml +++ b/gr-blocks/grc/blocks_stream_to_vector.block.yml @@ -1,5 +1,6 @@ id: blocks_stream_to_vector label: Stream to Vector +flags: python, cpp parameters: - id: type @@ -39,4 +40,11 @@ templates: imports: from gnuradio import blocks make: blocks.stream_to_vector(${type.size}*${vlen}, ${num_items}) +cpp_templates: + includes: ['#include <gnuradio/blocks/stream_to_vector.h>'] + declarations: 'blocks::stream_to_vector::sptr ${id};' + make: 'this->${id} = blocks::stream_to_vector::make(${type.size}*${vlen}, ${num_items});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_stream_to_vector_decimator.block.yml b/gr-blocks/grc/blocks_stream_to_vector_decimator.block.yml index c5b4e2059d..7bc639540b 100644 --- a/gr-blocks/grc/blocks_stream_to_vector_decimator.block.yml +++ b/gr-blocks/grc/blocks_stream_to_vector_decimator.block.yml @@ -1,5 +1,6 @@ id: blocks_stream_to_vector_decimator label: Stream to Vec Decim +flags: python parameters: - id: type diff --git a/gr-blocks/grc/blocks_streams_to_stream.block.yml b/gr-blocks/grc/blocks_streams_to_stream.block.yml index 404fcb0125..aa457ef7a3 100644 --- a/gr-blocks/grc/blocks_streams_to_stream.block.yml +++ b/gr-blocks/grc/blocks_streams_to_stream.block.yml @@ -1,5 +1,6 @@ id: blocks_streams_to_stream label: Streams to Stream +flags: python, cpp parameters: - id: type @@ -40,4 +41,11 @@ templates: imports: from gnuradio import blocks make: blocks.streams_to_stream(${type.size}*${vlen}, ${num_streams}) +cpp_templates: + includes: ['#include <gnuradio/blocks/streams_to_stream.h>'] + declarations: 'blocks::streams_to_stream::sptr ${id};' + make: 'this->${id} = blocks::streams_to_stream::make(${type.size}*${vlen}, ${num_streams});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_streams_to_vector.block.yml b/gr-blocks/grc/blocks_streams_to_vector.block.yml index d16d1e9384..3ebfc0a827 100644 --- a/gr-blocks/grc/blocks_streams_to_vector.block.yml +++ b/gr-blocks/grc/blocks_streams_to_vector.block.yml @@ -1,5 +1,6 @@ id: blocks_streams_to_vector label: Streams to Vector +flags: python, cpp parameters: - id: type @@ -40,4 +41,11 @@ templates: imports: from gnuradio import blocks make: blocks.streams_to_vector(${type.size}*${vlen}, ${num_streams}) +cpp_templates: + includes: ['#include <gnuradio/blocks/streams_to_vector.h>'] + declarations: 'blocks::streams_to_vector::sptr ${id};' + make: 'this->${id} = blocks::streams_to_vector::make(${type.size}*${vlen}, ${num_streams});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_stretch_ff.block.yml b/gr-blocks/grc/blocks_stretch_ff.block.yml index 95921538c0..d2a24c9eed 100644 --- a/gr-blocks/grc/blocks_stretch_ff.block.yml +++ b/gr-blocks/grc/blocks_stretch_ff.block.yml @@ -1,5 +1,6 @@ id: blocks_stretch_ff label: Stretch +flags: python, cpp parameters: - id: lo @@ -25,4 +26,9 @@ templates: imports: from gnuradio import blocks make: blocks.stretch_ff(${lo}, ${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/stretch_ff.h>'] + declarations: 'blocks::stretch_ff::sptr ${id};' + make: 'this->${id} = blocks::stretch_ff::make(${lo}, ${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_sub_xx.block.yml b/gr-blocks/grc/blocks_sub_xx.block.yml index 0cfab09407..d0522df819 100644 --- a/gr-blocks/grc/blocks_sub_xx.block.yml +++ b/gr-blocks/grc/blocks_sub_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_sub_xx label: Subtract +flags: python, cpp parameters: - id: type @@ -39,4 +40,9 @@ templates: imports: from gnuradio import blocks make: blocks.sub_${type.fcn}(${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/sub_${type.fcn}.h>'] + declarations: 'blocks::sub_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::sub_${type.fcn}::make(${vlen});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_tag_debug.block.yml b/gr-blocks/grc/blocks_tag_debug.block.yml index 4bab9b94dd..0a84a4c742 100644 --- a/gr-blocks/grc/blocks_tag_debug.block.yml +++ b/gr-blocks/grc/blocks_tag_debug.block.yml @@ -1,5 +1,6 @@ id: blocks_tag_debug label: Tag Debug +flags: python, cpp parameters: - id: type @@ -52,4 +53,17 @@ templates: callbacks: - set_display(${display}) +cpp_templates: + includes: ['#include <gnuradio/blocks/tag_debug.h>'] + declarations: 'blocks::tag_debug::sptr ${id};' + make: |- + this->${id} = blocks::tag_debug::make(${type.size}*${vlen}, ${name}, ${filter}); + this->${id}.set_display(${display}); + callbacks: + - set_display(${display}) + translations: + gr.sizeof_: 'sizeof(' + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_tag_gate.block.yml b/gr-blocks/grc/blocks_tag_gate.block.yml index a05ee3c276..cb8e199f49 100644 --- a/gr-blocks/grc/blocks_tag_gate.block.yml +++ b/gr-blocks/grc/blocks_tag_gate.block.yml @@ -1,5 +1,6 @@ id: blocks_tag_gate label: Tag Gate +flags: python, cpp parameters: - id: type @@ -47,4 +48,16 @@ templates: callbacks: - self.${id}.set_single_key(${single_key}) +cpp_templates: + includes: ['#include <gnuradio/blocks/tag_gate.h>'] + make: |- + this->${id} = blocks::tag_gate::make(${type.size} * ${vlen}, ${propagate_tags}); + this->${id}.set_single_key(${single_key}); + callbacks: + - self.${id}.set_single_key(${single_key}) + translations: + gr.sizeof_: 'sizeof(' + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_tag_object.block.yml b/gr-blocks/grc/blocks_tag_object.block.yml index cf0f996470..4584290d43 100644 --- a/gr-blocks/grc/blocks_tag_object.block.yml +++ b/gr-blocks/grc/blocks_tag_object.block.yml @@ -1,5 +1,6 @@ id: variable_tag_object label: Tag Object +flags: python parameters: - id: offset diff --git a/gr-blocks/grc/blocks_tag_share.block.yml b/gr-blocks/grc/blocks_tag_share.block.yml index 96096ef58c..b2f483164a 100644 --- a/gr-blocks/grc/blocks_tag_share.block.yml +++ b/gr-blocks/grc/blocks_tag_share.block.yml @@ -1,5 +1,6 @@ id: blocks_tag_share label: Tag Share +flags: python, cpp parameters: - id: io_type @@ -45,4 +46,11 @@ templates: imports: from gnuradio import blocks make: blocks.tag_share(${io_type.size}, ${share_type.size}, ${vlen}) +cpp_templates: + includes: ['#include <gnuradio/blocks/tag_share.h>'] + declarations: 'blocks::tag_share::sptr ${id};' + make: 'this->${id} = blocks::tag_share::make(${io_type.size}, ${share_type.size}, ${vlen});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_tagged_file_sink.block.yml b/gr-blocks/grc/blocks_tagged_file_sink.block.yml index f70c78154b..b1cff2f24c 100644 --- a/gr-blocks/grc/blocks_tagged_file_sink.block.yml +++ b/gr-blocks/grc/blocks_tagged_file_sink.block.yml @@ -1,5 +1,6 @@ id: blocks_tagged_file_sink label: Tagged File Sink +flags: python, cpp parameters: - id: type @@ -32,4 +33,11 @@ templates: imports: from gnuradio import blocks make: blocks.tagged_file_sink(${type.size}*${vlen}, ${samp_rate}) +cpp_templates: + includes: ['#include <gnuradio/blocks/tagged_file_sink.h>'] + declarations: 'blocks::tagged_file_sink::sptr ${id};' + make: 'this->${id} = blocks::tagged_file_sink::make(${type.size}*${vlen}, ${samp_rate});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_tagged_stream_align.block.yml b/gr-blocks/grc/blocks_tagged_stream_align.block.yml index cfc5a7717a..bb6f5b3e20 100644 --- a/gr-blocks/grc/blocks_tagged_stream_align.block.yml +++ b/gr-blocks/grc/blocks_tagged_stream_align.block.yml @@ -1,5 +1,6 @@ id: blocks_tagged_stream_align label: Tagged Stream Align +flags: python, cpp parameters: - id: type @@ -34,4 +35,11 @@ templates: imports: from gnuradio import blocks make: blocks.tagged_stream_align(${type.size}*${vlen}, ${lengthtagname}) +cpp_templates: + includes: ['#include <gnuradio/blocks/tagged_stream_align.h>'] + declarations: 'blocks::tagged_stream_align::sptr ${id};' + make: 'this->${id} = blocks::tagged_stream_align::make(${type.size}*${vlen}, ${lengthtagname});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_tagged_stream_multiply_length.block.yml b/gr-blocks/grc/blocks_tagged_stream_multiply_length.block.yml index 90fbcf0c21..576ba89508 100644 --- a/gr-blocks/grc/blocks_tagged_stream_multiply_length.block.yml +++ b/gr-blocks/grc/blocks_tagged_stream_multiply_length.block.yml @@ -1,5 +1,6 @@ id: blocks_tagged_stream_multiply_length label: Tagged Stream Multiply Length Tag +flags: python, cpp parameters: - id: type @@ -43,4 +44,14 @@ templates: callbacks: - set_scalar(${c}) +cpp_templates: + includes: ['#include <gnuradio/blocks/tagged_stream_multiply_length.h>'] + declarations: 'blocks::tagged_stream_multiply_length::sptr ${id};' + make: 'this->${id} = blocks.tagged_stream_multiply_length(${type.size}*${vlen}, ${lengthtagname}, + ${c});' + callbacks: + - set_scalar(${c}) + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_tagged_stream_mux.block.yml b/gr-blocks/grc/blocks_tagged_stream_mux.block.yml index 4807e95d2b..065103f93f 100644 --- a/gr-blocks/grc/blocks_tagged_stream_mux.block.yml +++ b/gr-blocks/grc/blocks_tagged_stream_mux.block.yml @@ -1,5 +1,6 @@ id: blocks_tagged_stream_mux label: Tagged Stream Mux +flags: python, cpp parameters: - id: type @@ -43,4 +44,11 @@ templates: imports: from gnuradio import blocks make: blocks.tagged_stream_mux(${type.size}*${vlen}, ${lengthtagname}, ${tag_preserve_head_pos}) +cpp_templates: + includes: ['#include <gnuradio/blocks/tagged_stream_mux.h>'] + declarations: 'blocks::tagged_stream_mux::sptr ${id};' + make: 'this->${id} = blocks::tagged_stream_mux::make(${type.size}*${vlen}, ${lengthtagname}, ${tag_preserve_head_pos});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_tagged_stream_to_pdu.block.yml b/gr-blocks/grc/blocks_tagged_stream_to_pdu.block.yml index e2292adb25..e62b5516df 100644 --- a/gr-blocks/grc/blocks_tagged_stream_to_pdu.block.yml +++ b/gr-blocks/grc/blocks_tagged_stream_to_pdu.block.yml @@ -1,5 +1,6 @@ id: blocks_tagged_stream_to_pdu label: Tagged Stream to PDU +flags: python parameters: - id: type @@ -27,4 +28,9 @@ templates: imports: from gnuradio import blocks make: blocks.tagged_stream_to_pdu(${type.tv}, ${tag}) +cpp_templates: + includes: ['#include <gnuradio/blocks/tagged_stream_to_pdu.h>'] + declarations: 'blocks::tagged_stream_to_pdu::sptr ${id};' + make: 'this->${id} = blocks::tagged_stream_to_pdu::make(${type.tv}, ${tag});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_tags_strobe.block.yml b/gr-blocks/grc/blocks_tags_strobe.block.yml index 344fb9bde8..fffb8b7e46 100644 --- a/gr-blocks/grc/blocks_tags_strobe.block.yml +++ b/gr-blocks/grc/blocks_tags_strobe.block.yml @@ -1,5 +1,6 @@ id: blocks_tags_strobe label: Tags Strobe +flags: python parameters: - id: type diff --git a/gr-blocks/grc/blocks_tcp_server_sink.block.yml b/gr-blocks/grc/blocks_tcp_server_sink.block.yml index fc8eae056b..e5d4fcc071 100644 --- a/gr-blocks/grc/blocks_tcp_server_sink.block.yml +++ b/gr-blocks/grc/blocks_tcp_server_sink.block.yml @@ -1,5 +1,6 @@ id: blocks_tcp_server_sink label: TCP Server Sink +flags: python, cpp parameters: - id: type @@ -39,4 +40,13 @@ templates: imports: from gnuradio import blocks make: blocks.tcp_server_sink(${type.size}*${vlen}, ${ipaddr}, ${port}, ${noblock}) +cpp_templates: + includes: ['#include <gnuradio/blocks/tcp_server_sink.h>'] + declarations: 'blocks::tcp_server_sink::sptr ${id};' + make: 'this->${id} = blocks::tcp_server_sink::make(${type.size}*${vlen}, ${ipaddr}, ${port}, ${noblock});' + translations: + gr.sizeof_: 'sizeof(' + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_test_tag_variable_rate_ff.block.yml b/gr-blocks/grc/blocks_test_tag_variable_rate_ff.block.yml index 1a873cc19c..a13bd777ad 100644 --- a/gr-blocks/grc/blocks_test_tag_variable_rate_ff.block.yml +++ b/gr-blocks/grc/blocks_test_tag_variable_rate_ff.block.yml @@ -1,5 +1,6 @@ id: blocks_test_tag_variable_rate_ff label: Test Tag Variable Rate +flags: python, cpp parameters: - id: once @@ -26,4 +27,12 @@ templates: imports: from gnuradio import blocks make: blocks.test_tag_variable_rate_ff(${once}, ${step}) +cpp_templates: + includes: ['#include <gnuradio/blocks/test_tag_variable_rate_ff.h>'] + declarations: 'blocks::test_tag_variable_rate_ff::sptr ${id};' + make: 'this->${id} = blocks::test_tag_variable_rate_ff::make(${once}, ${step});' + translations: + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_threshold_ff.block.yml b/gr-blocks/grc/blocks_threshold_ff.block.yml index 52a6f10059..23eb9c2d14 100644 --- a/gr-blocks/grc/blocks_threshold_ff.block.yml +++ b/gr-blocks/grc/blocks_threshold_ff.block.yml @@ -1,5 +1,6 @@ id: blocks_threshold_ff label: Threshold +flags: python, cpp parameters: - id: low @@ -30,4 +31,12 @@ templates: - set_hi(${high}) - set_lo(${low}) +cpp_templates: + includes: ['#include <gnuradio/blocks/threshold_ff.h>'] + declarations: 'blocks::threshold_ff::sptr ${id};' + make: 'this->${id} = blocks::threshold_ff::make(${low}, ${high}, ${init});' + callbacks: + - set_hi(${high}) + - set_lo(${low}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_throttle.block.yml b/gr-blocks/grc/blocks_throttle.block.yml index 8b497b60c4..0bfdeab0dc 100644 --- a/gr-blocks/grc/blocks_throttle.block.yml +++ b/gr-blocks/grc/blocks_throttle.block.yml @@ -1,6 +1,6 @@ id: blocks_throttle label: Throttle -flags: throttle +flags: throttle, python, cpp parameters: - id: type @@ -45,4 +45,16 @@ templates: callbacks: - set_sample_rate(${samples_per_second}) +cpp_templates: + includes: ['#include <gnuradio/blocks/throttle.h>'] + declarations: 'blocks::throttle::sptr ${id};' + make: 'this->${id} = blocks::throttle::make(${type.size})*${vlen}, ${samples_per_second}, ${ignoretag});' + callbacks: + - set_sample_rate(${samples_per_second}) + translations: + gr.sizeof_: 'sizeof(' + 'True': 'true' + 'False': 'false' + + file_format: 1 diff --git a/gr-blocks/grc/blocks_transcendental.block.yml b/gr-blocks/grc/blocks_transcendental.block.yml index ca9e5cd0d3..3e1b25c617 100644 --- a/gr-blocks/grc/blocks_transcendental.block.yml +++ b/gr-blocks/grc/blocks_transcendental.block.yml @@ -1,5 +1,6 @@ id: blocks_transcendental label: Transcendental +flags: python, cpp parameters: - id: type @@ -27,4 +28,9 @@ templates: imports: from gnuradio import blocks make: blocks.transcendental(${name}, "${type}") +cpp_templates: + includes: ['#include <gnuradio/blocks/transcendental.h>'] + declarations: 'blocks::transcendental::sptr ${id};' + make: 'this->${id} = blocks::transcendental::make(${name}, "$type");' + file_format: 1 diff --git a/gr-blocks/grc/blocks_tuntap_pdu.block.yml b/gr-blocks/grc/blocks_tuntap_pdu.block.yml index 0fd183cbfe..d159e3e8f3 100644 --- a/gr-blocks/grc/blocks_tuntap_pdu.block.yml +++ b/gr-blocks/grc/blocks_tuntap_pdu.block.yml @@ -1,5 +1,6 @@ id: blocks_tuntap_pdu label: TUNTAP PDU +flags: python, cpp parameters: - id: ifn @@ -31,4 +32,12 @@ templates: imports: from gnuradio import blocks make: blocks.tuntap_pdu(${ifn}, ${mtu}, ${istunflag}) +cpp_templates: + includes: ['#include <gnuradio/blocks/tuntap_pdu.h>'] + declarations: 'blocks::tuntap_pdu::sptr ${id};' + make: 'this->${id} = blocks::tuntap_pdu::make(${ifn}, ${mtu}, ${istunflag});' + translations: + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_uchar_to_float.block.yml b/gr-blocks/grc/blocks_uchar_to_float.block.yml index 984cbd3928..65a2284f6a 100644 --- a/gr-blocks/grc/blocks_uchar_to_float.block.yml +++ b/gr-blocks/grc/blocks_uchar_to_float.block.yml @@ -1,5 +1,6 @@ id: blocks_uchar_to_float label: UChar To Float +flags: python, cpp inputs: - domain: stream @@ -13,4 +14,9 @@ templates: imports: from gnuradio import blocks make: blocks.uchar_to_float() +cpp_templates: + includes: ['#include <gnuradio/blocks/uchar_to_float.h>'] + declarations: 'blocks::uchar_to_float::sptr ${id};' + make: 'this->${id} = blocks::uchar_to_float::make();' + file_format: 1 diff --git a/gr-blocks/grc/blocks_udp_sink.block.yml b/gr-blocks/grc/blocks_udp_sink.block.yml index 1ffa83c033..a761b86127 100644 --- a/gr-blocks/grc/blocks_udp_sink.block.yml +++ b/gr-blocks/grc/blocks_udp_sink.block.yml @@ -1,5 +1,6 @@ id: blocks_udp_sink label: UDP Sink +flags: python, cpp parameters: - id: type @@ -42,4 +43,13 @@ templates: imports: from gnuradio import blocks make: blocks.udp_sink(${type.size}*${vlen}, ${ipaddr}, ${port}, ${psize}, ${eof}) +cpp_templates: + includes: ['#include <gnuradio/blocks/udp_sink.h>'] + declarations: 'blocks::udp_sink::sptr ${id};' + make: 'this->${id} = blocks::udp_sink::make(${type.size}*${vlen}, ${ipaddr}, ${port}, ${psize}, ${eof});' + translations: + gr.sizeof_: 'sizeof(' + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_udp_source.block.yml b/gr-blocks/grc/blocks_udp_source.block.yml index 1e15678158..d6745d5ba3 100644 --- a/gr-blocks/grc/blocks_udp_source.block.yml +++ b/gr-blocks/grc/blocks_udp_source.block.yml @@ -1,6 +1,6 @@ id: blocks_udp_source label: UDP Source -flags: throttle +flags: throttle, python, cpp parameters: - id: type @@ -45,4 +45,13 @@ templates: imports: from gnuradio import blocks make: blocks.udp_source(${type.size}*${vlen}, ${ipaddr}, ${port}, ${psize}, ${eof}) +cpp_templates: + includes: ['#include <gnuradio/blocks/udp_source.h>'] + declarations: 'blocks::udp_source::sptr ${id};' + make: 'this->${id} = blocks::udp_source::make(${type.size}*${vlen}, ${ipaddr}, ${port}, ${psize}, ${eof});' + translations: + gr.sizeof_: 'sizeof(' + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_unpack_k_bits_bb.block.yml b/gr-blocks/grc/blocks_unpack_k_bits_bb.block.yml index 065fc45ebf..d963702ca0 100644 --- a/gr-blocks/grc/blocks_unpack_k_bits_bb.block.yml +++ b/gr-blocks/grc/blocks_unpack_k_bits_bb.block.yml @@ -1,5 +1,6 @@ id: blocks_unpack_k_bits_bb label: Unpack K Bits +flags: python, cpp parameters: - id: k @@ -18,4 +19,9 @@ templates: imports: from gnuradio import blocks make: blocks.unpack_k_bits_bb(${k}) +cpp_templates: + includes: ['#include <gnuradio/blocks/unpack_k_bits_bb.h>'] + declarations: 'blocks::unpack_k_bits_bb::sptr ${id};' + make: 'this->${id} = blocks::unpack_k_bits_bb::make(${k});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_unpacked_to_packed_xx.block.yml b/gr-blocks/grc/blocks_unpacked_to_packed_xx.block.yml index 97c7af9e28..095516b178 100644 --- a/gr-blocks/grc/blocks_unpacked_to_packed_xx.block.yml +++ b/gr-blocks/grc/blocks_unpacked_to_packed_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_unpacked_to_packed_xx label: Unpacked to Packed +flags: python parameters: - id: type @@ -41,4 +42,9 @@ templates: imports: from gnuradio import blocks make: blocks.unpacked_to_packed_${type.fcn}(${bits_per_chunk}, ${endianness}) +cpp_templates: + includes: ['#include <gnuradio/blocks/unpacked_to_packed_${type.fcn}.h>'] + declarations: 'blocks::unpacked_to_packed_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::unpacked_to_packed_${type.fcn}::make(${bits_per_chunk}, ${endianness});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_vco_c.block.yml b/gr-blocks/grc/blocks_vco_c.block.yml index b14b96bc54..dfcae9c7ae 100644 --- a/gr-blocks/grc/blocks_vco_c.block.yml +++ b/gr-blocks/grc/blocks_vco_c.block.yml @@ -1,5 +1,6 @@ id: blocks_vco_c label: VCO (complex) +flags: python, cpp parameters: - id: samp_rate @@ -24,4 +25,9 @@ templates: imports: from gnuradio import blocks make: blocks.vco_c(${samp_rate}, ${sensitivity}, ${amplitude}) +cpp_templates: + includes: ['#include <gnuradio/blocks/vco_c.h>'] + declarations: 'blocks::vco_c::sptr ${id};' + make: 'this->${id} = blocks::vco_c::make(${samp_rate}, ${sensitivity}, ${amplitude});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_vco_f.block.yml b/gr-blocks/grc/blocks_vco_f.block.yml index 79ade4d0af..4b81117e12 100644 --- a/gr-blocks/grc/blocks_vco_f.block.yml +++ b/gr-blocks/grc/blocks_vco_f.block.yml @@ -1,5 +1,6 @@ id: blocks_vco_f label: VCO +flags: python, cpp parameters: - id: samp_rate @@ -24,4 +25,9 @@ templates: imports: from gnuradio import blocks make: blocks.vco_f(${samp_rate}, ${sensitivity}, ${amplitude}) +cpp_templates: + includes: ['#include <gnuradio/blocks/vco_f.h>'] + declarations: 'blocks::vco_f::sptr ${id};' + make: 'this->${id} = blocks::vco_f::make(${samp_rate}, ${sensitivity}, ${amplitude});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_vector_insert_x.block.yml b/gr-blocks/grc/blocks_vector_insert_x.block.yml index d3b833865d..d27bc827d7 100644 --- a/gr-blocks/grc/blocks_vector_insert_x.block.yml +++ b/gr-blocks/grc/blocks_vector_insert_x.block.yml @@ -1,5 +1,6 @@ id: blocks_vector_insert_x label: Vector Insert +flags: python, cpp parameters: - id: type @@ -35,6 +36,11 @@ templates: imports: from gnuradio import blocks make: blocks.vector_insert_${type.fcn}(${vector}, ${period}, ${offset}) +cpp_templates: + includes: ['#include <gnuradio/blocks/vector_insert_${type.fcn}.h>'] + declarations: 'blocks::vector_insert_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::vector_insert_${type.fcn}::make(${vector}, ${period}, ${offset});' + documentation: |- Periodicity, the length of the periodicity at which the vector should be inserted at the output. (i.e. one vector for every N output items) diff --git a/gr-blocks/grc/blocks_vector_sink_x.block.yml b/gr-blocks/grc/blocks_vector_sink_x.block.yml index 4ffa4ddfde..f4640247c9 100644 --- a/gr-blocks/grc/blocks_vector_sink_x.block.yml +++ b/gr-blocks/grc/blocks_vector_sink_x.block.yml @@ -1,5 +1,6 @@ id: blocks_vector_sink_x label: Vector Sink +flags: python, cpp parameters: - id: type @@ -32,4 +33,9 @@ templates: imports: from gnuradio import blocks make: blocks.vector_sink_${type.fcn}(${vlen}, ${reserve_items}) +cpp_templates: + includes: ['#include <gnuradio/blocks/vector_sink_${type.fcn}.h>'] + declarations: 'blocks::vector_sink_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::vector_sink_${type.fcn}::make(${vlen}, ${reserve_items});' + file_format: 1 diff --git a/gr-blocks/grc/blocks_vector_source_x.block.yml b/gr-blocks/grc/blocks_vector_source_x.block.yml index 5cdb6d6d51..39df095a02 100644 --- a/gr-blocks/grc/blocks_vector_source_x.block.yml +++ b/gr-blocks/grc/blocks_vector_source_x.block.yml @@ -1,5 +1,6 @@ id: blocks_vector_source_x label: Vector Source +flags: python, cpp parameters: - id: type @@ -44,4 +45,14 @@ templates: callbacks: - set_data(${vector}, ${tags}) +cpp_templates: + includes: ['#include <gnuradio/blocks/vector_source_${type.fcn}.h>'] + declarations: 'blocks::vector_source_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::vector_source_${type.fcn}::make(${vector}, ${repeat}, ${vlen}, ${tags});' + callbacks: + - set_data(${vector}, ${tags}) + translations: + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_vector_to_stream.block.yml b/gr-blocks/grc/blocks_vector_to_stream.block.yml index 77b42ab68d..fab1f1d2b2 100644 --- a/gr-blocks/grc/blocks_vector_to_stream.block.yml +++ b/gr-blocks/grc/blocks_vector_to_stream.block.yml @@ -1,5 +1,6 @@ id: blocks_vector_to_stream label: Vector to Stream +flags: python, cpp parameters: - id: type @@ -39,4 +40,11 @@ templates: imports: from gnuradio import blocks make: blocks.vector_to_stream(${type.size}*${vlen}, ${num_items}) +cpp_templates: + includes: ['#include <gnuradio/blocks/vector_to_stream.h>'] + declarations: 'blocks::vector_to_stream::sptr ${id};' + make: 'this->${id} = blocks::vector_to_stream::make(${type.size}*${vlen}, ${num_items});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_vector_to_streams.block.yml b/gr-blocks/grc/blocks_vector_to_streams.block.yml index e64df38534..7affd864fe 100644 --- a/gr-blocks/grc/blocks_vector_to_streams.block.yml +++ b/gr-blocks/grc/blocks_vector_to_streams.block.yml @@ -1,5 +1,6 @@ id: blocks_vector_to_streams label: Vector to Streams +flags: python, cpp parameters: - id: type @@ -40,4 +41,11 @@ templates: imports: from gnuradio import blocks make: blocks.vector_to_streams(${type.size}*${vlen}, ${num_streams}) +cpp_templates: + includes: ['#include <gnuradio/blocks/vector_to_streams.h>'] + declarations: 'blocks::vector_to_streams::sptr ${id};' + make: 'this->${id} = blocks::vector_to_streams::make(${type.size}*${vlen}, ${num_streams});' + translations: + gr.sizeof_: 'sizeof(' + file_format: 1 diff --git a/gr-blocks/grc/blocks_wavfile_sink.block.yml b/gr-blocks/grc/blocks_wavfile_sink.block.yml index 6bce90d0ec..11d67aaffe 100644 --- a/gr-blocks/grc/blocks_wavfile_sink.block.yml +++ b/gr-blocks/grc/blocks_wavfile_sink.block.yml @@ -1,5 +1,6 @@ id: blocks_wavfile_sink label: Wav File Sink +flags: python, cpp parameters: - id: file @@ -33,4 +34,11 @@ templates: callbacks: - open(${file}) +cpp_templates: + includes: ['#include <gnuradio/blocks/wavfile_sink.h>'] + declarations: 'blocks::wavfile_sink::sptr ${id};' + make: 'this->${id} = blocks::wavfile_sink::make(${file}, ${nchan}, ${samp_rate}, ${bits_per_sample});' + callbacks: + - open(${file}) + file_format: 1 diff --git a/gr-blocks/grc/blocks_wavfile_source.block.yml b/gr-blocks/grc/blocks_wavfile_source.block.yml index 6a84ebbb83..d038b7a0d8 100644 --- a/gr-blocks/grc/blocks_wavfile_source.block.yml +++ b/gr-blocks/grc/blocks_wavfile_source.block.yml @@ -1,5 +1,6 @@ id: blocks_wavfile_source label: Wav File Source +flags: python, cpp parameters: - id: file @@ -29,4 +30,12 @@ templates: imports: from gnuradio import blocks make: blocks.wavfile_source(${file}, ${repeat}) +cpp_templates: + includes: ['#include <gnuradio/blocks/wavfile_source.h>'] + declarations: 'blocks::wavfile_source::sptr ${id};' + make: 'this->${id} = blocks::wavfile_source::make(${file}, ${repeat});' + translations: + 'True': 'true' + 'False': 'false' + file_format: 1 diff --git a/gr-blocks/grc/blocks_xor_xx.block.yml b/gr-blocks/grc/blocks_xor_xx.block.yml index 493afef0c2..7f9f78dd90 100644 --- a/gr-blocks/grc/blocks_xor_xx.block.yml +++ b/gr-blocks/grc/blocks_xor_xx.block.yml @@ -1,5 +1,6 @@ id: blocks_xor_xx label: Xor +flags: python, cpp parameters: - id: type @@ -31,4 +32,9 @@ templates: imports: from gnuradio import blocks make: blocks.xor_${type.fcn}() +cpp_templates: + includes: ['#include <gnuradio/blocks/xor_${type.fcn}.h>'] + declarations: 'blocks::xor_${type.fcn}::sptr ${id};' + make: 'this->${id} = blocks::xor_${type.fcn}::make();' + file_format: 1 diff --git a/gr-blocks/grc/xmlrpc_client.block.yml b/gr-blocks/grc/xmlrpc_client.block.yml index 3e395ecca4..54a1e20b84 100644 --- a/gr-blocks/grc/xmlrpc_client.block.yml +++ b/gr-blocks/grc/xmlrpc_client.block.yml @@ -1,5 +1,6 @@ id: xmlrpc_client label: XMLRPC Client +flags: python parameters: - id: addr diff --git a/gr-blocks/grc/xmlrpc_server.block.yml b/gr-blocks/grc/xmlrpc_server.block.yml index fb33fa79a8..85d5c14447 100644 --- a/gr-blocks/grc/xmlrpc_server.block.yml +++ b/gr-blocks/grc/xmlrpc_server.block.yml @@ -1,5 +1,6 @@ id: xmlrpc_server label: XMLRPC Server +flags: python parameters: - id: addr diff --git a/gr-qtgui/grc/qtgui_ber_sink_b.block.yml b/gr-qtgui/grc/qtgui_ber_sink_b.block.yml index d19a041e64..cc8d0ff8fb 100644 --- a/gr-qtgui/grc/qtgui_ber_sink_b.block.yml +++ b/gr-qtgui/grc/qtgui_ber_sink_b.block.yml @@ -1,5 +1,6 @@ id: qtgui_bercurve_sink label: QT GUI Bercurve Sink +flags: python parameters: - id: esno diff --git a/gr-qtgui/grc/qtgui_check_box.block.yml b/gr-qtgui/grc/qtgui_check_box.block.yml index e78c98379e..3a141ee8b7 100644 --- a/gr-qtgui/grc/qtgui_check_box.block.yml +++ b/gr-qtgui/grc/qtgui_check_box.block.yml @@ -1,5 +1,6 @@ id: variable_qtgui_check_box label: QT GUI Check Box +flags: python parameters: - id: label diff --git a/gr-qtgui/grc/qtgui_chooser.block.yml b/gr-qtgui/grc/qtgui_chooser.block.yml index a38147f45c..cc20a2a578 100644 --- a/gr-qtgui/grc/qtgui_chooser.block.yml +++ b/gr-qtgui/grc/qtgui_chooser.block.yml @@ -1,5 +1,6 @@ id: variable_qtgui_chooser label: QT GUI Chooser +flags: python parameters: - id: label diff --git a/gr-qtgui/grc/qtgui_const_sink_x.block.yml b/gr-qtgui/grc/qtgui_const_sink_x.block.yml index 1231a9f32e..aade1489c6 100644 --- a/gr-qtgui/grc/qtgui_const_sink_x.block.yml +++ b/gr-qtgui/grc/qtgui_const_sink_x.block.yml @@ -1,5 +1,6 @@ id: qtgui_const_sink_x label: QT GUI Constellation Sink +flags: python parameters: - id: type diff --git a/gr-qtgui/grc/qtgui_edit_box_msg.block.yml b/gr-qtgui/grc/qtgui_edit_box_msg.block.yml index fa325c3e5b..4ef8c77b65 100644 --- a/gr-qtgui/grc/qtgui_edit_box_msg.block.yml +++ b/gr-qtgui/grc/qtgui_edit_box_msg.block.yml @@ -1,5 +1,6 @@ id: qtgui_edit_box_msg label: QT GUI Message Edit Box +flags: python parameters: - id: type diff --git a/gr-qtgui/grc/qtgui_entry.block.yml b/gr-qtgui/grc/qtgui_entry.block.yml index 970099bbab..054624879a 100644 --- a/gr-qtgui/grc/qtgui_entry.block.yml +++ b/gr-qtgui/grc/qtgui_entry.block.yml @@ -1,5 +1,6 @@ id: variable_qtgui_entry label: QT GUI Entry +flags: python, cpp parameters: - id: label @@ -47,6 +48,28 @@ templates: lambda: self.set_${id}(${type.conv}(str(self._${id}_line_edit.text().toAscii())))) ${gui_hint() % win} +cpp_templates: + includes: ['#include <QToolBar>', '#include <QLineEdit>', '#include <QLabel>', '#include <QMetaObject>', '#include <QString>'] + declarations: |- + QToolBar *_${id}_tool_bar; + QLineEdit *_${id}_line_edit; + QLabel *_${id}_label; + var_make: ${id} = ${value}; + callbacks: + - set_${id}(${value}) + - QMetaObject::invokeMethod(this->_${id}_line_edit, "setText", Q_ARG(QString, + QString::number(${id}))) + link: ['gnuradio-qtgui', 'Qt5::Widgets'] + make: |- + this->_${id}_tool_bar = new QToolBar(); + this->_${id}_label = new QLabel(QString::fromStdString(std::string("${label.strip("'")}")+ std::string(":"))); + this->_${id}_tool_bar->addWidget(_${id}_label); + this->_${id}_line_edit = new QLineEdit(QString::number(this->${id})); + this->_${id}_tool_bar->addWidget(this->_${id}_line_edit); + QObject::connect(this->_${id}_line_edit, &QLineEdit::returnPressed, this, [this] () {this->set_${id}(this->_${id}_line_edit->text().toInt());}); + // FIXME + this->top_layout->addWidget(this->_${id}_tool_bar); + documentation: |- This block creates a variable with a text entry box. Leave the label blank to use the variable id as the label. diff --git a/gr-qtgui/grc/qtgui_freq_sink_x.block.yml b/gr-qtgui/grc/qtgui_freq_sink_x.block.yml index 327166621c..2d9308498a 100644 --- a/gr-qtgui/grc/qtgui_freq_sink_x.block.yml +++ b/gr-qtgui/grc/qtgui_freq_sink_x.block.yml @@ -1,5 +1,6 @@ id: qtgui_freq_sink_x label: QT GUI Frequency Sink +flags: python, cpp parameters: - id: type @@ -420,7 +421,7 @@ templates: % if type == "float" or type == "msg_float": self.${id}.set_plot_pos_half(not ${freqhalf}) - % endif + % endif labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] @@ -441,7 +442,76 @@ templates: self.${id}.set_line_alpha(i, alphas[i]) ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) - ${gui_hint() % win} + ${ gui_hint() % win} + +cpp_templates: + includes: ['#include <gnuradio/qtgui/${type.fcn}.h>', '#include <gnuradio/filter/firdes.h>'] + declarations: 'qtgui::${type.fcn}::sptr ${id};' + callbacks: + - set_frequency_range(${fc}, ${bw}) + - set_update_time(${update_time}) + - set_y_axis(${ymin}, ${ymax}) + - this->${id}.set_trigger_mode(${tr_mode}, ${tr_level}, ${tr_chan}, ${tr_tag}) + link: ['gnuradio-qtgui', 'Qt5::Widgets'] + make: |- + this->${id} = qtgui::${type.fcn}::make( + ${fftsize}, // size + ${wintype}, // wintype + ${fc}, // fc + ${bw}, // bw + ${name}, // name + ${ 0 if (type == 'msg_complex' or type == 'msg_float') else nconnections } // nconnections + ); + + std::string labels[10] = {"${label1.strip("'")}", "${label2.strip("'")}", "${label3.strip("'")}", "${label4.strip("'")}", "${label5.strip("'")}", + "${label6.strip("'")}", "${label7.strip("'")}", "${label8.strip("'")}", "${label9.strip("'")}", "${label10.strip("'")}"}; + int widths[10] = {${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}}; + std::string colors[10] = {${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}}; + double alphas[10] = {${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}}; + + QWidget* _${id}_win; + + this->${id}->set_update_time(${update_time}); + this->${id}->set_y_axis(${ymin}, ${ymax}); + this->${id}->set_y_label("${label.strip("'")}", "${units.strip("'")}"); + this->${id}->set_trigger_mode(${tr_mode}, ${tr_level}, ${tr_chan}, ${tr_tag}); + this->${id}->enable_autoscale(${autoscale}); + this->${id}->enable_grid(${grid}); + this->${id}->set_fft_average(${average}); + this->${id}->enable_axis_labels(${axislabels}); + this->${id}->enable_control_panel(${ctrlpanel}); + + if (!${legend}) { + this->${id}->disable_legend(); // if (!legend) + } + + /* C++ doesn't have this + if ("${type}" == "float" or "${type}" == "msg_float") { + this->${id}->set_plot_pos_half(not ${freqhalf}); + }*/ + + for (int i = 0; i < ${ 1 if (type == 'msg_complex' or type == 'msg_float') else nconnections }; i++) { + if (sizeof(labels[i]) == 0) { + this->${id}->set_line_label(i, "Data " + std::to_string(i)); + } else { + this->${id}->set_line_label(i, labels[i]); + } + this->${id}->set_line_width(i, widths[i]); + this->${id}->set_line_color(i, colors[i]); + this->${id}->set_line_alpha(i, alphas[i]); + } + + _${id}_win = this->${id}->qwidget(); + this->top_layout->addWidget(_${id}_win); + // FIXME + translations: + firdes.: 'filter::firdes::' + 'True': 'true' + 'False': 'false' + qtgui.: 'qtgui::' documentation: |- The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. diff --git a/gr-qtgui/grc/qtgui_histogram_sink_x.block.yml b/gr-qtgui/grc/qtgui_histogram_sink_x.block.yml index ec02c7466e..78ef44ec15 100644 --- a/gr-qtgui/grc/qtgui_histogram_sink_x.block.yml +++ b/gr-qtgui/grc/qtgui_histogram_sink_x.block.yml @@ -1,5 +1,6 @@ id: qtgui_histogram_sink_x label: QT GUI Histogram Sink +flags: python parameters: - id: type diff --git a/gr-qtgui/grc/qtgui_label.block.yml b/gr-qtgui/grc/qtgui_label.block.yml index 468a6c6f83..e279ddbacf 100644 --- a/gr-qtgui/grc/qtgui_label.block.yml +++ b/gr-qtgui/grc/qtgui_label.block.yml @@ -1,5 +1,6 @@ id: variable_qtgui_label label: QT GUI Label +flags: python parameters: - id: label diff --git a/gr-qtgui/grc/qtgui_number_sink.block.yml b/gr-qtgui/grc/qtgui_number_sink.block.yml index efd192683b..d674a25211 100644 --- a/gr-qtgui/grc/qtgui_number_sink.block.yml +++ b/gr-qtgui/grc/qtgui_number_sink.block.yml @@ -1,5 +1,6 @@ id: qtgui_number_sink label: QT GUI Number Sink +flags: python parameters: - id: name diff --git a/gr-qtgui/grc/qtgui_push_button.block.yml b/gr-qtgui/grc/qtgui_push_button.block.yml index 98ce4c9583..64188e76d6 100644 --- a/gr-qtgui/grc/qtgui_push_button.block.yml +++ b/gr-qtgui/grc/qtgui_push_button.block.yml @@ -1,5 +1,6 @@ id: variable_qtgui_push_button label: QT GUI Push Button +flags: python parameters: - id: label diff --git a/gr-qtgui/grc/qtgui_range.block.yml b/gr-qtgui/grc/qtgui_range.block.yml index 70144e740a..acd4bf137f 100644 --- a/gr-qtgui/grc/qtgui_range.block.yml +++ b/gr-qtgui/grc/qtgui_range.block.yml @@ -1,5 +1,6 @@ id: variable_qtgui_range label: QT GUI Range +flags: python parameters: - id: label diff --git a/gr-qtgui/grc/qtgui_sink_x.block.yml b/gr-qtgui/grc/qtgui_sink_x.block.yml index 6570ba5fec..665931601b 100644 --- a/gr-qtgui/grc/qtgui_sink_x.block.yml +++ b/gr-qtgui/grc/qtgui_sink_x.block.yml @@ -1,5 +1,6 @@ id: qtgui_sink_x label: QT GUI Sink +flags: python parameters: - id: type diff --git a/gr-qtgui/grc/qtgui_tab_widget.block.yml b/gr-qtgui/grc/qtgui_tab_widget.block.yml index 6a7128aaf2..aa070365ab 100644 --- a/gr-qtgui/grc/qtgui_tab_widget.block.yml +++ b/gr-qtgui/grc/qtgui_tab_widget.block.yml @@ -1,5 +1,6 @@ id: qtgui_tab_widget label: QT GUI Tab Widget +flags: python parameters: - id: num_tabs diff --git a/gr-qtgui/grc/qtgui_time_raster_x.block.yml b/gr-qtgui/grc/qtgui_time_raster_x.block.yml index ea4ede5fb6..1a77d21819 100644 --- a/gr-qtgui/grc/qtgui_time_raster_x.block.yml +++ b/gr-qtgui/grc/qtgui_time_raster_x.block.yml @@ -1,5 +1,6 @@ id: qtgui_time_raster_sink_x label: QT GUI Time Raster Sink +flags: python parameters: - id: type @@ -223,6 +224,8 @@ templates: - set_multiplier(${mult}) - set_offset(${offset}) - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) make: |- <% win = 'self._%s_win'%id diff --git a/gr-qtgui/grc/qtgui_time_sink_x.block.yml b/gr-qtgui/grc/qtgui_time_sink_x.block.yml index ca06e30c15..e9366da853 100644 --- a/gr-qtgui/grc/qtgui_time_sink_x.block.yml +++ b/gr-qtgui/grc/qtgui_time_sink_x.block.yml @@ -1,5 +1,6 @@ id: qtgui_time_sink_x label: QT GUI Time Sink +flags: python parameters: - id: type @@ -497,6 +498,8 @@ templates: callbacks: - set_time_domain_axis(${min}, ${max}) - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) - set_y_axis(${ymin}, ${ymax}) - set_samp_rate(${srate}) - self.${id}.set_trigger_mode(${tr_mode}, ${tr_slope}, ${tr_level}, ${tr_delay}, diff --git a/gr-qtgui/grc/qtgui_vector_sink_f.block.yml b/gr-qtgui/grc/qtgui_vector_sink_f.block.yml index b73897480d..09dbefd466 100644 --- a/gr-qtgui/grc/qtgui_vector_sink_f.block.yml +++ b/gr-qtgui/grc/qtgui_vector_sink_f.block.yml @@ -1,5 +1,6 @@ id: qtgui_vector_sink_f label: QT GUI Vector Sink +flags: python parameters: - id: name diff --git a/gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml b/gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml index 7c980dc768..ac17acd937 100644 --- a/gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml +++ b/gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml @@ -1,5 +1,6 @@ id: qtgui_waterfall_sink_x label: QT GUI Waterfall Sink +flags: python, cpp parameters: - id: type @@ -275,7 +276,7 @@ templates: % if type == "float" or type == "msg_float": self.${id}.set_plot_pos_half(not ${freqhalf}) - % endif + % endif labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] @@ -297,6 +298,64 @@ templates: ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) ${gui_hint() % win} +cpp_templates: + includes: ['#include <gnuradio/qtgui/${type.fcn}.h>', '#include <gnuradio/filter/firdes.h>'] + declarations: 'qtgui::${type.fcn}::sptr ${id};' + callbacks: + - set_frequency_range(${fc}, ${bw}) + - set_update_time(${update_time}) + link: ['gnuradio-qtgui', 'Qt5::Widgets'] + make: |- + this->${id} = qtgui::${type.fcn}::make( + ${fftsize}, // size + ${wintype}, // wintype + ${fc}, // fc + ${bw}, // bw + ${name}, // name + ${ (0 if type.startswith('msg') else nconnections) } // number of inputs + ); + + std::string labels[10] = {"${label1.strip("'")}", "${label2.strip("'")}", "${label3.strip("'")}", "${label4.strip("'")}", "${label5.strip("'")}", + "${label6.strip("'")}", "${label7.strip("'")}", "${label8.strip("'")}", "${label9.strip("'")}", "${label10.strip("'")}"}; + int colors[10] = {${color1 or 0}, ${color2 or 0}, ${color3 or 0}, ${color4 or 0}, ${color5 or 0}, + ${color6 or 0}, ${color7 or 0}, ${color8 or 0}, ${color9 or 0}, ${color10 or 0}}; + double alphas[10] = {${alpha1 or 1.0}, ${alpha2 or 1.0}, ${alpha3 or 1.0}, ${alpha4 or 1.0}, ${alpha5 or 1.0}, + ${alpha6 or 1.0}, ${alpha7 or 1.0}, ${alpha8 or 1.0}, ${alpha9 or 1.0}, ${alpha10 or 1.0}}; + + QWidget* _${id}_win; + + this->${id}->set_update_time(${update_time}); + this->${id}->enable_grid(${grid}); + this->${id}->enable_axis_labels(${axislabels}); + + if (!${legend}) { + this->${id}->disable_legend(); // if (!legend) + } + + /* C++ doesn't have this + if ("${type}" == "float" or "${type}" == "msg_float") { + this->${id}->set_plot_pos_half(not ${freqhalf}); + }*/ + + for (int i = 0; i < ${ 1 if (type == 'msg_complex' or type == 'msg_float') else nconnections }; i++) { + if (sizeof(labels[i]) == 0) { + this->${id}->set_line_label(i, "Data " + std::to_string(i)); + } else { + this->${id}->set_line_label(i, labels[i]); + } + this->${id}->set_color_map(i, colors[i]); + this->${id}->set_line_alpha(i, alphas[i]); + } + + this->${id}->set_intensity_range(${int_min}, ${int_max}); + + _${id}_win = this->${id}->qwidget(); + this->top_layout->addWidget(_${id}_win); + translations: + firdes.: 'filter::firdes::' + 'True': 'true' + 'False': 'false' + documentation: |- The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. diff --git a/grc/blocks/import.block.yml b/grc/blocks/import.block.yml index 2d36b7396d..72da0cdd26 100644 --- a/grc/blocks/import.block.yml +++ b/grc/blocks/import.block.yml @@ -1,5 +1,6 @@ id: import_ label: Import +flags: python parameters: - id: imports diff --git a/grc/blocks/note.block.yml b/grc/blocks/note.block.yml index 3f21a75ceb..1b9b77ef03 100644 --- a/grc/blocks/note.block.yml +++ b/grc/blocks/note.block.yml @@ -1,5 +1,6 @@ id: note label: Note +flags: python, cpp parameters: - id: note diff --git a/grc/blocks/options.block.yml b/grc/blocks/options.block.yml index dec77a3f84..70ee13a45e 100644 --- a/grc/blocks/options.block.yml +++ b/grc/blocks/options.block.yml @@ -1,6 +1,6 @@ id: options label: Options -flags: has_python, has_cpp +flags: python, cpp parameters: - id: title @@ -156,7 +156,7 @@ templates: else: self.stop(); self.wait()' cpp_templates: - includes: '#include <gnuradio/top_block.h>' + includes: ['#include <gnuradio/top_block.h>'] documentation: |- The options block sets special parameters for the flow graph. Only one option block is allowed per flow graph. diff --git a/grc/blocks/pad_sink.block.yml b/grc/blocks/pad_sink.block.yml index 5c5679a155..0298b6039a 100644 --- a/grc/blocks/pad_sink.block.yml +++ b/grc/blocks/pad_sink.block.yml @@ -1,5 +1,6 @@ id: pad_sink label: Pad Sink +flags: python parameters: - id: label diff --git a/grc/blocks/pad_source.block.yml b/grc/blocks/pad_source.block.yml index 6600fa7d0b..3400c5d96a 100644 --- a/grc/blocks/pad_source.block.yml +++ b/grc/blocks/pad_source.block.yml @@ -1,5 +1,6 @@ id: pad_source label: Pad Source +flags: python parameters: - id: label diff --git a/grc/blocks/parameter.block.yml b/grc/blocks/parameter.block.yml index 387cbbf181..baaabd5865 100644 --- a/grc/blocks/parameter.block.yml +++ b/grc/blocks/parameter.block.yml @@ -1,5 +1,6 @@ id: parameter label: Parameter +flags: python, cpp parameters: - id: label @@ -37,6 +38,10 @@ templates: var_make: self.${id} = ${id} make: ${value} +cpp_templates: + var_make: ${type.type} ${id} = ${id}; + make: ${value} + documentation: |- This block represents a parameter to the flow graph. A parameter can be used to pass command line arguments into a top block. Or, parameters can pass arguments into an instantiated hierarchical block. diff --git a/grc/blocks/stream.domain.yml b/grc/blocks/stream.domain.yml index f97695b828..0a679cad01 100644 --- a/grc/blocks/stream.domain.yml +++ b/grc/blocks/stream.domain.yml @@ -7,5 +7,5 @@ multiple_connections_per_output: true templates: - type: [stream, stream] - connect: connect(${ make_port_sig(source) }, ${ make_port_sig(sink) }) + connect: self.connect(${ make_port_sig(source) }, ${ make_port_sig(sink) }) cpp_connect: hier_block2::connect(${ make_port_sig(source) }, ${ make_port_sig(sink) }) diff --git a/grc/blocks/variable.block.yml b/grc/blocks/variable.block.yml index 045511afb0..801ca645c1 100644 --- a/grc/blocks/variable.block.yml +++ b/grc/blocks/variable.block.yml @@ -1,6 +1,6 @@ id: variable label: Variable -flags: has_python, has_cpp +flags: python, cpp parameters: - id: value diff --git a/grc/blocks/variable_config.block.yml b/grc/blocks/variable_config.block.yml index bb64ea2a8f..969843d950 100644 --- a/grc/blocks/variable_config.block.yml +++ b/grc/blocks/variable_config.block.yml @@ -1,5 +1,6 @@ id: variable_config label: Variable Config +flags: python parameters: - id: value diff --git a/grc/blocks/variable_function_probe.block.yml b/grc/blocks/variable_function_probe.block.yml index 702ab5d60e..fd6de50ec0 100644 --- a/grc/blocks/variable_function_probe.block.yml +++ b/grc/blocks/variable_function_probe.block.yml @@ -1,5 +1,6 @@ id: variable_function_probe label: Function Probe +flags: python parameters: - id: block_id diff --git a/grc/core/blocks/_flags.py b/grc/core/blocks/_flags.py index ec590ebbb5..dedbb5a485 100644 --- a/grc/core/blocks/_flags.py +++ b/grc/core/blocks/_flags.py @@ -25,8 +25,8 @@ class Flags(object): NEED_QT_GUI = 'need_qt_gui' DEPRECATED = 'deprecated' NOT_DSP = 'not_dsp' - HAS_PYTHON = 'has_python' - HAS_CPP = 'has_cpp' + HAS_PYTHON = 'python' + HAS_CPP = 'cpp' def __init__(self, flags): self.data = set(flags) diff --git a/grc/core/blocks/block.py b/grc/core/blocks/block.py index 4df3ec9663..19b16b53d6 100644 --- a/grc/core/blocks/block.py +++ b/grc/core/blocks/block.py @@ -169,9 +169,14 @@ class Block(Element): """check if this block supports the selected output language""" current_output_language = self.parent.get_option('output_language') - if current_output_language == 'cpp' and 'has_cpp' not in self.flags: + if current_output_language == 'cpp': + if 'cpp' not in self.flags: self.add_error_message("This block does not support C++ output.") + if self.key == 'parameter': + if not self.params['type'].value: + self.add_error_message("C++ output requires you to choose a parameter type.") + def _validate_var_value(self): """or variables check the value (only if var_value is used)""" if self.is_variable and self.value != 'value': @@ -266,6 +271,8 @@ class Block(Element): a list of strings """ def make_callback(callback): + if self.is_variable: + return callback if 'this->' in callback: return callback return 'this->{}->{}'.format(self.name, callback) diff --git a/grc/core/generator/cpp_templates/CMakeLists.txt.mako b/grc/core/generator/cpp_templates/CMakeLists.txt.mako index 56f39c6b22..4e5c18637a 100644 --- a/grc/core/generator/cpp_templates/CMakeLists.txt.mako +++ b/grc/core/generator/cpp_templates/CMakeLists.txt.mako @@ -16,7 +16,7 @@ class_name = flow_graph.get_option('id') cmake_opt_list = flow_graph.get_option('cmake_opt').split(";") %>\ -# cmake_minimum_required(VERSION 3.8) Which version? +cmake_minimum_required(VERSION 3.8) # Which version? % if generate_options == 'qt_gui': find_package(Qt5Widgets REQUIRED) @@ -50,11 +50,14 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(GR_LIBRARIES boost_system + % if parameters: + boost_program_options + % endif gnuradio-blocks gnuradio-runtime gnuradio-pmt % for link in links: - % if link != '': + % if link: ${link} % endif % endfor diff --git a/grc/core/generator/cpp_templates/flow_graph.cpp.mako b/grc/core/generator/cpp_templates/flow_graph.cpp.mako index b919015f86..8a8987084c 100644 --- a/grc/core/generator/cpp_templates/flow_graph.cpp.mako +++ b/grc/core/generator/cpp_templates/flow_graph.cpp.mako @@ -1,3 +1,4 @@ +<%def name="doubleindent(code)">${ '\n '.join(str(code).splitlines()) }</%def>\ /******************** GNU Radio C++ Flow Graph Source File @@ -12,21 +13,24 @@ Generated: ${generated_time} ********************/ #include "${flow_graph.get_option('id')}.hpp" +% if parameters: +namespace po = boost::program_options; + +% endif using namespace gr; <% - class_name = flow_graph.get_option('id') -## TODO: param_str +class_name = flow_graph.get_option('id') +param_str = ", ".join((param.vtype + " " + param.name) for param in parameters) +param_str_without_types = ", ".join(param.name for param in parameters) %>\ -<%def name="indent(code)">${ '\n '.join(str(code).splitlines()) }</%def> -## TODO: param_str % if generate_options == 'no_gui': -${class_name}::${class_name} () : top_block("${title}") { +${class_name}::${class_name} (${param_str}) { % elif generate_options.startswith('hb'): ## TODO: make_io_sig -${class_name}::${class_name} () : hier_block2("${title}") { +${class_name}::${class_name} (${param_str}) : hier_block2("${title}") { % for pad in flow_graph.get_hier_block_message_io('in'): message_port_register_hier_in("${pad['label']}") % endfor @@ -34,7 +38,7 @@ ${class_name}::${class_name} () : hier_block2("${title}") { message_port_register_hier_out("${pad['label']}") % endfor % elif generate_options == 'qt_gui': -${class_name}::${class_name} () : QWidget(), top_block("display_qt") { +${class_name}::${class_name} (${param_str}) : QWidget() { this->setWindowTitle("${title}"); // check_set_qss // set icon @@ -58,11 +62,15 @@ ${class_name}::${class_name} () : QWidget(), top_block("display_qt") { ## self._lock = threading.RLock() % endif +% if not generate_options.startswith('hb'): + this->tb = make_top_block("${title}"); +% endif + % if blocks: // Blocks: % for blk, blk_make, declarations in blocks: { - ${indent(blk_make)} + ${doubleindent(blk_make)} ## % if 'alias' in blk.params and blk.params['alias'].get_evaluated(): ## ${blk.name}.set_block_alias("${blk.params['alias'].get_evaluated()}") ## % endif @@ -107,11 +115,31 @@ void ${class_name}::set_${var.name} (${var.vtype} ${var.name}) { % endfor % endif } + % endfor int main (int argc, char **argv) { % if parameters: - ## parse args + % for parameter in parameters: + ${parameter.vtype} ${parameter.name}; + % endfor + + po::options_description desc("Options"); + desc.add_options() + ("help", "display help") + % for parameter in parameters: + ("${parameter.name}", po::value<${parameter.vtype}>(&${parameter.name}), "${parameter.label}") + % endfor + ; + + po::variables_map vm; + po::store(po::parse_command_line(argc, argv, desc), vm); + po::notify(vm); + + if (vm.count("help")) { + std::cout << desc << std::endl; + return 0; + } % endif % if flow_graph.get_option('realtime_scheduling'): if (enable_realtime_scheduling() != RT_OK) { @@ -123,7 +151,7 @@ int main (int argc, char **argv) { ${class_name}* top_block = new ${class_name}(); ## TODO: params % if flow_graph.get_option('run_options') == 'prompt': - top_block->start(); + top_block->tb->start(); % for m in monitors: (top_block->${m.name}).start(); % endfor @@ -131,7 +159,7 @@ int main (int argc, char **argv) { std::cin.ignore(); top_block->stop(); % elif flow_graph.get_option('run_options') == 'run': - top_block->start(); + top_block->tb->start(); % endif % for m in monitors: (top_block->${m.name}).start(); @@ -140,9 +168,9 @@ int main (int argc, char **argv) { % elif generate_options == 'qt_gui': QApplication app(argc, argv); - ${class_name} *top_block = new ${class_name}(); + ${class_name} *top_block = new ${class_name}(${param_str_without_types}); - top_block->start(); + top_block->tb->start(); top_block->show(); app.exec(); diff --git a/grc/core/generator/cpp_templates/flow_graph.hpp.mako b/grc/core/generator/cpp_templates/flow_graph.hpp.mako index 0acd90734a..7b117a45de 100644 --- a/grc/core/generator/cpp_templates/flow_graph.hpp.mako +++ b/grc/core/generator/cpp_templates/flow_graph.hpp.mako @@ -1,3 +1,4 @@ +<%def name="indent(code)">${ ' ' + '\n '.join(str(code).splitlines()) }</%def>\ #ifndef ${flow_graph.get_option('id').upper()}_HPP #define ${flow_graph.get_option('id').upper()}_HPP /******************** @@ -28,19 +29,25 @@ ${inc} #include <QSettings> % endif +% if parameters: +#include <iostream> +#include <boost/program_options.hpp> +% endif + using namespace gr; <% - class_name = flow_graph.get_option('id') -## TODO: param_str +class_name = flow_graph.get_option('id') +param_str = ", ".join((param.vtype + " " + param.name) for param in parameters) %>\ + % if generate_options == 'no_gui': -class ${class_name} : public top_block { +class ${class_name} { % elif generate_options.startswith('hb'): class ${class_name} : public hier_block2 { % elif generate_options == 'qt_gui': -class ${class_name} : public QWidget, public top_block { +class ${class_name} : public QWidget { Q_OBJECT % endif @@ -56,15 +63,15 @@ private: % for block, make, declarations in blocks: - % if declarations: - ${declarations} - % endif +% if declarations: +${indent(declarations)} +% endif % endfor % if parameters: // Parameters: % for param in parameters: - ${param.get_var_make()} + ${param.get_cpp_var_make()} % endfor % endif @@ -76,8 +83,10 @@ private: % endif public: - ${class_name}(); - ## TODO: param_str +% if not generate_options.startswith('hb'): + top_block_sptr tb; +% endif + ${class_name}(${param_str}); ~${class_name}(); % for var in parameters + variables: diff --git a/grc/core/generator/cpp_top_block.py b/grc/core/generator/cpp_top_block.py index 6991f22bf2..950a3cffba 100644 --- a/grc/core/generator/cpp_top_block.py +++ b/grc/core/generator/cpp_top_block.py @@ -60,6 +60,7 @@ class CppTopBlockGenerator(TopBlockGenerator): parameters = fg.get_parameters() monitors = fg.get_monitors() self._variable_types() + self._parameter_types() self.namespace = { 'flow_graph': fg, @@ -245,6 +246,14 @@ class CppTopBlockGenerator(TopBlockGenerator): for var in variables: var.decide_type() + def _parameter_types(self): + fg = self._flow_graph + parameters = fg.get_parameters() + + for param in parameters: + type_translation = {'eng_float' : 'double', 'intx' : 'int', 'std' : 'std::string'}; + param.vtype = type_translation[param.params['type'].value] + def _callbacks(self): fg = self._flow_graph variables = fg.get_cpp_variables() @@ -338,7 +347,7 @@ class CppTopBlockGenerator(TopBlockGenerator): for con in sorted(connections, key=by_domain_and_blocks): template = templates[con.type] code = template.render(make_port_sig=make_port_sig, source=con.source_port, sink=con.sink_port) - code = 'this->' + code + code = 'this->tb->' + code rendered.append(code) return rendered diff --git a/grc/core/generator/top_block.py b/grc/core/generator/top_block.py index cab1bf71cb..f2b485d641 100644 --- a/grc/core/generator/top_block.py +++ b/grc/core/generator/top_block.py @@ -266,6 +266,9 @@ class TopBlockGenerator(object): # Remove the virtual connection connections.remove(connection) + for connection in virtual_sink_connections: + connections.remove(connection) + # Bypassing blocks: Need to find all the enabled connections for the block using # the *connections* object rather than get_connections(). Create new connections # that bypass the selected block and remove the existing ones. This allows adjacent diff --git a/grc/core/schema_checker/block.py b/grc/core/schema_checker/block.py index 91ce906df2..e36865fed0 100644 --- a/grc/core/schema_checker/block.py +++ b/grc/core/schema_checker/block.py @@ -39,6 +39,7 @@ CPP_TEMPLATES_SCHEME = expand( includes=list, declarations=str_, make=str_, + var_make=str_, callbacks=list, link=list, translations=dict, diff --git a/grc/core/schema_checker/domain.py b/grc/core/schema_checker/domain.py index 86c29ed3c6..19b0a510d0 100644 --- a/grc/core/schema_checker/domain.py +++ b/grc/core/schema_checker/domain.py @@ -3,6 +3,7 @@ from .utils import Spec, expand, str_ DOMAIN_CONNECTION = expand( type=Spec(types=list, required=True, item_scheme=None), connect=str_, + cpp_connect=str_, ) DOMAIN_SCHEME = expand( diff --git a/grc/gui/Executor.py b/grc/gui/Executor.py index 79bb29f101..7d7caaaf98 100644 --- a/grc/gui/Executor.py +++ b/grc/gui/Executor.py @@ -79,49 +79,6 @@ class ExecFlowGraphThread(threading.Thread): shell=False, universal_newlines=True ) - def _cpp_run_cmake(self): - """ - Generate and compile this C++ flow graph. - """ - generator = self.page.get_generator() - - xterm_executable = find_executable(self.xterm_executable) - - dirname = generator.file_path - builddir = os.path.join(dirname, 'build') - - run_command_args = [ 'cmake', '..' ] - Messages.send_start_exec(' '.join(run_command_args)) - - return subprocess.Popen( - args=run_command_args, - cwd=builddir, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT, - shell=False, universal_newlines=True - ) - - def _cpp_compile(self): - """ - Compile this C++ flow graph. - """ - generator = self.page.get_generator() - - xterm_executable = find_executable(self.xterm_executable) - - dirname = generator.file_path - builddir = os.path.join(dirname, 'build') - - run_command_args = [ 'make' ] - Messages.send_start_exec(' '.join(run_command_args)) - - return subprocess.Popen( - args=run_command_args, - cwd=builddir, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT, - shell=False, universal_newlines=True - ) - - def _cpp_popen(self): """ Execute this C++ flow graph after generating and compiling it. @@ -129,22 +86,22 @@ class ExecFlowGraphThread(threading.Thread): generator = self.page.get_generator() run_command = generator.file_path + '/build/' + self.flow_graph.get_option('id') + dirname = generator.file_path + builddir = os.path.join(dirname, 'build') + if os.path.isfile(run_command): os.remove(run_command) xterm_executable = find_executable(self.xterm_executable) - process = self._cpp_run_cmake() - process.wait() - process = self._cpp_compile() - process.wait() - run_command_args = [xterm_executable, '-e', run_command] + run_command_args = ['cmake .. &&', 'make && ', xterm_executable, '-e', run_command] Messages.send_start_exec(' '.join(run_command_args)) return subprocess.Popen( - args=run_command_args, + args=' '.join(run_command_args), + cwd=builddir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, - shell=False, universal_newlines=True + shell=True, universal_newlines=True ) def run(self): |