![]() | ![]() | ![]() | Arranging for periodic actions | ![]() |
The Readout software maintains a set of periodic actions that are scheduled when a run is Active. You can add periodic actions of your own to this list. The approximate scheduling resolution of the list is 100ms.
To add a periodic action you must:
The following example, assumes that you have created a Run variable called "temperature" that is intended to hold the temperature of a detector, to be logged during a run. We will assume that:
The example below shows a sample definnitions of the timed event class you might write:
... class CUpdateTemp : public CTimedEvent { private: CRunVariable* m_pTemp; public: CUpdateTemp(unsigned int nms, CRunVariable* pTemp) : CTimedEvent(nms), m_pTemp(pTemp) {} virtual void operator()(); }; ... void CUpdateTemp::operator()() { m_pTemp->Set(getTemperature(), TCL_GLOBAL_ONLY); } ...
You can instantiate and register this timer to update e.g. once a second SetupReadout with the code fragment shown below:
... getClock().EstablishEvent(*(new CTimedEvent(1000, m_pTemperature))); ...
![]() | ![]() | ![]() | Arranging for periodic actions | ![]() |