source: flair-src/trunk/lib/FlairCore/src/IODevice.cpp@ 167

Last change on this file since 167 was 157, checked in by Sanahuja Guillaume, 7 years ago

iadded isready to iodevice:
avoid problem of imu not ready in ardrone2

File size: 1.8 KB
RevLine 
[2]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[2]4// %flair:license}
5// created: 2011/05/01
6// filename: IODevice.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: Abstract class for input/ouput system
14//
15//
16/*********************************************************************/
17
18#include "IODevice.h"
19#include "IODevice_impl.h"
20#include "io_data.h"
21#include "io_data_impl.h"
22#include "FrameworkManager.h"
23
24using std::string;
25
[15]26namespace flair {
27namespace core {
[2]28
[38]29IODevice::IODevice(const Object* parent,string name): Object(parent,name,"IODevice") {
30 pimpl_=new IODevice_impl(this);
[2]31}
32
[15]33IODevice::~IODevice() { delete pimpl_; }
[2]34
[15]35void IODevice::AddDeviceToLog(const IODevice *device) {
36 pimpl_->AddDeviceToLog(device);
[2]37}
38
[15]39void IODevice::OutputToShMem(bool enabled) { pimpl_->OutputToShMem(enabled); }
[2]40
[15]41void IODevice::ProcessUpdate(io_data *data) {
42 if (data != NULL)
43 data->pimpl_->SetConsistent(true);
[2]44
[15]45 for (size_t i = 0; i < TypeChilds()->size(); i++) {
46 ((IODevice *)TypeChilds()->at(i))->UpdateFrom(data);
47 }
[2]48
[38]49 if(data!=NULL) {
50 if(getFrameworkManager()->IsLogging()==true) pimpl_->WriteLog(data->DataTime());
[2]51
[15]52 data->pimpl_->Circle();
53 }
[2]54
[15]55 pimpl_->WriteToShMem();
[2]56
[15]57 pimpl_->ResumeThread();
[2]58}
59
[15]60void IODevice::AddDataToLog(const io_data *data) { pimpl_->AddDataToLog(data); }
[2]61
[15]62DataType const &IODevice::GetInputDataType() const { return dummyType; }
[2]63
[15]64DataType const &IODevice::GetOutputDataType() const { return dummyType; }
[2]65
[157]66void IODevice::SetIsReady(bool status) {
67 pimpl_->SetIsReady(status);
68}
69
70bool IODevice::IsReady(void) const {
71 return pimpl_->IsReady();
72}
73
[2]74} // end namespace core
75} // end namespace flair
Note: See TracBrowser for help on using the repository browser.