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,
Marcus
On 31.10.2016 22:25, kunal sankhe wrote:
Hello Members,
I am using GNU Radio 3.7.10.1 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 probewith 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 self.run()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/2 ,014-06/msg00152.html which mentionedto add the accessor in the include/*.h file as a virtual member functionI defined virtual function poll_complex_gain in randphpert4_f.h file as belowvirtual 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.
Regards,Kunal Sankhe
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
No comments:
Post a Comment