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)
parser.add_option .....adds some options....
(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 ()
I get the following error:
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