Changeset 122 in flair-src for trunk/lib/FlairCore


Ignore:
Timestamp:
Jan 6, 2017, 1:56:26 PM (8 years ago)
Author:
Sanahuja Guillaume
Message:

modifs uav vrpn i686

Location:
trunk/lib/FlairCore/src
Files:
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/FrameworkManager.cpp

    r55 r122  
    178178}
    179179
     180bool FrameworkManager::IsDeviceLogged(const IODevice *device) const {
     181        return pimpl_->IsDeviceLogged(device);
     182}
     183
    180184void FrameworkManager::StartLog(void) { pimpl_->StartLog(); }
    181185
  • trunk/lib/FlairCore/src/FrameworkManager.h

    r55 r122  
    121121  */
    122122  void AddDeviceToLog(IODevice *device);
     123       
     124        /*!
     125  * \brief Is device logged
     126  *
     127  * Check if AddDeviceToLog was called for an IODevice
     128  *
     129  * \param device IODevice to check
     130  * \return true if AddDeviceToLog was called for this IODevice
     131  */
     132  bool IsDeviceLogged(const IODevice *device) const;
    123133
    124134  /*!
  • trunk/lib/FlairCore/src/FrameworkManager_impl.cpp

    r118 r122  
    630630
    631631  if (is_logging == false) {
    632     if (device->pimpl_->SetToBeLogged()) {
     632    if (!device->pimpl_->IsSetToBeLogged()) {
     633                        device->pimpl_->SetToBeLogged();
    633634      log_desc_t tmp;
    634635      tmp.device = device;
     
    640641    Err("impossible while logging\n");
    641642  }
     643}
     644
     645bool FrameworkManager_impl::IsDeviceLogged(const IODevice *device) const {
     646        return device->pimpl_->IsSetToBeLogged();
    642647}
    643648
  • trunk/lib/FlairCore/src/IODevice_impl.cpp

    r15 r122  
    106106}
    107107
    108 bool IODevice_impl::SetToBeLogged(void) {
     108bool IODevice_impl::IsSetToBeLogged(void) const{
     109        return tobelogged;
     110}
     111
     112void IODevice_impl::SetToBeLogged(void) {
    109113  if (!tobelogged) {
    110114    tobelogged = true;
    111     return true;
    112115  } else {
    113116    self->Warn("already added to log\n");
    114     return false;
    115117  }
    116118}
    117119
    118120void IODevice_impl::WriteLogsDescriptors(fstream &desc_file, int *index) {
    119   // own descriptor
     121  //Printf("WriteLogsDescriptors %s\n",self->ObjectName().c_str());
     122        // own descriptor
    120123  for (size_t i = 0; i < datasToLog.size(); i++)
    121124    datasToLog.at(i)->pimpl_->WriteLogDescriptor(desc_file, index);
     
    127130  for (size_t i = 0; i < devicesToLog.size(); i++)
    128131    devicesToLog.at(i)->pimpl_->WriteLogsDescriptors(desc_file, index);
     132        //Printf("WriteLogsDescriptors %s ok\n",self->ObjectName().c_str());
    129133}
    130134
     
    194198
    195199void IODevice_impl::AppendLog(char **ptr) {
    196   // Printf("AppendLog %s %x\n",self->ObjectName().c_str(),*ptr);
     200   //Printf("AppendLog %s %x\n",self->ObjectName().c_str(),*ptr);
    197201
    198202  // copy state to buf
    199203  for (size_t i = 0; i < datasToLog.size(); i++) {
    200     // printf("copy\n");
     204    // printf("copy %s\n",datasToLog.at(i)->ObjectName().c_str());
    201205    datasToLog.at(i)->CopyDatas(*ptr);
    202206    (*ptr) += datasToLog.at(i)->GetDataType().GetSize();
  • trunk/lib/FlairCore/src/io_data_impl.cpp

    r15 r122  
    4242
    4343void io_data_impl::WriteLogDescriptor(std::fstream &desc_file, int *index) {
     44        if(descriptors.size()==0) self->Warn("AppendLogDescription was not called for this object.\n");
    4445  for (size_t i = 0; i < descriptors.size(); i++) {
    4546    desc_file << (*index)++ << ": " << self->ObjectName() << " - "
  • trunk/lib/FlairCore/src/unexported/FrameworkManager_impl.h

    r55 r122  
    4848  void SetupLogger(std::string log_path);
    4949  void AddDeviceToLog(flair::core::IODevice *device);
     50        bool IsDeviceLogged(const flair::core::IODevice *device) const;
    5051  void StartLog();
    5152  void StopLog();
  • trunk/lib/FlairCore/src/unexported/IODevice_impl.h

    r15 r122  
    4242  void WriteLog(flair::core::Time time);
    4343  void AddDeviceToLog(const flair::core::IODevice *device);
    44   bool SetToBeLogged(void); // return true if possible
     44  void SetToBeLogged(void);
     45        bool IsSetToBeLogged(void) const;
    4546  void OutputToShMem(bool enabled);
    4647  void WriteToShMem(void);
Note: See TracChangeset for help on using the changeset viewer.