I am trying to create a busy status indicator for a communication
process. When data is incoming, events occur at least every 1.3
seconds. Events can occur at intervals shorter than 1.3 seconds, if
the messages are short. 

I want to set a busy status on the incoming data event, and then have
a TTimer turn the busy status off again if 1.4 seconds elapses without
any incoming data events. (It is OK if it remains busy a bit longer
than the actual duration)

I tried creating SetBusy and ClearBusy procedures like this:

procedure TForm1.SetBusyIndicator;
begin

  Timer1.enabled := True;
  BusyPanel.color := clRed;

end;

procedure TForm1.ClearBusyIndicator(Sender: TObject);
begin

  Timer1.enabled := False;
  BusyPanel.color := clBtnFace;

end;

SetBusyIndicator is called by the incoming event handler.
ClearBusyIndicator is the OnTimer event for Timer1.

When the input is busy for 5 events (about 6.5 seconds) the busy
indicator goes on and off with alternating events, rather than staying
continually set for 7.8 seconds as expected.

I have been unable to find a good explanation for how TTimers work.
>From reading the TTimer source in ExtCtrls, I thought that enabling
the timer resets the count and restarts the timer. 

I want the SetBusy procedure to restart the timer, so the busy status
will remain set for 1.4 seconds after the last SetBusy event. 

Does anyone know how this could be accomplished? 

Thanks,

Tim.





------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hoq5s85/M=362131.6882499.7825260.1510227/D=groups/S=1705115362:TM/Y=YAHOO/EXP=1123708059/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to