#include <OMKHumanoRecorder.h>
Inheritance diagram for OMK::HumanoRecorder:
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) |
Definition at line 15 of file OMKHumanoRecorder.h.
OMK::HumanoRecorder::DECLARE_OBJECT_FACTORY | ( | HumanoRecorder | ) | [private] |
bool HumanoRecorder::loadParameters | ( | const ConfigurationParameterDescriptor * | node | ) | [protected, virtual] |
Configuration parameters loader of ExtensibleSimulatedObject.
[in] | node | the root node of the configuration parameter. |
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().
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] |
Name OMK::HumanoRecorder::_humanoToRecord [protected] |
HBT::Recorder OMK::HumanoRecorder::_file [protected] |
Definition at line 25 of file OMKHumanoRecorder.h.
Referenced by computeParameters(), and loadParameters().
Documentation generated on Mon Jun 9 11:46:04 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |