I found that “tb.wait()” is written in the file so it takes too long
time .
Now after I erased tb.wait() … the output on terminal is —> ( ) … I
don’t know why ?? Here is what is written in top_block.py
#!/usr/bin/env python
##################################################
Gnuradio Python Flow Graph
Title: Top Block
Generated: Sat Mar 29 01:47:01 2014
##################################################
from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from grc_gnuradio import wxgui as grc_wxgui
from optparse import OptionParser
import wx
class top_block(grc_wxgui.top_block_gui):
def __init__(self):
grc_wxgui.top_block_gui.__init__(self, title="Top Block")
_icon_path =
“/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png”
self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))
##################################################
# Variables
##################################################
self.samp_rate = samp_rate = 32000
##################################################
# Blocks
##################################################
self.blocks_vector_source_x_0 = blocks.vector_source_b((6, 6),
True, 1, [])
self.blocks_vector_sink_x_0 = blocks.vector_sink_b(1)
self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char*1,
samp_rate,True)
##################################################
# Connections
##################################################
self.connect((self.blocks_vector_source_x_0, 0),
(self.blocks_throttle_0, 0))
self.connect((self.blocks_throttle_0, 0),
(self.blocks_vector_sink_x_0, 0))
4,1 Top
QT sink close method reimplementation
def get_samp_rate(self):
return self.samp_rate
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.blocks_throttle_0.set_sample_rate(self.samp_rate)
if name == ‘main’:
import ctypes
import sys
if sys.platform.startswith(‘linux’):
try:
x11 = ctypes.cdll.LoadLibrary(‘libX11.so’)
x11.XInitThreads()
except:
print “Warning: failed to XInitThreads()”
parser = OptionParser(option_class=eng_option, usage=“%prog:
[options]”)
(options, args) = parser.parse_args()
tb = top_block()
tb.Start(True)
print tb.blocks_vector_sink_x_0.data()
2014-03-29 0:06 GMT+02:00 Sara C. [email protected]: