I would like to monitor a simulation process from a commercial software package. The commercial software offers C API interface that has an initialization callback function for a process along with a callback function that is executed at each step in the simulation process. At each step I would like to monitor/plot approximately 10 float values that are available in the callback function. I plan to use a plotting tool such as LightningChart, http://www.arction.com/, to monitor and view the values. I will use a C++/CLI wrapper to call the .NET charting library during each step in the process to update the chart.
I have already created a simple dll utilizing the API callback functions to output the values to a text file in which I would perform plotting and analysis after completion. Although my goal is to see the data real-time.
My question is, how can I call a form in the simulation process initialization callback that stays persistent throughout the process and I can update at each step. Also, what would be the ideal data structure to store the process parameter values that would also be persistent? When using C++ to write the data values to a text file with the callback functions the speed on my i7 processor is approximately 1700 steps per second. Without using the API and the callback functions to store data the simulation speed is approximately 4000 steps per second. I would obviously expect this to be dramatically slower when charting the real time data and that is acceptable. Any thoughts?
As you intent to chart real time data, I would suggest you to use Memory Mapped Files for sharing data between the simulation process and the callback function. This would be faster than performing I/O operations on a physical file and you would be able to share data.
In the initialization function you can create the Form and update the values on it from the callback using a memory mapped file. Here are some links on Memory Mapped Files link1
link2