#include <LogPlayer.h>
Inheritance diagram for LogPlayer:
Public Types | |
enum | LogPlayerState { initial, recording, paused, playing } |
different states of the logplayer More... | |
Public Member Functions | |
LogPlayer (MessageQueue &targetQueue) | |
Constructor. | |
LogPlayerState | getState () |
Returns the state of the queue. | |
void | _new () |
Deletes all messages from the queue. | |
bool | open (const char *fileName) |
Opens a log file and reads all messages into the queue. | |
void | play () |
Playes the queue. | |
void | pause () |
Pauses playing the queue. | |
void | stop () |
Stops playing the queue, resets the position in the queue to the first message. | |
void | stepForward () |
Plays the next message in the queue. | |
void | stepBackward () |
Plays the previous message in the queue. | |
void | stepRepeat () |
repeats the current message in the queue | |
void | jumpFrame (int frame) |
jumps to given message-number in the queue | |
void | record () |
Starts / Stops recording. | |
void | smooth () |
Activates/deactivates jpeg image smoothing. | |
bool | save (const char *fileName) |
Writes all messages in the log player queue to a log file. | |
bool | saveAMV (const char *fileName) |
Writes all messages in the log player queue to an AIBOVision compatibile movie file. | |
void | saveCSVrow (OutTextRawFile &file, double *row, unsigned int rowLen) |
Writes an row of doubles to an comma separated value file. | |
bool | saveCSV (const char *fileName) |
Writes a couple of message types in the log player queue to an comma separated value file with a common time line. | |
bool | saveImages (const char *fileName) |
Writes all images in the log player queue to a bunch of files (*.bmp or *.jpg). | |
void | setPlaySpeed (double speed) |
Sets the playing speed of the log player. | |
void | handleMessage (InMessage &message) |
Adds the message to the queue depending on isRecording. | |
void | onIdle () |
If playing a log file, that function checks if it is time to release the next message dependend on the time stamp. | |
int | getNumberOfMessages () const |
Returns the number of stored messages. | |
int | getCurrentMessageNumber () const |
Returns the number of the current message. | |
MessageID | getCurrentMessageID () const |
Returns the type of the current message. | |
bool | isSmoothingEnabled () const |
Returns the status of the smoothing flag. | |
Protected Attributes | |
int | currentMessageNumber |
The number of the current message. | |
Private Member Functions | |
void | convertIntString (char *str, int value) |
little routine to convert an integer into C style string | |
unsigned long | getTimeStamp (int message) |
Returns the time stamp of a given message. | |
Private Attributes | |
LogPlayerState | state |
the state of the log player | |
MessageQueue & | targetQueue |
double | playSpeed |
A factor, how fast the messages are played. | |
unsigned long | timeWhenFirstMessageWasPlayed |
The time when the first message was played. | |
unsigned long | timeOfFirstPlayedMessage |
The time stamp of the first played message. | |
bool | smoothingEnabled |
Flag which triggers smoothing of jpeg compressed images. |
The messages are played in the same time sequence as they were recorded.
Definition at line 22 of file LogPlayer.h.
|
different states of the logplayer
Definition at line 32 of file LogPlayer.h. Referenced by getState(). |
|
Constructor.
Definition at line 21 of file LogPlayer.cpp. References _new(). |
Here is the call graph for this function:
|
Returns the state of the queue.
Definition at line 414 of file LogPlayer.cpp. References LogPlayerState, and state. |
|
Deletes all messages from the queue.
Definition at line 29 of file LogPlayer.cpp. References MessageQueue::clear(), initial, state, and stop(). Referenced by LogPlayer(). |
Here is the call graph for this function:
|
Opens a log file and reads all messages into the queue.
Definition at line 36 of file LogPlayer.cpp. References MessageQueue::clear(), InFile::exists(), and stop(). |
Here is the call graph for this function:
|
Playes the queue. Note that you have to call onIdle() regularely if you want to use that function Definition at line 49 of file LogPlayer.cpp. |
Here is the call graph for this function:
|
Pauses playing the queue.
Definition at line 61 of file LogPlayer.cpp. References getNumberOfMessages(), initial, paused, state, timeOfFirstPlayedMessage, and timeWhenFirstMessageWasPlayed. Referenced by jumpFrame(), play(), record(), stepBackward(), stepForward(), stepRepeat(), and stop(). |
Here is the call graph for this function:
|
Stops playing the queue, resets the position in the queue to the first message.
Definition at line 55 of file LogPlayer.cpp. References currentMessageNumber, and pause(). Referenced by _new(), onIdle(), open(), saveAMV(), saveCSV(), and saveImages(). |
Here is the call graph for this function:
|
Plays the next message in the queue.
Definition at line 78 of file LogPlayer.cpp. References MessageQueue::copyMessage(), currentMessageNumber, getNumberOfMessages(), pause(), paused, state, and targetQueue. |
Here is the call graph for this function:
|
Plays the previous message in the queue.
Definition at line 70 of file LogPlayer.cpp. References MessageQueue::copyMessage(), currentMessageNumber, pause(), paused, state, and targetQueue. |
Here is the call graph for this function:
|
repeats the current message in the queue
Definition at line 86 of file LogPlayer.cpp. References MessageQueue::copyMessage(), currentMessageNumber, pause(), paused, state, and targetQueue. |
Here is the call graph for this function:
|
jumps to given message-number in the queue
Definition at line 94 of file LogPlayer.cpp. References MessageQueue::copyMessage(), currentMessageNumber, getNumberOfMessages(), pause(), paused, state, and targetQueue. |
Here is the call graph for this function:
|
Starts / Stops recording. Note that you have to notify the queue on new messages with handleMessage(). Definition at line 379 of file LogPlayer.cpp. References initial, pause(), paused, playing, recording, and state. |
Here is the call graph for this function:
|
Activates/deactivates jpeg image smoothing.
Definition at line 394 of file LogPlayer.cpp. References smoothingEnabled. |
|
Writes all messages in the log player queue to a log file.
Definition at line 102 of file LogPlayer.cpp. References OutFile::exists(), and getNumberOfMessages(). |
Here is the call graph for this function:
|
Writes all messages in the log player queue to an AIBOVision compatibile movie file. Images are encoded in a raw YUV format.
Definition at line 130 of file LogPlayer.cpp. References InMessage::bin, Image::cameraInfo, convertIntString(), currentMessageNumber, OutFile::exists(), getCurrentMessageID(), getNumberOfMessages(), idImage, idJPEGImage, Image::image, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, MessageQueueBase::setSelectedMessageForReading(), stop(), JPEGImage::toImage(), and OutStream< OutFile, OutBinary >::write(). |
Here is the call graph for this function:
|
Writes an row of doubles to an comma separated value file.
Definition at line 198 of file LogPlayer.cpp. Referenced by saveCSV(). |
|
Writes a couple of message types in the log player queue to an comma separated value file with a common time line.
Definition at line 219 of file LogPlayer.cpp. References InMessage::bin, SpecialPercept::checkerPose, currentMessageNumber, OutFile::exists(), RobotPose::frameNumber, SpecialPercept::frameNumber, getCurrentMessageID(), getNumberOfMessages(), idSpecialPercept, idWorldState, RECEIVE_WORLDSTATE, Pose2D::rotation, saveCSVrow(), MessageQueueBase::setSelectedMessageForReading(), stop(), Pose2D::translation, SpecialPercept::type, Vector2< double >::x, and Vector2< double >::y. |
Here is the call graph for this function:
|
Writes all images in the log player queue to a bunch of files (*.bmp or *.jpg).
Definition at line 290 of file LogPlayer.cpp. References InMessage::bin, Image::cameraInfo, Image::convertFromYUVToRGB(), currentMessageNumber, OutFile::exists(), getCurrentMessageID(), getNumberOfMessages(), idImage, idJPEGImage, Image::image, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, MessageQueueBase::setSelectedMessageForReading(), stop(), JPEGImage::toImage(), and OutStream< OutFile, OutBinary >::write(). |
Here is the call graph for this function:
|
Sets the playing speed of the log player. "2" playes the messages double as fast as they were recorded, "0.5" plays the messages with the half speed. Definition at line 402 of file LogPlayer.cpp. References playSpeed, and timeWhenFirstMessageWasPlayed. |
|
Adds the message to the queue depending on isRecording. That function should be called for every message in the queue that the log player shall work on. Definition at line 408 of file LogPlayer.cpp. |
|
If playing a log file, that function checks if it is time to release the next message dependend on the time stamp. Call that function whenever there is some processing time left. Definition at line 419 of file LogPlayer.cpp. References MessageQueue::copyMessage(), currentMessageNumber, SystemCall::getCurrentSystemTime(), getNumberOfMessages(), SystemCall::getTimeSince(), getTimeStamp(), playing, playSpeed, state, stop(), targetQueue, timeOfFirstPlayedMessage, and timeWhenFirstMessageWasPlayed. |
Here is the call graph for this function:
|
Returns the number of stored messages.
Definition at line 462 of file LogPlayer.cpp. References MessageQueueBase::getNumberOfMessages(). Referenced by jumpFrame(), onIdle(), pause(), save(), saveAMV(), saveCSV(), saveImages(), and stepForward(). |
Here is the call graph for this function:
|
Returns the number of the current message.
Definition at line 467 of file LogPlayer.cpp. References currentMessageNumber. |
|
Returns the type of the current message.
Definition at line 472 of file LogPlayer.cpp. References currentMessageNumber, MessageQueueBase::getMessageID(), and MessageID. Referenced by saveAMV(), saveCSV(), and saveImages(). |
Here is the call graph for this function:
|
Returns the status of the smoothing flag.
Definition at line 151 of file LogPlayer.h. References smoothingEnabled. |
|
little routine to convert an integer into C style string
Definition at line 116 of file LogPlayer.cpp. Referenced by saveAMV(). |
|
Returns the time stamp of a given message.
Definition at line 457 of file LogPlayer.cpp. References MessageQueueBase::getTimeStamp(). Referenced by onIdle(). |
Here is the call graph for this function:
|
the state of the log player
Definition at line 159 of file LogPlayer.h. Referenced by _new(), getState(), handleMessage(), jumpFrame(), onIdle(), pause(), play(), record(), stepBackward(), stepForward(), and stepRepeat(). |
|
Definition at line 162 of file LogPlayer.h. Referenced by jumpFrame(), onIdle(), stepBackward(), stepForward(), and stepRepeat(). |
|
A factor, how fast the messages are played. "2" playes the messages double as fast as they were recorded, "0.5" plays the messages with the half speed. Definition at line 172 of file LogPlayer.h. Referenced by onIdle(), and setPlaySpeed(). |
|
The number of the current message.
Definition at line 183 of file LogPlayer.h. Referenced by getCurrentMessageID(), getCurrentMessageNumber(), jumpFrame(), onIdle(), saveAMV(), saveCSV(), saveImages(), stepBackward(), stepForward(), stepRepeat(), and stop(). |
|
The time when the first message was played.
Definition at line 187 of file LogPlayer.h. Referenced by onIdle(), pause(), and setPlaySpeed(). |
|
The time stamp of the first played message.
Definition at line 190 of file LogPlayer.h. |
|
Flag which triggers smoothing of jpeg compressed images.
Definition at line 193 of file LogPlayer.h. Referenced by isSmoothingEnabled(), and smooth(). |