OMK::HumanoRecorder Class Reference

This Simulated object defines a position which moves in the space. More...

#include <OMKHumanoRecorder.h>

Inheritance diagram for OMK::HumanoRecorder:

Inheritance graph
[legend]
Collaboration diagram for OMK::HumanoRecorder:

Collaboration graph
[legend]
List of all members.

Protected Member Functions

virtual bool loadParameters (const ConfigurationParameterDescriptor *node)
 Configuration parameters loader of ExtensibleSimulatedObject.
virtual void computeParameters ()
 This part of the compute methods computes the associated data.
bool processInitialisationSequence (OMK::Type::InitialisationSequenceEvent *e)

Protected Attributes

AttributeT< HBT::PostureData_posture
AttributeT< bool_record
Name _humanoToRecord
HBT::Recorder _file

Private Member Functions

 DECLARE_OBJECT_FACTORY (HumanoRecorder)

Detailed Description

This Simulated object defines a position which moves in the space.

Definition at line 15 of file OMKHumanoRecorder.h.


Member Function Documentation

OMK::HumanoRecorder::DECLARE_OBJECT_FACTORY ( HumanoRecorder   )  [private]

bool HumanoRecorder::loadParameters ( const ConfigurationParameterDescriptor node  )  [protected, virtual]

Configuration parameters loader of ExtensibleSimulatedObject.

Parameters:
[in] node the root node of the configuration parameter.
Returns:
true if all needed parameters can be read.
Reads in the configuration node the values to set the attributs. No data or output have been declared, this method does nothing.

Reimplemented from OMK::ExtensibleSimulatedObject.

Definition at line 41 of file OMKHumanoRecorder.cpp.

References _file, _humanoToRecord, _posture, OMK::IAttribute::connectTo(), OMK::ParametersAccessor::get(), OMK::Name::getString(), OMK::EventId::INITIALISATION_SEQUENCE, OMMESSAGE, HBT::Recorder::open(), processInitialisationSequence(), and OMK::SimulatedObject::registerForSignalBy().

00042 { 
00043   bool ok = true ;
00044   // Get the humano to record
00045   ok = ok && ParametersAccessor::get( node, "Record", _humanoToRecord, this ) ;
00046   
00047   // get the file to output data
00048   std::string file( _humanoToRecord.getString() + ".rec" ) ;
00049   if( !ParametersAccessor::get( node, "File", file ) )
00050   {
00051     OMMESSAGE( "No file name given, use \"" << file << "\"" ) ;
00052   }
00053   _file.open( file.c_str() ) ;
00054 
00055   ok = ok && _posture.connectTo( _humanoToRecord, "Posture" ) ;
00056   new ValuedEventListenerCallBack< HumanoRecorder, InitialisationSequenceType >(
00057           *this, 
00058           &HumanoRecorder::processInitialisationSequence, 
00059           EventId::INITIALISATION_SEQUENCE ) ;
00060   ok = ok && registerForSignalBy( EventId::INITIALISATION_SEQUENCE, _humanoToRecord ) ;
00061   return ok ;
00062 }

void HumanoRecorder::computeParameters (  )  [protected, virtual]

This part of the compute methods computes the associated data.

The inputs and outputs should work with associated data, you should use these associated data.

Reimplemented from OMK::ExtensibleSimulatedObject.

Definition at line 65 of file OMKHumanoRecorder.cpp.

References _file, _posture, _record, OMK::IAttributeT< PrmType, ModelType, AccessorType >::get(), OMK::SimulatedObject::getController(), OMK::Controller::getSimulatedDate(), and HBT::Recorder::write().

00066 { 
00067   if( _record && _file )
00068   {
00069     unsigned int date = getController().getSimulatedDate() ;
00070     _file.write( date, _posture.get() ) ;
00071   }
00072 }

bool OMK::HumanoRecorder::processInitialisationSequence ( OMK::Type::InitialisationSequenceEvent *  e  )  [protected]

Referenced by loadParameters().


Member Data Documentation

AttributeT< HBT::PostureData > OMK::HumanoRecorder::_posture [protected]

Definition at line 22 of file OMKHumanoRecorder.h.

Referenced by computeParameters(), and loadParameters().

AttributeT< bool > OMK::HumanoRecorder::_record [protected]

Definition at line 23 of file OMKHumanoRecorder.h.

Referenced by computeParameters().

Name OMK::HumanoRecorder::_humanoToRecord [protected]

Definition at line 24 of file OMKHumanoRecorder.h.

Referenced by loadParameters().

HBT::Recorder OMK::HumanoRecorder::_file [protected]

Definition at line 25 of file OMKHumanoRecorder.h.

Referenced by computeParameters(), and loadParameters().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:04 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007