Index: Interface_Web/trunk/pspaWT/sources/controler/src/sectorParameters.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/controler/src/sectorParameters.cc	(revision 431)
+++ Interface_Web/trunk/pspaWT/sources/controler/src/sectorParameters.cc	(revision 436)
@@ -1,42 +1,49 @@
-
-//#include <cstdlib>
 
 #include "sectorParameters.h"
 #include "mixedTools.h"
 
-sectorParameters::sectorParameters() : parametersString_(NULL)
+#define BAVARD 1
+
+sectorParameters::sectorParameters()
 {
   geometry_= string("CIRCULAR");
-  nCells_ = 0;
-  lCell_ = 0.0;
-  pc_ = 0.0;
-  nbParam_ = 4;
-  parametersString_ = new string[nbParam_+1];
+  sectors_.push_back(statements("vide",vector<string>()));
+  sectors_.back().second.push_back("xxx");
+  sectors_.back().second.push_back("xxx");
+  sectors_.back().second.push_back("Unchecked");
+  sectors_.back().second.push_back("1");
 }
 
-string* sectorParameters::getParametersString() const 
-{
-  parametersString_[0] = mixedTools::intToString(nbParam_);
-  parametersString_[1] = geometry_;
-  parametersString_[2] = mixedTools::intToString(nCells_);
-  parametersString_[3] = mixedTools::doubleToString(lCell_);
-  parametersString_[4] = mixedTools::doubleToString(pc_);
-  return parametersString_;
-}
+// sectorParameters::sectorParameters() : parametersString_(NULL)
+// {
+//   geometry_= string("CIRCULAR");
+//   nCells_ = 0;
+//   lCell_ = 0.0;
+//   pc_ = 0.0;
+//   nbParam_ = 4;
+//   parametersString_ = new string[nbParam_+1];
+// }
 
-void sectorParameters::setParametersString(string* param)
-{
-  geometry_ = param[1].c_str();
-  nCells_ = atoi(param[2].c_str());
-  lCell_ = atof(param[3].c_str());
-  pc_ = atof(param[4].c_str());
-}
+// string* sectorParameters::getParametersString() const 
+// {
+//   parametersString_[0] = mixedTools::intToString(nbParam_);
+//   parametersString_[1] = geometry_;
+//   parametersString_[2] = mixedTools::intToString(nCells_);
+//   parametersString_[3] = mixedTools::doubleToString(lCell_);
+//   parametersString_[4] = mixedTools::doubleToString(pc_);
+//   return parametersString_;
+// }
+
+// void sectorParameters::setParametersString(string* param)
+// {
+//   geometry_ = param[1].c_str();
+//   nCells_ = atoi(param[2].c_str());
+//   lCell_ = atof(param[3].c_str());
+//   pc_ = atof(param[4].c_str());
+// }
 
 void sectorParameters::raz()
 {
-  geometry_= string("CIRCULAR");
-  nCells_ = 0;
-  lCell_ = 0.0;
-  pc_ = 0.0;
+  if(!sectors_.empty()) sectors_.clear();
 }
 
@@ -44,6 +51,9 @@
 {
   ostringstream sortie;
-  sortie<<" lattice "<<endl;
-  sortie<<geometry_<<" "<<nCells_<<" "<<lCell_<<" "<<pc_<<endl;
+  sortie << " sectors " << endl;
+  sortie << sectors_.size() << endl;
+  for(int i = 0; i < sectors_.size(); i++) {
+    sortie << sectors_.at(i).first << " " << sectors_.at(i).second.at(0) << " " << sectors_.at(i).second.at(1) << " " << sectors_.at(i).second.at(2) << " " << sectors_.at(i).second.at(3) << endl;
+  }
   return sortie.str();  
 }
@@ -51,35 +61,70 @@
 void sectorParameters::FileInput(ifstream& ifs)
 {
-  ifs >> geometry_ >> nCells_ >> lCell_ >> pc_;
+  int n;
+  ifs >> n;
+  string txt = "";
+  for(int i = 0; i < n; i++) {
+    ifs >> txt;
+    sectors_.push_back(statements(txt,vector<string>()));
+    for(int j = 0; j < 4; j++) {
+      ifs >> txt;
+      sectors_.back().second.push_back(txt);
+    }
+  } 
 }
 
 void sectorParameters::InputRep(UAPNode* root)
 {
-  UAPNode* node = root->addChild("lattice");
-  node->addAttribute("name","global_lattice");
-  node->addChild("geometry")->addAttribute("type",geometry_);
-  string txt = "";
-  txt = mixedTools::doubleToString(pc_);
-  node->addChild("pc")->addAttribute("design",txt);
+  // UAPNode* node = root->addChild("lattice");
+  // node->addAttribute("name","global_lattice");
+  // node->addChild("geometry")->addAttribute("type",geometry_);
+  // string txt = "";
+  // txt = mixedTools::doubleToString(pc_);
+  // node->addChild("pc")->addAttribute("design",txt);
 
-  node = root->addChild("sector");
-  node->addAttribute("name","sect");
-  txt = mixedTools::doubleToString(lCell_);
-  node->addAttribute("length",txt);
-  txt = mixedTools::intToString(nCells_);
-  node->addAttribute("repeat",txt);
+  // node = root->addChild("sector");
+  // node->addAttribute("name","sect");
+  // txt = mixedTools::doubleToString(lCell_);
+  // node->addAttribute("length",txt);
+  // txt = mixedTools::intToString(nCells_);
+  // node->addAttribute("repeat",txt);
 }
 
-int sectorParameters::getNumberOfCells() const {
-  return nCells_;
+// int sectorParameters::getNumberOfCells() const {
+//   return nCells_;
+// }
+
+// double sectorParameters::getCellLength() const {
+//   return lCell_;
+// }
+
+// double sectorParameters::getParticleMomentum() const {
+//   return pc_;
+// }
+
+vector<statements> sectorParameters::getSectors() const {
+  return sectors_;
 }
 
-double sectorParameters::getCellLength() const {
-  return lCell_;
+void sectorParameters::setSectors(const vector<statements>& v) 
+{
+#if BAVARD > 0
+  cout << "***********************************" << endl;
+  cout << " sectorParameters::setSectors() " << endl << endl;
+#endif
+
+  if(!sectors_.empty()) sectors_.clear();
+
+  for(int i = 0; i < v.size(); i++) {
+    sectors_.push_back(statements(v.at(i).first,vector<string>()));
+    for(int j = 0; j < 4; j++) 
+      sectors_.back().second.push_back(v.at(i).second.at(j));
+  }
+
+#if BAVARD > 0
+  cout << "sectors_.size()= " << sectors_.size() << endl;
+  for(int i = 0; i < sectors_.size(); i++) {
+    cout << "name= " << sectors_.at(i).first << ", de " << sectors_.at(i).second.at(0) << ", Ã  " << sectors_.at(i).second.at(1) << ", reflection = " << sectors_.at(i).second.at(2) << ", repeat= " << sectors_.at(i).second.at(3) << endl << endl;
+  }
+#endif
 }
-
-double sectorParameters::getParticleMomentum() const {
-  return pc_;
-}
-
-
