Ignore:
Timestamp:
06/06/17 17:58:16 (4 years ago)
Author:
oabramkina
Message:

Two server levels: merging with trunk r1137.
There are bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/filter/file_writer_filter.cpp

    r639 r1158  
    22#include "exception.hpp" 
    33#include "field.hpp" 
     4#include "utils.hpp" 
    45 
    56namespace xios 
     
    1617  void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 
    1718  { 
     19    bool ignoreMissingValue = (!field->detect_missing_value.isEmpty() &&  
     20                               !field->default_value.isEmpty() &&  
     21                               field->detect_missing_value == true); 
     22    if (ignoreMissingValue) 
     23    { 
     24      double missingValue = field->default_value; 
     25      size_t nbData = data[0]->data.numElements(); 
     26      for (size_t idx = 0; idx < nbData; ++idx) 
     27      { 
     28        if (NumTraits<double>::isnan(data[0]->data(idx))) 
     29          data[0]->data(idx) = missingValue; 
     30      } 
     31    }     
     32 
    1833    field->sendUpdateData(data[0]->data); 
    1934  } 
     35 
     36  bool CFileWriterFilter::isDataExpected(const CDate& date) const 
     37  { 
     38    return true; 
     39  } 
    2040} // namespace xios 
Note: See TracChangeset for help on using the changeset viewer.