Changeset 1090 for XIOS


Ignore:
Timestamp:
04/12/17 17:39:10 (7 years ago)
Author:
ymipsl
Message:

Bug fix in append mode when file are split with different period.
-> informations in registry contains now the file names.
(Untested currently)

YM

Location:
XIOS/trunk/src/node
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/file.cpp

    r1046 r1090  
    5050   //---------------------------------------------------------------- 
    5151 
    52    const StdString& CFile::getFileOutputName(void) const 
    53    { 
    54      return name.isEmpty() ? getId() : name; 
     52   const StdString CFile::getFileOutputName(void) const 
     53   { 
     54     return (name.isEmpty() ? getId() : name) + (name_suffix.isEmpty() ? StdString("") :  name_suffix.getValue()); 
    5555   } 
    5656 
     
    216216      if (!split_freq.isEmpty()) 
    217217      { 
    218         if (context->registryIn->foundKey("splitStart") && context->registryIn->foundKey("splitEnd")) 
     218        StdString keySuffix("CContext_"+CContext::getCurrent()->getId()+"::CFile_"+getFileOutputName()+"::") ;  
     219        if (context->registryIn->foundKey(keySuffix+"splitStart") && context->registryIn->foundKey(keySuffix+"splitEnd")) 
    219220        { 
    220221          CDate savedSplitStart(*context->getCalendar()), savedSplitEnd(*context->getCalendar()); 
     
    348349      { 
    349350         StdString filename = getFileOutputName(); 
    350          if (!name_suffix.isEmpty()) filename+=name_suffix.getValue(); 
    351351 
    352352// determine splitting format in the file name  : firstPart%start_date%middlePart%end_date%lastPart 
     
    415415           oss << lastPart ; 
    416416 
    417            context->registryOut->setKey("splitStart", lastSplit); 
    418            context->registryOut->setKey("splitEnd",   splitEnd); 
     417           StdString keySuffix("CContext_"+CContext::getCurrent()->getId()+"::CFile_"+getFileOutputName()+"::") ;  
     418           context->registryOut->setKey(keySuffix+"splitStart", lastSplit); 
     419           context->registryOut->setKey(keySuffix+"splitEnd",   splitEnd); 
    419420         } 
    420421         else oss<<firstPart<<lastPart ; 
     
    508509      StdOStringStream oss; 
    509510      oss << filename; 
    510       if (!name_suffix.isEmpty()) oss << name_suffix.getValue(); 
    511511 
    512512      if (!split_freq.isEmpty()) 
  • XIOS/trunk/src/node/file.hpp

    r957 r1090  
    6969      public: 
    7070         /// Accesseurs /// 
    71          const StdString& getFileOutputName(void) const; 
     71         const StdString getFileOutputName(void) const; 
    7272         boost::shared_ptr<CDataOutput> getDataOutput(void) const; 
    7373         boost::shared_ptr<CDataInput> getDataInput(void) const; 
Note: See TracChangeset for help on using the changeset viewer.