Changeset 173 for XMLIO_V2/dev/dev_rv/src/xmlio/main_server.cpp
- Timestamp:
- 04/13/11 15:15:12 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/xmlio/main_server.cpp
r171 r173 13 13 { 14 14 comm::CMPIManager::Initialise(&argc, &argv); // < seulement en mode connecté 15 16 //CTreeManager::ParseFile ("test/iodef_simple_test.xml"); 17 18 /*StdOFStream ofs("data/data.bin"); 19 CTreeManager::ToBinary(ofs); 20 ofs.close();*/ 15 21 16 // Création d'un contexte 17 boost::shared_ptr<CContext> contxt = CTreeManager::CreateContext("mon_context"); 22 StdIFStream ifs("data/data.bin"); 23 CTreeManager::FromBinary(ifs); 24 ifs.close(); 18 25 19 20 boost::shared_ptr<CGridGroup> grid_def = 21 CObjectFactory::GetObject<CGridGroup>(StdString("grid_definition")); 22 boost::shared_ptr<CAxisGroup> axis_def = 23 CObjectFactory::GetObject<CAxisGroup>(StdString("axis_definition")); 24 boost::shared_ptr<CDomainGroup> domain_def = 25 CObjectFactory::GetObject<CDomainGroup>(StdString("domain_definition")); 26 27 // Ajout d'une grille, d'un axe et d'un domaine. 28 boost::shared_ptr<CGrid> grid = 29 CGroupFactory::CreateChild(grid_def , StdString("ma_grille")); 30 boost::shared_ptr<CAxis> axis = 31 CGroupFactory::CreateChild(axis_def , StdString("mon_axe")); 32 boost::shared_ptr<CDomain> domain = 33 CGroupFactory::CreateChild(domain_def, StdString("mon_domaine")); 34 35 boost::shared_ptr<CDomain> sdomain = 36 CGroupFactory::CreateChild(domain_def, StdString("mon_super_domaine")); 37 38 // Définition des attributs de la grille. 39 grid->domain_ref.setValue(StdString("mon_domaine")); 40 grid->axis_ref.setValue(StdString("mon_axe")); 41 42 // Définition des attributs de l'axe. 43 ARRAY_CREATE(zvalue, double, 1, [10]); 44 45 axis->size.setValue(zvalue->num_elements()); 46 axis->zvalue.setValue(zvalue); 47 48 // Définition des attributs du domaine l'axe. 49 ARRAY_CREATE(latvalue, double, 1, [200]); 50 ARRAY_CREATE(lonvalue, double, 1, [200]); 51 52 ARRAY_CREATE(mask, bool, 2, [20][10]); 53 54 for (StdSize i = 0; i<mask->num_elements(); i++) 55 (mask->data())[i] = i%2; 56 57 domain->ni_glo.setValue(40); 58 domain->nj_glo.setValue(40); 59 60 domain->ibegin.setValue(1); 61 domain->ni.setValue(20); 62 domain->jbegin.setValue(1); 63 domain->nj.setValue(10); 64 65 domain->data_dim.setValue(2); 66 67 domain->mask.setValue(mask); 68 domain->lonvalue.setValue(lonvalue); 69 domain->latvalue.setValue(latvalue); 70 71 // Résolution 72 grid->solveReference(); 73 74 std::cout << grid->storeIndex << std::endl; 75 std::cout << grid->out_i_index << std::endl; 76 std::cout << grid->out_j_index << std::endl; 77 std::cout << grid->out_l_index << std::endl; 26 StdIFStream ifss("data/data.bin"); 27 CTreeManager::FromBinary(ifss); 28 ifss.close(); 78 29 79 30 // Sortie de l'arborescence xml sous forme de fichier. 80 31 CTreeManager::PrintTreeToFile("data/def/test.xml"); 81 82 83 ARRAY_CREATE(sarray, double, 1, [1]);84 StdIFStream ifs("data/monfichierbinaire");85 sarray->fromBinary(ifs);86 ifs.close();87 88 89 90 91 92 93 94 95 32 96 33
Note: See TracChangeset
for help on using the changeset viewer.