コード例 #1
0
ファイル: Highscore.cpp プロジェクト: nixz/covise
void HSEntry::setEndTime(double t)
{
    endTime = t;
    char number[100];
    sprintf(number, "%03.3f", getLapTime());
    LapLabel->setLabel(number);
}
コード例 #2
0
// given a session number, find it the start of the session and return a handle to it   
lap_handle_t CLapTimes::getSessionHandle(uint8_t nSession)
{
  lap_handle_t currentLapHandle = 0;
  uint8_t nCurrentSession = 0;
  uint16_t nLapTime = 0;
   
  while(nCurrentSession != nSession && currentLapHandle < m_pLapStore->getMaxLaps())
  {
    // loop until we read the max laps or we find and empty lap
    do
    {
      currentLapHandle++;  
    }
    while((currentLapHandle) < m_pLapStore->getMaxLaps() && m_pLapStore->getLapTime(currentLapHandle) != EMPTY_LAP_TIME);
     
    nCurrentSession++;
     
    if(currentLapHandle < m_pLapStore->getMaxLaps())
    {
      // move next to step over the 0 terminator for the previous session    
      currentLapHandle++;
       
      // if the first lap of the session is empty there is no session
      // so return invalid lap to indicate no session found.
      if(getLapTime(currentLapHandle) == EMPTY_LAP_TIME)
      {
        currentLapHandle = INVALID_LAP_HANDLE;
      }
    }
    else
    { 
      currentLapHandle = INVALID_LAP_HANDLE;
    }
  }
   
  return currentLapHandle;
}