One way to do this is to create a flowgraph, such as foo.grc. This will
generate a Python file that you can import into another file, bar.py:
#!/usr/bin/env python2
import foo
if name == ‘main’:
tb = foo.foo()
custom code
print "samp_rate:", tb.get_samp_rate()
# standard stuff
tb.start()
try:
raw_input('Press Enter to quit: ')
except EOFError:
pass
tb.stop()
tb.wait()
You can add custom stuff into bar.py while being able to modify foo in
GRC. I’m not sure if this applies directly to what you want to do, but
I’ve found it useful for testing while avoiding having GRC overwrite
your custom code.
Of course, another way to do this is to export your flowgraph as a
hierarchical block, which you then import into a top level flowgraph.
Your top level can stay the same but you can keep iterating on the
hierarchical block.
Sean
From: discuss-gnuradio-bounces+sean.nowlan=removed_email_address@domain.invalid
[mailto:discuss-gnuradio-bounces+sean.nowlan=removed_email_address@domain.invalid] On
Behalf Of Marcus M.
Sent: Monday, July 06, 2015 9:33 AM
To: [email protected]
Subject: Re: [Discuss-gnuradio] Additional code to GRC flowgraph
As I said, if that’s the case, avoid using function probes but just use
the MPSK estimator (not the estimator probe), and write your own block
that just takes the tags that come from that, and translates them to
messages that you send to another block that does something useful with
them (e.g. adjusting a frequency correction etc.)
Best regards,
Marcus
On 07/06/2015 12:11 PM, Daniel Brogren wrote:
Sorry for for that… I thought the “imoprt” block was a type of block
that I could create from the modtool.
but
In the import-block I can import modules. But I can still not import
actuall code into my top_block and I can not call functions from the
import-block. What I want to avoid is to add code in the top_block
manually since I’m normally using the GRC to generate the top_block.
/Daniel
Date: Mon, 6 Jul 2015 09:43:24 +0200
From: [email protected]mailto:[email protected]
To: [email protected]mailto:[email protected]
Subject: Re: [Discuss-gnuradio] Additional code to GRC flowgraph
Try the block search (magnifier button in GRC), type in “import”
On 07/06/2015 09:33 AM, Daniel Brogren wrote:
Hi again
I have a MPSK SNR Estimator Probe and a Function Probe that calculates
the SNR.
I can not find any information regarding “import” block.
BR
Daniel Brogren
skynet.kill_sarah()
messages containing the changed parameter to the block that needs
On 07/03/2015 04:27 PM, Daniel Brogren wrote:
Discuss-gnuradio mailing list
[email protected]mailto:[email protected]
Discuss-gnuradio Info Page
Discuss-gnuradio mailing list
[email protected]mailto:[email protected]
Discuss-gnuradio Info Page
Discuss-gnuradio mailing list
[email protected]mailto:[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
_______________________________________________ Discuss-gnuradio mailing
list [email protected]mailto:[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Discuss-gnuradio mailing list
[email protected]mailto:[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio