bool TimerUnit::enableTimer(const QString & name ) { bool found = false; QMap<QString, TTimer *>::const_iterator it = mLookupTable.find( name ); while( it != mLookupTable.end() && it.key() == name ) { TTimer * pT = it.value(); if( ! pT->isOffsetTimer() ) /* ret = */ pT->setIsActive( true ); else pT->setShouldBeActive( true ); if( pT->isFolder() ) { // disable or enable all timers in the respective branch // irrespective of the user defined state. if( pT->shouldBeActive() ) { pT->enableTimer(); } else { pT->disableTimer(); } } else { if( pT->isOffsetTimer() ) { // state of offset timers is managed by the trigger engine if( pT->shouldBeActive() ) { pT->enableTimer(); } else { pT->disableTimer(); } } } ++it; found = true; } return found; }
bool TimerUnit::disableTimer( QString & name ) { bool found = false; QMap<QString, TTimer *>::const_iterator it = mLookupTable.find( name ); while( it != mLookupTable.end() && it.key() == name ) { TTimer * pT = it.value(); if( pT->isOffsetTimer() ) pT->setShouldBeActive( false ); else pT->setIsActive( false ); pT->disableTimer(); ++it; found = true; } return found; }