Index: /Interface_Web/trunk/pspaWT/History
===================================================================
--- /Interface_Web/trunk/pspaWT/History	(revision 470)
+++ /Interface_Web/trunk/pspaWT/History	(revision 471)
@@ -5,4 +5,9 @@
      PSPA - Plateforme de simulation en physique des accÃ©lÃ©rateurs
      =========================================================
+
+19 Décembre 2013 : Laurent Garnier
+- GWt_softwarePanel:
+  o Suppression de UIsectionsToExecute_, désormais le vecteur de sectionsToExcute est géré par le controleur
+  o Modification du softwarePanel, on peut désormais ajouter plusieurs sections et en changer le logiciel. Reste à faire les suppression de sections et les modifications de début/fin
 
 19 Décembre 2013 : Laurent Garnier
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h	(revision 470)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h	(revision 471)
@@ -49,6 +49,4 @@
   WContainerWidget* contenuSections_;
   GWt_sector* UIsector_;
-
-  std::vector <GWt_sectionToExecute*> UIsectionsToExecute_;
 };
 #endif /* defined(__PSPA__GWt_softwarePanel__) */
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 470)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 471)
@@ -63,4 +63,6 @@
     // FIXME : Add a message to tell the user to add first an element
   } else {
+
+    unsigned long firstSectionToExecuteIndex = 0;
     for (unsigned int a=0; a<UIsector_->getSectorControler()->getSectionsToExecute().size(); a++) {
       abstractElement* premierElement = NULL;
@@ -82,7 +84,7 @@
       
       // set to first
-      lineFromCombo->setCurrentIndex(0);
+      lineFromCombo->setCurrentIndex(firstSectionToExecuteIndex);
       // set to last
-      lineToCombo->setCurrentIndex(lineToCombo->count());
+      lineToCombo->setCurrentIndex(firstSectionToExecuteIndex + UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size() - 1);
       
       WComboBox* softCombo = new WComboBox();
@@ -108,7 +110,7 @@
       GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(a),UIsector_->getSectorControler()->getSectionsToExecute()[a],UIsector_);
       
-      // FIXME ?
+/*      // FIXME ?
       stringstream st;
-      st << UIsectionsToExecute_.size();
+      st << UIsectionsToExecute_deprecated_.size();
       
       // this is the mean to identify this section!
@@ -116,9 +118,10 @@
       
       // push back on sections vector
-      UIsectionsToExecute_.push_back(newSection);
+      UIsectionsToExecute_deprecated_.push_back(newSection);
+*/
       contenuSections_->addWidget(newSection);
 //      updateSections();
 
-      
+      firstSectionToExecuteIndex += UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size();
     }
   }
@@ -134,22 +137,22 @@
   /*
   // update all sections in order to manage new/deleted items
-  for (int a = 0; a < UIsectionsToExecute_.size(); a++) {
-    fillComboWithElements(UIsectionsToExecute_[a]->getFirstElement());
-    fillComboWithElements(UIsectionsToExecute_[a]->getLastElement());
-    UIsectionsToExecute_[a]->getFirstElement()->setEnabled (true);
-    UIsectionsToExecute_[a]->getLastElement()->setEnabled (true);
-  }
-  
-  if (UIsectionsToExecute_.size() == 0) {
+  for (int a = 0; a < UIsectionsToExecute_deprecated_.size(); a++) {
+    fillComboWithElements(UIsectionsToExecute_deprecated_[a]->getFirstElement());
+    fillComboWithElements(UIsectionsToExecute_deprecated_[a]->getLastElement());
+    UIsectionsToExecute_deprecated_[a]->getFirstElement()->setEnabled (true);
+    UIsectionsToExecute_deprecated_[a]->getLastElement()->setEnabled (true);
+  }
+  
+  if (UIsectionsToExecute_deprecated_;.size() == 0) {
     return;
   }
   
   // the first element will always be the first element of the beamLine
-  UIsectionsToExecute_[0]->getFirstElement()->setCurrentIndex(0);
-  UIsectionsToExecute_[0]->getFirstElement()->setEnabled (false);
+  UIsectionsToExecute_deprecated_[0]->getFirstElement()->setCurrentIndex(0);
+  UIsectionsToExecute_deprecated_[0]->getFirstElement()->setEnabled (false);
 
   // the last element will always be the last element of the beamLine
-  UIsectionsToExecute_[UIsectionsToExecute_.size()-1]->getLastElement()->setCurrentIndex(UIsectionsToExecute_[UIsectionsToExecute_.size()-1]->getLastElement()->count());
-  UIsectionsToExecute_[UIsectionsToExecute_.size()-1]->getLastElement()->setEnabled(false);
+  UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_.size()-1]->getLastElement()->setCurrentIndex(UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_;.size()-1]->getLastElement()->count());
+  UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_.size()-1]->getLastElement()->setEnabled(false);
 
   // set default values
@@ -180,9 +183,9 @@
   // FIXME :  A rÃ©Ã©crire
   /*
-  if (UIsectionsToExecute_.size() > 0) {
-    UIsectionsToExecute_[0]->setFirstElementCurrentSelection(premier);
-  }
-  
-  Wt::WString currentString =  UIsectionsToExecute_[0]->getLastElementCurrentText();
+  if (UIsectionsToExecute_deprecated_.size() > 0) {
+    UIsectionsToExecute_deprecated_[0]->setFirstElementCurrentSelection(premier);
+  }
+  
+  Wt::WString currentString =  UIsectionsToExecute_deprecated_[0]->getLastElementCurrentText();
   int current = dtmanage_->getNumeroFromElementLabel(currentString.toUTF8());
   
@@ -192,6 +195,6 @@
       current = dtmanage_->getBeamLineSize();
       currentString =  dtmanage_->getLabelFromElementNumero(current);
-      if (UIsectionsToExecute_.size() > 0) {
-	UIsectionsToExecute_[0]->setLastElementCurrentSelection(currentString);
+      if (UIsectionsToExecute_deprecated_.size() > 0) {
+	UIsectionsToExecute_deprecated_[0]->setLastElementCurrentSelection(currentString);
 	//...
       }
@@ -201,18 +204,18 @@
   
   // traitement des suivantes (on avance d'un cran dans la liste)
-  for (int a = 1; a< UIsectionsToExecute_.size(); a++)
+  for (int a = 1; a< UIsectionsToExecute_deprecated_;.size(); a++)
     {
       // debut
       if ( current > dtmanage_->getBeamLineSize() )
         {
-          UIsectionsToExecute_[a]->setErrors("This section element could not be after previous session last element");
+          UIsectionsToExecute_deprecated_;[a]->setErrors("This section element could not be after previous session last element");
           exec_go_->disable();
           return false;
         }
       
-      UIsectionsToExecute_[a]->setFirstElementCurrentSelection(currentString);
+      UIsectionsToExecute_deprecated_;[a]->setFirstElementCurrentSelection(currentString);
 
       // fin
-      string finString =  UIsectionsToExecute_[a]->getLastElementCurrentText().toUTF8();
+      string finString =  UIsectionsToExecute_deprecated_;[a]->getLastElementCurrentText().toUTF8();
       
       int numeroFin = dtmanage_->getNumeroFromElementLabel( finString);
@@ -220,5 +223,5 @@
       if ( numeroFin < current)
       {
-        UIsectionsToExecute_[a]->setErrors("Last section element should be after first section element");
+        UIsectionsToExecute_deprecated_;[a]->setErrors("Last section element should be after first section element");
         exec_go_->disable();
         return false;
@@ -227,5 +230,5 @@
       if (numeroFin > dtmanage_->getBeamLineSize())
       {
-        UIsectionsToExecute_[a]->setErrors("Last section element number is greater than the beam line size");
+        UIsectionsToExecute_deprecated_;[a]->setErrors("Last section element number is greater than the beam line size");
         exec_go_->disable();
         return false;
@@ -261,13 +264,14 @@
     return;
   }
-  unsigned int s = UIsector_->getSectorControler()->getSectionsToExecute().size();
+  unsigned long s = UIsector_->getSectorControler()->getSectionsToExecute().size();
   if (s > 0) {
     abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->getLastElement();
     UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL));
-    UIsector_->getSectorControler()->getSectionsToExecute()[s]->removeLastElement();
+    UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->removeLastElement();
   }
 
  
   displayFromControler();
+  UIsector_->getBeamLineWidget()->buildBeamLineWidget();
 }
 
@@ -283,8 +287,9 @@
   st << sectionLabel;
   std::string sectionName = st.str();
-  
-  if ( dtmanage_->getJobListSize() == 0 ) return;
-  for (unsigned int sectionIndex = 0; sectionIndex< UIsectionsToExecute_.size(); sectionIndex++) {
-    if (UIsectionsToExecute_[sectionIndex]->objectName() == sectionName) {
+  //FIXME
+  
+/*  if ( dtmanage_->getJobListSize() == 0 ) return;
+  for (unsigned int sectionIndex = 0; sectionIndex< UIsectionsToExecute_deprecated_.size(); sectionIndex++) {
+    if (UIsectionsToExecute_deprecated_[sectionIndex]->objectName() == sectionName) {
 
       // delete from dataManager
@@ -292,9 +297,10 @@
 
       // delete from User Interface
-      contenuSections_->removeWidget(UIsectionsToExecute_[sectionIndex]);
-      delete UIsectionsToExecute_[sectionIndex];
-      UIsectionsToExecute_.erase (UIsectionsToExecute_.begin()+sectionIndex);
+      contenuSections_->removeWidget(UIsectionsToExecute_deprecated_[sectionIndex]);
+      delete UIsectionsToExecute_deprecated_[sectionIndex];
+      UIsectionsToExecute_deprecated_.erase (UIsectionsToExecute_deprecated_.begin()+sectionIndex);
     }
   }  
+*/
   displayFromControler();
 }
