I'm Italian and I help my brother for graduation ..
this is my first post .. sorry for my English!
I'm doing a program that controls a carriage with stepper motors ..
over carriage is an ultrasound probe that acquires data ..
ok everything works just talking to the I/O ports and synchronizing data (with several "sleep") crashes the GUI ..
Then I thought of a "thread" but I put everything in one "thread"? ..
Or only the elements that affect the interaction with the outside world (and thus block the GUI)?!
I would like to highlight the progress of the process (as a rendering in a 3D program) I would like to use a ProgressBar as well as black pixels already processed
Since the threads do not interact with the VCL .. What should I do?
Synchronize the thread with the VCL, or by separate thread?! And how to stop everything if I want to cancel the job?!
Here's my process (very macro) ..
The cycle goes through each pixel of the image (the image is a map of pressure that is a 256-color image obtained from another program and another process) ..
- 1. Read the image pixels
2. Find the color in the DB to find the correct angle of cutting
3. Position the probe (another long process and if I use a thread I have to go to the angke just found this thread)
4. wait "X" seconds before reading (pitching vibration) ..
5. active reading
6. wait "X" seconds
7. Turn OFF reading (get the value)
8. Black the pixel on trial and take forward the process bar ..
I do not care the detail, but a process to figure out which way to go ..
Thank you very much ..