discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File Meta Sink question


From: Volker Schroer
Subject: Re: File Meta Sink question
Date: Fri, 17 Mar 2023 17:58:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

Have a look at

https://wiki.gnuradio.org/index.php/File_Meta_Sink

There you'll find an example with multiple entries.
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'







reply via email to

[Prev in Thread] Current Thread [Next in Thread]