Re: Problem with adjusting value during runtime in my OOT block

2022-03-14 Thread Josh Morman
Those files look good to me - I'm wondering how the python bindings look.
Can you share the file python/bindings/adding_ff_python.cc ?

On Sun, Mar 13, 2022 at 8:04 PM Nikoloz Glonti  wrote:

> Thanks for Your response! I'm using gnuradio 3.9.4.0
>
> void set_constant0(int constant0); is inside of my block header -
> "adding_ff_impl.h". then I made "gr_modtool bind adding_ff" before I asked.
> I also installed pygccxml, but it didn't helped - doing gr_modtool bind
> adding_ff takes  longer time than before.
>
> Do You have any other suggestions?
>
> adding_ff_impl.cc looks like https://pastebin.com/JUnxQtYi
>
> and adding_ff_impl.h looks like https://pastebin.com/MF93s9WD
>
> Niko
> On 3/13/22 21:32, Josh Morman wrote:
>
> This sounds like it could be an issue with the python bindings
>
> 1) did you run “gr_modtool bind” after adding the callback to your block
> header
> 2) is pygccxml installed?  Without it the binding using modtool can only
> do the basic block things
>
> Josh
>
> On Sun, Mar 13, 2022 at 4:09 PM Nikoloz Glonti  wrote:
>
>> Dear Gnuradio community,
>>
>> I wrote my block in OOT module. It has function set_constant0(int
>> constant0) which should change value on the go.
>> I also added callback to grc yaml file. But when I run my flowgraph, I'm
>> having this error "AttributeError: 'SiNK.SiNK_python.adding_ff' object
>> has no attribute 'set_constant0'" .
>>
>> How can i fix it?
>>
>> Niko
>>
>


Re: Problem with adjusting value during runtime in my OOT block

2022-03-14 Thread Nikoloz Glonti

adding_ff_python.cc looks like that - https://pastebin.com/nmpshmvj


On 3/14/22 11:26, Josh Morman wrote:
Those files look good to me - I'm wondering how the python bindings 
look.  Can you share the file python/bindings/adding_ff_python.cc ? 




Re: Problem with adjusting value during runtime in my OOT block

2022-03-14 Thread Josh Morman
Yes, that is the problem - not sure why modtool bind is not doing the
trick.  You can manually add the method if you want, which would just look
like:

.def(py::init(&adding_ff::make),
py::arg("constant0"),
D(adding_ff,make)
)
.def("set_constant0", &adding_ff::set_constant0)
;

The only thing then to be careful of is if you run modtool bind again, it
would blow away your changes

It may be worth trying to figure out why modtool bind is not doing the full
set of methods that pygccxml would find, such as trying a new oot from
scratch and see if the same problem exists, now that pygccxml is installed


On Mon, Mar 14, 2022 at 7:53 AM Nikoloz Glonti  wrote:

> adding_ff_python.cc looks like that - https://pastebin.com/nmpshmvj
>
>
> On 3/14/22 11:26, Josh Morman wrote:
> > Those files look good to me - I'm wondering how the python bindings
> > look.  Can you share the file python/bindings/adding_ff_python.cc ?
>


Python problem..

2022-03-14 Thread tech k1ng
Hi there,

This is my first mailing post, so please excuse me if there are any errors.

I'm trying to make a block that gives me the bins with corresponding its
energy ([bins, energy]) when over a thresh, so input vector is from "log
power fft" block. With the output, I'm hoping to store it as a file for
further use, or perhaps use it to visualize it. Marcus Müller has already
proposed something similar while describing a technique to another person:
here



The python code is shown here: The output does not seem to represent it
properly. I'm lost right now, and I'm not sure how to proceed. I've
attempted to troubleshoot it and experiment with other things before coming
here to ask for help.

Thank you; I'm hoping that someone can check into this and give me some
advice on what I can do.

Best Regards,
David


Re: Python problem..

2022-03-14 Thread tech k1ng
Hello again.

Here is the python code: https://pastebin.com/waUMgRSD

I patiently await your response. By the way, this is my first time using a
mailing list:)

Regards,
David.



tir. 15. mar. 2022 kl. 00:15 skrev tech k1ng :

> Hi there,
>
> This is my first mailing post, so please excuse me if there are any errors.
>
> I'm trying to make a block that gives me the bins with corresponding its
> energy ([bins, energy]) when over a thresh, so input vector is from "log
> power fft" block. With the output, I'm hoping to store it as a file for
> further use, or perhaps use it to visualize it. Marcus Müller has already
> proposed something similar while describing a technique to another person:
> here
> 
>
>
> The python code is shown here: The output does not seem to represent it
> properly. I'm lost right now, and I'm not sure how to proceed. I've
> attempted to troubleshoot it and experiment with other things before coming
> here to ask for help.
>
> Thank you; I'm hoping that someone can check into this and give me some
> advice on what I can do.
>
> Best Regards,
> David
>
>
>
>
>