discuss-gnuradio
[Top][All Lists]
Advanced

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

Embedded Python Block Tutorial Param ID Error


From: Solomon Tan
Subject: Embedded Python Block Tutorial Param ID Error
Date: Sat, 8 May 2021 04:23:23 +0000 (UTC)

Dear all,                       
                                                
I was following the GNURadio Embedded Python Block Tutorial. After adding a     
Python block, I got the following error.                                        
```                                                                             
Param - Id(id):                                                                 
        ID "epy_block_0" is blacklisted.                                        
```                                                                             
The parameter ID of the Python block is marked in red. Why and how? The 
weirdest thing is that the Python block worked initially at first. I could run 
the
flowgraph, but after stopping it, I couldnt rerun it again. I was given that 
Param
ID error. My code was almost equivalent to the template, so it cant be my fault
, right?
```
"""
Embedded Python Blocks:
"""
import numpy as np
from gnuradio import gr

class blk(gr.sync_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='EPB Multiply by Const',   # will show up in GRC
            in_sig=[np.float32],
            out_sig=[np.float32]
        )
        # if an attribute with the same name as a parameter is found,
        # a callback is registered (properties work, too).
        self.example_param = example_param


    def work(self, input_items, output_items):
        """example: multiply with constant"""
        output_items[0][:] = input_items[0] *2 * self.example_param
        return len(output_items[0])
```

I could not find any other mail in the archive about this parameter ID error.

Thank you.
Cheers,
Sol


reply via email to

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