Skip to content

Commit d7cdf22

Browse files
AsriFoxwillcode
authored andcommitted
GRC: generate valid C++ string parameters
Added translation from ' to " in string parameters; Added bool values translation for C++ block parameters; Added value translation for 'parameter' blocks based on their vtype; Removed these translations from GRC files; Applied linting. Signed-off-by: Oleg Nikitin <[email protected]>
1 parent 4242290 commit d7cdf22

File tree

59 files changed

+92
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+92
-250
lines changed

gr-analog/grc/analog_ctcss_squelch_ff.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,5 @@ cpp_templates:
5050
- set_level(${level})
5151
- set_frequency(${freq})
5252
link: ['gnuradio::gnuradio-analog']
53-
translations:
54-
'True': 'true'
55-
'False': 'false'
5653

5754
file_format: 1

gr-analog/grc/analog_pwr_squelch_xx.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ cpp_templates:
4949
- set_threshold(${threshold})
5050
- set_alpha(${alpha})
5151
link: ['gnuradio::gnuradio-analog']
52-
translations:
53-
True: true
54-
False: false
5552

5653
documentation: |-
5754
This will either pass the input unchanged or block it, depending on

gr-audio/grc/audio_sink.block.yml

-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ cpp_templates:
4444
declarations: 'audio::sink::sptr ${id};'
4545
make: 'this->${id} = audio::sink::make(${samp_rate}, ${device_name}, ${ok_to_block});'
4646
link: ['gnuradio::gnuradio-audio']
47-
translations:
48-
"'": '"'
49-
'True': 'true'
50-
'False': 'false'
5147

5248
documentation: |-
5349
Not all sampling rates will be supported by your hardware.

gr-audio/grc/audio_source.block.yml

-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ cpp_templates:
4444
declarations: 'audio::source::sptr ${id};'
4545
make: 'this->${id} = audio::source::make(${samp_rate}, ${device_name}, ${ok_to_block});'
4646
link: ['gnuradio::gnuradio-audio']
47-
translations:
48-
"'": '"'
49-
'True': 'true'
50-
'False': 'false'
5147

5248
documentation: |-
5349
Not all sampling rates will be supported by your hardware.

gr-blocks/grc/blocks_burst_tagger.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,5 @@ cpp_templates:
6060
callbacks:
6161
- set_true_tag(${true_key},${true_value})
6262
- set_false_tag(${false_key},${false_value})
63-
translations:
64-
'True': 'true'
65-
'False': 'false'
6663

6764
file_format: 1

gr-blocks/grc/blocks_complex_to_interleaved_char.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ cpp_templates:
3333
includes: ['#include <gnuradio/blocks/complex_to_interleaved_char.h>']
3434
declarations: 'blocks::complex_to_interleaved_char::sptr ${id};'
3535
make: 'this->${id} = blocks::complex_to_interleaved_char::make(${vector_output});'
36-
translations:
37-
'True': 'true'
38-
'False': 'false'
3936

4037
documentation: |-
4138
This block converts a complex sample to interleaved IQ bytes.

gr-blocks/grc/blocks_complex_to_interleaved_short.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ cpp_templates:
3737
make: 'this->${id} = blocks::complex_to_interleaved_short::make(${vector_output});'
3838
callbacks:
3939
- set_scale_factor(${scale_factor})
40-
translations:
41-
'True': 'true'
42-
'False': 'false'
4340

4441
documentation: |-
4542
This block converts a complex sample to interleaved IQ 16-bit values.

gr-blocks/grc/blocks_copy.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,5 @@ cpp_templates:
6161
this->${id}->set_enabled(${enabled});
6262
callbacks:
6363
- set_enabled(${enabled})
64-
translations:
65-
'True': 'true'
66-
'False': 'false'
6764

6865
file_format: 1

gr-blocks/grc/blocks_file_descriptor_source.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,5 @@ cpp_templates:
3939
includes: ['#include <gnuradio/blocks/file_descriptor_source.h>']
4040
declarations: 'blocks::file_descriptor_source::sptr ${id};'
4141
make: 'this->${id} = blocks::file_descriptor_source::make(${type.size}*${vlen}, ${fd}, ${repeat});'
42-
translations:
43-
'True': 'true'
44-
'False': 'false'
4542

4643
file_format: 1

gr-blocks/grc/blocks_file_sink.block.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,8 @@ templates:
5252
cpp_templates:
5353
includes: ['#include <gnuradio/blocks/file_sink.h>']
5454
declarations: 'blocks::file_sink::sptr ${id};'
55-
make: 'this->${id} = blocks::file_sink::make(${type.size}*${vlen}, "${no_quotes(file)}", ${append});'
55+
make: 'this->${id} = blocks::file_sink::make(${type.size}*${vlen}, ${file}, ${append});'
5656
callbacks:
5757
- open(${file})
58-
translations:
59-
'True': 'true'
60-
'False': 'false'
6158

6259
file_format: 1

gr-blocks/grc/blocks_file_source.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,5 @@ cpp_templates:
6363
make: 'this->${id} =blocks::file_source::make(${type.size}*${vlen}, ${file}, ${repeat}, ${offset}, ${length});'
6464
callbacks:
6565
- open(${file}, ${repeat})
66-
translations:
67-
'True': 'true'
68-
'False': 'false'
6966

7067
file_format: 1

gr-blocks/grc/blocks_interleaved_char_to_complex.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ cpp_templates:
3737
make: 'this->${id} = blocks::interleaved_char_to_complex::make(${vector_input});'
3838
callbacks:
3939
- set_scale_factor(${scale_factor})
40-
translations:
41-
'True': 'true'
42-
'False': 'false'
4340

4441
documentation: |-
4542
This block converts interleaved IQ bytes to a float complex data type.

gr-blocks/grc/blocks_interleaved_short_to_complex.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ cpp_templates:
4646
callbacks:
4747
- set_swap(${swap})
4848
- set_scale_factor(${scale_factor})
49-
translations:
50-
'True': 'true'
51-
'False': 'false'
5249

5350
documentation: |-
5451
This block converts interleaved 12/16-bit IQ samples to a float complex data

gr-blocks/grc/blocks_mute_xx.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,5 @@ cpp_templates:
3939
make: 'this->${id} = blocks::mute_${type.fcn}::(bool(${mute}));'
4040
callbacks:
4141
- set_mute(bool(${mute}))
42-
translations:
43-
'True': 'true'
44-
'False': 'false'
4542

4643
file_format: 1

gr-blocks/grc/blocks_repack_bits_bb.block.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,5 @@ cpp_templates:
5353
- set_k_and_l(${k},${l})
5454
translations:
5555
gr\.: ''
56-
'True': 'true'
57-
'False': 'false'
56+
5857
file_format: 1

gr-blocks/grc/blocks_selector.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,5 @@ cpp_templates:
9393
- set_enabled(${enabled})
9494
- set_input_index(${input_index})
9595
- set_output_index(${output_index})
96-
translations:
97-
'True': 'true'
98-
'False': 'false'
9996

10097
file_format: 1

gr-blocks/grc/blocks_tag_debug.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,5 @@ cpp_templates:
6161
this->${id}.set_display(${display});
6262
callbacks:
6363
- set_display(${display})
64-
translations:
65-
'True': 'true'
66-
'False': 'false'
6764

6865
file_format: 1

gr-blocks/grc/blocks_tag_gate.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,5 @@ cpp_templates:
5555
this->${id}.set_single_key(${single_key});
5656
callbacks:
5757
- self.${id}.set_single_key(${single_key})
58-
translations:
59-
'True': 'true'
60-
'False': 'false'
6158

6259
file_format: 1

gr-blocks/grc/blocks_test_tag_variable_rate_ff.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,5 @@ cpp_templates:
3131
includes: ['#include <gnuradio/blocks/test_tag_variable_rate_ff.h>']
3232
declarations: 'blocks::test_tag_variable_rate_ff::sptr ${id};'
3333
make: 'this->${id} = blocks::test_tag_variable_rate_ff::make(${once}, ${step});'
34-
translations:
35-
'True': 'true'
36-
'False': 'false'
3734

3835
file_format: 1

gr-blocks/grc/blocks_throttle.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ cpp_templates:
5252
make: 'this->${id} = blocks::throttle::make(${type.size}*${vlen}, ${samples_per_second}, ${ignoretag});'
5353
callbacks:
5454
- set_sample_rate(${samples_per_second})
55-
translations:
56-
'True': 'true'
57-
'False': 'false'
5855

5956

6057
file_format: 1

gr-blocks/grc/blocks_throttle2.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,5 @@ cpp_templates:
8686
callbacks:
8787
- 'set_sample_rate(${samples_per_second})'
8888
- 'set_maximum_items_per_chunk(${id}_limit(${maximum}))'
89-
translations:
90-
'True': 'true'
91-
'False': 'false'
9289

9390
file_format: 1

gr-blocks/grc/blocks_vector_source_x.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,5 @@ cpp_templates:
5151
make: 'this->${id} = blocks::vector_source_${type.fcn}::make(${vector}, ${repeat}, ${vlen}, ${tags});'
5252
callbacks:
5353
- set_data(${vector}, ${tags})
54-
translations:
55-
'True': 'true'
56-
'False': 'false'
5754

5855
file_format: 1

gr-blocks/grc/blocks_wavfile_sink.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,5 @@ cpp_templates:
143143
callbacks:
144144
## TODO Handle std::string type when const char* argument is needed
145145
- this->${id}->open(${file})
146-
translations:
147-
'True': 'true'
148-
'False': 'false'
149146

150147
file_format: 1

gr-blocks/grc/blocks_wavfile_source.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,5 @@ cpp_templates:
3535
declarations: 'blocks::wavfile_source::sptr ${id};'
3636
make: |-
3737
this->${id} = blocks::wavfile_source::make(${file}${'.c_str()' if str(file)[0] != "'" and str(file)[0] != "\"" else ''}, ${repeat});
38-
translations:
39-
'True': 'true'
40-
'False': 'false'
4138
4239
file_format: 1

gr-digital/grc/digital_burst_shaper.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,5 @@ cpp_templates:
6464
${insert_phasing},
6565
${length_tag_name});
6666
link: ['gnuradio::gnuradio-digital']
67-
translations:
68-
'True': 'true'
69-
'False': 'false'
7067

7168
file_format: 1

gr-digital/grc/digital_costas_loop_cc.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,5 @@ cpp_templates:
5757
link: ['gnuradio::gnuradio-digital']
5858
callbacks:
5959
- set_loop_bandwidth(${w})
60-
translations:
61-
'True': 'true'
62-
'False': 'false'
6360

6461
file_format: 1

gr-digital/grc/digital_crc16_async_bb.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,5 @@ cpp_templates:
3030
this->${id} = digital::crc16_async_bb::make(
3131
${check});
3232
link: ['gnuradio-digital']
33-
translations:
34-
'True': 'true'
35-
'False': 'false'
3633

3734
file_format: 1

gr-digital/grc/digital_crc32_async_bb.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,5 @@ cpp_templates:
3030
this->${id} = digital::crc32_async_bb::make(
3131
${check});
3232
link: ['gnuradio::gnuradio-digital']
33-
translations:
34-
'True': 'true'
35-
'False': 'false'
3633

3734
file_format: 1

gr-digital/grc/digital_crc32_bb.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,5 @@ cpp_templates:
4040
${lengthtagname},
4141
${packed});
4242
link: ['gnuradio::gnuradio-digital']
43-
translations:
44-
'True': 'true'
45-
'False': 'false'
4643

4744
file_format: 1

gr-digital/grc/digital_crc_append.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,5 @@ cpp_templates:
6464
${input_reflected}, ${result_reflected}, ${swap_endianness},
6565
${skip_header_bytes});
6666
link: ['gnuradio-digital']
67-
translations:
68-
'True': 'true'
69-
'False': 'false'
7067

7168
file_format: 1

gr-digital/grc/digital_crc_check.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,5 @@ cpp_templates:
7373
${input_reflected}, ${result_reflected}, ${swap_endianness},
7474
${discard_crc}, ${skip_header_bytes});
7575
link: ['gnuradio-digital']
76-
translations:
77-
'True': 'true'
78-
'False': 'false'
7976

8077
file_format: 1

gr-digital/grc/digital_glfsr_source_x.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,5 @@ cpp_templates:
4545
${mask},
4646
${seed});
4747
link: ['gnuradio::gnuradio-digital']
48-
translations:
49-
'True': 'true'
50-
'False': 'false'
5148

5249
file_format: 1

gr-digital/grc/digital_header_payload_demux.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,5 @@ cpp_templates:
108108
${special_tags},
109109
${header_padding});
110110
link: ['gnuradio::gnuradio-digital']
111-
translations:
112-
'True': 'true'
113-
'False': 'false'
114111

115112
file_format: 1

gr-digital/grc/digital_ofdm_carrier_allocator_cvc.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,5 @@ cpp_templates:
6262
${len_tag_key},
6363
${output_is_shifted});
6464
link: ['gnuradio::gnuradio-digital']
65-
translations:
66-
'True': 'true'
67-
'False': 'false'
6865

6966
file_format: 1

gr-digital/grc/digital_ofdm_chanest_vcvc.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,5 @@ cpp_templates:
6565
${max_carr_offset},
6666
${force_one_symbol});
6767
link: ['gnuradio::gnuradio-digital']
68-
translations:
69-
'True': 'true'
70-
'False': 'false'
7168

7269
file_format: 1

gr-digital/grc/digital_ofdm_frame_equalizer_vcvc.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,5 @@ cpp_templates:
5555
${propagate_channel_state},
5656
${fixed_frame_len});
5757
link: ['gnuradio::gnuradio-digital']
58-
translations:
59-
'True': 'true'
60-
'False': 'false'
6158

6259
file_format: 1

gr-digital/grc/digital_ofdm_serializer_vcc.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,5 @@ cpp_templates:
6262
${carr_offset_key},
6363
${input_is_shifted});
6464
link: ['gnuradio::gnuradio-digital']
65-
translations:
66-
'True': 'true'
67-
'False': 'false'
6865

6966
file_format: 1

gr-digital/grc/digital_ofdm_sync_sc_cfb.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,5 @@ cpp_templates:
5555
link: ['gnuradio::gnuradio-digital']
5656
callbacks:
5757
- set_threshold(${threshold})
58-
translations:
59-
'True': 'true'
60-
'False': 'false'
6158

6259
file_format: 1

gr-fft/grc/fft_fft_vxx.block.yml

-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ cpp_templates:
6969
callbacks:
7070
- set_nthreads(${nthreads})
7171
translations:
72-
'True': 'true'
73-
'False': 'false'
7472
'window\.': 'fft::window::'
7573

7674
file_format: 1

gr-filter/grc/filter_dc_blocker_xx.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,5 @@ cpp_templates:
3838
declarations: 'filter::dc_blocker_${type}::sptr ${id};'
3939
make: 'this->${id} = filter::dc_blocker_${type}::make(${length}, ${long_form});'
4040
link: ['gnuradio::gnuradio-filter']
41-
translations:
42-
'True': 'true'
43-
'False': 'false'
4441

4542
file_format: 1

gr-filter/grc/filter_iir_filter_xxx.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,5 @@ cpp_templates:
6060
link: ['gnuradio::gnuradio-filter']
6161
callbacks:
6262
- set_taps(fftaps, fbtaps)
63-
translations:
64-
'True': 'true'
65-
'False': 'false'
6663

6764
file_format: 1

gr-filter/grc/filter_pfb_decimator.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,5 @@ cpp_templates:
7777
callbacks:
7878
- set_taps(taps)
7979
- set_channel(int(${channel}))
80-
translations:
81-
'True': 'true'
82-
'False': 'false'
8380

8481
file_format: 1

gr-filter/grc/filter_pfb_synthesizer.block.yml

-3
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,5 @@ cpp_templates:
7474
callbacks:
7575
- set_taps(taps)
7676
- set_channel_map(ch_map)
77-
translations:
78-
'True': 'true'
79-
'False': 'false'
8077

8178
file_format: 1

0 commit comments

Comments
 (0)