[Top][All Lists]

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

Re: [Discuss-gnuradio] Error in using Accessor method in GNU Radio 3.7.

From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Error in using Accessor method in GNU Radio 3.7. AttributeError: Object has no attribute
Date: Mon, 31 Oct 2016 22:29:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

Hi Kunal,

1. you shouldn't implement the virtual method in the include/*.h if you override it in the impl. Just virtual gr_complex poll_complex_gain() const = 0; should do the trick.

2. Your approach of adding this method in the include/*.h was absolutely correct. However, SWIG might not yet have picket this up; "make clean && make" should help here.

hope that helps,


On 31.10.2016 22:25, kunal sankhe wrote:
Hello Members,

I am using GNU Radio and have created a new OOT module using gr_modtool. 
I have created two blocks 1) Random Phase Perturbation 2) Apply BF weight, again using gr_modtool 

My goal is to update the parameter 'bf_weight' of Apply BF weight block using the function probe
with function poll_complex_gain() defined in the block Random Phase Perturbation.

Block: Random Phase Perturbation 

This block has accessor method "poll_complex_gain" defined in its randphpert4_f_impl.h file as below:

gr_complex poll_complex_gain() const { return d_complex_gain;}

While running GRC, I am getting below run-time error:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/genesys/Documents/EnergyHarvesting-Project/top_block.py", line 80, in _bf_weight_probe
    val = self.EnergyBeamforming_randphpert4_f_0.poll_complex_gain()
AttributeError: 'randphpert4_f_sptr' object has no attribute 'poll_complex_gain'

While searching for similar problems, I found a solution in the thread https://lists.gnu.org/archive/html/discuss-gnuradio/2014-06/msg00152.html,
which mentioned 
to add the accessor in the include/*.h file as a virtual member function
I defined virtual function poll_complex_gain in randphpert4_f.h file as below
virtual gr_complex poll_complex_gain() const { return d_complex_gain; } 
But, I am still getting the same error as above.

Please let me know, where am I making mistake. 
Any help would be appreciated. 

Thanks in advance. 

Kunal Sankhe

Discuss-gnuradio mailing list

reply via email to

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