INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

orcalog::MasterFileReader Class Reference

Knows how to parse a master file. More...

#include <masterfilereader.h>

List of all members.

Public Member Functions

void getLogs (std::vector< std::string > &filenames, std::vector< std::string > &interfaceTypes, std::vector< std::string > &formats, std::vector< bool > &enableds)
 Get info on all logs from the master file.
void rewindToStart ()
int getData (int &seconds, int &useconds, int &id, int &index)
int getDataAtOrAfterTime (int &seconds, int &useconds, int &id, int &index, int seekSec, int seekUsec=0)
void placeCursorBeforeTime (int seekSec, int seekUsec=0)
 Places the cursor at the item with the greatest time < seekSec:seekUsec.
int placeCursorAtOrAfterTime (int seekSec, int seekUsec=0)
bool getCursorTime (int &seconds, int &useconds) const
void stepBackward ()

Detailed Description

Knows how to parse a master file.


Member Function Documentation

bool MasterFileReader::getCursorTime ( int &  seconds,
int &  useconds 
) const

Gives the time of the item which would be returned if getData() were called. Returns: cursorIsValid (is invalid at end of log)

int MasterFileReader::getData ( int &  seconds,
int &  useconds,
int &  id,
int &  index 
)

Read one line of data log. Returns:

  • 0 if data read sucessfully.
  • 1 if end of file is reached.

Referenced by getDataAtOrAfterTime(), and placeCursorAtOrAfterTime().

int MasterFileReader::getDataAtOrAfterTime ( int &  seconds,
int &  useconds,
int &  id,
int &  index,
int  seekSec,
int  seekUsec = 0 
)

Steps through the data entries until the time stamp is equal to or is after the one specified. For example, data is logged every second and the last replayed time was t=3. Calling getData(...,5,0) or getData(...,5,1) will return the data at time t=5.

Seeking time after the end of the log will result in fast forwarding to the end.

Returns:

  • 0 if data read sucessfully.
  • 1 if end of file is reached.

References getData(), and placeCursorAtOrAfterTime().

Referenced by placeCursorBeforeTime().

int MasterFileReader::placeCursorAtOrAfterTime ( int  seekSec,
int  seekUsec = 0 
)

Places the cursor at the item with the smallest time >= seekSec:seekUsec. Returns:

  • 0 if sucessful.
  • 1 if end of file is reached.

References getData(), orcalog::iceUtilTime(), and stepBackward().

Referenced by getDataAtOrAfterTime(), and stepBackward().

void MasterFileReader::rewindToStart (  ) 

Rewind to the start of the data log. Calling getData() afterwards will return the first data point.

References orcalog::iceUtilTime().

Referenced by placeCursorBeforeTime().

void MasterFileReader::stepBackward (  ) 

Steps the cursor backward (unless it's already at the start). Ie interleaved calls to stepBackward() and getData() will move the cursor back and forth between two locations.

References placeCursorAtOrAfterTime(), and placeCursorBeforeTime().

Referenced by placeCursorAtOrAfterTime().


The documentation for this class was generated from the following files:
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5