当前位置: 首页>>代码示例>>C++>>正文


C++ TTimer::getID方法代码示例

本文整理汇总了C++中TTimer::getID方法的典型用法代码示例。如果您正苦于以下问题:C++ TTimer::getID方法的具体用法?C++ TTimer::getID怎么用?C++ TTimer::getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TTimer的用法示例。


在下文中一共展示了TTimer::getID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: enableTimer

void TTimer::enableTimer( qint64 id )
{

    if( mID == id )
    {
        if( canBeUnlocked( 0 ) )
        {
            if( activate() )
            {
                if( mScript.size() > 0 )
                {
                    mpTimer->start();
                }
            }
            else
            {
                deactivate();
                mpTimer->stop();
            }
        }
    }

    if( mIsFolder )
    {
        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() );
            }
        }
    }
}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例2: reenableAllTriggers

void TimerUnit::reenableAllTriggers()
{
    for(auto it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++)
    {
        TTimer * pChild = *it;
        pChild->enableTimer( pChild->getID() );
    }
}
开发者ID:EldFitheach,项目名称:Mudlet,代码行数:8,代码来源:TimerUnit.cpp

示例3: 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() );
    }
}
开发者ID:olostan,项目名称:Mudlet-vadi2,代码行数:9,代码来源:TimerUnit.cpp

示例4: disableTimer

void TTimer::disableTimer( qint64 id )
{
    if( mID == id )
    {
        deactivate();
        mpTimer->stop();
    }

    typedef list<TTimer *>::const_iterator I;
    for( I it = mpMyChildrenList->begin(); it != mpMyChildrenList->end(); it++)
    {
        TTimer * pChild = *it;
        if( ! pChild->isOffsetTimer() && pChild->shouldBeActive() )
        {
            pChild->disableTimer( pChild->getID() );
        }
    }
}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例5: 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() );

}
开发者ID:vadi2,项目名称:Mudlet-Ubuntu-PPA,代码行数:74,代码来源:XMLimport.cpp

示例6: 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();
        }
    }
}
开发者ID:,项目名称:,代码行数:64,代码来源:


注:本文中的TTimer::getID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。