Changeset 214 for XMLIO_V2/dev/dev_rv/src/xmlio/data_treatment.cpp
- Timestamp:
- 06/14/11 16:20:27 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/xmlio/data_treatment.cpp
r206 r214 5 5 #include "group_template_impl.hpp" 6 6 #include "object_factory_impl.hpp" 7 7 8 8 9 namespace xmlioserver … … 30 31 { 31 32 return (this->enabledFiles); 33 } 34 //---------------------------------------------------------------- 35 36 void CDataTreatment::update_calendar(int step) 37 { 38 // Mise à jour cÃŽté client 39 this->currentContext->getCalendar()->update(step); 40 if (CXIOSManager::GetStatus() == CXIOSManager::LOC_CLIENT) 41 { // Mise à jour cÃŽté serveur 42 boost::shared_ptr<comm::CClient> client = comm::CClient::GetClient(); 43 client->updateCalendar(step); 44 } 45 } 46 47 void CDataTreatment::set_timestep(const date::CDuration & duration) 48 { 49 // Mise à jour cÃŽté client 50 this->currentContext->getCalendar()->setTimeStep(duration); 51 if (CXIOSManager::GetStatus() == CXIOSManager::LOC_CLIENT) 52 { // Mise à jour cÃŽté serveur 53 boost::shared_ptr<comm::CClient> client = comm::CClient::GetClient(); 54 client->setTimestep(duration); 55 } 56 } 57 58 //---------------------------------------------------------------- 59 60 void CDataTreatment::write_data 61 (const StdString & fieldId, 62 const StdString & fileId, 63 const std::deque<ARRAY(double, 1)> & data) 64 { 65 const date::CDate & currDate = 66 this->currentContext->getCalendar()->getCurrentDate(); 67 const std::vector<boost::shared_ptr<CField> > & refField= 68 CObjectFactory::GetObject<CField>(fieldId)->getAllReference(); 69 std::vector<boost::shared_ptr<CField> >::const_iterator 70 it = refField.begin(), end = refField.end(); 71 72 for (; it != end; it++) 73 { 74 boost::shared_ptr<CField> field = *it; 75 boost::shared_ptr<CFile> file = field->getRelFile(); 76 if (file->getId().compare(fileId) == 0) 77 { 78 if (field->updateDataServer(currDate, data)) 79 file->getDataOutput()->writeFieldData(field); 80 return; 81 } 82 } 83 32 84 } 33 85
Note: See TracChangeset
for help on using the changeset viewer.