Forum: GNU Radio controlling flowgraph

Aaa0fc4458ead49e4f9317634a32ae92?d=identicon&s=25 Nemanja Savic (Guest)
on 2013-10-10 12:41
(Received via mailing list)
Hi all guys,

I wanted to implement a ask transmitter and a button for triggering
transmition of a single frame of data. My idea was to do that with a
sort
of state machine and a button, but as far as i can see there is no
button
in wx gui blocks. How do uo usually do this?

Many thanks,
Aaa0fc4458ead49e4f9317634a32ae92?d=identicon&s=25 Nemanja Savic (Guest)
on 2013-10-10 17:27
(Received via mailing list)
Ok, I have found button :), but the problem is now following. Part of my
script looks like this:

def aaa(a):
    global state
    state = 1

state = 1
data = [0]
if __name__ == '__main__':
    parser = OptionParser(option_class=eng_option, usage="%prog:
[options]")
    (options, args) = parser.parse_args()
    tb = top_block()
    while(True):
        if state == 1:
            print "aa"
            state = 0
            data.append(0)
            tb.blocks_vector_source_x_0.set_data(data)
            tb.run()
            print tb.blocks_vector_sink_x_0.data()

aaa is callback function called when the button is pressed.
What i want to achieve is following:
when flowgraph starts i don't want any transmiton, I just want to see
gui.
when i press the button, then one frame should be sent.
when i press again the button another frame should be sent.
...

Is this possible? In example above I don't see gui at all.
Aaa0fc4458ead49e4f9317634a32ae92?d=identicon&s=25 Nemanja Savic (Guest)
on 2013-10-11 15:27
(Received via mailing list)
I still can't find solution so any suggestion would be good.

Best,
Nemanja
Aaa0fc4458ead49e4f9317634a32ae92?d=identicon&s=25 Nemanja Savic (Guest)
on 2013-10-11 16:42
(Received via mailing list)
When want to use method Start, that is defined for top_block_gui class,
i
always get this error:

AttributeError: 'gr_top_block_sptr' object has no attribute 'Start'
[savi_ne@ts-070046nl GRC]$ gvim
/usr/local/lib64/python2.6/site-packages/gnuradio/gr/top_block.py

But it is clear that tb is of top_block_gui, and there is no error for
using Run method.
Why is this so?
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.