FutureSDR Macros
Macros to make working with FutureSDR a bit nicer.
Connect Macro
Avoid boilerplate when creating the flowgraph. This macro simplifies adding blocks to the flowgraph and connecting them.
Assume you have created a flowgraph fg and several blocks (src, shift, ...) and need to add the block to the flowgraph and connect them. Using the connect! macro, this can be done with:
connect!;
It generates the following code:
// Add all the blocks to the `Flowgraph`...
let src = fg.add_block;
let shift = fg.add_block;
let resamp1 = fg.add_block;
let demod = fg.add_block;
let resamp2 = fg.add_block;
let snk = fg.add_block;
// ... and connect the ports appropriately
fg.connect_stream?;
fg.connect_stream?;
fg.connect_stream?;
fg.connect_stream?;
fg.connect_stream?;
Connections endpoints are defined by block.port_name. Standard names (i.e.,
out/in) can be omitted.
When ports have different name than standard in and out, one can use following notation.
Stream connections are indicated as >, while message connections are indicated as |.
It is possible to add blocks that have no connections by just putting them on a line separately.
connect!;