[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Disable some paths of the flowgraph without stopp
From: |
Stefan Oltmanns |
Subject: |
Re: [Discuss-gnuradio] Disable some paths of the flowgraph without stopping (C++) |
Date: |
Sun, 5 Nov 2017 19:35:18 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
Hello Blake,
can you explain what the advantage of using a hier block is? At the
moment I cannot see any advantage if I use this kind of block
combination only once.
I'm sorry, but I don't understand how a null sink alone helps me. If I
disconnect the path I've got an unconnected input, no unconnected output.
What I think could work is a real null source (IMHO the null source in
GNU Radio is a zero source) that is connected to a null sink, which by
itself is pretty useless, but then I could switch the block from the
real source to the null source whether it should be en- or disabled.
Am I thinking wrong? Any better idea?
Best regards
Stefan
Am 05.11.2017 um 18:40 schrieb Brashendeavours:
> Stefan,
>
> Consider wrapping the blocks you want to switch in/out in a hier block.
> Use the setter functions of the hier block parameters to:
> 1. lock the flow graph
> 2. swap in/out the null sink(s) [1]
> 3. unlock the flowgraph
>
> [1] https://gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1null__sink.html
>
> Respectfully,
> Blake
>
>
>
> Sent from my iPhone
>> On Nov 4, 2017, at 7:13 PM, Stefan Oltmanns <address@hidden> wrote:
>>
>> Hello,
>>
>> I've got a flowgraph with one source that will end in several sinks. Not
>> all paths of the flowgraph are needed all the time and I would like to
>> enable/disable a path without stopping the flowgraph to reduce processor
>> load.
>> When I leave a path unconnected by default the application will crash.
>> I've seen there is a (deprecated) Valve block implemented in Python, but
>> I'm all C++.
>>
>> Is there a solution in C++?
>> If there is not, I could probably write a custom block that could either
>> just return 0 from work function or copy all data from input to output,
>> but I don't like the idea of copying the data, is there a way to just
>> handover the pointer?
>>
>> Best regards
>> Stefan
>>
>>
>