07-19-2012 01:18 PM
Hi,
I have a command button, which starts a long calculation process (signal computation, several graph updates, etc.). During the process everything is block in the GUI. Now I would like to add another button (or additional feature to the same button) to stop the running calcutation/visualization progress...
How can I manage that?
Cheers
07-19-2012 02:48 PM
07-20-2012 03:25 AM
Its wanted that the processing takes so much time...
The only thing I would like to add is a kind of interrupt feature:
Button X has two functionalities:
- starting thread 1 with multiple calculations and visualizations
- if thread 1 is running, interrupting this thread again
07-20-2012 04:11 AM - edited 07-20-2012 04:20 AM
I did not suggest to shorten the processing time, only the callback
So the suggestion would be to have your button callback as follows:
if ( event == EVENT_COMMIT )
{
status != status;
if ( status )
{
// start thread
}
else
{
// stop thread
}
}
This way your main (GUI) thread can react on user events, see also SetSleepPolicy and the multithreading examples provided by CVI.
I think that you actually do not even need to start and stop the thread in the callback, if your visualization thread (launched ahead) checks the status variable
07-20-2012 10:08 AM
Hi HansiWWW,
I think what you're looking for is ProcessSystemEvents.
Cheers,
07-24-2012 08:19 AM
I did it like Wolfgang and KyleP said... It works fine... Thanks guys...
08-20-2012 02:27 AM
...if your question got resolved, you could mark the answer as the solution... When searching the forum solved threads are better than threads that are still open