Re: [Discuss-gnuradio] inserting code into top_block.py

2014-09-24 Thread Ryan Marlow
How is that Makefile executed? GRC generates the top_block.py then executes it. The Makefile would have to edit it before execution right? Ryan On Wed, Sep 24, 2014 at 10:25 AM, wrote: > Just as a follow-up, I have a flow-graph, simple_ra, that originates in > GRC, but the Makefile that I use e

Re: [Discuss-gnuradio] inserting code into top_block.py

2014-09-24 Thread mleech
Just as a follow-up, I have a flow-graph, simple_ra, that originates in GRC, but the Makefile that I use edits the generated code post-facto, in an automated way, so that it's reproducible. My use-case is trivial--I'm just editing-in a version number into a title string, but the general ap

Re: [Discuss-gnuradio] inserting code into top_block.py

2014-09-24 Thread Ryan Marlow
Hey All, Thanks for the leads and advice. Ryan > Vanush, > > GRC will overwrite any changes you make to the generated Python file, so > you would want to do any custom programming outside that file. The > '__main__' code is only hit if you execute the file as the top level > program. > > - Jeff >

Re: [Discuss-gnuradio] inserting code into top_block.py

2014-09-23 Thread Jeff Long
Vanush, GRC will overwrite any changes you make to the generated Python file, so you would want to do any custom programming outside that file. The '__main__' code is only hit if you execute the file as the top level program. - Jeff On 09/23/2014 07:52 PM, Vanush Vaswani wrote: Shouldn't h

Re: [Discuss-gnuradio] inserting code into top_block.py

2014-09-23 Thread Vanush Vaswani
Shouldn't he "cut" the code? On Wed, Sep 24, 2014 at 5:53 AM, Jeff Long wrote: > The most straightforward way is to make a small Python program that calls > the class generated by GRC. Copy the autogenerated code after > > if __name__ == '__main__' > > into another file, and insert your logic bef

Re: [Discuss-gnuradio] inserting code into top_block.py

2014-09-23 Thread Jeff Long
The most straightforward way is to make a small Python program that calls the class generated by GRC. Copy the autogenerated code after if __name__ == '__main__' into another file, and insert your logic before the tb.start() line. - Jeff On 09/23/2014 03:14 PM, Martin Braun wrote: You might

Re: [Discuss-gnuradio] inserting code into top_block.py

2014-09-23 Thread Martin Braun
You might be able to trick the 'Variable' block into doing what you want. M On 23.09.2014 12:01, Ryan Marlow wrote: Hey All, I'm trying to figure out if what I want to do is possible in GNU Radio Companion or if there's a better way to achieve this functionality. I have some code that I want to