I was able to get a little farther with using import pmt in the Import
block. I am now having some new difficulty with the Extra Dict field
in the File Meta Sink block. I'd like to add a few definitions to the
Extra Dictionary.
If I use:
pmt.dict_add(pmt.make_dict(),pmt.intern('FFT_size'),pmt.from_long(FFT_size))
to add in the FFT_size, that will run without error. However, I'm not
sure how to add another entry.
If I try adding another entry,
pmt.dict_add(pmt.make_dict(),pmt.intern('FFT_size'),pmt.from_long(FFT_size)),
pmt.dict_add(pmt.make_dict(),pmt.intern('freq'),pmt.from_long(freq))
I get an error about incompatible constructor arguments:
in __init__
self.blocks_file_meta_sink_0 =
blocks.file_meta_sink(gr.sizeof_float*FFT_size, 'output.dat', samp_rate,
1, blocks.GR_FILE_FLOAT, False, 1000000,
pmt.dict_add(pmt.make_dict(),pmt.intern('FFT_size'),pmt.from_long(FFT_size)),pmt.dict_add(pmt.make_dict(),pmt.intern('freq'),pmt.from_long(freq)),
False)
TypeError: __init__(): incompatible constructor arguments. The following
argument types are supported:
1. gnuradio.blocks.blocks_python.file_meta_sink(itemsize: int,
filename: str, samp_rate: float = 1, relative_rate: float = 1, type:
gnuradio.blocks.blocks_python.gr_file_types =
<gr_file_types.GR_FILE_FLOAT: 5>, complex: bool = True,
max_segment_size: int = 1000000, extra_dict: pmt.pmt_python.pmt_base =
(), detached_header: bool = False)
Invoked with: 4096, 'output.dat', 10000000, 1,
<gr_file_types.GR_FILE_FLOAT: 5>, False, 1000000, ((FFT_size . 1024)),
((freq . 105700000)), False
If I try the entry this way:
pmt.dict_add(pmt.make_dict(),pmt.intern('FFT_size','freq'),pmt.from_long(FFT_size,freq))
I get an error in the block:
Param - Extra Dict.(extra_dict):
Value
"pmt.dict_add(pmt.make_dict(),pmt.intern('FFT_size','freq'),pmt.from_long(FFT_size,freq))"
cannot be evaluated:
intern(): incompatible function arguments. The following argument types
are supported:
1. (s: str) -> pmt.pmt_python.pmt_base
I'm not sure how to add multiple entries to the dictionary, or if it's
possible to do so. Thanks for any assistance!
Invoked with: 'FFT_size', 'freq'