[Fwd: again TTimers, TApplication proces control]

Rutger van der Eijk (r36@nikhef.nl)
Wed, 06 May 1998 10:53:36 +0200


This is a multi-part message in MIME format.
--------------16117A7B7E9B8B30443B7464
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

For some reason this messages was not posted last week...

--------------16117A7B7E9B8B30443B7464
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Message-ID: <35473C8F.290D7535@nikhef.nl>
Date: Wed, 29 Apr 1998 16:43:27 +0200
From: Rutger van der Eijk <r36@nikhef.nl>
Reply-To: r36@nikhef.nl
Organization: NIKHEF
X-Mailer: Mozilla 4.04 [en] (WinNT; I)
MIME-Version: 1.0
Newsgroups: cern.root
CC: Andrej.Filipcic@ijs.si
Subject: again TTimers, TApplication proces control
References: <3545E86E.4A5B@mail.cern.ch>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

This is a message in reply/continueation to the messages from Andrej
Filipcic from 27/3/98 with subject "TApplication & process control".

I am also programming for a online monitoring system. I will have
something like a event loop (to take data and monitor etc.) and in the
meanwhile I want to be able to press buttons etc.
From the above mentioned message I leared that using TTimers is a
good solution to tackle this problem. I experience some problems when
using this technique. The are probably related to my lake of knowledge
about the use of timers.

Questions:

1) What is the difference between a synchronous and an asynchronous
timer?
2) What should I specify as return statement for the Notify
functionmember (of my own sub-classed timer object (i.e. OTGTimer)) When
do I use kTRUE and when kFALSE?
3) In the above example (in message) the timer is used to handle GUI
input. What happens, if during 'handeling' the GUI input, the timer
times out again (and optionally new GUI input is present)?

My problems:

I define a (async) timer class like in the above example. In my main
program I define my own MainFrame class alike the guitest test example.
Inside this mainframe I somewhere start a datataking loop by pressing a
'start' button. By using my timer class I want pressing the stop button
to eventually stop the event loop (this is done by setting some variable
(fEndLoop) on which is checked by the event loop) In case I add the
timer inside the main program before starting the TApplication
everything works fine. But when I add the timer just before I enter the
event loop the timers Notify() is never called. Should I somehow
activate the timer?

I would appriciate any examples from people who also used timers to
tackle similiar problems.

Rutger van der Eijk

--------------16117A7B7E9B8B30443B7464--