本文整理汇总了C++中TTimer::enableTimer方法的典型用法代码示例。如果您正苦于以下问题:C++ TTimer::enableTimer方法的具体用法?C++ TTimer::enableTimer怎么用?C++ TTimer::enableTimer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTimer
的用法示例。
在下文中一共展示了TTimer::enableTimer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enableTimer
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;
}
示例2: enableTimer
void TTimer::enableTimer( QString & name )
{
if( mName == name )
{
if( canBeUnlocked( 0 ) )
{
if( activate() )
{
mpTimer->start();
}
else
{
deactivate();
mpTimer->stop();
}
}
}
if( ! isOffsetTimer() )
{
typedef list<TTimer *>::const_iterator I;
for( I it = mpMyChildrenList->begin(); it != mpMyChildrenList->end(); it++)
{
TTimer * pChild = *it;
pChild->enableTimer( pChild->getName() );
}
}
}
示例3: reParentTimer
void TimerUnit::reParentTimer( int childID, int oldParentID, int newParentID, int parentPosition, int childPosition )
{
TTimer * pOldParent = getTimerPrivate( oldParentID );
TTimer * pNewParent = getTimerPrivate( newParentID );
TTimer * pChild = getTimerPrivate( childID );
if( ! pChild )
{
return;
}
pChild->disableTimer( childID );
if( pOldParent )
{
pOldParent->popChild( pChild );
}
if( ! pOldParent )
{
mTimerRootNodeList.remove( pChild );
}
if( pNewParent )
{
pNewParent->addChild( pChild, parentPosition, childPosition );
if( pChild ) pChild->setParent( pNewParent );
}
else
{
pChild->Tree<TTimer>::setParent( 0 );
addTimerRootNode( pChild, parentPosition, childPosition );
}
pChild->enableTimer( childID );
}
示例4: reenableAllTriggers
void TimerUnit::reenableAllTriggers()
{
for(auto it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++)
{
TTimer * pChild = *it;
pChild->enableTimer( pChild->getID() );
}
}
示例5: reenableAllTriggers
void TimerUnit::reenableAllTriggers()
{
typedef list<TTimer *>::const_iterator I;
for( I it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++)
{
TTimer * pChild = *it;
pChild->enableTimer( pChild->getID() );
}
}
示例6: readTimerGroup
void XMLimport::readTimerGroup( TTimer * pParent )
{
TTimer * pT;
if( pParent )
{
pT = new TTimer( pParent, mpHost );
}
else
{
pT = new TTimer( 0, mpHost );
}
pT->registerTimer();
pT->setShouldBeActive( ( attributes().value("isActive") == "yes" ) );
pT->mIsFolder = ( attributes().value("isFolder") == "yes" );
pT->mIsTempTimer = ( attributes().value("isTempTimer") == "yes" );
if (module)
pT->mModuleMember = true;
while( ! atEnd() )
{
readNext();
if( isEndElement() ) break;
if( isStartElement() )
{
if( name() == "name" )
{
pT->setName( readElementText() );
continue;
}
else if( name() == "packageName")
{
pT->mPackageName = readElementText();
continue;
}
else if( name() == "script")
{
QString script = readElementText();
pT->setScript( script );
continue;
}
else if( name() == "command")
{
pT->mCommand = readElementText();
continue;
}
else if( name() == "time")
{
QString timeString = readElementText();
QTime time = QTime::fromString( timeString, "hh:mm:ss.zzz" );
pT->setTime( time );
continue;
}
else if( name() == "TimerGroup" )
{
readTimerGroup( pT );
}
else if( name() == "Timer" )
{
readTimerGroup( pT );
}
else
{
readUnknownTimerElement();
}
}
}
if( ( ! pT->isOffsetTimer() ) && ( pT->shouldBeActive() ) )
pT->enableTimer( pT->getID() );
else
pT->disableTimer( pT->getID() );
}
示例7: execute
void TTimer::execute()
{
if( ! isActive() || mIsFolder )
{
mpTimer->stop();
return;
}
if( mudlet::debugMode ) {TDebug(QColor(Qt::darkYellow),QColor(Qt::darkBlue)) << "\n[TIMER EXECUTES]: "<<mName<<" fired. Executing command="<<mCommand<<" and executing script:"<<mScript<<"\n" >> 0;}
if( mIsTempTimer )
{
if( mScript == "" )
{
mpHost->mLuaInterpreter.call_luafunction( this );
}
else
{
mpHost->mLuaInterpreter.compileAndExecuteScript( mScript );
}
mpTimer->stop();
mpHost->mTimerUnit.markCleanup( this );
return;
}
if( ( ! isFolder() && hasChildren() ) || ( isOffsetTimer() ) )
{
typedef list<TTimer *>::const_iterator I;
for( I it = mpMyChildrenList->begin(); it != mpMyChildrenList->end(); it++)
{
TTimer * pChild = *it;
if( pChild->isOffsetTimer() )
{
pChild->enableTimer( pChild->getID() );
}
}
if( isOffsetTimer() )
{
disableTimer( mID );
deactivate();
}
}
if( mCommand.size() > 0 )
{
mpHost->send( mCommand );
}
if( mScript.size() > 0 )
{
if( mNeedsToBeCompiled )
{
if( ! compileScript() )
{
disableTimer();
return;
}
}
if( ! mpHost->mLuaInterpreter.call( mFuncName, mName ) )
{
mpTimer->stop();
}
}
}