discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Question about hier block


From: Axel Belliard
Subject: [Discuss-gnuradio] Question about hier block
Date: Fri, 26 Mar 2010 17:23:34 +0100 (CET)
User-agent: SquirrelMail/1.5.1

Hi

I'm trying to make a very simple hier block. ( see the code below). When I
execute my top block i get no error, but the data seems to never enter the
hier block ( the print-line prints  : "()"). What am I doing wrong?



####my hier block#########
from gnuradio import gr
class Trameur(gr.hier_block2):
        def __init__(self):
                gr.hier_block2.__init__(self, "Trameur",gr.io_signature(1, 1,
gr.sizeof_char),gr.io_signature(1, 1, gr.sizeof_char))


                #####input####
                self.in_data = gr.vector_sink_b()
                self.connect(self ,self.in_data)
                self.src_data = self.in_data.data()
                print self.src_data

                #######output###########"
                self.out_data = gr.vector_source_b (self.src_data)
                self.connect(self.out_data , self)

#####################My top block############################


from gnuradio import gr
from Trameur_stanag import Trameur
class top(gr.top_block):
        def __init__(self):
                gr.top_block.__init__(self)

                self.src_data =
(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)

                self.in_data =   gr.vector_source_b(self.src_data)
                self.tramage = Trameur ()
                self.sink2=gr.vector_sink()

                self.connect( self.in_data, self.tramage)
                self.connect(self.tramage, self.sink2)

if __name__ == '__main__':
        try:
                tb = top()
                tb.run()
        except KeyboardInterrupt:
                pass







reply via email to

[Prev in Thread] Current Thread [Next in Thread]