我可以在一个嵌入式Python块中拥有多个输入吗?

问题描述 投票:0回答:1

我想知道我是否可以在一个嵌入式Python块中拥有多个输入?如果答案是肯定的,我如何才能得到它?

python input block gnuradio
1个回答
1
投票

要想拥有多个输入,你需要向 in_sig 参数。例如,要有两个复杂的输入,你需要 in_sig=[np.complex64, np.complex64]

class blk(gr.sync_block):  # other base classes are basic_block, decim_block, interp_block
    """Embedded Python Block example - a simple multiply const"""

    def __init__(self, example_param=1.0):  # only default arguments here
        """arguments to this function show up as parameters in GRC"""
        gr.sync_block.__init__(
            self,
            name='Embedded Python Block',   # will show up in GRC
            in_sig=[np.complex64, np.complex64],
            out_sig=[np.complex64]
        )

另见 3.2.3. 修改Python块文件.

© www.soinside.com 2019 - 2024. All rights reserved.