|
|
|

Object inspector:
The published properties and events of Prof's Threading Components can easily be set in the Object Inspector, as shown by the scheduled action component (TPCScheduledAction) shown below. |
 |
|
 |
|
Setting
up your scheduled action's events couldn't be any easier.
Skeleton code is automatically added to your source file when
you create a new event handler using the Object Inspector.
Note the OnTrigger and
OnAfterExecute events which allow pre- and
post- processing for each execution of your scheduled action.
Also note the OnProlog and
OnEpilog events which are run once when your scheduled action is created and destroyed respectively.
|
Note
the Scheme subcomponent, which you can drop onto a form as a
separate component. Clicking on the Scheme's
Schedule property opens the schedule scheme property editor, allowing you to to intuitively design a customized schedule of trigger times at which your scheduled action will be executed. |
| |
Sample applications: We have 9 sample applications illustrating a wide range of applications for the components. Here are screenshots from just a few: |
 |
Sample 3 (Run time): This example
calculates the value of Pi to a specified number of digits on
a separate thread. Feedback from the calculator thread is
displayed by a progress bar running in the main user interface
thread, using the notification mechanisms of the
TPCNotifier component. Another notifier is used to alter the calculator's performance whenever the track bar's position is changed. |
| |
 |
Sample 4 (Design time): In this
sample we create a new component, namely
TPCMemoLog, that derives from
TMemo and includes a
TPCNotifier as a subcomponent, which allows
us to asynchronously inform the user interface of the activity
or progress of the thread. TPCMemoLog
implements the OnNotify event on behalf of
the TPCNotifier, and provides an overloaded
Add method to log formatted messages to the memo, either
directly if running on the main VCL thread, or via its
TPCNotifier otherwise. |
| |
 |
Sample 7 (Run time): This sample
shows how to protect shared data from simultaneous access by
more than one thread, using the TPCMutex
component. It also uses a TPCNotifier for inter-thread notification of the cycle simulator's progress. In addition, it demonstrates how to write components that include threading components. |
| |
|
|