You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to write a Python block with a variable number of message inputs. Of course I don't want to implement a fixed number of message handlers for a variable number of ports, so I would write one handler and assign all ports to it, with another parameter port indicating which port was used:
I believe a more portable solution would be to store method pointers instead of strings here.
System Information
OS: Arch Linux
GR Installation Method: Conda
GNU Radio Version
3.10 (maint-3.10)
Specific Version
3.10.1.1
Steps to Reproduce the Problem
Create block from above
Connect message inputs to some message source
Generate and run graph
Relevant log output
File "example.py", line 93, in __init__
self.set_msg_handler(pmt.intern(f"receiver{i}"), functools.partialmethod(self.receiver_handler, i))
File "/lib/python3.10/site-packages/gnuradio/gr/gateway.py", line 228, in set_msg_handler
which_port, handler_function.__name__)
AttributeError: 'partialmethod' object has no attribute '__name__'. Did you mean: '__ne__'?
The text was updated successfully, but these errors were encountered:
What happened?
I am trying to write a Python block with a variable number of message inputs. Of course I don't want to implement a fixed number of message handlers for a variable number of ports, so I would write one handler and assign all ports to it, with another parameter
portindicating which port was used:and
However this is not possible because internally GNURadio is keeping a string reference to my method, instead of a pointer:
I believe a more portable solution would be to store method pointers instead of strings here.
System Information
OS: Arch Linux
GR Installation Method: Conda
GNU Radio Version
3.10 (maint-3.10)
Specific Version
3.10.1.1
Steps to Reproduce the Problem
Relevant log output
The text was updated successfully, but these errors were encountered: