David,
I may incorporate a progress bar for the current image being taken.
With the appropriate configuration of threads, you can provide feedback asynchronously on the same process interface that you use to capture the images. The feedback mechanism can be as simple as a progress bar, or more sophisticated including a text log on a console embedded within your interface. Once you have it running, we can refine it later in numerous ways.
Basically, you need two elements working cooperatively:
- A thread that controls image acquisition. This thread provides two items for communication with the main thread (the main thread is the thread from which PI has started your module):
* A progress indicator. This can be an integer running from 0 to 100.
* A way to cancel the acquisition process. This is typically implemented as a global Boolean variable.
The only precaution is that all accesses to shared global variables must be protected with Mutex objects.
- A loop that watches the acquisition thread until it finishes, or if the user clicks a Cancel button, then it sets the corresponding global Boolean variable to true and waits until the acquisition thread terminates. This loop runs in the main thread. Note that only the main thread can perform GUI operations, so this thread is also responsible for providing user feedback such as a progress bar, and for capturing click events on a Cancel button, etc.