I have a GRC project with multiple functionalities, but not all of them must be called at the same time. It would be a solution to divide it into several independent projects, but I'd prefer a more flexible solution which dynamically activate/deactivate some blocks in the top level flow graph.
So my idea is to enable/disable the blocks according to the value of a variable. It this possible? Or is there any alternative similar solution?
If you're using GNU Radio 3.8.0.0 or later: We've replaced the above mechanism by a simple point-to-point copy, which is way more robust (but comes at a copying overhead). So, starting with 3.8-techpreview, selector is safe to use.
Try the "Selector" block. You can set the active in/output ports with two variables.
Internally, selector is a hierarchical block, and it will pause your flowgraph, disconnect the formerly active in- and output blocks connect the now active blocks, and then continue operation of the flow graph.
In that manner, it's not sample-accurate, and might not be the tool of choice. You might want to look into message passing instead of using variables, and go for the "Multiply (with) Matrix" block.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With