Hi Jeff,
Thanks for your response!
If you can write a short code snippet to show me how to do this I would appreciate it very much. For instance, I am making an OOT Python Interpolator block which takes a number of inputs and I would like to be able to set a parameter value to tell the block how many input ports are needed. Currently, my design is static, in that if I want to run an experiment with 4- complex input ports, then in a static manner, I set:
in_sig = [numpy.complex64, numpy.complex64, numpy.complex64, numpy.complex64]
The question is: how do I set "in_sig" in a non-static manner, so even if I wanted 4 inputs, I would not need to explicitly write it out as above and of course if I wanted 20 inputs, I just set a parameter to 20 and the grc block will show 20 inputs for signal connection?
The followup question to this is, how do I set up the "yml" file accordingly?
Thanks again for your help.
Regards,
George
On Wed, Feb 3, 2021 at 2:57 PM Jeff Long <willcode4@gmail.com> wrote:
`gr.io_signature()` in Python works exactly the same as it does in C++. The legacy Python way (list of types) is still used in most places, but you have the option.On Wed, Feb 3, 2021 at 3:17 PM George Edwards <gedwards.eng@gmail.com> wrote:Hello,I wish to build an OOT module in Python which can take a variable number of inputs and outputs. In C++ OOT, there are the io signatures <+min_in+>, <+max_in+>, etc. which can be set to 1 and -1 to mean the input can be any number. Python does not have these, it has the in_sig and out_sig which do not offer the flexibility as the C++ OOT. How can I get a variable number of inputs/outputs that is user defined in a Python OOT?Also, how do I set the parameters in yml file for variable inputs and outputs?I will appreciate any help.Thank you!Regards,George
No comments:
Post a Comment