Index: /Interface_Web/trunk/pspaWT/History
===================================================================
--- /Interface_Web/trunk/pspaWT/History	(revision 471)
+++ /Interface_Web/trunk/pspaWT/History	(revision 472)
@@ -5,4 +5,21 @@
      PSPA - Plateforme de simulation en physique des accÃ©lÃ©rateurs
      =========================================================
+
+19 Décembre 2013 : Laurent Garnier
+- abstractSoftware:
+  o Supression de initComputationLimits_deprecated()
+  o Ajout d'un pointeur vers dataManager
+
+- dataManager:
+  o Suppression de getCurrentBeam() qui n'a plus lieu d'être puisque le beamLine est maintenant dans le sector.
+- sectionToExecute:
+  o Ajout d'un pointeur vers dataManager
+
+- sector:
+  o Ajout de méthodes pour gérér la particleBeam : getParticleBeam()/setParticleBeam()
+
+- softwareXX :
+  o Ajout d'un pointeur vers dataManager
+
 
 19 Décembre 2013 : Laurent Garnier
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h	(revision 472)
@@ -40,5 +40,4 @@
 
   bool launchJob(string commandLine, string& resul);
-  bool initComputationLimits_deprecated(unsigned int numeroDeb,unsigned int numeroFin);
   bool ComputationLimitsOk_deprecated() const;
 
@@ -51,5 +50,5 @@
   public :
 
-  abstractSoftware(string, sectionToExecute*);
+  abstractSoftware(string, sectionToExecute*, dataManager* );
   ~abstractSoftware() {;}
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h	(revision 472)
@@ -30,5 +30,4 @@
   int getBeamLineSize_deprecated();
   inline globalParameters* getGlobalParameters()  {return &globParam_;}
-  inline particleBeam* getCurrentBeam() {return currentBeam_;}
     
   particleBeam* getDiagnosticBeam(unsigned index);
@@ -99,5 +98,4 @@
 
   globalParameters globParam_;
-  particleBeam* currentBeam_;
   PspaApplication* pspa_;
   
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h	(revision 472)
@@ -12,5 +12,5 @@
   /** Create a new sectionToExecute and initialize it with the given element and software
    */
-  sectionToExecute(abstractElement*,abstractSoftware*);
+  sectionToExecute(abstractElement*,abstractSoftware*,dataManager*);
   
   /** Deprecated : To be removed ! */
@@ -57,5 +57,5 @@
 
   abstractSoftware* software_;
-
+  dataManager* dataManager_;
   std::vector< abstractElement* > elements_;
 };
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/sector.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/sector.h	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/sector.h	(revision 472)
@@ -7,4 +7,6 @@
 #include "nomDeLogiciel.h"
 #include "sectorParameters.h"
+#include "particleBeam.h"
+
 
 class sectionToExecute;
@@ -86,7 +88,16 @@
   }
 
+  inline particleBeam* getParticleBeam() {
+    return currentBeam_;
+  }
+  
+  inline void setParticleBeam(particleBeam* part) {
+    currentBeam_ = part;
+  }
+  
 private:
 
   std::vector <sectionToExecute*> sectionToExecute_;
+  particleBeam* currentBeam_;
 
   std::string name_;
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h	(revision 472)
@@ -18,5 +18,5 @@
   
   softwareGenerator();  
-  softwareGenerator(string inputFileName, sectionToExecute*);
+  softwareGenerator(string inputFileName, sectionToExecute*, dataManager*);
 
   virtual ~softwareGenerator() {;}
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h	(revision 472)
@@ -13,5 +13,5 @@
   
   softwareMadx();
-  softwareMadx(string,sectionToExecute*);
+  softwareMadx(string,sectionToExecute*, dataManager*);
   virtual ~softwareMadx() {;}
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareParmela.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareParmela.h	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareParmela.h	(revision 472)
@@ -36,5 +36,5 @@
     softwareParmela();
     
-    softwareParmela(string inputFileName, sectionToExecute*);
+    softwareParmela(string inputFileName, sectionToExecute*, dataManager*);
 
   virtual ~softwareParmela() {;}
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTest.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTest.h	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTest.h	(revision 472)
@@ -18,5 +18,5 @@
     softwareTest();
     
-    softwareTest(string inputFileName, sectionToExecute*);
+    softwareTest(string inputFileName, sectionToExecute*, dataManager*);
 
   virtual ~softwareTest() {;}
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTransport.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTransport.h	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTransport.h	(revision 472)
@@ -20,5 +20,5 @@
  public : 
     softwareTransport();
-    softwareTransport(string inputFileName, sectionToExecute*);
+    softwareTransport(string inputFileName, sectionToExecute*, dataManager*);
 
   virtual ~softwareTransport() {;}
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h	(revision 472)
@@ -13,5 +13,5 @@
  public : 
     softwareUsersprogram();
-    softwareUsersprogram(string inputFileName, sectionToExecute*);
+    softwareUsersprogram(string inputFileName, sectionToExecute*, dataManager*);
 
   virtual ~softwareUsersprogram() {;}
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc	(revision 472)
@@ -3,5 +3,4 @@
 #include <algorithm>
 #include <iostream>
-
 
 abstractSoftware::abstractSoftware()
@@ -11,5 +10,5 @@
 }
 
-abstractSoftware::abstractSoftware(string inputFileName, sectionToExecute* sect)
+abstractSoftware::abstractSoftware(string inputFileName, sectionToExecute* sect, dataManager* data)
 {
   inputFileName_ = inputFileName;
@@ -17,19 +16,13 @@
   numeroDeb_deprecated_ = 0;
   numeroFin_deprecated_ = 0;
+  dataManager_ = data;
   nameOfSoftware_ = nomDeLogiciel("unknownSoftware");
 }
 
-bool abstractSoftware::initComputationLimits_deprecated(unsigned int numeroDeb,unsigned int numeroFin_deprecated_)
-{
-/*  numeroDeb_deprecated_ = numeroDeb;
-  numeroFin_deprecated__ = numeroFin_deprecated_;
-  return ComputationLimitsOk_deprecated();
-*/
-}
 
 bool abstractSoftware::ComputationLimitsOk_deprecated() const 
 {
 /*  if (numeroDeb_deprecated_ < 1 || numeroFin_deprecated__ < 1 || numeroDeb_deprecated_ > dataManager_->getBeamLineSize() || numeroFin_deprecated__ > dataManager_->getBeamLineSize() ) {
-    dataManager_->consoleMessage(" abstractSoftware::initComputationLimit : num of element out of limits in software " + getName() );
+    consoleMessage(" abstractSoftware::initComputationLimit : num of element out of limits in software " + getName() );
     return false;
   } else {
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 472)
@@ -18,5 +18,4 @@
 
 dataManager::dataManager(PspaApplication* pspa) :
-currentBeam_(NULL),
 pspa_ (pspa)
 {}
@@ -28,5 +27,4 @@
     if ( jobList_[k] != NULL ) delete jobList_[k];
   }
-  if ( currentBeam_ == NULL ) delete currentBeam_;
 }
 
@@ -82,5 +80,4 @@
   diagnosticBeam_.clear();
   indexElementToIndexDiag_.clear();
-  currentBeam_ = NULL;
   for (unsigned int a=0; a< jobList_.size(); a++) {
       jobList_[a]->clearSectionToExecute();
@@ -130,5 +127,5 @@
     }
     
-    success = softw->createInputFile(currentBeam_,workingDir);
+    success = softw->createInputFile(sector->getParticleBeam(),workingDir);
     if ( success ) {
       success = softw->execute(workingDir);
@@ -139,8 +136,8 @@
     
     if ( success ) {
-      currentBeam_ = &diagnosticBeam_.at(indexElementToIndexDiag_.back());
+      sector->setParticleBeam(&diagnosticBeam_.at(indexElementToIndexDiag_.back()));
       cout << " execute termine avec succes " << endl;
     } else {
-      currentBeam_ = NULL;
+      sector->setParticleBeam(NULL);
       cout << " execute termine en ECHEC " << endl;
     }
@@ -157,9 +154,9 @@
     } //l
   } //k
-  // if ( currentBeam_ ) {
+  // if ( currentBeam_deprecated_ ) {
   // string aml_file = workingDir + "/" + "faisceau_final" + ".aml";
-  //   currentBeam_->writeToAMLFile(aml_file);
+  //   currentBeam_deprecated_->writeToAMLFile(aml_file);
   //   // TESTS
-  //   currentBeam_->readFromAMLFile(aml_file);
+  //   currentBeam_deprecated_->readFromAMLFile(aml_file);
   // }
   cout << " dataManager::executeAll() " << endl;
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/sectionToExecute.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/sectionToExecute.cc	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/sectionToExecute.cc	(revision 472)
@@ -10,5 +10,7 @@
 
 
-sectionToExecute::sectionToExecute(abstractElement* f, abstractSoftware* s) {
+sectionToExecute::sectionToExecute(abstractElement* f, abstractSoftware* s,dataManager* data) {
+  dataManager_ = data;
+  
   elements_.push_back(f);
   if (s == NULL) {
@@ -39,19 +41,19 @@
   if(logiciel == "parmela") {
     inputFileName = "parmin";
-    prog = new softwareParmela(inputFileName, this);
+    prog = new softwareParmela(inputFileName, this,dataManager_ );
   } else if (logiciel  == "transport") {
     inputFileName = "transport.input";
-    prog =  new softwareTransport(inputFileName, this);
+    prog =  new softwareTransport(inputFileName, this,dataManager_ );
   } else if (logiciel == "generator") {
     inputFileName = "generator.in";
-    prog = new softwareGenerator(inputFileName, this);
+    prog = new softwareGenerator(inputFileName, this,dataManager_ );
   } else if (logiciel  == "madx") {
     inputFileName = "madx.input";
-    prog = new softwareMadx(inputFileName,this);
+    prog = new softwareMadx(inputFileName,this,dataManager_ );
   } else if (logiciel  == "usersprogram") {
     inputFileName = "dummy";
-    prog = new softwareUsersprogram(inputFileName, this);
+    prog = new softwareUsersprogram(inputFileName, this,dataManager_ );
   } else if (logiciel  == "test") {
-    prog = new softwareTest(inputFileName, this);
+    prog = new softwareTest(inputFileName, this,dataManager_ );
   } else {
     prog = new softwareUnknown();
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc	(revision 472)
@@ -16,4 +16,5 @@
 duplicatedFrom_(NULL),
 repetitionNumber_(1),
+currentBeam_(NULL),
 name_(name),
 dataManager_(data),
@@ -31,5 +32,5 @@
   if (previousElement == NULL) {
     if (sectionToExecute_.size() == 0) {
-      sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL));
+      sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL,dataManager_));
     } else {
         sectionToExecute* section = sectionToExecute_.front();
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc	(revision 472)
@@ -12,5 +12,5 @@
 }
 
-softwareGenerator::softwareGenerator(string inputFileName, sectionToExecute* sect) : abstractSoftware(inputFileName, sect)
+softwareGenerator::softwareGenerator(string inputFileName, sectionToExecute* sect,dataManager* data) : abstractSoftware(inputFileName, sect,data)
 {
   cout << " softwareUsersprogram::softwareGenerator ENREGISTREMENT " << endl;
@@ -57,5 +57,5 @@
   
   ostringstream sortie;
-  sortie << " EXECUTION DE GENERATOR DE l'ELEMENT " << numeroDeb_deprecated_ << " A L'ELEMENT " << numeroFin_deprecated_ << endl;
+  sortie << " EXECUTION DE GENERATOR  " << endl;
 
   string generatorJob = workingDir + "generator";
@@ -94,5 +94,5 @@
   if ( !ComputationLimitsOk_deprecated() ) return false;
 
-  if ( numeroDeb_deprecated_ != numeroFin_deprecated_ ) {
+  if ( getSectionToExecute()->getElements().size() != 1 ) {
     dataManager_->consoleMessage(" softwareGenerator::buildBeamAfterElements : only one element (rfgun) must be calculated " );
     return false;
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc	(revision 472)
@@ -8,5 +8,5 @@
 }
 
-softwareMadx::softwareMadx(string inputFileName,sectionToExecute* sect) : abstractSoftware(inputFileName,sect)
+softwareMadx::softwareMadx(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName,sect,data)
 {
   nameOfSoftware_ = nomDeLogiciel("madx");
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc	(revision 472)
@@ -12,5 +12,5 @@
 }
 
-softwareParmela::softwareParmela(string inputFileName,sectionToExecute* sect) : abstractSoftware(inputFileName, sect)
+softwareParmela::softwareParmela(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect, data)
 {
   nameOfSoftware_ = nomDeLogiciel("parmela");
@@ -118,5 +118,5 @@
   
   ostringstream sortie;
-  sortie << " EXECUTION DE PARMELA DE l'ELEMENT " << numeroDeb_deprecated_ << " A L'ELEMENT " << numeroFin_deprecated_ << endl;
+  sortie << " EXECUTION DE PARMELA " <<  endl;
     
   string parmelaJob = workingDir + "parmela";
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTest.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTest.cc	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTest.cc	(revision 472)
@@ -14,5 +14,5 @@
 
 
-softwareTest::softwareTest(string inputFileName,sectionToExecute* sect) : abstractSoftware(inputFileName, sect)
+softwareTest::softwareTest(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
 {
   nameOfSoftware_ = nomDeLogiciel("test");
@@ -38,7 +38,5 @@
   dataManager_->consoleMessage(" softwareTest::buildBeamAfterElements  " );
   bool result = true;
-  unsigned k;
-  for ( k= numeroDeb_deprecated_; k <= numeroFin_deprecated_; k++)
-    {
+  for ( unsigned int k=0; k < getSectionToExecute()->getElements().size() ; k++ ) {
       particleBeam* newDiag = dataManager_->updateCurrentDiagnostic(true);
   //      beams.push_back(particleBeam());
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTransport.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTransport.cc	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTransport.cc	(revision 472)
@@ -11,5 +11,5 @@
 }
 
-softwareTransport::softwareTransport(string inputFileName,sectionToExecute* sect) : abstractSoftware(inputFileName, sect)
+softwareTransport::softwareTransport(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
 {
   nameOfSoftware_ = nomDeLogiciel("transport");
@@ -105,5 +105,5 @@
 
   ostringstream sortie;
-  sortie << " EXECUTION DE TRANSPORT DE " << numeroDeb_deprecated_ << " a " << numeroFin_deprecated_ << endl;
+  sortie << " EXECUTION DE TRANSPORT " << endl;
   
   string transportJob = workingDir + "transport";
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc	(revision 472)
@@ -10,5 +10,5 @@
 }
 
-softwareUsersprogram::softwareUsersprogram(string inputFileName, sectionToExecute* sect) : abstractSoftware(inputFileName, sect)
+softwareUsersprogram::softwareUsersprogram(string inputFileName, sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
 {
   cout << " softwareUsersprogram::softwareUsersprogram ENREGISTREMENT " << endl;
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 471)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 472)
@@ -267,5 +267,5 @@
   if (s > 0) {
     abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->getLastElement();
-    UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL));
+    UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL,dtmanage_));
     UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->removeLastElement();
   }
