Forum: GNU Radio Can't stop the top_block which contain transmit_path

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ling H. (Guest)
on 2009-05-15 11:56
(Received via mailing list)
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-w...
Sent from the GnuRadio mailing list archive at Nabble.com.
Eric B. (Guest)
on 2009-05-15 12:00
(Received via mailing list)
On Fri, May 15, 2009 at 12:55:20AM -0700, Ling H. wrote:
>          self.trans=transmit_path(...)
> see what's the problem.
What version of GNU Radio are you using?

We fixed a problem in the trunk about a month ago that could be
related to this.

Eric
Ling H. (Guest)
on 2009-05-15 15:02
(Received via mailing list)
>What version of GNU Radio are you using?
my GNU Radio version is 10853

--
View this message in context:
http://www.nabble.com/Can%27t-stop-the-top_block-w...
Sent from the GnuRadio mailing list archive at Nabble.com.
Ling H. (Guest)
on 2009-05-15 20:00
(Received via mailing list)
Eric,
would you please tell me what cause tb.wait() hanging, where is this bug
from?
I have install the newest version of GNU Radio, but the problem is still
the
same.

Eric B. wrote:
>> block,
>> tb.wait() # IT HANG IN HERE
> related to this.
>
> Eric
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> removed_email_address@domain.invalid
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>

--
View this message in context:
http://www.nabble.com/Can%27t-stop-the-top_block-w...
Sent from the GnuRadio mailing list archive at Nabble.com.
This topic is locked and can not be replied to.