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.htmlRespectfully, 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
|