-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async data/event #52
Comments
Hi Xing, if I understand the question, you want to inject some sort of data from a different thread to the one the circuit is processing on - data that may come in at any time. Well, components are just regular classes right, so you can add what ever public methods you like to them. E.g. a Gain component could expose a SetGain() method that simply updates a member variable in the class - that member used to apply gain to the signal within your Process method. |
Nice! I got the point. Can I ask if you have similar examples just as you mentioned “SetGain”? |
Sure: https://github.com/cross-platform/dspatchables/blob/master/Components/Gain/Gain.cpp This is also an example of how one could use a component input for setting the gain as well. |
Thanks I read the Gain.cpp. Could you please point out the example you are referring to ? I tried hard and didn't find it. |
You can see the component has a public method "SetGain()" here: https://github.com/cross-platform/dspatchables/blob/master/Components/Gain/Gain.cpp#L64 (this is the answer to your original question) You can also see here that input 2 of the component can accept a gain value from another component (if you want that): https://github.com/cross-platform/dspatchables/blob/master/Components/Gain/Gain.cpp#L92 |
Many thanks |
Many thanks for sharing this data centric programing framework. Actually I love it very much and think it will simplifies a lot of programming effort when dealing with streaming data.
After reading the docs, I come across a question that if there are async event, such as user input, or history data based decision branch, that generating data not synced with the main data stream, what is the best way to do with the DSPatch framework?
Best regards,
Xing
The text was updated successfully, but these errors were encountered: