本文整理汇总了C++中TIMER::ExpiredSeconds方法的典型用法代码示例。如果您正苦于以下问题:C++ TIMER::ExpiredSeconds方法的具体用法?C++ TIMER::ExpiredSeconds怎么用?C++ TIMER::ExpiredSeconds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIMER
的用法示例。
在下文中一共展示了TIMER::ExpiredSeconds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StateProcess
void StateProcess(void)
{
double d;
// Check that robot is in a safe state.
if (!ROBOT_Safe(ROBOT_ID))
{
printf("Robot not safe.\n");
ProgramExit();
}
// Special processing while a trial is running.
if (TrialRunning)
{
if (!RobotActive())
{
// If robot is not active, abort current trial.
ErrorRobotInactive();
TrialAbort();
MissTrial();
}
else
if (FrameData.Full())
{
// Abort current trail if frame data is full.
ErrorFrameDataFull();
TrialAbort();
MissTrial();
}
}
// Some states are processing in the LoopTask.
if (StateLoopTask[State])
{
return;
}
// State processing.
switch (State)
{
case STATE_INITIALIZE:
// Initialization state.
if (TargetTestFlag)
{
break;
}
ExperimentTimer.Reset();
StateNext(STATE_SETUP);
break;
case STATE_SETUP:
// Setup details of next trial, but only when robot stationary and active.
if (RobotNotMoving() && RobotActive())
{
printf("Dynamic learning: before Trialsetup i am here=====!!!!\n");
TrialSetup();
StateNext(STATE_HOME);
}
break;
case STATE_HOME:
// Start trial when robot in home position (and stationary and active).
if (RobotNotMoving() && RobotHome() && RobotActive())
{
StateNext(STATE_START);
break;
}
break;
case STATE_START:
// Start trial.
TrialStart();
StateNext(STATE_DELAY);
break;
case STATE_DELAY:
// Delay period before go signal.
if (StateTimer.ExpiredSeconds(TrialDelay))
{
StateNext(STATE_GO);
break;
}
if (MovementStarted())
{
ErrorMoveTooSoon();
TrialAbort();
MissTrial();
}
break;
case STATE_GO:
// Wait until graphics state matches.
if (State != StateGraphics)
{
//.........这里部分代码省略.........