Changeset 266 for XMLIO_V2/dev/common/src/xmlio/node/field.hpp
- Timestamp:
- 09/06/11 16:45:08 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/common/src/xmlio/node/field.hpp
r231 r266 64 64 public : 65 65 66 StdSize getNStep(void) const; 67 66 68 const date::CDuration & getFreqOperation(void) const; 67 69 const date::CDuration & getFreqWrite(void) const; … … 78 80 /// Mutateur /// 79 81 void setRelFile(const boost::shared_ptr<CFile> _file); 82 void incrementNStep(void); 80 83 81 84 template <StdSize N> 82 85 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); 84 87 85 88 bool updateDataServer … … 118 121 date::CDuration freq_operation, freq_write; 119 122 123 StdSize nstep; 120 124 boost::shared_ptr<date::CDate> last_Write, last_operation; 121 125 boost::shared_ptr<func::CFunctor> foperation; … … 146 150 147 151 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) 151 167 { 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); 155 177 (*this->foperation)(input); 178 156 179 *last_operation = currDate; 180 // std::cout << "(*last_operation = currDate) : " << *last_operation << " = " << currDate << std::endl; 157 181 } 158 182 159 if ( (*last_Write + freq_write) >= currDate)183 if (writeDate < (currDate + freq_operation)) 160 184 { 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); 163 190 } 191 // std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl; 164 192 return (false); 165 193 };
Note: See TracChangeset
for help on using the changeset viewer.