discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] How to call another blocks in custom out-of-tree modu


From: address@hidden
Subject: [Discuss-gnuradio] How to call another blocks in custom out-of-tree module
Date: Tue, 5 Nov 2013 12:56:24 +0000

Hi,

 

Can you help me to call gnu-blocks from my own out-of-tree code written in python?

 

For example, from this code (http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules)

1 import numpy

2 from gnuradio import gr

3

 4 class square3_ff(gr.sync_block):

5     " Squaring block "

 6     def __init__(self):

7         gr.sync_block.__init__(

8             self,

9             name = "square3_ff",

10             in_sig = [numpy.float32], # Input signature: 1 float at a time

11             out_sig = [numpy.float32], # Output signature: 1 float at a time

12         )

           Self.my_block = (another block / or hier-block)

13

14     def work(self, input_items, output_items):

15         #output_items[0][:] = input_items[0] * input_items[0] # Only works because numpy.array

# I want to call self.my_block here

16         return len(output_items[0])

 

 

I want to call another gnu-blocks (or another hier-block) in work function.(Line 14~16)

1)     How to connect input item to another block’s input

2)     How to connect local array to another block’s output

 

Please help me.

Actually I need to make my own sub block.

But I need gnuradio blocks during processing my own block.

 

Bye.

 


reply via email to

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