>
> Hello,
>
> I tried to print what data gr_vector_sink_f contains in the following code:
>
> #!/usr/bin/env python
>
> import howto
> from gnuradio import gr, gru
> from gnuradio.gr import firdes
> from optparse import OptionParser
> from gnuradio import blks2
>
> class howto_square (gr.top_block):
> def __init__(self):
> gr.top_block.__init__(self)
> src_data = (-3, 4, -5.5, 2, 3)
> expected_result = (9, 16, 30.25, 4, 9)
> src = gr.vector_source_f (src_data)
> sqr = howto.square_ff ()
> dst = gr.vector_sink_f ()
> self.connect (src, sqr)
> self.connect (sqr, dst)
> self.result_data = dst.data()
right here, you collect the data before running the flow graph
-josh
>
> def print_data(self):
> print self.result_data
>
> if __name__ == '__main__':
> #parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
> #(options, args) = parser.parse_args()
> hw = howto_square()
> hw.run()
> hw.print_data()
>
> But it is always empty.
>
> Any thoughts?
>
> Thanks
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
No comments:
Post a Comment