Control of message_source flowgraph

I have a top block with two flow graphs in it

both of which are defined as hier blocks

one flowgraph consists of a message source that writes to a file sink

the other flowgraph detects an incoming signal (from a usrp2 source) and
writes n samples of it to the message source

each time the file sink is written to I would like to copy and rename
that file and delete the original

therefore I can obtain multiple files of signals I’ve detected and not
just append to the same file each time a subsequent signal is detected

what I can’t quite figure out is how to trigger the copy/rename/delete
of the file sink file

e.g. is there an event of some sort I can use when the message source
flowgraph completes?

I have looked at some of the relevant files e.g. rx_voice.py and I have
a suspicion i could do it with a callback function but I can’t quite see
how it works

any pointers gratefully received

PS is it still the case you cannot have multiple instances of top_block
(i seem to have managed it without any error messages)

On Wed, Jan 27, 2010 at 09:55, Ben H. [email protected] wrote:

what I can’t quite figure out is how to trigger the copy/rename/delete of the file sink file

You do this outside of a GNU Radio flowgraph by creating a
gru.msq_runner and passing it a Python callback function. The
callback function will be invoked for each arriving message in the
queue. You can then (inside your callback function) write standard
Python code to create, write to, and rename files as needed.

Johnathan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs