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


C++ IsTimedOut函数代码示例

本文整理汇总了C++中IsTimedOut函数的典型用法代码示例。如果您正苦于以下问题:C++ IsTimedOut函数的具体用法?C++ IsTimedOut怎么用?C++ IsTimedOut使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: ASSERT

RageFileBasic *ThreadedFileWorker::Copy( RageFileBasic *&pFile, CString &sError )
{
	ASSERT( m_pChildDriver != NULL ); /* how did you get a file to begin with? */

	/* If we're currently in a timed-out state, fail. */
	if( IsTimedOut() )
	{
		this->Close( pFile );
		pFile = NULL;
	}

	if( pFile == NULL )
	{
		sError = "Operation timed out";
		return NULL;
	}

	m_pRequestFile = pFile;
	if( !DoRequest(REQ_COPY) )
	{
		/* If we time out, we can no longer access pFile. */
		sError = "Operation timed out";
		pFile = NULL;
		return NULL;
	}

	RageFileBasic *pRet = m_pResultFile;
	m_pRequestFile = NULL;
	m_pResultFile = NULL;

	return pRet;
}
开发者ID:BitMax,项目名称:openitg,代码行数:32,代码来源:RageFileDriverTimeout.cpp

示例2: IsFinished

bool SetShooterAngle::IsFinished()
{
	if(IsTimedOut())
		return true;
	else
		return Robot::shooterrotation->OnTarget();
}
开发者ID:Chantilly612Code,项目名称:612-2016,代码行数:7,代码来源:SetShooterAngle.cpp

示例3: getCurrentMillis

bool AngelChange::IsFinished() {
#if ASYNC_BRAKE
	return brakeEngagedTime> 0 && brakeEngagedTime + 100 < getCurrentMillis();
#else
	return stability>13 || IsTimedOut();
#endif
}
开发者ID:GitHubGuy119,项目名称:2014AerialAssist,代码行数:7,代码来源:AngelChange.cpp

示例4: Execute

void AngelChange::Execute() {
	pterodactyl->setOutputRange();
	// Let the PID run.

	if (pterodactyl->isPIDFinished(true) || (target <= 0
			&& pterodactyl->getAngle() <= 0.25)) {
		stability++;
	} else {
		stability = 0;
	}
	if (tmpTarget == 45 && target < 45 && shooter->isReallyDrawnBack()) {
		tmpTarget = target;
		pterodactyl->setTarget(tmpTarget+(tmpTarget>0 ? 0.5 : 0));
	}
#if ASYNC_BRAKE
	if ((stability> 13 && (tmpTarget != 45)) || IsTimedOut()) {
		if (brakeEngagedTime <= 0) {
			brakeEngagedTime = getCurrentMillis();
		}
		if (target> 0) {
			pterodactyl->setBrakeState(Pterodactyl::kActive);
		}
	}
#endif
}
开发者ID:GitHubGuy119,项目名称:2014AerialAssist,代码行数:25,代码来源:AngelChange.cpp

示例5: CheckTimeout

bool ExecHolder::CheckTimeout() {
	if(IsTimedOut()){
		timing=false;
		return true;
	}
	return false;
}
开发者ID:FRCTeam159,项目名称:2016-Robot-Code,代码行数:7,代码来源:ExecHolder.cpp

示例6: IsFinished

bool Shoot::IsFinished()
{
	if(IsTimedOut())
		return true;
	else
		return solenoid->Get() == (push ? DoubleSolenoid::kForward : DoubleSolenoid::kReverse);
}
开发者ID:Chantilly612Code,项目名称:612-2016,代码行数:7,代码来源:Shoot.cpp

示例7: IsTimedOut

bool FindPosition::IsFinished() {

    double range = beaglebone->goalRange;

    return IsTimedOut() || range == 99.0 ||
           (range > MIN_FIRE_RANGE && range < MAX_FIRE_RANGE);
}
开发者ID:james-ward,项目名称:aerial-assist,代码行数:7,代码来源:FindPosition.cpp

示例8: TimeoutEnabled

bool ThreadedFileWorker::FlushDirCache( const CString &sPath )
{
	/* FlushDirCache() is often called globally, on all drivers, which means it's called with
	 * no timeout.  Temporarily enable a timeout if needed. */
	bool bTimeoutEnabled = TimeoutEnabled();
	if( !bTimeoutEnabled )
		SetTimeout(1);

	if( m_pChildDriver == NULL )
		return false;

	/* If we're currently in a timed-out state, fail. */
	if( IsTimedOut() )
		return false;

	m_sRequestPath = sPath;

	/* Kick off the worker thread, and wait for it to finish. */
	if( !DoRequest(REQ_FLUSH_DIR_CACHE) )
	{
		if( !bTimeoutEnabled )
			SetTimeout(-1);

		LOG->Trace( "FlushDirCache(%s) timed out", sPath.c_str() );
		return false;
	}

	if( !bTimeoutEnabled )
		SetTimeout(-1);

	return true;
}
开发者ID:BitMax,项目名称:openitg,代码行数:32,代码来源:RageFileDriverTimeout.cpp

示例9: IsFinished

bool CollectPreset::IsFinished() {
  if(!IsTimedOut()) {
    return false;
  }
  //If the arm gets within 0.2 volts of the target call it done
  return abs(Ford::mainArm->GetSetpoint()-Ford::mainArm->GetPosition()) < 0.2;
}
开发者ID:team2059,项目名称:Ford-cpp,代码行数:7,代码来源:CollectPreset.cpp

示例10:

RageFileBasic *ThreadedFileWorker::Open( const CString &sPath, int iMode, int &iErr )
{
	if( m_pChildDriver == NULL )
	{
		iErr = ENODEV;
		return NULL;
	}

	/* If we're currently in a timed-out state, fail. */
	if( IsTimedOut() )
	{
		iErr = EFAULT; /* Win32 has no ETIMEDOUT */
		return NULL;
	}

	m_sRequestPath = sPath;
	m_iRequestMode = iMode;

	if( !DoRequest(REQ_OPEN) )
	{
		LOG->Trace( "Open(%s) timed out", sPath.c_str() );
		iErr = EFAULT; /* Win32 has no ETIMEDOUT */
		return NULL;
	}

	iErr = m_iResultRequest;
	RageFileBasic *pRet = m_pResultFile;
	m_pResultFile = NULL;

	return pRet;
}
开发者ID:BitMax,项目名称:openitg,代码行数:31,代码来源:RageFileDriverTimeout.cpp

示例11: IsFinished

bool SetShooter::IsFinished()
{
	if(IsTimedOut())
		return true;
	else
		return false;
}
开发者ID:Chantilly612Code,项目名称:612-2016,代码行数:7,代码来源:SetShooter.cpp

示例12: IsFinished

bool Turn::IsFinished() {
	if(IsTimedOut()){
		std::cout << "Turn Error:  Timeout expired"<<std::endl;
		return true;
	}
	return pid.OnTarget();
}
开发者ID:FRCTeam159,项目名称:MentorRepository,代码行数:7,代码来源:Turn.cpp

示例13: IsFinished

bool CompressorEnabled::IsFinished() {
  if(IsTimedOut()) {
    return true;
  } else {
    return false;
  }
}
开发者ID:team2059,项目名称:Ford-cpp,代码行数:7,代码来源:CompressorEnabled.cpp

示例14: IsTimedOut

bool ActuateCanStabilizer::IsFinished() {
    if (timeout == -1) {
        return true;
    } else {
        return IsTimedOut();
    }
}
开发者ID:RossBajocich,项目名称:2015RecycleRush,代码行数:7,代码来源:ActuateCanStabilizer.cpp

示例15: IsTimedOut

// Make this return true when this Command no longer needs to run execute()
bool AutonomousDriveCommand::IsFinished() {
	bool isInRange = ( useRangeFinder ? Robot::robotRangeFinder->IdealAutonomousRange() : false);
	bool isTimeout = IsTimedOut();
	printf("isInRange = %s, isTimeout = %s, range: %d, matchTime: %f\n", isInRange ? "true" : "false",
			isTimeout ? "true" : "false", Robot::robotRangeFinder->GetDistance(), Timer::GetFPGATimestamp());
	return isInRange || isTimeout;
	//return isTimeout; use if robot has no rangefinder
}
开发者ID:FRCTeam1073-TheForceTeam,项目名称:robot14,代码行数:9,代码来源:AutonomousDriveCommand.cpp


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