You are here: Symbol Reference > AbFlashT Namespace > Classes > TAbFlashTimer Class
ContentsIndexHome
PreviousUpNext
TAbFlashTimer Class
public   protected   published   TAbFlashTimer Members   Send Feedback
File
Pascal
TAbFlashTimer = class(TAbFlash);
C++
class TAbFlashTimer : public TAbFlash;
Description

TAmFlashTimer is a threaded Timer to supply all our component's with a common 

time/pulses. The timer-thread will be created when the first component need the timer 

function. The timer will be destroyed when application terminates. 

 

Timer Basic-cycle:

16ms 

 

 

Max deviation:

~ 8ms in sum since Start (the timer counts the interval-error and may correct 

the next pulse time) 

 

Allowed Interval times:

>32ms or one of the Interval-Constants for synchronous time-events. 

Interval constants: Freq8Hz, Freq4Hz, Freq2Hz, Freq1Hz, Freq05Hz and SyncOneSec 

 

 

 

 

Use of our timer for your own controls / applications:

In general there are two way's to implement our timer in your code: 

 

For Controls:
  • Add a method to handle "WM_FLASH" events
  • Call method "AddControl(Control: TControl; Interval: Cardinal);" to start
  • Call method "DelControl(Control: TControl);" to stop timer events for this control.

 

If the timer event occurs for this control the timer will send a "WM_FLASH" message to the control. This message is send directly to the component (not via windows message queue). To change the interval time you only have to call "AddControl()" again with the new interval. A Control can only use one Frequency at once. 

 

For Methods:

 

If the timer event occurs for this method the timer will call directly your method. You can add several methods and call them individually. 

 

Common for both:

Interval: interval time in ms or synchronous pulses if a Freq-constants is used 

Wpar : no of times the "Timer-Basic-cycle" is called since Timer-Start. 

Lpar : if one of the Frequency constants is used for "Interval" then Lpar toggles between 0 and not 0 each time the event occurs otherwise it's "0" 

 

Interval Times

e.g:

  • if you start with an interval of 1000ms then the first timer event occurs 1000 ms after start
  • if you start with an interval of "Freq1Hz" then the timer events occur if the Frequency bit

has changed. If you add several components/methods with the same interval-constant then they will be called synchronous.

Hierarchy
_AbFlash.TAbFlash
AbFlashT.TAbFlashTimer
Related Information
Hard-& Software A.Baecker
What do you think about this topic? Send feedback!