• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IsTimedOut函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: IsFinished

// Make this return true when this Command no longer needs to run execute()
bool ExtendSFM::IsFinished()
{
	if(IsTimedOut()){ //time out
		return true;
	}else{
		return false;
	}
}
开发者ID:RaiderRobotics,项目名称:FRC2016,代码行数:9,代码来源:ExtendSFM.cpp


示例17: IsFinished

bool DriveStraight::IsFinished() {
	if(IsTimedOut()){
		std::cout << "DriveStraight Error:  Timeout expired"<<std::endl;
		return true;
	}
	at_heading=Acntrl.AtTarget();
	at_position=Dcntrl.AtTarget();
	return(at_position && at_heading);
}
开发者ID:FRCTeam159,项目名称:MentorRepository,代码行数:9,代码来源:DriveStraight.cpp


示例18: IsFinished

bool TensionToGivenValueCommand::IsFinished()
{
	if (IsTimedOut())
		return true;
	float deltaTension = fabs(currentTension - tensionValue); 
	if(deltaTension < 2 && deltaTension > -2)
		return true;
	return false;
}
开发者ID:Nashoba-Robotics,项目名称:Nashoba-Robotics2012,代码行数:9,代码来源:TensionToGivenValueCommand.cpp


示例19: IsFinished

bool DriveUntilRange::IsFinished()
{
	if (IsTimedOut()){
		return true;
	}
	if (direction > 0){
		return rangefinder->rangefinder_bottom->GetRangeInches() < range;
	}
	return rangefinder->rangefinder_bottom->GetRangeInches() > range;
}
开发者ID:FRC1740,项目名称:2016_Base,代码行数:10,代码来源:DriveUntilRange.cpp


示例20: IsTimedOut

bool Turn::IsFinished()
{
	if(drive_ == nullptr)
		return true;

	if(type_ == FOREVER)
		return false;

	return IsTimedOut() || (fabs(drive_->GetLeftRevs()) > fabs(length_));
}
开发者ID:FRC-3637-Daleks,项目名称:Asimov,代码行数:10,代码来源:Turn.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IsTimerFinished函数代码示例发布时间:2022-05-30
下一篇:
C++ IsTileType函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap