|
From: | Tom Rondeau |
Subject: | Re: [Discuss-gnuradio] GUI to display transmitted signal |
Date: | Wed, 20 Feb 2013 13:47:04 -0500 |
parser.add_option .....adds some options....I am transmitting a signal from my USRP N210, but I would like to also see that signal on screen in a gui. I'm currently getting an error that I don't understand. I have a simple class, tx_test(gr.heir_block2), that simply transmits a sine wave.The second class, tx_sink(stdgui2.std_to_block), has the following things:
def __init__(self, frame, panel, vbox, argv):
stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv)
parser = OptionParser(option_class=eng_option)I get the following error:
(options, args) = parser.parse_args ()
self.u = uhd.usrp_sink(device_addr=options.args,
stream_args=uhd.stream_args('fc32'))
It goes on to set sample rates and such. Lastly I have:
sig0 = tx_test(options.samp_rate)
self.connect(sig0, self.u)
gui = fftsink2.fft_sink_c(panel, title="Tx FFT Plot",
fft_size=1024, sample_rate=self.usrp_rate)
self.connect (sig0, gui)
vbox.Add (gui.win, 1, wx.EXPAND)
def main ():
app = stdgui2.stdapp(tx_sink, "Transmitted Signal", nstatus=1)
app.MainLoop ()
if __name__ == '__main__':
main ()
File "tx_test_gui.py", line 47, in tx_sink
self.u = uhd.usrp_sink(device_addr=options.args, stream_args=uhd.stream_args('fc32'))
NameError: name 'self' is not defined
[Prev in Thread] | Current Thread | [Next in Thread] |