discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] using file descriptor with wxgui


From: Chuck Swiger
Subject: [Discuss-gnuradio] using file descriptor with wxgui
Date: Sun, 05 Jun 2005 10:23:18 -0400

Hi All - looking for clues on how to include a file descriptor sink with
wxpython - for example, if I add code to gnuradio-examples/python/usrp/fft_usrp.py
at the end of

-------------------------------------------------------------------------
class app_flow_graph (stdgui.gui_flow_graph):
    def __init__(self, frame, panel, vbox, argv):
        stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)

(existing code)

        # open socket output
        port=7001
        fd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        fd.connect(('192.168.1.53',7001))

        file = gr.file_descriptor_sink(gr.sizeof_gr_complex,fd.fileno() )
        self.connect(self.u,file)
------------------------------------------------------------------------


we get the old 'stale file descriptor' out of scope trick when init exits.
In some other application I put this at the end of an init block and can make
it work using fg.run, but of course you don't get the gui window since
init does NOT exit.  Can the fd be 'return'ed or put in a mainloop() somewhere?

--Chuck




reply via email to

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