Here is an example (from the QA code) of using history from a Python block.

https://github.com/gnuradio/gnuradio/blob/5953d3c96b42086c5f8c5f97b6fd7e57717f9aa5/gr-blocks/python/blocks/qa_block_gateway.py#L60

See if your code appears to be doing the same thing.

On Thu, Sep 21, 2023 at 11:03 AM <kron...@tiscali.it> wrote:

> Hello List!
> I'm trying to implement a sync block into a OOT module that use previous
> samples of the input streams.
> So, I'm using the method set_history in the constructor.
> The problem is that when I use self.set_history(N) I obtain the following
> errors:
>
> Generating:
> '/home/userr/workspace/gnuradio-oot/gr-customModule/examples/untitled.py'
>
> Executing: /usr/bin/python3 -u
> /home/user/workspace/gnuradio-oot/gr-customModule/examples/untitled.py
>
> QSocketNotifier: Can only be used with threads started with QThread
> Traceback (most recent call last):
>   File
> "/home/user/workspace/gnuradio-oot/gr-customModule/examples/untitled.py",
> line 291, in <module>
>     main()
>   File
> "/home/user/workspace/gnuradio-oot/gr-customModule/examples/untitled.py",
> line 269, in main
>     tb = top_block_cls()
>          ^^^^^^^^^^^^^^^
>   File
> "/home/user/workspace/gnuradio-oot/gr-customModule/examples/untitled.py",
> line 179, in __init__
>     self.customModule_testBlock_0_0 = customModule.testBlock(1, max_lag,
> lags, alpha, win_len, 1, False)
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File
> "/usr/local/lib/python3.11/dist-packages/gnuradio/customModule/testBlock.py",
> line 33, in __init__
>     self.set_history(self.max_pos_lag-self.min_neg_lag+1)
>     ^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3/dist-packages/gnuradio/gr/gateway.py", line 129,
> in __getattr__
>     if not hasattr(self, "gateway"):
>            ^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3/dist-packages/gnuradio/gr/gateway.py", line 129,
> in __getattr__
>     if not hasattr(self, "gateway"):
>            ^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3/dist-packages/gnuradio/gr/gateway.py", line 129,
> in __getattr__
>     if not hasattr(self, "gateway"):
>            ^^^^^^^^^^^^^^^^^^^^^^^^
>   [Previous line repeated 984 more times]
> RecursionError: maximum recursion depth exceeded
>
> >>> Done (return code 1)
>
> I'm using GNU Radio 3.10.5.1 (Python 3.11.2) on Debian 12.
> What is going on?
> Thanks in advance!
> Ivan
>
>

Reply via email to