[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] Can't stop the top_block which contain transmit_path
From: |
Ling Huang |
Subject: |
[Discuss-gnuradio] Can't stop the top_block which contain transmit_path |
Date: |
Fri, 15 May 2009 00:55:20 -0700 (PDT) |
Hi, all
I modify the gnuradio-examples/python/digital codes for some experiences. In
one case I want to stop the running flow graph(top block), and then to start
a new connect. I do it well in stop the receive_path connect. But I just
can't stop the top block contain a transmit_path. If I stop the top block,
and wait, it hang in the tb.wait.
I seem not express well. To make it simple let's see:
class my_topblock(gr.top_block)
def __init__(self):
self.trans=transmit_path(...)
self.connect(self.trans)
....
tb.start()
tb.stop()
tb.wait() # IT HANG IN HERE
...
tb.start()
I made a simple test code to test stopping the top block , please test it to
see what's the problem.
-------------------------------code--------------------------------------------------------
#!/usr/bin/env python
from gnuradio import gr, gru, modulation_utils
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import random, time, struct, sys
# from current dir
from transmit_path import transmit_path
import fusb_options
class my_top_block(gr.top_block):
def __init__(self,mod_class,options):
gr.top_block.__init__(self)
self.txpath = transmit_path(mod_class, options)
self.connect(self.txpath);
def main():
mods = modulation_utils.type_1_mods()
parser = OptionParser(option_class=eng_option,
conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
parser.add_option("-m", "--modulation", type="choice",
choices=mods.keys(),
default='gmsk',
help="Select modulation from: %s [default=%%default]"%
(', '.join(mods.keys()),))
transmit_path.add_options(parser, expert_grp)
for mod in mods.values():
mod.add_options(expert_grp)
r = gr.enable_realtime_scheduling()
fusb_options.add_options(expert_grp)
(options, args) = parser.parse_args ()
tb=my_top_block(mods[options.modulation], options)
tb.start()
tb.stop()
print "afater stop"
tb.wait()
print "wait done"
tb.start()
print "start again"
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
pass
--
View this message in context:
http://www.nabble.com/Can%27t-stop-the-top_block-which-contain-transmit_path-tp23555109p23555109.html
Sent from the GnuRadio mailing list archive at Nabble.com.
- [Discuss-gnuradio] Can't stop the top_block which contain transmit_path,
Ling Huang <=