Virtual Sinks and Sources
A flowgraph with many blocks and connections can be come difficult to analyze visually. Virtual Sinks and Virtual Sources are blocks which can be used to simplify the look of a flowgraph.
Connecting Virtual Sinks and Sources
Initially when virtual sinks and sources are added to a flowgraph they are given a white color, which represents that they do not have a data type yet. The data type will be assumed when connected to a block.
Add a Signal Source and a QT GUI Time Sink block to the flowgraph, and connect them accordingly:
Note that the previously white connections are now blue due to the complex type of the Signal Source and QT GUI Time Sink blocks. Add the following blocks and connect them:
- Noise Source
- QT GUI Freq Sink
- Virtual Sink
- Virtual Source
There are now a couple errors in the flowgraph, highlighted by the red text in the blocks. There are two Virtual Sinks and neither named, therefore GRC does not know which connection to make for the two Virtual Sources. Does the top sink go to the top source? Or does the top sink go to the bottom source? To resolve the errors, names are given to the two sinks and two sources which clarify the connections. Open the two sinks and two sources and give each one the name signalSource or noiseSource: