Just use `dtype: raw` in the YAML file; then anything that's valid python goes!

For example `["key1", "key2"]`,
 but also other things like dicts, `{ "key1": 42, "key2": 1337 }`.

Best regards,
Marcus

On 15.07.21 06:58, Anton Ottosson wrote:
> Hi,
> 
> I'm writing a block for an OOT module and I would like to take a list of keys 
> as one of
> the parameters. They will be used to select entries in a pmt dictionary. I 
> first tried to
> use std::vector<std::string> as the parameter type, but there doesn't seem to 
> exist any
> corresponding string_vector dtype to use in the YAML file
> (https://wiki.gnuradio.org/index.php/YAML_GRC
> <https://wiki.gnuradio.org/index.php/YAML_GRC>). I then switched over to pmt 
> arguments and
> managed to get it to work, but it is very ugly and hacky. This is the kind of 
> thing I have
> to enter into the parameter field on the block:
> 
> 
> pmt.list2(pmt.intern("key1"), pmt.intern("key2"))
> 
> 
> Is there a better way? Is there a block that does something similar that I 
> can take a look
> at? Best I could find was PDU Filter, but it only takes a single key, not a 
> list.
> 
> 
> Best regards,
> 
> Anton
> 

Reply via email to