Hello Marcus,

I have made it work, by checking some of your answers before. Here are the
steps, in case someone else is interested:

1. define the set_param() function in lib/myblock_imp.h file:
     Public:
         ...
         void set_param(float param) {_param = param;}
2. Add in the lib/myblock_imp.cc file:
     _param = param;
3. In include/gnuradio/customModule/myblock.h add:
      Public:
         ...
         virtual void set_param(float param) = 0;
4. run "md5sum include/gnuradio/customModule/myblock.h" to get the tag
value.
5. copy and paste the tag value in "BINDTOOL_HEADER_FILE_HASH(xxxx)" in the
file python/customModule/bindings/myblock_python.cc
6. then do cmake../, make, sudo make install and sudo ldconfig. It should
work now.
7. I also did "gr_modtool bind myblock", but I'm not sure if it helped or
not.

Best regards,
Wei

On Thu, 24 Apr 2025 at 11:42, Marcus Müller <mmuel...@gnuradio.org> wrote:

> Hi Huang Wei,
>
> nice to have you here!
>
> Can you show us where you use `_param` in your C++ implementation?
> What you show us looks right, in general.
>
> Best regards,
> Marcus
>
> On 4/22/25 4:56 PM, Huang Wei wrote:
> > And I have added in the .yml file:
> > callbacks:
> > - set_param(${param})
> >
> > But still the value can't be changed.
> >
> > On Tue, 22 Apr 2025 at 15:16, Huang Wei <weizar...@gmail.com <mailto:
> weizar...@gmail.com>>
> > wrote:
> >
> >     Hello everyone,
> >
> >     In Gnu Radio 3.10, how to set a variable in a C++ OOT block that can
> be adjusted
> >     dynamically by a QT GUI range?
> >     I did in a .h file:
> >        Private:
> >          float _param;
> >        Public:
> >          void set_param(float param) {_param = param;}
> >     and in the impl.cc file:
> >        _param = param;
> >
> >     anywhere else I need to change? I just tried before in Gnu Radio
> 3.7, and now I am
> >     very lost with the new version.
> >
> >     Thank you very much.
> >
> >     Regards,
> >     Wei
> >
> >
>
>
>

Reply via email to