mirror of
https://github.com/gnuradio/gnuradio-companion.git
synced 2025-12-10 17:46:12 -06:00
grc: snippets in init before blocks
Allow new snippet insertion point in the init function but before blocks are instantiated. This allows actions or objects that might be required in the constructors of the blocks, such as connecting to a server, to be initialized Signed-off-by: Josh Morman <jmorman@gnuradio.org>
This commit is contained in:
parent
9e007e5bc6
commit
883bb7c240
@ -6,8 +6,8 @@ parameters:
|
||||
- id: section
|
||||
label: Section of Flowgraph
|
||||
dtype: string
|
||||
options: ['main_after_init', 'main_after_start', 'main_after_stop' ]
|
||||
option_labels: ['Main - After Init', 'Main - After Start', 'Main - After Stop']
|
||||
options: ['main_after_init', 'main_after_start', 'main_after_stop', 'init_before_blocks' ]
|
||||
option_labels: ['Main - After Init', 'Main - After Start', 'Main - After Stop', 'Init - Before Blocks']
|
||||
- id: priority
|
||||
label: Priority
|
||||
dtype: int
|
||||
|
||||
@ -55,7 +55,7 @@ ${indent(snip['def'])}
|
||||
% endfor
|
||||
\
|
||||
<%
|
||||
snippet_sections = ['main_after_init', 'main_after_start', 'main_after_stop']
|
||||
snippet_sections = ['main_after_init', 'main_after_start', 'main_after_stop', 'init_before_blocks']
|
||||
snippets = {}
|
||||
for section in snippet_sections:
|
||||
snippets[section] = flow_graph.get_snippets_dict(section)
|
||||
@ -205,6 +205,7 @@ gr.io_signature.makev(${len(io_sigs)}, ${len(io_sigs)}, [${', '.join(size_strs)}
|
||||
# Blocks
|
||||
${'##################################################'}
|
||||
% endif
|
||||
${'snippets_init_before_blocks(self)' if snippets['init_before_blocks'] else ''}
|
||||
% for blk, blk_make in blocks:
|
||||
% if blk_make:
|
||||
${ indent(blk_make.strip('\n')) }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user