本文整理汇总了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;
}
示例2: IsFinished
bool SetShooterAngle::IsFinished()
{
if(IsTimedOut())
return true;
else
return Robot::shooterrotation->OnTarget();
}
示例3: getCurrentMillis
bool AngelChange::IsFinished() {
#if ASYNC_BRAKE
return brakeEngagedTime> 0 && brakeEngagedTime + 100 < getCurrentMillis();
#else
return stability>13 || IsTimedOut();
#endif
}
示例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
}
示例5: CheckTimeout
bool ExecHolder::CheckTimeout() {
if(IsTimedOut()){
timing=false;
return true;
}
return false;
}
示例6: IsFinished
bool Shoot::IsFinished()
{
if(IsTimedOut())
return true;
else
return solenoid->Get() == (push ? DoubleSolenoid::kForward : DoubleSolenoid::kReverse);
}
示例7: IsTimedOut
bool FindPosition::IsFinished() {
double range = beaglebone->goalRange;
return IsTimedOut() || range == 99.0 ||
(range > MIN_FIRE_RANGE && range < MAX_FIRE_RANGE);
}
示例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;
}
示例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;
}
示例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;
}
示例11: IsFinished
bool SetShooter::IsFinished()
{
if(IsTimedOut())
return true;
else
return false;
}
示例12: IsFinished
bool Turn::IsFinished() {
if(IsTimedOut()){
std::cout << "Turn Error: Timeout expired"<<std::endl;
return true;
}
return pid.OnTarget();
}
示例13: IsFinished
bool CompressorEnabled::IsFinished() {
if(IsTimedOut()) {
return true;
} else {
return false;
}
}
示例14: IsTimedOut
bool ActuateCanStabilizer::IsFinished() {
if (timeout == -1) {
return true;
} else {
return IsTimedOut();
}
}
示例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
}