Ignore:
Timestamp:
09/06/11 16:45:08 (13 years ago)
Author:
hozdoba
Message:

Corrections après tests sur titane

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/common/src/xmlio/node/field.hpp

    r231 r266  
    6464      public : 
    6565 
     66         StdSize getNStep(void) const; 
     67 
    6668         const date::CDuration & getFreqOperation(void) const; 
    6769         const date::CDuration & getFreqWrite(void) const; 
     
    7880         /// Mutateur /// 
    7981         void setRelFile(const boost::shared_ptr<CFile> _file); 
     82         void incrementNStep(void); 
    8083 
    8184         template <StdSize N> 
    8285            inline bool updateData 
    83                (const date::CDate & currDate, const ARRAY(double, N) data); 
     86               (const date::CDate & currDate, const date::CDuration & timestep, const ARRAY(double, N) data); 
    8487 
    8588         bool updateDataServer 
     
    118121         date::CDuration freq_operation, freq_write; 
    119122 
     123         StdSize nstep; 
    120124         boost::shared_ptr<date::CDate>    last_Write, last_operation; 
    121125         boost::shared_ptr<func::CFunctor> foperation; 
     
    146150 
    147151   template <StdSize N> 
    148       bool CField::updateData(const date::CDate & currDate, const ARRAY(double, N) data) 
    149    { 
    150       if ((*last_operation + freq_operation) >= currDate) 
     152      bool CField::updateData(const date::CDate & currDate, const date::CDuration & timestep, const ARRAY(double, N) _data) 
     153   {         
     154      const date::CDate opeDate      = *last_operation + freq_operation; 
     155      const date::CDate writeDate    = *last_Write     + freq_write;        
     156 
     157//      std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl; 
     158//      std::cout << "Champ : "     << this->getBaseFieldId() << std::endl; 
     159//      std::cout << "CurrDate : "  << currDate  << std::endl; 
     160//      std::cout << "opeDate : "   << opeDate   << " = " << *last_operation << " + " << freq_operation << std::endl; 
     161//      std::cout       << "writeDate : " << writeDate << " = " << *last_Write     << " + " << freq_write     << std::endl; 
     162//      std::cout << "(opeDate <= currDate)   = " << std::boolalpha << (opeDate <= currDate)   << std::endl; 
     163//      std::cout       << "(writeDate <= currDate) = " << std::boolalpha << (writeDate <= currDate) << std::endl;    
     164    
     165       //std::cout << ">> " << currDate <<  " : Envoi de données " << this->getBaseFieldId() << std::endl; 
     166      if (opeDate <= currDate) 
    151167      { 
    152          ARRAY_CREATE(input, double, 1, [0]); 
    153          input->resize(boost::extents[data->size()]); 
    154          this->grid->inputField(data, input); 
     168         //std::cout << "> " << currDate << ": Operation du champs" << this->getBaseFieldId() << std::endl; 
     169          
     170         if (this->data->num_elements() != this->grid->storeIndex[0]->num_elements()) 
     171         { 
     172            this->data->resize(boost::extents[this->grid->storeIndex[0] ->num_elements()]); 
     173         } 
     174             
     175         ARRAY_CREATE(input, double, 1, [this->data->num_elements()]); 
     176         this->grid->inputField(_data, input);           
    155177         (*this->foperation)(input); 
     178          
    156179         *last_operation = currDate; 
     180//         std::cout << "(*last_operation = currDate) : " << *last_operation << " = " << currDate << std::endl;  
    157181      } 
    158182       
    159       if ((*last_Write + freq_write) >= currDate) 
     183      if (writeDate < (currDate + freq_operation)) 
    160184      { 
    161          *last_Write = currDate; 
    162          return (true); 
     185         this->foperation->final(); 
     186         this->incrementNStep(); 
     187         *last_Write = writeDate; 
     188//         std::cout << "(*last_Write = currDate) : " << *last_Write << " = " << currDate       << std::endl; 
     189         return (true);         
    163190      } 
     191//      std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl; 
    164192      return (false); 
    165193   }; 
Note: See TracChangeset for help on using the changeset viewer.