Index: Interface_Web/trunk/Interfaces/aml/v1r0p0/cmt/requirements
===================================================================
--- Interface_Web/trunk/Interfaces/aml/v1r0p0/cmt/requirements	(revision 468)
+++ Interface_Web/trunk/Interfaces/aml/v1r0p0/cmt/requirements	(revision 469)
@@ -9,9 +9,9 @@
 
 macro aml_home "" \
-      Darwin "/usr/local/accelerator-ml-code" \
-      Linux  "/usr/local/accelerator-ml-code/uap/trunk"
+      Darwin "/Users/garnier/Work/PSPA/accelerator-ml-code/uap/trunk/" \
+      Linux  "/Users/garnier/Work/PSPA/accelerator-ml-code/uap/trunk"
 
 macro aml_cflags   "" \
-      Darwin " -I $(aml_home) -I/usr/local/include" \
+      Darwin " -I $(aml_home) -I/usr/local/include -I/sw/include" \
       Linux  " -I $(aml_home) -I/usr/include"
 macro aml_cppflags "" \
@@ -20,5 +20,5 @@
 
 macro aml_linkopts "" \
-      Darwin " -L${aml_home}/lib/ -lantlr -luap -L/usr/local/lib -lxerces-c-3.1"\
+      Darwin " -L${aml_home}/lib/ -lantlr -luap -L/sw/lib -lxerces-c-3.1"\
       Linux  " -L${aml_home}/lib/ -lantlr -luap -L/usr/lib -lxerces-c"
 
Index: Interface_Web/trunk/pspaWT/History
===================================================================
--- Interface_Web/trunk/pspaWT/History	(revision 468)
+++ Interface_Web/trunk/pspaWT/History	(revision 469)
@@ -5,4 +5,41 @@
      PSPA - Plateforme de simulation en physique des accÃ©lÃ©rateurs
      =========================================================
+
+19 Décembre 2013 : Laurent Garnier
+- abstractElement : 
+  o Suppression des méthodes relatives aux softwares, ils sont désormais traités dans les sectionToExecute.
+    getAbstractSoftware(), setSoftware, abstractSoftware_
+
+- softwareUnknown : 
+  o Changement de la méthode createInputFile qui ne prend désormais plus de numéroDeb ni numéroFin.
+   - createInputFile(particleBeam* beamBefore,unsigned int numeroDeb, unsigned int numeroFin, string workingDir)
+
+- sectionToExecute :
+  o Suppression de sectionToExecute(abstractElement*), désormais il faut obligatoirement passer le nom du sofware associé (ou sofwareUnknown si besoin)
+  o Ajout de la méthode setSoftware(std::string) afin de gérer tout les select/case de sofware uniquement dans le controller
+  o Ajout de insertAtFirst(abstractElement* abs)
+
+- dataManager : Renommage de pspa_->getBeamLine() en pspa_->getBeamLine_deprecated(), en effet la beamLine n'existe plus dans cette classe, elle se trouve désormais dans la section.
+
+- GWt_elementLigneFaisceau : 
+  o Passage de setBGColor() en méthode publique
+  o Suppression de updateSoftware() qui n'a plus lien d'être
+
+- GWt_sectionToExecute :
+  o Un peu de renommage pour une meilleure clarté
+  o Ajout d'un argument vers la sectionToExecute du controler
+
+- GWt_ligneFaisceau :
+  o Suppression de initializeSoftwares() qui est désormais automatiquement fait à la création d'un composant de la beamLine
+
+- PspaApplication : 
+  o Renommage degetBeamLine() en getBeamLine_deprecated(), en effet la beamLine n'existe plus dans cette classe, elle se trouve désormais dans la section.
+
+- GWt_sector : 
+  o Ajout d'une méthode pour récupérer le widget de la beamLine : getBeamLineWidget() 
+
+- GWt_softwarePanel :
+  o Désormais il est de nouveau possible d'ajouter des sections et d'y affecter des softwares (ne marche pour le moment qu'avec la 1ere sectionToExecute)
+
 
 18 Décembre 2013 : Laurent Garnier
Index: Interface_Web/trunk/pspaWT/sources/controler/include/abstractElement.h
===================================================================
--- Interface_Web/trunk/pspaWT/sources/controler/include/abstractElement.h	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/controler/include/abstractElement.h	(revision 469)
@@ -61,22 +61,5 @@
   virtual string print() = 0;
   virtual void InputRep(UAPNode* root) = 0;
-
-  /* Return the abstractSofware associated with this element
-   */
-  inline abstractSoftware* getAbstractSoftware() {
-    return abstractSoftware_;
-  }
-  
-  /* Set the software to this element
-     @param abstractSoftware a pointer to the abstract software
-  */
-  inline void setSoftware(abstractSoftware* prog) { 
-    abstractSoftware_ = prog; 
-  }
-  
- private :
-
-  abstractSoftware *abstractSoftware_;
-  
+    
 };
 #endif
Index: Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h
===================================================================
--- Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h	(revision 469)
@@ -9,7 +9,4 @@
 {
  public :
-  /** Create a new sectionToExecute and initialize it with the given element
-   */
-  sectionToExecute(abstractElement*);
 
   /** Create a new sectionToExecute and initialize it with the given element and software
@@ -26,8 +23,14 @@
   }
   
-  inline abstractSoftware* setSoftware(abstractSoftware* soft) {
+  inline void setSoftware(abstractSoftware* soft) {
     software_ = soft;
   }
   
+/**
+ Set a software according to the corresponding given string.
+ If not found, set a softwareUnknown
+ */
+  void setSoftware(std::string);
+
   /**
    Get the vector of elements of this sector
@@ -47,4 +50,8 @@
   bool insertAfter(abstractElement*,abstractElement*);
 
+  inline bool insertAtFirst(abstractElement* abs) {
+    elements_.insert ( elements_.begin() ,abs);
+  };
+  
   private :
 
Index: Interface_Web/trunk/pspaWT/sources/controler/include/sector.h
===================================================================
--- Interface_Web/trunk/pspaWT/sources/controler/include/sector.h	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/controler/include/sector.h	(revision 469)
@@ -69,4 +69,5 @@
   /** Add an element after another one. Will put it in the same sectionToExecuteList. If the element after is NULL
    it will create a new sectionToExecute and put it inside.
+   if the previous element is NULL, it will try to add at the beginning of the first section
    */
   void addElementAfter(abstractElement*,abstractElement*);
Index: Interface_Web/trunk/pspaWT/sources/controler/include/softwareUnknown.h
===================================================================
--- Interface_Web/trunk/pspaWT/sources/controler/include/softwareUnknown.h	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/controler/include/softwareUnknown.h	(revision 469)
@@ -11,5 +11,5 @@
   virtual ~softwareUnknown() {;}
 
-  virtual bool createInputFile(particleBeam*,sectionToExecute* sectionToExe, string);
+  virtual bool createInputFile(particleBeam* beamBefore, string workingDir);
   virtual bool execute(string);
   virtual bool buildBeamAfterElements(string);
Index: Interface_Web/trunk/pspaWT/sources/controler/src/abstractElement.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/controler/src/abstractElement.cc	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/controler/src/abstractElement.cc	(revision 469)
@@ -5,5 +5,5 @@
 #include "abstractElement.h"
 
-abstractElement::abstractElement() : abstractSoftware_(NULL)
+abstractElement::abstractElement()
 {
   setDefaultValues();
@@ -12,5 +12,5 @@
 }
 
-abstractElement::abstractElement(string lab) : abstractSoftware_(NULL)
+abstractElement::abstractElement(string lab)
 {
   specificName_ = lab;
Index: Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 469)
@@ -41,5 +41,5 @@
 {
 /*
- abstractElement* ptr = pspa_->getBeamLine()->getAbstractElement(numero-1);
+ abstractElement* ptr = pspa_->getBeamLine_deprecated()->getAbstractElement(numero-1);
   if ( ptr == NULL ) return "";
   return ptr->getLabel();
@@ -52,6 +52,6 @@
 /*  int index = -1;
   for (int k = 0; k < getBeamLineSize() ; k++) {
-    if (pspa_->getBeamLine()->getAbstractElement(k) != NULL) {
-      if ( pspa_->getBeamLine()->getAbstractElement(k)->getLabel() == label )
+    if (pspa_->getBeamLine_deprecated()->getAbstractElement(k) != NULL) {
+      if ( pspa_->getBeamLine_deprecated()->getAbstractElement(k)->getLabel() == label )
 	{
 	  index = (int)k + 1;
@@ -264,5 +264,5 @@
   //NOTE:: je ne sais pas si les "secteurs" seront conservÃ©s, aussi pour ne pas trop changer les fichiers je lis les donnÃ©es aprÃšs "globals" dans la boucle 
   
-  pspa_->getBeamLine()->clear();
+  pspa_->getBeamLine_deprecated()->clear();
   nomdElements::typedElement elementType;
   string elementLabel;
@@ -278,5 +278,5 @@
     } else {
       elementType = nomdElements::getTypeFromLabel(elementLabel);
-      GWt_abstractElement* nouveau = pspa_->getBeamLine()->addElement(elementType);
+      GWt_abstractElement* nouveau = pspa_->getBeamLine_deprecated()->addElement(elementType);
       if ( nouveau == NULL ) {
 	cerr << " dataManager::restoreElements() : restore element " << elementLabel << " failed " << endl;
@@ -291,5 +291,5 @@
   unsigned k;
   for(k = 0; k < getBeamLineSize(); k++) {
-    abstractElement* ptr = pspa_->getBeamLine()->getAbstractElement(k);
+    abstractElement* ptr = pspa_->getBeamLine_deprecated()->getAbstractElement(k);
     cout << "recupere " << ptr->getLabel() << endl;
   }
Index: Interface_Web/trunk/pspaWT/sources/controler/src/sectionToExecute.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/controler/src/sectionToExecute.cc	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/controler/src/sectionToExecute.cc	(revision 469)
@@ -1,13 +1,20 @@
 #include "sectionToExecute.h"
-
-
-sectionToExecute::sectionToExecute(abstractElement* a) {
-  elements_.push_back(a);
-}
+#include "softwareUnknown.h"
+#include "softwareParmela.h"
+#include "softwareTransport.h"
+#include "softwareGenerator.h"
+#include "softwareGenerator.h"
+#include "softwareUsersprogram.h"
+#include "softwareTest.h"
+#include "softwareMadx.h" //xx
 
 
 sectionToExecute::sectionToExecute(abstractElement* f, abstractSoftware* s) {
   elements_.push_back(f);
+  if (s == NULL) {
+    software_ = new softwareUnknown();
+  } else {
     software_ = s;
+  }
 }
 
@@ -25,36 +32,31 @@
 }
 
-/*
-bool sectionToExecute::setSoftware(nomDeLogiciel logiciel) {
-  
-  if (sectionToExecuteNumber >= sectionToExecute_.size()) {
-    return false;
+
+void sectionToExecute::setSoftware(std::string logiciel) {
+ 
+  abstractSoftware* prog;
+  string inputFileName;
+  if(logiciel == "parmela") {
+    inputFileName = "parmin";
+    prog = new softwareParmela(inputFileName, this);
+  } else if (logiciel  == "transport") {
+    inputFileName = "transport.input";
+    prog =  new softwareTransport(inputFileName, this);
+  } else if (logiciel == "generator") {
+    inputFileName = "generator.in";
+    prog = new softwareGenerator(inputFileName, this);
+  } else if (logiciel  == "madx") {
+    inputFileName = "madx.input";
+    prog = new softwareMadx(inputFileName,this);
+  } else if (logiciel  == "usersprogram") {
+    inputFileName = "dummy";
+    prog = new softwareUsersprogram(inputFileName, this);
+  } else if (logiciel  == "test") {
+    prog = new softwareTest(inputFileName, this);
+  } else {
+    prog = new softwareUnknown();
   }
   
-  abstractSoftware* prog;
-  string inputFileName;
-  if(logiciel == nomDeLogiciel::parmela) {
-    inputFileName = "parmin";
-    prog = new softwareParmela(inputFileName, this);
-  } else if (logiciel  == nomDeLogiciel::transport) {
-    inputFileName = "transport.input";
-    prog =  new softwareTransport(inputFileName, this);
-  } else if (logiciel == nomDeLogiciel::generator) {
-    inputFileName = "generator.in";
-    prog = new softwareGenerator(inputFileName, this);
-  } else if (logiciel  == nomDeLogiciel::madx) {
-    inputFileName = "madx.input";
-    prog = new softwareMadx(inputFileName,this);
-  } else if (logiciel  == nomDeLogiciel::usersprogram) {
-    inputFileName = "dummy";
-    prog = new softwareUsersprogram(inputFileName, this);
-  } else if (logiciel  == nomDeLogiciel::test) {
-    prog = new softwareTest(inputFileName, this);
-  } else {
-    prog = new softwareUnknown(); // xx
-  }
-  
-  sectionToExecute_[sectionToExecuteNumber]->setSoftware(prog);
-  return true;
+  setSoftware(prog);
 }
-*/
+
Index: Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc	(revision 469)
@@ -8,12 +8,4 @@
 
 #include "sector.h"
-#include "softwareParmela.h"
-#include "softwareTransport.h"
-#include "softwareGenerator.h"
-#include "softwareGenerator.h"
-#include "softwareUsersprogram.h"
-#include "softwareTest.h"
-#include "softwareMadx.h" //xx
-#include "softwareUnknown.h" //xx
 
 #include "sectionToExecute.h"
@@ -35,9 +27,12 @@
 
 void sector::addElementAfter(abstractElement* currentElement ,abstractElement* previousElement){
+// if the previous element is NULL, it will try to add at the beginning of the first section
+  
   if (previousElement == NULL) {
     if (sectionToExecute_.size() == 0) {
-      sectionToExecute_.push_back(new sectionToExecute(currentElement));
+      sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL));
     } else {
-      sectionToExecute_.insert ( sectionToExecute_.begin() , new sectionToExecute(currentElement) );
+        sectionToExecute* section = sectionToExecute_.front();
+      section->insertAtFirst(currentElement);
     }
   } else {
Index: Interface_Web/trunk/pspaWT/sources/controler/src/softwareUnknown.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/controler/src/softwareUnknown.cc	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/controler/src/softwareUnknown.cc	(revision 469)
@@ -17,5 +17,5 @@
 }
 
-bool softwareUnknown::createInputFile(particleBeam* beamBefore,sectionToExecute* sectionToExe, string workingDir)
+bool softwareUnknown::createInputFile(particleBeam* beamBefore, string workingDir)
 {
   return true;
Index: Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementLigneFaisceau.h
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementLigneFaisceau.h	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementLigneFaisceau.h	(revision 469)
@@ -31,5 +31,5 @@
      */
     
-    GWt_elementLigneFaisceau(dataManager*,GWt_ligneFaisceau*, abstractElement* abstractElem);
+  GWt_elementLigneFaisceau(dataManager*,GWt_ligneFaisceau*, abstractElement* abstractElem, std::string);
     
     ~GWt_elementLigneFaisceau();
@@ -61,4 +61,10 @@
         softwareName_ =new WText(name);
     }
+  
+  /**
+   Set the background color for this element
+   */
+  void setBGColor(const WColor);
+
 
 private:
@@ -66,12 +72,8 @@
     void removeDone(GWt_abstractElement*);
     std::string getElementNumberInBeamLine(nomdElements el);
-    void initialize_ligneFaisceau(GWt_ligneFaisceau* ligne, abstractElement* abstractElem);
+    void initialize_ligneFaisceau(GWt_ligneFaisceau* ligne, abstractElement* abstractElem, std::string);
     void mouseWentOut();
     void mouseWentOver();
-  /**
-   Update the software of this element according to the sectionToExecute software. Will change the color of this object
-   */
-  void updateSoftware();
-    void setBGColor(const WColor);
+
     GWt_dialog* messageDropZone_;
     WText* firstTimeInsertMessage_;
Index: Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_ligneFaisceau.h
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_ligneFaisceau.h	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_ligneFaisceau.h	(revision 469)
@@ -79,13 +79,12 @@
    */
   void update_deprecated(int);
-  
-    void initializeSoftwares();
-  
+    
   /** Return the sector of this beamLine */
   inline GWt_sector* getUISector() { return UI_sector_;};
   
+  void buildBeamLineWidget();
+
   private :
   void manageLineFaisceauLayout_deprecated();
-  void buildBeamLineWidget();
   
   GWt_dropZoneLigneFaisceau* allDropZone_;
Index: Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h	(revision 469)
@@ -93,5 +93,5 @@
   }
 
-  inline GWt_ligneFaisceau* getBeamLine() {
+  inline GWt_ligneFaisceau* getBeamLine_deprecated() {
     return beamLine_deprecated_;
   }
Index: Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h	(revision 469)
@@ -8,35 +8,31 @@
 class GWt_softwarePanel;
 class GWt_sector;
+class sectionToExecute;
 
 class GWt_sectionToExecute : public Wt::WContainerWidget
 {
     public :
-    GWt_sectionToExecute(Wt::WComboBox*,Wt::WComboBox*,Wt::WComboBox*,Wt::WContainerWidget* buttonPanel,GWt_softwarePanel* sPanel,GWt_sector*);
+    GWt_sectionToExecute(Wt::WComboBox* ,Wt::WComboBox* ,Wt::WComboBox*,Wt::WContainerWidget* ,sectionToExecute*,GWt_sector* );
 
     ~GWt_sectionToExecute() {;}
 
+    void setSoftware();
+
     inline Wt::WString getFirstElementCurrentText() {
-        return firstElement->currentText();
+        return firstElement_->currentText();
     }
     
     inline Wt::WString getLastElementCurrentText() {
-        return lastElement->currentText();
-    }
-    
-    inline Wt::WString getSoftwareCurrentText() {
-        return software->currentText();
+        return lastElement_->currentText();
     }
     
     inline Wt::WComboBox * getFirstElement() {
-        return firstElement;
+        return firstElement_;
     }
     
     inline Wt::WComboBox * getLastElement() {
-        return lastElement;
+        return lastElement_;
     }
     
-    inline Wt::WComboBox * getSoftware() {
-        return software;
-    }
     void setFirstElementCurrentSelection(Wt::WString);
     void setLastElementCurrentSelection(Wt::WString);
@@ -56,8 +52,9 @@
     
     void manageWarningsAndErrors();
-    Wt::WComboBox*  firstElement;
-    Wt::WComboBox*  lastElement;
-    Wt::WComboBox* software;
-    GWt_softwarePanel* softwarePanel;
+    Wt::WComboBox*  firstElement_;
+    Wt::WComboBox*  lastElement_;
+    Wt::WComboBox*  softElement_;
+    sectionToExecute* section_;
+    GWt_sector* UIsector_;
 
     Wt::WText* errorsLabel_;
@@ -66,5 +63,4 @@
     Wt::WContainerWidget* warningsContainer_;
     Wt::WContainerWidget* errorsContainer_;
-    GWt_sector* UI_sector_;
 };
 
Index: Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sector.h
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sector.h	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sector.h	(revision 469)
@@ -32,4 +32,11 @@
   }
   
+  /** 
+   Get the beam line widget
+   */
+  inline GWt_ligneFaisceau* getBeamLineWidget() {
+    return UI_beamLine_;
+  };
+  
   private :
   GWt_ligneFaisceau* UI_beamLine_;
Index: Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h	(revision 469)
@@ -39,5 +39,9 @@
   string getSelection();
   void fillComboWithElements(Wt::WComboBox* cBox);
-  void fillComboWithSoftwares(Wt::WComboBox* cBox);
+
+  /** Fill a ComboBox with the software list
+   By default, will setup the default text to the last software
+   */
+  void fillComboWithSoftwares(Wt::WComboBox* cBox, std::string );
   Wt::WContainerWidget* createAddDeletePushButtons(int sectionIndex);
 
Index: Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_accelerator.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_accelerator.cc	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_accelerator.cc	(revision 469)
@@ -669,6 +669,6 @@
    
    // intialize User Interface
-   if (pspa_->getBeamLine()) {
-   pspa_->getBeamLine()->initializeSoftwares();
+   if (pspa_->getBeamLine_deprecated()) {
+   pspa_->getBeamLine_deprecated()->initializeSoftwares();
    }
    
@@ -679,10 +679,10 @@
    string debString= sections_[a]->getFirstElementCurrentText().toUTF8();
    string finString= sections_[a]->getLastElementCurrentText().toUTF8();
-   int debut = pspa_->getBeamLine()->getAbstractElementNumeroFromLabel(debString);
-   int fin = pspa_->getBeamLine()->getAbstractElementNumeroFromLabel(finString);
+   int debut = pspa_->getBeamLine_deprecated()->getAbstractElementNumeroFromLabel(debString);
+   int fin = pspa_->getBeamLine_deprecated()->getAbstractElementNumeroFromLabel(finString);
    
    string currentSoft= sections_[a]->getSoftwareCurrentText().toUTF8();
    nomDeLogiciel prog = nomDeLogiciel(currentSoft);
-   sectionToExecute* sectToExec = dtmanage_->addSectionToExecute(pspa_->getBeamLine()->getAbstractElement(debut),debut,pspa_->getBeamLine()->getAbstractElement(fin),fin,prog);
+   sectionToExecute* sectToExec = dtmanage_->addSectionToExecute(pspa_->getBeamLine_deprecated()->getAbstractElement(debut),debut,pspa_->getBeamLine_deprecated()->getAbstractElement(fin),fin,prog);
    
    abstractSoftware* softToExec = sectToExec->getSoftware();
@@ -691,6 +691,6 @@
    for(int i = debut-1; i < fin; i++) // check sections
    {
-   if (!pspa_->getBeamLine()) continue;
-   abstractElement* elPtr= pspa_->getBeamLine()->getAbstractElement(i);
+   if (!pspa_->getBeamLine_deprecated()) continue;
+   abstractElement* elPtr= pspa_->getBeamLine_deprecated()->getAbstractElement(i);
    if (!elPtr) continue;
    
@@ -709,5 +709,5 @@
    }
    }
-   pspa_->getBeamLine()->update(i);
+   pspa_->getBeamLine_deprecated()->update(i);
    } //i
    
Index: Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc	(revision 469)
@@ -20,5 +20,5 @@
 
 
-GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(dataManager* data,GWt_ligneFaisceau* ligne, abstractElement* abstractElem)
+GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(dataManager* data,GWt_ligneFaisceau* ligne, abstractElement* abstractElem,std::string bgcolor)
   : WContainerWidget(),
     firstTimeInsertMessage_(NULL),
@@ -31,8 +31,8 @@
   // set the css name
   setObjectName("elementLigneFaisceau");
-  initialize_ligneFaisceau(ligne,abstractElem);
-}
-
-void GWt_elementLigneFaisceau::initialize_ligneFaisceau(GWt_ligneFaisceau* ligne, abstractElement* abstractElem)
+  initialize_ligneFaisceau(ligne,abstractElem,bgcolor);
+}
+
+void GWt_elementLigneFaisceau::initialize_ligneFaisceau(GWt_ligneFaisceau* ligne, abstractElement* abstractElem,std::string bgcolor)
 {   
   // set layout
@@ -173,4 +173,7 @@
   gridLayout->setColumnStretch (2,1);
   
+  // Change background color
+  setBGColor(WColor(bgcolor));
+
   // set layout
   setLayout(gridLayout);
@@ -182,5 +185,4 @@
   actionTrash_->clicked().connect(GWt_abstractElement_deprecated_,&GWt_abstractElement::deleteElement);
 
-  updateSoftware();
 }
 
@@ -188,19 +190,4 @@
 {}
 
-void GWt_elementLigneFaisceau::updateSoftware() 
-{
-  if (getGWt_AbstractElement()->getAbstractElement()) {
-    if (getGWt_AbstractElement()->getAbstractElement()->getAbstractSoftware()) {
-      //      setBGColor(WColor(getGWt_AbstractElement()->getAbstractElement()->getAbstractSoftware()->getColor()));
-      setBGColor(WColor(getGWt_AbstractElement()->getAbstractElement()->getAbstractSoftware()->getNomDeLogiciel()->getColor()));
-      softwareName_->setText(getGWt_AbstractElement()->getAbstractElement()->getAbstractSoftware()->getName());
-
-    // no abstract software
-    } else {
-      setBGColor(WColor("#FFFFFF"));
-      softwareName_->setText("");
-    }
-  }
-}
 
 void GWt_elementLigneFaisceau::setBGColor(const WColor c) {
Index: Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc	(revision 469)
@@ -178,5 +178,5 @@
       elemLigneFaisceau = new GWt_elementLigneFaisceau(dataManager_,
                                                        this,
-                                                       abstractElem[j]);
+                                                       abstractElem[j],UI_sector_->getSectorControler()->getSectionsToExecute()[i]->getSoftware()->getColor());
       
       // remove default text
@@ -328,15 +328,2 @@
     }
 }
-
-
-void GWt_ligneFaisceau::initializeSoftwares()
-{    
-  vector <abstractElement*> elems = getAllAbstractElements();
-  cout << "GWt_ligneFaisceau::initializeSoftwares() " << elems.size() << endl;
-
-  for (int a = 0; a < elems.size(); a++) {
-    elems[a]->setSoftware( NULL );
-  }
-}
-
-
Index: Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc	(revision 469)
@@ -8,12 +8,13 @@
 #include "GWt_sectionToExecute.h"
 #include "GWt_softwarePanel.h"
+#include "GWt_sector.h"
 
-GWt_sectionToExecute::GWt_sectionToExecute(Wt::WComboBox* first,Wt::WComboBox* last,Wt::WComboBox* soft,Wt::WContainerWidget* buttonPanel, GWt_softwarePanel* sPanel,GWt_sector* sect)
+GWt_sectionToExecute::GWt_sectionToExecute(Wt::WComboBox* first,Wt::WComboBox* last,Wt::WComboBox* soft,Wt::WContainerWidget* buttonPanel, sectionToExecute* section,GWt_sector* sector)
 :WContainerWidget(),
-firstElement(first),
-lastElement(last),
-software(soft),
-softwarePanel(sPanel),
-UI_sector_(sect)
+firstElement_(first),
+lastElement_(last),
+softElement_(soft),
+section_(section),
+UIsector_(sector)
 {
   Wt::WGridLayout* mainContainerLayout = new Wt::WGridLayout();
@@ -29,8 +30,8 @@
   
   labelAndComboInsideContainerLayout->addWidget(new Wt::WText("from&nbsp;:&nbsp;"));
-  labelAndComboInsideContainerLayout->addWidget(first);
+  labelAndComboInsideContainerLayout->addWidget(firstElement_);
   labelAndComboInsideContainerLayout->addWidget(new Wt::WText("to&nbsp;:&nbsp;"));
-  labelAndComboInsideContainerLayout->addWidget(last);
-  labelAndComboInsideContainerLayout->addWidget(soft);
+  labelAndComboInsideContainerLayout->addWidget(lastElement_);
+  labelAndComboInsideContainerLayout->addWidget(softElement_);
   
     // add buttons
@@ -86,11 +87,11 @@
   
   // resize combo
-  firstElement->setMinimumSize(80,12);
-  lastElement->setMinimumSize(80,12);
-  software->setMinimumSize(80,12);
+  firstElement_->setMinimumSize(80,12);
+  lastElement_->setMinimumSize(80,12);
+  softElement_->setMinimumSize(80,12);
   
-  firstElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
-  lastElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
-  software->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
+//  firstElement_->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
+//  lastElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
+  softElement_->activated().connect(this,&GWt_sectionToExecute::setSoftware);
   
   manageWarningsAndErrors();
@@ -99,7 +100,7 @@
 
 void GWt_sectionToExecute::setFirstElementCurrentSelection(Wt::WString txt){
-    for (int a=0; a< firstElement->count(); a++) {
-        if (firstElement->itemText(a) == txt) {
-            firstElement->setCurrentIndex (a);
+    for (int a=0; a< firstElement_->count(); a++) {
+        if (firstElement_->itemText(a) == txt) {
+            firstElement_->setCurrentIndex (a);
             return;
         }
@@ -108,7 +109,7 @@
 
 void GWt_sectionToExecute::setLastElementCurrentSelection(Wt::WString txt){
-    for (int a=0; a< lastElement->count(); a++) {
-        if (lastElement->itemText(a) == txt) {
-            lastElement->setCurrentIndex (a);
+    for (int a=0; a< lastElement_->count(); a++) {
+        if (lastElement_->itemText(a) == txt) {
+            lastElement_->setCurrentIndex (a);
             return;
         }
@@ -117,7 +118,7 @@
 
 void GWt_sectionToExecute::setSoftwareElementCurrentSelection(Wt::WString txt){
-  for (int a=0; a< software->count(); a++) {
-    if (software->itemText(a) == txt) {
-      software->setCurrentIndex (a);
+  for (int a=0; a< softElement_->count(); a++) {
+    if (softElement_->itemText(a) == txt) {
+      softElement_->setCurrentIndex (a);
       return;
     }
@@ -140,10 +141,9 @@
 }
 
-/*
- void GWt_sectionToExecute::setSoftware(nomDeLogiciel logiciel)
+
+ void GWt_sectionToExecute::setSoftware()
 {
-  UI_sector_->getSectorControler()->setSoftware(logiciel);
-
+  section_->setSoftware(softElement_->currentText().toUTF8());
+  UIsector_->getBeamLineWidget()->buildBeamLineWidget();
 }
 
-*/
Index: Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 468)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 469)
@@ -67,7 +67,4 @@
       abstractElement* dernierElement = NULL;
       
-      int premierIndex = 0;
-      int dernierIndex = 0;
-      
       std::string premierElementLabel = "";
       std::string dernierElementLabel = "";
@@ -84,14 +81,32 @@
       fillComboWithElements(lineToCombo);
       
-      // set selection
-      lineFromCombo->setCurrentIndex(premierIndex);
-      lineToCombo->setCurrentIndex(dernierIndex);
+      // set to first
+      lineFromCombo->setCurrentIndex(0);
+      // set to last
+      lineToCombo->setCurrentIndex(lineToCombo->count());
       
       WComboBox* softCombo = new WComboBox();
-      fillComboWithSoftwares(softCombo);
+      sector * sector = UIsector_->getSectorControler();
+      sectionToExecute* sect = UIsector_->getSectorControler()->getSectionsToExecute()[a];
+      abstractSoftware* abs = sect->getSoftware();
+      
+      fillComboWithSoftwares(softCombo,UIsector_->getSectorControler()->getSectionsToExecute()[a]->getSoftware()->getName());
+
+      // disable the "to" comboBox
+      lineToCombo->disable();
+
+      // disable the first "from" comboBox
+      if (a==0) {
+        lineFromCombo->disable();
+      }
+      // disable the last "to" comboBox
+      if (a==UIsector_->getSectorControler()->getSectionsToExecute().size()-1) {
+        lineToCombo->disable();
+      }
       
       // Add the sectionToExecute Widget
-      GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(UIsectionsToExecute_.size()),this,UIsector_);
-      
+      GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(a),UIsector_->getSectorControler()->getSectionsToExecute()[a],UIsector_);
+      
+      // FIXME ?
       stringstream st;
       st << UIsectionsToExecute_.size();
@@ -103,5 +118,5 @@
       UIsectionsToExecute_.push_back(newSection);
       contenuSections_->addWidget(newSection);
-      updateSections();
+//      updateSections();
 
       
@@ -116,6 +131,6 @@
   cout << " GWt_softwarePanel::updateSections() " << endl<<endl;
 #endif
-  return;
-  
+
+  /*
   // update all sections in order to manage new/deleted items
   for (int a = 0; a < UIsectionsToExecute_.size(); a++) {
@@ -140,4 +155,5 @@
   // set default values
   updateSectionSelection();
+*/
 }
 
@@ -248,5 +264,5 @@
   if (s > 0) {
     abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->getLastElement();
-    UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs));
+    UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL));
     UIsector_->getSectorControler()->getSectionsToExecute()[s]->removeLastElement();
   }
@@ -290,8 +306,4 @@
   if (cBox == NULL) return;
 
-  // get the last item selected
-  WString selectedString = cBox->currentText();
-  cBox->clear();
-
   if (!UIsector_->getSectorControler()) {
     return;
@@ -306,14 +318,7 @@
     }
   }
-  
-  for(int a = 0; a < cBox->count(); a++) {
-    if (cBox->itemText (a) == selectedString) {
-      cBox->setCurrentIndex(a);
-    }
-  }
-  cBox->refresh();
-}
-
-void GWt_softwarePanel::fillComboWithSoftwares(Wt::WComboBox* cBox) 
+}
+
+void GWt_softwarePanel::fillComboWithSoftwares(Wt::WComboBox* cBox, std::string selected)
 {
 #if BAVARD > 0
@@ -329,6 +334,8 @@
   for(k = 0; k <= nb; k++) { //xx
     cBox->addItem(nomDeLogiciel(k).getString());
-  }
-  cBox->setCurrentIndex(nb); // xx
+    if (nomDeLogiciel(k).getString() == selected) {
+      cBox->setCurrentIndex(cBox->count()-1);
+    }
+  }
   cBox->refresh();
 }
