简体   繁体   中英

Can I have multiple inputs in a Embedded Python Block?

I'd like to know If I could have an Embedded Python Block with multiples inputs? If the answer is yes, How could I get it? Thank you

To have multiple inputs you need to add more elements to the in_sig parameter. For example to have two complex inputs you need 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]
        )

See also 3.2.3. Modifying the Python Block File .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM