TutorialsUsingMessageBlocksPython: Difference between revisions
(Imported from Redmine) |
No edit summary |
||
Line 9: | Line 9: | ||
Messages provide a method to pass data from the Python domain into the flow graph, or C++ domain, and vice versa. This is useful if you have a flow graph that does some heavy lifting signal processing, and have some simple Python-based post-processing. Some of the graphical sinks use this feature; the data is generated in C++ and then passed to Python which in turn runs the display code. | Messages provide a method to pass data from the Python domain into the flow graph, or C++ domain, and vice versa. This is useful if you have a flow graph that does some heavy lifting signal processing, and have some simple Python-based post-processing. Some of the graphical sinks use this feature; the data is generated in C++ and then passed to Python which in turn runs the display code. | ||
[[File: | [[File:msg-sink.png|msg-sink.png]] | ||
This figure illustrates how it works. A ''message sink'' is a sink in a flow graph sense. Any data piped into the message sink is then packed into a ''message''. This message can be fetched from outside the flow graph. Conversely, a ''message source'' may be used to inject data into a running flow graph, however it is not easily possible to specify the timing. | This figure illustrates how it works. A ''message sink'' is a sink in a flow graph sense. Any data piped into the message sink is then packed into a ''message''. This message can be fetched from outside the flow graph. Conversely, a ''message source'' may be used to inject data into a running flow graph, however it is not easily possible to specify the timing. |
Latest revision as of 14:32, 13 March 2017
Using Message Sinks and piping data to Python
Don't use vector sinks
Seriously, that's not what they were made for. Don't use them.
How to do it: message sinks and sources
Messages provide a method to pass data from the Python domain into the flow graph, or C++ domain, and vice versa. This is useful if you have a flow graph that does some heavy lifting signal processing, and have some simple Python-based post-processing. Some of the graphical sinks use this feature; the data is generated in C++ and then passed to Python which in turn runs the display code.
This figure illustrates how it works. A message sink is a sink in a flow graph sense. Any data piped into the message sink is then packed into a message. This message can be fetched from outside the flow graph. Conversely, a message source may be used to inject data into a running flow graph, however it is not easily possible to specify the timing.