|
From: | Jason Goldberg |
Subject: | Re: proper way in GRC to pass a python dictionary as a parameter to a custom python block |
Date: | Wed, 18 Dec 2019 14:01:14 -0800 |
Hi Jason,
On 18/12/2019 03.19, Jason Goldberg wrote:
> I have an OOT module to which I added a custom block via gr_modtool. This
> custom hier block is supposed to accept a python dictionary as a
> parameter. The yml file associated with the block has a parameters section
> where the dtype is to be specified. "dict" appears to be an invalid data
> type. I have found that if I set dtype to { $type } or even comment out
> that line, the flowgraph runs, but the dictionary I pass in to the block
> (via a variable or a parameter) gets expanded out in the block icon such
> that the icon becomes huge. By expanded out I mean that the parameter
> field in the block icon looks like e.g.,
> {'first_key_of_huge_dict;: {'nested_key_1': 9.873, 'nested_key_2': 'a
> really long string' etc
>
> rather than just containing the name of the dictionary variable. How can I
> pass in a dictionary to my block and avoid this problem?
Try with "dtype: raw" and "hide: part". See also:
https://wiki.gnuradio.org/index.php/YAML_GRC#Parameters
https://wiki.gnuradio.org/index.php/GNURadioCompanion#Creating_the_XML_Block_Definition
Regards,
Vasil
[Prev in Thread] | Current Thread | [Next in Thread] |