Index: /Interface_Web/trunk/pspaWT/sources/controler/include/abstractElement.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/abstractElement.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/abstractElement.h	(revision 431)
@@ -7,14 +7,7 @@
 
 #include "nomdElements.h"
-//#include "nomDeLogiciel.h"
-//#include "trivaluedBool.h"
 #include "abstractSoftware.h"
-/* #include "softwareGenerator.h" */
-/* #include "softwareParmela.h" */
-/* #include "softwareTest.h" */
-/* #include "softwareTransport.h" */
 
 #include "UAP/UAPNode.hpp"
-
 using namespace std;
 
@@ -26,18 +19,16 @@
   int nbParam_;
   string* parametersString_;
-  double phaseStepMax_;
+  
+  string defaultSpecificName_;
+  string specificName_;
+  nomdElements elementName_;
     
   double defaultLength_;
   double defaultAperture_;
-  string defaultSpecificName_;
-  
-  string specificName_;
-  nomdElements elementName_;
+  double phaseStepMax_;
   
   double lenghtElem_; // cm
   double aperture_; // cm
-  
   double stepmaxcm_;
-  //  bool curvedTrajectory_;
   
   void setDefaultValues();
@@ -51,10 +42,12 @@
   
   void setParameters(double ll,double aper);
+  
+  nomdElements getNomdElement() const;
+  int getNbParams() const;
+
   void setLabel(string lab);
   string getLabel() const;
-  nomdElements getNomdElement() const;
-  
+
   double getLenghtOfElement() const;
-  int getNbParams() const;
   
   virtual void setPhaseStep(double);
@@ -67,5 +60,4 @@
   virtual void FileInput(ifstream& ifs) = 0;
   virtual string print() = 0;
-  
   virtual void InputRep(UAPNode* root) = 0;
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h	(revision 431)
@@ -3,4 +3,5 @@
 
 #include "globalParameters.h"
+#include "sectorParameters.h"
 #include "particleBeam.h"
 #include "nomDeLogiciel.h"
@@ -19,21 +20,22 @@
 
  protected :
-
+  
   unsigned numeroDeb_, numeroFin_;
   globalParameters* globParamPtr_;
+  sectorParameters* sectParamPtr_; //xx
   dataManager* dataManager_;
   string inputFileName_;
   nomDeLogiciel nameOfSoftware_;
 
-    /**
+  /**
      Accepted elements list for this software
-     */
+  */
   std::vector <nomdElements::typedElement> acceptedElements_;
 
-    /**
+  /**
      Ignore software list for this element
-     */
+  */
   std::vector <nomdElements::typedElement> ignoredElements_;
-
+  
   abstractSoftware();
 
@@ -42,37 +44,32 @@
   bool ComputationLimitsOk() const;
 
-
   void registerElement(nomdElements::typedElement nomdel,trivaluedBool b);
 
  public :
 
-  abstractSoftware(string inputFileName, globalParameters* globals, dataManager* dt);
+  abstractSoftware(string,globalParameters*,dataManager*);
+  abstractSoftware(string,sectorParameters*,dataManager*);
   ~abstractSoftware() {;}
 
   inline const nomDeLogiciel* getNomDeLogiciel() const {
     return &nameOfSoftware_;
-}
+  }
 
   trivaluedBool doAcceptElement(nomdElements::typedElement typdel);
 
+  virtual bool createInputFile(particleBeam* beamBefore,unsigned int numeroDeb, unsigned int numeroFin, string workingDir) = 0;
+  virtual bool execute(string workingDir) = 0;
+  virtual bool buildBeamAfterElements(string workingDir) = 0;
 
-  virtual bool createInputFile(particleBeam* beamBefore,unsigned int numeroDeb, unsigned int numeroFin, string workingDir) = 0;
-
-
-  virtual bool  execute(string workingDir) = 0;
-
- virtual bool buildBeamAfterElements(string workingDir) = 0;
-
-    /** Color of the background of this sofware
-     Should be a valid Css name as FFEEDD
-     */
-    virtual string getColor() = 0;
-
-    /** Name of this software
-     */
-    inline string getName() const {
-      return nameOfSoftware_.getString();
-    }
-
+  /** Color of the background of this sofware
+      Should be a valid Css name as FFEEDD
+  */
+  virtual string getColor() = 0;
+  
+  /** Name of this software
+   */
+  inline string getName() const {
+    return nameOfSoftware_.getString();
+  }
 };
 #endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h	(revision 431)
@@ -14,4 +14,6 @@
 #include "nomDeLogiciel.h"
 
+#include "sectorParameters.h" //xx
+
 class PspaApplication;
 
@@ -21,4 +23,5 @@
  public:
   
+  dataManager() {;}
   dataManager(PspaApplication*);
   virtual ~dataManager();
@@ -27,4 +30,7 @@
   inline globalParameters* getGlobalParameters()  {return &globParam_;}
   inline particleBeam* getCurrentBeam() {return currentBeam_;}
+
+  // xx
+  inline sectorParameters* getSectorParameters() {return &sectorParam_;}
     
   particleBeam* getDiagnosticBeam(unsigned index);
@@ -50,6 +56,5 @@
   
   void initializeExecution();
-//  trivaluedBool checkExecute(string& diagnostic);
-//  trivaluedBool checkElementsForExec(nomDeLogiciel logiciel, unsigned indexDeb, unsigned indexFin, string& diagnostic);
+
   bool executeAll();
  
@@ -81,24 +86,6 @@
     return &diagnosticBeam_.back();
   }
-  
-  /** return a specific jobList index
-      return NULL if the index does not exist
-  */
-  
-  /* inline sectionToExecute* getJobListAt(int a) { */
-    /*     if (a < 0) return NULL; */
-    /*     if (a >= getJobListSize()) return NULL; */
-    /*     return jobList_[a]; */
-    /* } */
-
-  
-  
-    /* inline const abstractSoftware* getSoftwareOfSection( int index) const { */
-    /*     if (index < 0) return NULL; */
-    /*     if (index >= getJobListSize()) return NULL; */
-    /* 	return jobList_[index]->getSoftware(); */
-    /* } */
     
-    /** Clear a specific jobList */
+  /** Clear a specific jobList */
   void clearSectionToExecute(int a);
     
@@ -106,4 +93,5 @@
 
   globalParameters globParam_;
+  sectorParameters sectorParam_; //xx
   particleBeam* currentBeam_;
   PspaApplication* pspa_;
@@ -113,7 +101,4 @@
   vector<particleBeam> diagnosticBeam_;
   vector<unsigned> indexElementToIndexDiag_;
-  // numeroElementToIndexDiag_[k] contient, pour l'element d'index k, l'indice ind tel que diagnosticBeam_[ind]
-  // soit le faisceau resultat, en l'etat qu'il doit avoir apres l'element k
-  
   vector<sectionToExecute*> jobList_;
   
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/elementMultipole.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/elementMultipole.h	(revision 431)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/elementMultipole.h	(revision 431)
@@ -0,0 +1,29 @@
+#ifndef MPOLEDEFINITION_SEEN
+#define MPOLEDEFINITION_SEEN
+
+#include <string>
+#include "abstractElement.h"
+
+using namespace std;
+
+class elementMultipole : public abstractElement
+{
+  int order_;
+  double component_;
+    
+ public:
+  
+  elementMultipole();
+  ~elementMultipole() {;}
+    
+  virtual string* getParametersString() const;
+  virtual void setParametersString(string* param);
+  virtual vector< pair<string, vector<string> > > parametersToSoftware () const;
+  virtual string FileOutputFlow() const;
+  virtual void FileInput(ifstream& ifs);
+  virtual void InputRep(UAPNode* root);
+
+  /** return a string with all parameters and value */
+  string print();
+};
+#endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/nomDeLogiciel.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/nomDeLogiciel.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/nomDeLogiciel.h	(revision 431)
@@ -6,24 +6,20 @@
 using namespace std;
 
-
-
 class nomDeLogiciel
 {
 
- public: 
-
-
+ public : 
+  
   enum Logiciel
   {
-    parmela, transport, generator, useraction, test, unknownSoftware
+    parmela, transport, generator, useraction, test, madx, unknownSoftware
   };
-
+  
     
- private:
+ private :
 
   Logiciel program_;
   std::string progString_;
-  //  int value_;
-  
+   
   static Logiciel fromString( std::string s);
   static std::string toString( Logiciel lg);  
@@ -31,6 +27,5 @@
   
  public : 
-  // constructors
-  
+ 
   nomDeLogiciel();  
   nomDeLogiciel(const string& s);  
@@ -39,21 +34,14 @@
   
   inline std::string getString() const {return progString_;}
+  inline nomDeLogiciel::Logiciel getLogiciel() const {return program_;}
 
-  inline nomDeLogiciel::Logiciel getLogiciel() const { return program_; }
-
-    /** Color of the background of the sofware
-     Should be a valid Css name as FFEEDD
-     */
+  /** Color of the background of the sofware
+      Should be a valid Css name as FFEEDD
+  */
   inline std::string  getColor() const {return getWtColor(program_);}
   // operators
-  
   nomDeLogiciel& operator= (const nomDeLogiciel& nl);  
   bool operator== (const nomDeLogiciel& nl);  
   bool operator!= (const nomDeLogiciel& nl);
-  
 };
-
-
-
-
 #endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/nomdElements.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/nomdElements.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/nomdElements.h	(revision 431)
@@ -13,5 +13,5 @@
  public :
 
-enum typedElement {beam, RFgun, drift, cell, bend, soleno, fit, snapshot, inconnu};
+  enum typedElement {beam, RFgun, drift, cell, bend, soleno, fit, snapshot, mpole, inconnu};
 
  private : 
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h	(revision 431)
@@ -8,42 +8,43 @@
 class sectionToExecute
 {
-    public :
-    sectionToExecute(abstractElement*, abstractElement*, abstractSoftware*);
+ public :
 
-    /** Deprecated : To be removed ! */
-    sectionToExecute(abstractElement*, int, abstractElement*, int, abstractSoftware*);
+  sectionToExecute(abstractElement*,abstractElement*,abstractSoftware*);
+  
+  /** Deprecated : To be removed ! */
+  sectionToExecute(abstractElement*, int, abstractElement*, int, abstractSoftware*);
 
-    ~sectionToExecute() {;}
+  ~sectionToExecute() {;}
 
-    inline abstractElement* getFirstElement() {
-        return firstElement;
-    }
+  inline abstractElement* getFirstElement() {
+    return firstElement;
+  }
     
-    inline abstractElement* getLastElement() {
-        return lastElement;
-    }
+  inline abstractElement* getLastElement() {
+    return lastElement;
+  }
     
-    /** Deprecated : To be removed ! */
-    inline int getElementNumberInSection() const {
-        return firstElementNumberInBeamLine;
-    }
+  /** Deprecated : To be removed ! */
+  inline int getElementNumberInSection() const {
+    return firstElementNumberInBeamLine;
+  }
     
-    /** Deprecated : To be removed ! */
-    inline int getLastElementNumberInSection()  const {
-        return lastElementNumberInBeamLine;
-    }
-    inline abstractSoftware* getSoftware() const {
-        return software;
-    }
-    
-    private :
-    abstractElement*  firstElement;
-    abstractElement*  lastElement;
+  /** Deprecated : To be removed ! */
+  inline int getLastElementNumberInSection()  const {
+    return lastElementNumberInBeamLine;
+  }
 
-    int firstElementNumberInBeamLine;
-    int lastElementNumberInBeamLine;
-    
-    abstractSoftware* software;
+  inline abstractSoftware* getSoftware() const {
+    return software;
+  }
+  
+ private :
+
+  abstractElement*  firstElement;
+  abstractElement*  lastElement;
+  abstractSoftware* software;
+
+  int firstElementNumberInBeamLine;
+  int lastElementNumberInBeamLine;  
 };
-
 #endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/sectorParameters.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/sectorParameters.h	(revision 431)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/sectorParameters.h	(revision 431)
@@ -0,0 +1,37 @@
+#ifndef SECTORPARAMETERS_SEEN
+#define SECTORPARAMETERS_SEEN
+
+#include <string>
+#include <iostream>
+#include "UAP/UAPNode.hpp"
+using namespace std;
+
+class sectorParameters  
+{
+  string geometry_;
+  int nCells_;
+  double lCell_;
+  double pc_;
+
+  int nbParam_;
+  string* parametersString_;
+
+ public :
+  
+  sectorParameters();
+  ~sectorParameters() {
+    if(parametersString_ != NULL) delete [] parametersString_;
+  }
+  
+  string* getParametersString() const;
+  void setParametersString(string*);
+  void raz();
+  string FileOutputFlow() const;
+  void FileInput(ifstream&);
+  void InputRep(UAPNode* root);
+
+  int getNumberOfCells() const;
+  double getCellLength() const;
+  double getParticleMomentum() const;
+};
+#endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h	(revision 431)
@@ -7,42 +7,26 @@
 class softwareGenerator : public abstractSoftware
 {
+ protected : 
+  
+  bool beamFromGenerator(string beamFileName, string workingDir, vector<double>& centroid, bareParticle& refPart,vector<bareParticle>& particles, vector<bareParticle>& passiveParticles );
 
- protected : 
-
-
-
- bool beamFromGenerator(string beamFileName, string workingDir, vector<double>& centroid, bareParticle& refPart,vector<bareParticle>& particles, vector<bareParticle>& passiveParticles );
-
-
- string elementsData(const vector< pair<string, vector<string> > >& donnees) const;
- string rfgunData(const vector< pair<string, vector<string> > >& donnees) const;
-
+  string elementsData(const vector< pair<string, vector<string> > >& donnees) const;
+ 
+  string rfgunData(const vector< pair<string, vector<string> > >& donnees) const;
 
  public : 
-
-
-    softwareGenerator();
-    
-    softwareGenerator(string inputFileName, globalParameters* globals, dataManager* dt);
+  
+  softwareGenerator();  
+  softwareGenerator(string inputFileName, globalParameters* globals, dataManager* dt);
 
   virtual ~softwareGenerator() {;}
 
-
   virtual bool createInputFile(particleBeam* beamBefore, unsigned int numeroDeb, unsigned int numeroFin, string workingDir);
-
-
-  virtual bool  execute(string workingDir);
-
-
+  virtual bool execute(string workingDir);
   virtual bool buildBeamAfterElements(string workingDir);
 
-    inline string getColor() {
-        return "#a3c0ed";
-    }
-
-    /* inline string getName() const { */
-    /*     return "generator"; */
-    /* } */
+  inline string getColor() {
+    return "#a3c0ed";
+  }
 };
-
 #endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h	(revision 431)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h	(revision 431)
@@ -0,0 +1,25 @@
+#ifndef SOFTWAREMADX_SEEN
+#define SOFTWAREMADX_SEEN
+
+#include "abstractSoftware.h"
+
+typedef pair<string, vector<string> > statements;
+
+class softwareMadx : public abstractSoftware
+{
+  string inputFormat(const vector<statements>&) const;
+
+ public :
+  
+  softwareMadx();
+  softwareMadx(string,sectorParameters*,dataManager*);
+  virtual ~softwareMadx() {;}
+
+  virtual bool createInputFile(particleBeam*,unsigned int,unsigned int,string);
+  virtual bool execute(string);
+  virtual bool buildBeamAfterElements(string);
+  
+  inline string getColor() {return "#ecc38e";}
+  //{ return "#FFFF00"; }
+};
+#endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUnknown.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUnknown.h	(revision 431)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUnknown.h	(revision 431)
@@ -0,0 +1,19 @@
+#ifndef SOFTWAREUNKNOWN_SEEN
+#define SOFTWAREUNKNOWN_SEEN
+
+#include "abstractSoftware.h"
+
+class softwareUnknown : public abstractSoftware
+{
+ public :
+  
+  softwareUnknown();
+  virtual ~softwareUnknown() {;}
+
+  virtual bool createInputFile(particleBeam*,unsigned int,unsigned int,string);
+  virtual bool execute(string);
+  virtual bool buildBeamAfterElements(string);
+  
+  inline string getColor() {return "#FFFFFF";}
+};
+#endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/abstractElement.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/abstractElement.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/abstractElement.cc	(revision 431)
@@ -5,7 +5,5 @@
 #include "abstractElement.h"
 
-abstractElement::abstractElement() 
-//: nameOfSoftware_(NULL)
-  : abstractSoftware_(NULL)
+abstractElement::abstractElement() : abstractSoftware_(NULL)
 {
   setDefaultValues();
@@ -14,7 +12,5 @@
 }
 
-abstractElement::abstractElement(string lab)
-  //: nameOfSoftware_(NULL)
-  : abstractSoftware_(NULL)
+abstractElement::abstractElement(string lab) : abstractSoftware_(NULL)
 {
   specificName_ = lab;
@@ -27,5 +23,4 @@
 {
   if (parametersString_ != NULL) delete [] parametersString_ ;
-  //  if ( nameOfSoftware_ != NULL ) delete nameOfSoftware_;
 }
 
@@ -62,16 +57,11 @@
 }
 
-string abstractElement::getLabel() const
-{
+string abstractElement::getLabel() const {
   return specificName_;
 }
 
-
-nomdElements abstractElement::getNomdElement() const 
-{
+nomdElements abstractElement::getNomdElement() const {
   return elementName_;
 }
-
-
 
 double abstractElement::getLenghtOfElement() const { 
@@ -83,9 +73,5 @@
 }
 
-
 double abstractElement::getInitialKineticEnergy() const {
   return 0.0;
 }
-
-
-
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc	(revision 431)
@@ -2,14 +2,18 @@
 #include "dataManager.h"
 #include <algorithm>
+
 abstractSoftware::abstractSoftware()
 {
   globParamPtr_ = NULL;
+  sectParamPtr_ = NULL; //xx
   dataManager_ = NULL;
   nameOfSoftware_ = nomDeLogiciel("unknownSoftware");
 }
 
-abstractSoftware::abstractSoftware(string inputFileName, globalParameters* globals, dataManager* dt) {
+abstractSoftware::abstractSoftware(string inputFileName, globalParameters* globals, dataManager* dt) 
+{
   inputFileName_ = inputFileName;
   globParamPtr_ = globals;
+  sectParamPtr_ = NULL; //xx
   dataManager_ = dt;
   numeroDeb_ = 0;
@@ -18,5 +22,17 @@
 }
 
-bool abstractSoftware::initComputationLimits(unsigned int numeroDeb,unsigned int numeroFin) {
+abstractSoftware::abstractSoftware(string inputFileName,sectorParameters* lattice,dataManager* dt) 
+{
+  inputFileName_ = inputFileName;
+  globParamPtr_ = NULL;
+  sectParamPtr_ = lattice;
+  dataManager_ = dt;
+  numeroDeb_ = 0;
+  numeroFin_ = 0;
+  nameOfSoftware_ = nomDeLogiciel("unknownSoftware");
+}
+
+bool abstractSoftware::initComputationLimits(unsigned int numeroDeb,unsigned int numeroFin) 
+{
   numeroDeb_ = numeroDeb;
   numeroFin_ = numeroFin;
@@ -24,7 +40,8 @@
 }
 
-bool abstractSoftware::ComputationLimitsOk() const {
-  if (   numeroDeb_ < 1 ||  numeroFin_ < 1 || numeroDeb_ > dataManager_->getBeamLineSize() || numeroFin_ > dataManager_->getBeamLineSize() ) {
-  dataManager_->consoleMessage(" abstractSoftware::initComputationLimit : numero of element out of limits in software " + getName() );
+bool abstractSoftware::ComputationLimitsOk() const 
+{
+  if (numeroDeb_ < 1 || numeroFin_ < 1 || numeroDeb_ > dataManager_->getBeamLineSize() || numeroFin_ > dataManager_->getBeamLineSize() ) {
+    dataManager_->consoleMessage(" abstractSoftware::initComputationLimit : num of element out of limits in software " + getName() );
     return false;
   } else {
@@ -33,6 +50,6 @@
 }
 
-
-void abstractSoftware::registerElement(nomdElements::typedElement nomdel,trivaluedBool b) {
+void abstractSoftware::registerElement(nomdElements::typedElement nomdel,trivaluedBool b) 
+{
   if (b == TBoolIgnore) {
     ignoredElements_.push_back(nomdel);
@@ -42,20 +59,26 @@
 }
 
-trivaluedBool abstractSoftware::doAcceptElement(nomdElements::typedElement typdel) {
-  if (acceptedElements_.size() == 0) {
+trivaluedBool abstractSoftware::doAcceptElement(nomdElements::typedElement typdel) 
+{
+
+  //xx
+  if (acceptedElements_.size() == 0 && nameOfSoftware_ != nomDeLogiciel::unknownSoftware) {
     return TBoolError;
   }
-  if ( std::find(acceptedElements_.begin(), acceptedElements_.end(), typdel) != acceptedElements_.end()) {
+
+  if (std::find(acceptedElements_.begin(),acceptedElements_.end(),typdel) != acceptedElements_.end()) {
     return TBoolOk;
   }
+
   if (ignoredElements_.size() == 0) {
     return TBoolError;
   }
-  if ( std::find(ignoredElements_.begin(), ignoredElements_.end(), typdel) != ignoredElements_.end()) {
+
+  if (std::find(ignoredElements_.begin(),ignoredElements_.end(),typdel) != ignoredElements_.end()) {
     return TBoolIgnore;
   }
+
   return TBoolOk;
 }
-
 
 bool abstractSoftware::launchJob(string commandLine, string& resul)
@@ -66,8 +89,7 @@
   ostringstream sortie;
   if (pp == NULL) {
-    sortie << " launching  failed : " << commandLine << endl;
+    sortie << " launching failed : " << commandLine << endl;
     ExecuteStatus = false;
   } else {
-    cout << " executing command :  "  << commandLine << endl;
     // on copie la sortie dans le fichier assigne
     char buf[132];
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 431)
@@ -1,18 +1,25 @@
+#include <stdio.h>
+#include <fstream>
+
 #include "dataManager.h"
 #include "mathematicalConstants.h"
 #include "PhysicalConstants.h"
+
+#include "GWt_pspaApplication.h"
+#include "GWt_console.h"
+
 #include "softwareParmela.h"
 #include "softwareTransport.h"
-#include "GWt_pspaApplication.h"
-#include "GWt_console.h"
 #include "softwareGenerator.h"
 #include "softwareTest.h"
+#include "softwareMadx.h" //xx
+#include "softwareUnknown.h" //xx
 
 #include <boost/filesystem.hpp>
-#include <stdio.h>
-#include <fstream>
 
 #include "UAP/UAPUtilities.hpp"
 #include "AML/AMLReader.hpp"
+
+#define BAVARD 0
 
 dataManager::dataManager(PspaApplication* pspa) :
@@ -23,42 +30,39 @@
 dataManager::~dataManager()
 {
-    unsigned k;
-    for (k=0; k < jobList_.size();k++) {
-        if ( jobList_[k] != NULL ) delete jobList_[k];
-    }
-    if ( currentBeam_ == NULL ) delete currentBeam_;
-}
-
-void dataManager::consoleMessage(string message) {
-    GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));
-    if (console) console->addConsoleMessage(message + "\n");
-    pspa_->processEvents();
+  unsigned k;
+  for (k=0; k < jobList_.size();k++) {
+    if ( jobList_[k] != NULL ) delete jobList_[k];
+  }
+  if ( currentBeam_ == NULL ) delete currentBeam_;
+}
+
+void dataManager::consoleMessage(string message)
+{
+  GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));
+  if (console) console->addConsoleMessage(message + "\n");
+  pspa_->processEvents();
 }
 
 string dataManager::getLabelFromElementNumero(int numero)
 {
-    abstractElement* ptr = pspa_->getBeamLine()->getAbstractElement(numero-1);
-    if ( ptr == NULL ) return "";
-    return ptr->getLabel();
-}
-
+  abstractElement* ptr = pspa_->getBeamLine()->getAbstractElement(numero-1);
+  if ( ptr == NULL ) return "";
+  return ptr->getLabel();
+}
 
 int dataManager::getNumeroFromElementLabel(string label)
 {
-    int index = -1;
-    
-    for (int k = 0; k < getBeamLineSize() ; k++)
-    {
-        if (pspa_->getBeamLine()->getAbstractElement(k) != NULL){
-            if ( pspa_->getBeamLine()->getAbstractElement(k)->getLabel() == label )
-            {
-                index = (int)k + 1;
-                return index;
-            }
-        }
-    }
-    return index;
-}
-
+  int index = -1;    
+  for (int k = 0; k < getBeamLineSize() ; k++) {
+    if (pspa_->getBeamLine()->getAbstractElement(k) != NULL) {
+      if ( pspa_->getBeamLine()->getAbstractElement(k)->getLabel() == label )
+	{
+	  index = (int)k + 1;
+	  return index;
+	}
+    }
+  }
+  return index;
+}
 
 abstractElement* dataManager::getElementPointerFromNumero(int k)
@@ -67,6 +71,11 @@
 }
 
-sectionToExecute*  dataManager::addSectionToExecute(abstractElement* debut,int debutIndex, abstractElement* fin, int finIndex, nomDeLogiciel logiciel)
-{
+sectionToExecute* dataManager::addSectionToExecute(abstractElement* debut,int debutIndex, abstractElement* fin, int finIndex, nomDeLogiciel logiciel)
+{
+  #if BAVARD > 0
+  cout << "***********************************" << endl;
+  cout << " dataManager::addSectionToExecute " << endl << endl;
+#endif
+
   abstractSoftware* prog;
   string inputFileName;
@@ -82,11 +91,12 @@
   } else if (logiciel  == nomDeLogiciel::test) {
     prog = new softwareTest(inputFileName, &globParam_, this);
+  } else if (logiciel  == nomDeLogiciel::madx) {
+    inputFileName = "madx.input";
+    prog = new softwareMadx(inputFileName,&sectorParam_,this);  
   } else {
-    prog = NULL;
-  }
-
-  //  abstractSoftware* prog = createSoftwareConnexion(logiciel);
-  jobList_.push_back(new sectionToExecute(debut, debutIndex, fin, finIndex, prog));
-  //  return prog;
+    prog = new softwareUnknown(); // xx
+  }
+
+  jobList_.push_back(new sectionToExecute(debut,debutIndex,fin,finIndex,prog));
   return jobList_.back();
 }
@@ -94,26 +104,25 @@
 void dataManager::clearSectionToExecute()
 {
-    unsigned k;
-    for(k = 0; k < jobList_.size(); k++)
+  unsigned k;
+  for(k = 0; k < jobList_.size(); k++)
     {
-        if ( jobList_[k] != NULL ) clearSectionToExecute(k);
-    }
-    jobList_.clear();
-}
-
-
-void dataManager::clearSectionToExecute(int a) {
-  cout << " dataManager::clearSectionToExecute efaacement section d'index : " << a << endl;
+      if ( jobList_[k] != NULL ) clearSectionToExecute(k);
+    }
+  jobList_.clear();
+}
+
+void dataManager::clearSectionToExecute(int a)
+{
+  cout << " dataManager::clearSectionToExecute : effacement de la section d'index = " << a << endl;
   if (a < 0) return;
   if (a >= (int)jobList_.size()) return;
-
+  
   // lors de la creation de la section on a fait un 'new' d'un 
   // softwareXXXX : on fait ici le 'delete'
-
+  
   const abstractSoftware* soft = jobList_.at(a)->getSoftware();
   if ( soft != NULL ) delete soft;
   jobList_.erase (jobList_.begin()+a);
 }
-
 
 void dataManager::initializeExecution()
@@ -141,18 +150,21 @@
 void dataManager::removeFile(string nameOfFile)
 {
-    ifstream fileExists;
-    fileExists.open(nameOfFile.c_str(), ios::in);
-    if (fileExists) {
-        fileExists.close();
-        remove(nameOfFile.c_str());
-    }
+  ifstream fileExists;
+  fileExists.open(nameOfFile.c_str(), ios::in);
+  if (fileExists) {
+    fileExists.close();
+    remove(nameOfFile.c_str());
+  }
 }
 
 bool dataManager::executeAll()
 {
+  cout << "***********************************" << endl;
+  cout << " dataManager::executeAll() " << endl << endl;
+
   bool success = true;
   abstractSoftware* softw = NULL;
   string workingDir = pspa_->getWorkingDir();
- 
+  
   // on verifie la consecution des sections
   int lastel = 0;
@@ -165,47 +177,50 @@
     }
   }
-
+  
   unsigned debut;
   unsigned fin;
   for(unsigned k = 0; k < jobList_.size(); k++) {
+  
     cout << " dataManager::executeAll je m'apprete a executer : " << (jobList_[k]->getSoftware()->getName()) << endl;
-      
+    
     debut = jobList_[k]->getElementNumberInSection();
     fin = jobList_[k]->getLastElementNumberInSection();
     softw = jobList_[k]->getSoftware();
     
+    //cout << "k= " << k << ", de " << jobList_[k]->getFirstElement()->getLabel() << " Ã  " << jobList_[k]->getLastElement()->getLabel() << " avec " << softw->getName() << endl;
+
     if (softw == NULL) {
-        success = false;
-        consoleMessage("dataManager::executeAll : unknown software");
-        break;
+      success = false;
+      consoleMessage("dataManager::executeAll : unknown software");
+      break;
+    }
+    
+    success = softw->createInputFile(currentBeam_,debut,fin,workingDir);
+    if ( success ) {
+      success = softw->execute(workingDir);
+      if ( success ) {
+	success = softw->buildBeamAfterElements(workingDir);
       }
-      
-      success = softw->createInputFile(currentBeam_,debut,fin,workingDir);
-      if ( success ) {
-	success = softw->execute(workingDir);
-	if ( success ) {
-	  success = softw->buildBeamAfterElements(workingDir);
-	}
-      }
-      
-      if ( success ) {
-	currentBeam_ = &diagnosticBeam_.at(indexElementToIndexDiag_.back());
-	cout << " execute termine avec succes " << endl;
-      } else {
-	currentBeam_ = NULL;
-	cout << " execute termine en ECHEC " << endl;
-      }
-      if ( !success ) break;
-      
-      if ( debut < firstComputedElemNumero_ ) firstComputedElemNumero_ = debut;
-      if ( fin > lastComputedElemNumero_ ) lastComputedElemNumero_ = fin;
-      
-      //debug
-      cout << "dataManager::executeAll #diagnosticBeam= " << diagnosticBeam_.size() << endl;
-      cout << "dataManager::executeAll #getBeamLineSize()= " << getBeamLineSize() << endl;
-      for (unsigned j = debut; j <= fin; j++) {
-	abstractElement* elPtr= getElementPointerFromNumero(j);
-	cout << "[" << j << "] " << elPtr->getNomdElement().getExpandedName() << endl;
-      }
+    }
+    
+    if ( success ) {
+      currentBeam_ = &diagnosticBeam_.at(indexElementToIndexDiag_.back());
+      cout << " execute termine avec succes " << endl;
+    } else {
+      currentBeam_ = NULL;
+      cout << " execute termine en ECHEC " << endl;
+    }
+    if ( !success ) break;
+    
+    if ( debut < firstComputedElemNumero_ ) firstComputedElemNumero_ = debut;
+    if ( fin > lastComputedElemNumero_ ) lastComputedElemNumero_ = fin;
+    
+    //debug
+    cout << "dataManager::executeAll #diagnosticBeam= " << diagnosticBeam_.size() << endl;
+    cout << "dataManager::executeAll #getBeamLineSize()= " << getBeamLineSize() << endl;
+    for (unsigned j = debut; j <= fin; j++) {
+      abstractElement* elPtr= getElementPointerFromNumero(j);
+      cout << "[" << j << "] " << elPtr->getNomdElement().getExpandedName() << endl;
+    }
   } //k
   
@@ -216,27 +231,28 @@
 void dataManager::saveConfiguration(string folder, string nameOfFile)
 {
-    ofstream outfile;
-    //    string name = pspa_->getWorkingDir()+ folder + "/" + nameOfFile + ".save";
-    cout << " dataManager::saveConfiguration : suppression du folder dans le nom de " << endl;
-    cout << " sauvegarde, en attendant que ce soit autre chose que le sessionId" << endl;
-    cout << " et qu'on puisse restaurer normalement" << endl;
-    string name = pspa_->getWorkingDir() + "/" + nameOfFile + ".save";
-    
-    // make dir if not exist
-    boost::filesystem::create_directories(pspa_->getWorkingDir() + folder + "/");
-    
-    outfile.open(name.c_str(), ios::out);
-    if (!outfile) {
-        cerr << " error opening output file for persistency " << name << endl;
-    }
-    
-    outfile << globParam_.FileOutputFlow();
-    abstractElement* elPtr;
-    for(int k = 0; k < getBeamLineSize() ; k++)
+  ofstream outfile;
+  //    string name = pspa_->getWorkingDir()+ folder + "/" + nameOfFile + ".save";
+  cout << " dataManager::saveConfiguration : suppression du folder dans le nom de " << endl;
+  cout << " sauvegarde, en attendant que ce soit autre chose que le sessionId" << endl;
+  cout << " et qu'on puisse restaurer normalement" << endl;
+
+  string name = pspa_->getWorkingDir() + "/" + nameOfFile + ".save";  
+  // make dir if not exist
+  boost::filesystem::create_directories(pspa_->getWorkingDir() + folder + "/");
+  
+  outfile.open(name.c_str(), ios::out);
+  if (!outfile) {
+    cerr<<" ERROR opening output file for persistency "<<name<<endl;
+  }
+  
+  outfile << globParam_.FileOutputFlow();
+  outfile << sectorParam_.FileOutputFlow();
+  abstractElement* elPtr;
+  for(int k = 0; k < getBeamLineSize() ; k++)
     {
       elPtr = pspa_->getBeamLine()->getAbstractElement(k);
       outfile << elPtr->FileOutputFlow();
     }
-    outfile.close();
+  outfile.close();
 }
 
@@ -247,15 +263,17 @@
   uap_root = new UAPNode("UAP_root");
   UAPNode* rep = uap_root->addChild("AML_representation");
-
+  
   // root node in the hierarchy
   UAPNode* lab = rep->addChild("laboratory");
   lab->addAttribute("name","PSPA lab");
-
+  
   // general global parameters
   globParam_.InputRep(lab);
-
+  
   // accelerator or section of accelerator
   //UAPNode* acc = lab->addChild("machine");
   //acc->addAttribute("name",fileName);
+
+  sectorParam_.InputRep(lab);
 
   // sequence of elements
@@ -275,54 +293,64 @@
 }
 
-bool dataManager::restoreElements( string inputFileName)
-{
-    cout << "dataManager::restoreElements() fichier " << inputFileName << endl;
-    ifstream infile;
-    string name = inputFileName;
-    infile.open(name.c_str(), ios::in);
-    if (!infile) {
-        cerr << " error opening input stream " << name << endl;
-        return false;
-    }
-    else cout << " successful opening input stream " << name << endl;
-    
-    string globalTitle;
-    if ( infile >> globalTitle ) {
-        if ( globalTitle == string("globals") ) {
-            globParam_.raz();
-            globParam_.FileInput(infile);
-        } else {
-            cerr << " dataManager::restoreElements ERROR : global parameters seems to be missing" << endl;
-            return false;
-        }
+bool dataManager::restoreElements(string inputFileName)
+{
+  cout << "***********************************" << endl;
+  cout << " dataManager::restoreElements() fichier :" << inputFileName << endl << endl;
+
+  ifstream infile;
+  string name = inputFileName;
+  infile.open(name.c_str(), ios::in);
+  if (!infile) {
+    cerr << " error opening input stream " << name << endl;
+    return false;
+  }
+  else cout << " successful opening input stream : " << name << endl;
+  
+  string globalTitle;
+  if ( infile >> globalTitle ) {
+    if ( globalTitle == string("globals") ) {
+      globParam_.raz();
+      globParam_.FileInput(infile);
     } else {
-        cerr << " dataManager::restoreElements ERROR : reading data save file" << endl;
-        return false;
-    }
-    
-    pspa_->getBeamLine()->clear();
-    
-    nomdElements::typedElement elementType;
-    string elementLabel;
-    while (infile >> elementLabel) {
-        elementType = nomdElements::getTypeFromLabel(elementLabel);
-        
-        GWt_abstractElement* nouveau = pspa_->getBeamLine()->addElement(elementType);
-        
-        if ( nouveau == NULL ) {
-            cerr << " dataManager::restoreElements ERROR : restoring element " << elementLabel << " failed " << endl;
-            return false;
-        }
-        nouveau->FileInput(infile);
-    }
-    infile.close();
-    
-    // debug
-    // unsigned k;
-    // for(k = 0; k < getBeamLineSize(); k++) {
-    //     abstractElement* ptr = pspa_->getBeamLine()->getAbstractElement(k);
-    //     cout << "reupere " << ptr->getLabel() << endl;
-    // }
-    return true;
+      //cout << " INFO::dataManager::restoreElements : global parameters seems to be missing" << endl;
+      //return false;
+    }
+  } else {
+    cerr << " ERROR::dataManager::restoreElements : reading globalParameters in save file" << endl;
+    return false;
+  }
+
+  //NOTE:: je ne sais pas si les parametres "secteur" 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();
+  nomdElements::typedElement elementType;
+  string elementLabel;
+  while (infile >> elementLabel) {
+
+    if (elementLabel == string("lattice") ) {
+      sectorParam_.raz();
+      sectorParam_.FileInput(infile);
+    } else {
+      elementType = nomdElements::getTypeFromLabel(elementLabel);
+      GWt_abstractElement* nouveau = pspa_->getBeamLine()->addElement(elementType);
+      if ( nouveau == NULL ) {
+	cerr << " dataManager::restoreElements() : restore element " << elementLabel << " failed " << endl;
+	return false;
+      } else {
+	nouveau->FileInput(infile);
+      }
+    }
+  }// while
+  
+ #if BAVARD > 1
+  unsigned k;
+  for(k = 0; k < getBeamLineSize(); k++) {
+    abstractElement* ptr = pspa_->getBeamLine()->getAbstractElement(k);
+    cout << "recupere " << ptr->getLabel() << endl;
+  }
+#endif
+
+  infile.close();
+  return true;
 }
 
@@ -386,23 +414,23 @@
 abstractSoftware* dataManager::createSoftwareConnexion(nomDeLogiciel logi)
 {
-    string inputFileName;
-    if(logi == nomDeLogiciel::parmela) {
-      cout << " dataManager::createSoftwareConnexion : logiciel identifie : parmela " << endl;
-        inputFileName = "parmin";
-        return new softwareParmela(inputFileName, &globParam_, this);
-    } else if (logi == nomDeLogiciel::transport) {
-      cout << " dataManager::createSoftwareConnexion : logiciel identifie : transport " << endl;
-        inputFileName = "transport.input";
-        return new softwareTransport(inputFileName, &globParam_, this);
-    } else if (logi == nomDeLogiciel::generator) {
-      cout << " dataManager::createSoftwareConnexion : logiciel identifie : generator " << endl;
-        inputFileName = "generator.in";
-        return new softwareGenerator(inputFileName, &globParam_, this);
-    } else if (logi == nomDeLogiciel::test) {
-      cout << " dataManager::createSoftwareConnexion : logiciel identifie : test " << endl;
+  string inputFileName;
+  if(logi == nomDeLogiciel::parmela) {
+    cout << " dataManager::createSoftwareConnexion : logiciel identifie : parmela " << endl;
+    inputFileName = "parmin";
+    return new softwareParmela(inputFileName, &globParam_, this);
+  } else if (logi == nomDeLogiciel::transport) {
+    cout << " dataManager::createSoftwareConnexion : logiciel identifie : transport " << endl;
+    inputFileName = "transport.input";
+    return new softwareTransport(inputFileName, &globParam_, this);
+  } else if (logi == nomDeLogiciel::generator) {
+    cout << " dataManager::createSoftwareConnexion : logiciel identifie : generator " << endl;
+    inputFileName = "generator.in";
+    return new softwareGenerator(inputFileName, &globParam_, this);
+  } else if (logi == nomDeLogiciel::test) {
+    cout << " dataManager::createSoftwareConnexion : logiciel identifie : test " << endl;
         return new softwareTest(inputFileName, &globParam_, this);
-    } else {
-      cout << " dataManager::createSoftwareConnexion : logiciel identifie : null " << endl;
-        return NULL;
-    }
-}
+  } else {
+    cout << " dataManager::createSoftwareConnexion : logiciel identifie : null " << endl;
+    return NULL;
+  }
+}
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/elementDrift.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/elementDrift.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/elementDrift.cc	(revision 431)
@@ -29,8 +29,8 @@
 {
   int compteur = -1;
-  parametersString_[++compteur] = mixedTools::intToString(nbParam_);
-  parametersString_[++compteur] = specificName_;
-  parametersString_[++compteur] = mixedTools::doubleToString(lenghtElem_);
-  parametersString_[++compteur] = mixedTools::doubleToString(aperture_);
+  parametersString_[++compteur]= mixedTools::intToString(nbParam_);
+  parametersString_[++compteur]= specificName_;
+  parametersString_[++compteur]= mixedTools::doubleToString(lenghtElem_);
+  parametersString_[++compteur]= mixedTools::doubleToString(aperture_);
   if ( compteur != nbParam_ ) {
     cerr << " elementDrift::getParametersString() : ERROR nr pf parameters dosnt match " << endl;
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/elementMultipole.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/elementMultipole.cc	(revision 431)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/elementMultipole.cc	(revision 431)
@@ -0,0 +1,104 @@
+
+#include <iostream>
+
+#include "elementMultipole.h"
+#include "mixedTools.h"
+
+elementMultipole::elementMultipole() : abstractElement() 
+{
+  defaultSpecificName_ = "mpole";
+  specificName_ = defaultSpecificName_;
+  order_ = 0;
+  component_ = 0.0;
+  
+  elementName_ = nomdElements("mpole");
+  nbParam_ = elementName_.getElementNbParameters();
+  parametersString_ = new string[nbParam_+1];
+}
+
+string* elementMultipole::getParametersString() const 
+{
+  int compteur = -1;
+  parametersString_[++compteur]= mixedTools::intToString(nbParam_);
+  parametersString_[++compteur]= specificName_;
+  parametersString_[++compteur]= mixedTools::intToString(order_);
+  parametersString_[++compteur]= mixedTools::doubleToString(component_);
+  if ( compteur != nbParam_ ) {
+    cerr << "ERROR::elementMultipole::getParametersString() : " << nbParam_ << endl;
+    return NULL;
+  } else {
+    return parametersString_;
+  }
+}
+
+void elementMultipole::setParametersString(string* param)
+{
+  if ( param == NULL ) {
+    cerr << "elementMultipole::setParametersString:: empty parameter set" << endl;
+    return;
+  }
+
+  int compteur = -1;
+  int nbparam = atoi(param[++compteur].c_str());
+  if ( nbparam != nbParam_ ) {
+    cerr << "elementMultipole::setParametersString:: parameters do not match for a multipole";
+    return;
+  }
+
+  specificName_ = param[++compteur];
+  order_ = atoi(param[++compteur].c_str());
+  component_ = atof(param[++compteur].c_str());
+}
+
+string elementMultipole::FileOutputFlow() const
+{
+  ostringstream sortie;
+  sortie << elementName_.getGenericLabel() << endl;
+  sortie  << specificName_ << endl;
+  sortie << order_ << "  " << component_ <<endl;
+  return sortie.str();
+}
+
+vector< pair<string, vector<string> > > elementMultipole::parametersToSoftware () const 
+{
+  vector< pair<string, vector<string> > >  sortie;
+  sortie.push_back( pair<string, vector<string> >("labelsGenericSpecific",  vector<string>() ) );
+  sortie.back().second.push_back(elementName_.getGenericLabel());
+  sortie.back().second.push_back(specificName_);
+  sortie.push_back( pair<string, vector<string> >("KnL",vector<string>() ) );
+  sortie.back().second.push_back(mixedTools::intToString(order_));
+  sortie.back().second.push_back(mixedTools::doubleToString(component_));
+  return sortie;
+}
+
+void elementMultipole::FileInput(ifstream& ifs)
+{
+  ifs >> specificName_;
+  ifs >> order_ >> component_;
+}
+
+string elementMultipole::print() 
+{
+  string txt = "";
+  txt += specificName_;
+  txt += "\nnth order : ";
+  txt += mixedTools::intToString(order_);
+  txt += "\ncomponent (m^-n): ";
+  txt += mixedTools::doubleToString(component_);  
+  return txt;
+}
+
+void elementMultipole::InputRep(UAPNode* root)
+{
+  UAPNode* ele = root->addChild("element");
+  ele->addAttribute("name",specificName_);
+
+  string txt = "";
+  UAPNode* node = ele->addChild("multipole");
+  node->addAttribute("at","CENTER");
+  UAPNode* knl = node->addChild("kl");
+  txt = mixedTools::intToString(order_);
+  knl->addAttribute("n",txt);
+  txt = mixedTools::doubleToString(component_);
+  knl->addAttribute("design",txt);
+}
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/nomDeLogiciel.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/nomDeLogiciel.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/nomDeLogiciel.cc	(revision 431)
@@ -1,4 +1,3 @@
 #include "nomDeLogiciel.h"
-
 
 nomDeLogiciel::Logiciel nomDeLogiciel::fromString( std::string s)
@@ -9,86 +8,79 @@
     else if ( s == "useraction" ) return useraction;
     else if ( s == "test" ) return test;
+    else if ( s == "madx" ) return madx;
     return unknownSoftware;
   }
 
- std::string nomDeLogiciel::toString( nomDeLogiciel::Logiciel lg)
-  {
-    switch (lg)
-      {
-      case parmela : { return "parmela"; }
-      case transport : { return "transport"; }
-      case generator : { return "generator"; }
-      case useraction : { return "useraction"; }
-      case test : { return "test"; }
-      case unknownSoftware : { return "unknownSoftware"; }
-      }
-    return "unknownSoftware";
-  }
+std::string nomDeLogiciel::toString(nomDeLogiciel::Logiciel lg)
+{
+  switch (lg) 
+    {
+    case parmela : { return "parmela"; }
+    case transport : { return "transport"; }
+    case generator : { return "generator"; }
+    case useraction : { return "useraction"; }
+    case test : { return "test"; }
+    case madx : { return "madx"; }
+    case unknownSoftware : { return "unknownSoftware"; }
+    }
+  return "unknownSoftware";
+}
 
-    /** Color of the background of the sofware
-     Should be a valid Css name as FFEEDD
-     */
- std::string nomDeLogiciel::getWtColor( nomDeLogiciel::Logiciel lg) const
-  {
-    switch (lg)
-      {
-      case parmela : { return "#e09bdf"; }
-      case transport : { return "#c0ea8e"; }
-      case generator : { return "#a3c0ed"; }
-      case useraction : { return "#FFFFFF"; }
-      case test : { return "#ecc38e"; }
-      case unknownSoftware : { return "#FFFFFF"; }
-      }
-    return "#FFFFFF";
-  }
-
+/** Color of the background of the sofware
+    Should be a valid Css name as FFEEDD
+*/
+std::string nomDeLogiciel::getWtColor( nomDeLogiciel::Logiciel lg) const
+{
+  switch (lg)
+    {
+    case parmela : { return "#e09bdf"; }
+    case transport : { return "#c0ea8e"; }
+    case generator : { return "#a3c0ed"; }
+    case useraction : { return "#FFFFFF"; }
+    case test : { return "#ecc38e"; }
+    case madx : { return "#ecc38e"; } //{ return "#FFFF00"; }
+    case unknownSoftware : { return "#FFFFFF"; }
+    }
+  return "#FFFFFF";
+}
 
  nomDeLogiciel::nomDeLogiciel()  
-  {
-    program_ = unknownSoftware;
-    progString_ = toString(program_);
-    //    value_ = toValue(program_);
-  }
+ {
+   program_ = unknownSoftware;
+   progString_ = toString(program_);
+ }
 
-  nomDeLogiciel::nomDeLogiciel(const string& s)
-    {
-      program_ = fromString(s);
-      progString_ = toString(program_);
-      //      value_ = toValue(program_);
-    }
+nomDeLogiciel::nomDeLogiciel(const string& s)
+{
+  program_ = fromString(s);
+  progString_ = toString(program_);
+}
 
-  nomDeLogiciel::nomDeLogiciel(int val)
-    {  
-      program_ = (Logiciel)val;
-      progString_ = toString(program_);
-      //      program_ = fromValue(val);
-      //      value_ = toValue(program_);
-    }
-
-
+nomDeLogiciel::nomDeLogiciel(int val)
+{  
+  program_ = (Logiciel)val;
+  progString_ = toString(program_);
+}
 
 int nomDeLogiciel::getNumberOfSoftwares() 
 { 
-  //  return toValue(unknownSoftware);
   return unknownSoftware;
 }
 
-  // operators
-  
-  nomDeLogiciel& nomDeLogiciel::operator= (const nomDeLogiciel& nl)
-    {
-      program_ = nl.program_;
-      progString_ = nl.progString_;
-      //      value_ = nl.value_;
-      return *this;
-    }
+// operators
+nomDeLogiciel& nomDeLogiciel::operator= (const nomDeLogiciel& nl)
+{
+  program_ = nl.program_;
+  progString_ = nl.progString_;
+  return *this;
+}
 
-  bool nomDeLogiciel::operator== (const nomDeLogiciel& nl)
-  {
-    return ( program_ == nl.program_);
-  }
+bool nomDeLogiciel::operator== (const nomDeLogiciel& nl)
+{
+  return ( program_ == nl.program_);
+}
 
-  bool nomDeLogiciel::operator!= (const nomDeLogiciel& nl)
-  {
-    return ( program_ != nl.program_);
-  }
+bool nomDeLogiciel::operator!= (const nomDeLogiciel& nl)
+{
+  return ( program_ != nl.program_);
+}
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/nomdElements.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/nomdElements.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/nomdElements.cc	(revision 431)
@@ -14,4 +14,5 @@
   else if( strstr(s.c_str(),"fit") ) return fit;
   else if( strstr(s.c_str(),"snapshot") ) return snapshot;
+  else if( strstr(s.c_str(),"mpole") ) return mpole;
   return inconnu;
 }
@@ -27,4 +28,5 @@
   else if( s == "fit" ) return fit;
   else if( s == "snapshot" ) return snapshot;
+  else if( s == "mpole" ) return mpole;
   return inconnu;
 }
@@ -41,4 +43,5 @@
   case fit : return "FIT"; break;
   case snapshot : return "SNAPSHOT"; break;
+  case mpole : return "MPOLE"; break;
   default : return "UNKNOWN";
   }
@@ -56,4 +59,5 @@
   case fit :   return "fit";
   case snapshot : return "snapshot";
+  case mpole :   return "mpole";
   default : return string("");
   }
@@ -71,4 +75,5 @@
   case fit :   return 4;
   case snapshot : return 2;
+  case mpole :   return 3;
   default : return 0;
   }
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 431)
@@ -0,0 +1,85 @@
+
+//#include <cstdlib>
+
+#include "sectorParameters.h"
+#include "mixedTools.h"
+
+sectorParameters::sectorParameters() : parametersString_(NULL)
+{
+  geometry_= string("CIRCULAR");
+  nCells_ = 0;
+  lCell_ = 0.0;
+  pc_ = 0.0;
+  nbParam_ = 4;
+  parametersString_ = new string[nbParam_+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_;
+}
+
+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;
+}
+
+string sectorParameters::FileOutputFlow() const
+{
+  ostringstream sortie;
+  sortie<<" lattice "<<endl;
+  sortie<<geometry_<<" "<<nCells_<<" "<<lCell_<<" "<<pc_<<endl;
+  return sortie.str();  
+}
+
+void sectorParameters::FileInput(ifstream& ifs)
+{
+  ifs >> geometry_ >> nCells_ >> lCell_ >> pc_;
+}
+
+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);
+
+  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_;
+}
+
+double sectorParameters::getCellLength() const {
+  return lCell_;
+}
+
+double sectorParameters::getParticleMomentum() const {
+  return pc_;
+}
+
+
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc	(revision 431)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc	(revision 431)
@@ -0,0 +1,144 @@
+
+#include "softwareMadx.h"
+#include "dataManager.h"
+
+softwareMadx::softwareMadx() : abstractSoftware()
+{
+  nameOfSoftware_ = nomDeLogiciel("madx");
+}
+
+softwareMadx::softwareMadx(string inputFileName,sectorParameters* lattice,dataManager* dt) : abstractSoftware(inputFileName,lattice,dt)
+{
+  nameOfSoftware_ = nomDeLogiciel("madx");
+
+  registerElement(nomdElements::drift,TBoolOk);
+  registerElement(nomdElements::mpole,TBoolOk);
+}
+
+bool softwareMadx::createInputFile(particleBeam* beamBefore,unsigned int numeroDeb,unsigned int numeroFin,string workingDir)
+{
+  cout << "***********************************" << endl;
+  cout << " softwareMadx::createInputFile(...) " << endl << endl;
+
+  dataManager_->consoleMessage(" softwareMadx::createInputFile");
+  if (!initComputationLimits(numeroDeb,numeroFin)) return false;
+
+  string name = workingDir + inputFileName_;
+  ofstream outfile;
+  outfile.open(name.c_str(),ios::out);
+  if(!outfile) {
+    dataManager_->consoleMessage(" softwareMadx::createInputFile : error opening output stream ");
+    cerr << " error opening output stream " << name << endl;
+    return false;
+  }
+  
+  outfile << endl; // saut de ligne
+  ostringstream os;
+  os << "L: " << "line=(";
+
+  abstractElement* elPtr;
+  for(unsigned k = numeroDeb_; k <= numeroFin_; k++)
+    {
+      elPtr = dataManager_->getElementPointerFromNumero(k);
+      cout << "debug:: element [" << k << "] " << elPtr->getNomdElement().getExpandedName() << endl;
+      vector<statements> v= elPtr->parametersToSoftware();
+      string label= v.at(0).second.at(1);
+      outfile << inputFormat(v); //<< endl;
+      os << label <<",";
+    }//k;
+
+  os << ");" << endl;
+  int nCells= sectParamPtr_->getNumberOfCells();
+  os << "all: line=(" << nCells << "*L);" << endl;
+  outfile << endl; // saut de ligne
+  outfile << os.str() << endl; // beam line definition p34
+
+  outfile << "beam;" << endl; // beam data p46
+  outfile << "use, period = all;" << endl << endl; // action commands p45
+  
+  outfile << "select,flag = twiss,column = name,s,betx,bety;" << endl; //p48
+  outfile << "twiss,save,centre,file = twiss.out;" << endl; //p51
+  outfile << "stop;" << endl;
+
+  outfile.close();
+  dataManager_->consoleMessage("input file done for madx");
+  return true;
+}
+
+string softwareMadx::inputFormat(const vector<statements>& v) const 
+{
+  // v.at(0).first = "labelsGenericSpecific"
+  // v.at(0).second = vector<string> de 2 elements (type de l'element,label)
+  string keyword= v.at(0).second.at(0);
+  string label= v.at(0).second.at(1);
+  ostringstream os;
+  if(keyword == "drift") {
+    double length = atof(v.at(1).second.at(0).c_str());
+    os << label << ":" << " drift, l=" << 0.01*length<< ";" << endl;
+
+  } else if(keyword == "mpole") {
+    double x[9]= {0.0}; // 0 <= n <= 9 in user's manual of MAD program  
+    int n= atoi(v.at(1).second.at(0).c_str());
+    x[n]= atof(v.at(1).second.at(1).c_str());
+    os << label << ":" << " multipole, knl={" << x[0];
+    for(int i = 1; i <= n; i++) {
+      os << "," << x[i];
+    }
+    os <<"};" << endl;
+    
+  } else {
+    cout << "softwareMadx::inputFormat ERROR : element type= " << keyword << " not defined" << endl;
+  }
+  
+  return os.str();
+}
+
+bool softwareMadx::execute(string workingDir)
+{
+  cout << "***********************************" << endl;
+  cout << " softwareMadx::execute(...) " << endl << endl;
+
+  dataManager_->consoleMessage(" softwareMadx::execute");
+  bool status= true;
+
+  ostringstream sortie;
+  sortie << " run madx from " << numeroDeb_ << " to " << numeroFin_ << endl;
+
+  string mjob = workingDir + "madx64";
+  mjob += string(" <  ");
+  mjob += workingDir + inputFileName_;
+  cout << " job madx = " << mjob << endl;
+  
+  string resultOfRun;
+  bool success = launchJob(mjob,resultOfRun);
+  // xx sortie << resultOfRun << endl;
+  if ( !success ) {
+    //sortie << " launching of madx failed " << endl;
+    status = false;
+  } else {
+    sortie << " madx finished normally" << endl;
+    string nameOut = workingDir + "madx.output";
+    ofstream outfile;
+    outfile.open(nameOut.c_str(),ios::out);
+    if (!outfile) {
+      sortie << " error in opening madx output stream " << nameOut << endl;
+      status = false;
+    } else {
+      // on copie la sortie dans un fichier 'madx.out'
+      outfile << resultOfRun << endl;
+      outfile.close();
+    }
+  }
+
+  dataManager_->consoleMessage(sortie.str());
+  return status;
+}
+
+bool softwareMadx::buildBeamAfterElements(string workingDir)
+{
+  cout << "***********************************" << endl;
+  cout << " softwareMadx::buildBeamAfterElements(...) " << endl << endl;
+
+  dataManager_->consoleMessage(" softwareMadx::buildBeamAfterElements");
+  return false;
+}
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUnknown.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUnknown.cc	(revision 431)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUnknown.cc	(revision 431)
@@ -0,0 +1,33 @@
+
+#include "softwareUnknown.h"
+
+softwareUnknown::softwareUnknown() : abstractSoftware()
+{
+   nameOfSoftware_ = nomDeLogiciel("unknownSoftware");
+
+   registerElement(nomdElements::beam,TBoolIgnore);
+   registerElement(nomdElements::RFgun,TBoolIgnore);
+   registerElement(nomdElements::drift,TBoolIgnore);
+   registerElement(nomdElements::cell,TBoolIgnore);
+   registerElement(nomdElements::bend,TBoolIgnore);
+   registerElement(nomdElements::soleno,TBoolIgnore);
+   registerElement(nomdElements::fit,TBoolIgnore);
+   registerElement(nomdElements::snapshot,TBoolIgnore);
+   registerElement(nomdElements::mpole,TBoolIgnore);
+}
+
+bool softwareUnknown::createInputFile(particleBeam* beamBefore,unsigned int numeroDeb,unsigned int numeroFin,string workingDir)
+{
+  return true;
+}
+
+bool softwareUnknown::execute(string workingDir)
+{
+  return true;
+}
+
+bool softwareUnknown::buildBeamAfterElements(string workingDir)
+{
+  return true;
+}
+
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_abstractElement.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_abstractElement.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_abstractElement.h	(revision 431)
@@ -3,6 +3,7 @@
 
 #include "GWt_draggableImage.h"
+#include "GWt_console.h"
+
 #include "abstractElement.h"
-#include "GWt_console.h"
 #include "elementDrift.h"
 #include "elementRfgun.h"
@@ -13,4 +14,5 @@
 #include "elementFit.h"
 #include "elementSnapshot.h"
+#include "elementMultipole.h"
 
 #include <Wt/WDialog>
@@ -33,49 +35,47 @@
 class GWt_abstractElement : public WContainerWidget
 {
-    protected :
+ protected :
     
-    abstractElement* abstractElement_;
+  abstractElement* abstractElement_;
     
-    WDialog* dialog_;
-    GWt_draggableImage* dropped_;
-    WContainerWidget* wc_;
-    WText* wc_item_;
-    WLineEdit* labelEdit_;
+  WDialog* dialog_;
+  GWt_draggableImage* dropped_;
+  WContainerWidget* wc_;
+  WText* wc_item_;
+  WLineEdit* labelEdit_;
     
-    GWt_abstractElement() {;}
-    string* beginDialog();
-    
-    public :
-    
-    GWt_abstractElement(abstractElement*);
-    
-    void initialize();
-    void showParameters();
-    void deleteElement();
+  GWt_abstractElement() {;}
+  string* beginDialog();
+  
+ public :
+  
+  GWt_abstractElement(abstractElement*);
+  
+  void initialize();
+  void showParameters();
+  void deleteElement();
+  
+  void updateLabelAndToolTipWidget();
+  void FileInput(ifstream& ifs);
+  
+  WContainerWidget* getWidget();
+  abstractElement* getAbstractElement();
 
-    void updateLabelAndToolTipWidget();
-    void FileInput(ifstream& ifs);
-    
-    //  GWt_draggableImage* getImage();
-    WContainerWidget* getWidget();
-    abstractElement* getAbstractElement();
-    
-    virtual void dialogDone(WDialog::DialogCode code) = 0;
-    
-    inline WString print() {
-        return abstractElement_->print();
-    }
-    
-    virtual string getMimeType() = 0;
-    virtual string getSmallImageURL() = 0;
-    virtual string getBigImageURL() = 0;
-    virtual string getName() = 0;
-    virtual void initilializeDialog() = 0;
-    
-    void createDragImage(WContainerWidget*);
-    WImage* getImage();
-    
-protected:
-    
+  inline WString print() {
+    return abstractElement_->print();
+  }
+
+  virtual void dialogDone(WDialog::DialogCode code) = 0; 
+  virtual string getMimeType() = 0;
+  virtual string getSmallImageURL() = 0;
+  virtual string getBigImageURL() = 0;
+  virtual string getName() = 0;
+  virtual void initilializeDialog() = 0;
+  
+  void createDragImage(WContainerWidget*);
+  WImage* getImage();
+  
+ protected:
+  
     WImage* image_;
     GWt_elementLigneFaisceau* elementLigneFaiseauContainer_;
@@ -86,10 +86,10 @@
     
     inline void registerParam(string name, variant<int, string, bool, float, NullType> value, string desc) {
-        parameterMapValue[name] = value;
-        parameterMapDescription[name] = desc;
+      parameterMapValue[name] = value;
+      parameterMapDescription[name] = desc;
     }
     
-    variant<int, string, bool, float, NullType> getParamValue(string elem);
-    string getParamDescription(string elem);
+    variant<int, string, bool, float, NullType> getParamValue(string);
+    string getParamDescription(string);
 };
 #endif
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_abstractElementFactory.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_abstractElementFactory.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_abstractElementFactory.h	(revision 431)
@@ -18,4 +18,5 @@
 #include "GWt_fit.h"
 #include "GWt_snapshot.h"
+#include "GWt_mpole.h"
 
 using namespace Wt;
@@ -62,4 +63,8 @@
   inline void setSnapshotEnable(bool a) { isSnapshotElementEnable = a;};
   
+  /* Enable the mpole element creation
+   */
+  inline void setMPoleEnable(bool a) { isMPoleElementEnable = a;};
+  
   GWt_drift* createDriftElement();
   GWt_rfgun* createRFGunElement();
@@ -70,4 +75,5 @@
   GWt_fit* createFitElement();
   GWt_snapshot* createSnapshotElement();
+  GWt_mpole* createMPoleElement();
   vector <GWt_abstractElement*> getAllElements();
   
@@ -82,4 +88,5 @@
   bool isFitElementEnable;
   bool isSnapshotElementEnable;
+  bool isMPoleElementEnable;
 };
 #endif
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_globalParameters.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_globalParameters.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_globalParameters.h	(revision 431)
@@ -39,5 +39,5 @@
   void updateGlobals();
   void renew();
-  void setText(WContainerWidget*);
+  void setText(WText*);
 };
 #endif
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_mpole.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_mpole.h	(revision 431)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_mpole.h	(revision 431)
@@ -0,0 +1,37 @@
+#ifndef GRAPHMPOLEELEMENT_SEEN
+#define GRAPHMPOLEELEMENT_SEEN
+
+#include "GWt_abstractElement.h"
+#include "abstractElement.h"
+
+#include <iostream>
+#include <string>
+#include <sstream>
+
+using namespace Wt;
+using namespace std;
+
+class GWt_mpole : public GWt_abstractElement
+{
+  WLineEdit* orderEdit_;
+  WLineEdit* componentEdit_;
+
+ public :
+  
+  GWt_mpole()  {;}
+  GWt_mpole(GWt_elementLigneFaisceau*);
+  ~GWt_mpole() {;}
+  
+  virtual void dialogDone(WDialog::DialogCode code);
+  WImage* getImage();
+    
+  inline string getMimeType() {return "htdocs/mpole.jpg";}
+  inline string getSmallImageURL() {return "htdocs/mpole.jpg";}
+  inline string getBigImageURL() {return "htdocs/mpole.jpg";}
+  inline string getName() {return "mpole";}
+  
+ private :
+
+  void initilializeDialog();
+};
+#endif
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h	(revision 431)
@@ -3,5 +3,6 @@
 
 #include <cstdlib>
-#include <list>
+#include <string.h>
+#include <vector>
 
 #include <Wt/WApplication>
@@ -9,4 +10,5 @@
 #include <Wt/WContainerWidget>
 #include <Wt/WText>
+#include <Wt/WLineEdit>
 #include <Wt/WPanel>
 #include <Wt/WComboBox>
@@ -24,4 +26,5 @@
 #include "GWt_ligneFaisceau.h"
 #include "GWt_globalParameters.h"
+#include "GWt_sectorParameters.h"
 
 #include "dataManager.h"
@@ -43,6 +46,6 @@
   GWt_LigneFaisceau* beamLine_;
     
-  // WWidget* globalParam_;
-  GWt_globalParameters* globalParam_; // xx
+  GWt_globalParameters* globalParam_;
+  GWt_sectorParameters* sectorParam_;
   
   GWt_dialog* graphicsDialog_;
@@ -73,8 +76,7 @@
   WContainerWidget* createDrawingWidget();
 
-  //WWidget* createGlobalParamWidget();
-  WWidget* createDashBoard(); // xx
-  void messageBox1(); // xx
-  void messageBox2(); // xx
+  WWidget* createDashBoard();
+  void messageBox1();
+  void messageBox2();
   
   // extensions (.001, .002,...) pour les fichiers "snapshot" 
@@ -119,9 +121,4 @@
   }
 
-
-  /* inline WWidget* getGlobalParam() { */
-  /*   return globalParam_; */
-  /* } */
-
   inline GWt_softwarePanel* getExecuteWidget() {
     return executeWidget_;
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sectorParameters.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sectorParameters.h	(revision 431)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sectorParameters.h	(revision 431)
@@ -0,0 +1,42 @@
+#ifndef GWT_SECTORPARAMETERS_SEEN
+#define GWT_SECTORPARAMETERS_SEEN
+
+#include <string>
+#include <Wt/WContainerWidget>
+#include <Wt/WLineEdit>
+#include <Wt/WDialog>
+#include <Wt/WText>
+
+using namespace Wt;
+using namespace std;
+
+class dataManager;
+
+class GWt_sectorParameters : public WContainerWidget
+{
+  WLineEdit* geometry_;
+  WLineEdit* nCells_;
+  WLineEdit* lCell_;
+  WLineEdit* pc_;
+
+  dataManager* dt_;
+  WText *status_;
+  WDialog *dialog_;
+  string envoi_[5];
+
+  string* getSectorParameters();
+  void setStatus();
+
+ public :
+  
+  GWt_sectorParameters() {;}
+  GWt_sectorParameters(dataManager*);
+  virtual ~GWt_sectorParameters() {;}
+
+  void execDialog();
+  void dialogDone(WDialog::DialogCode code);
+  void update();
+  void renew();
+  void setText(WText*);
+};
+#endif
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h	(revision 431)
@@ -23,30 +23,29 @@
 class GWt_softwarePanel  : public WContainerWidget
 {
-    public :
-    GWt_softwarePanel(dataManager*, PspaApplication*);
-    virtual ~GWt_softwarePanel();
+ public :
+  
+  GWt_softwarePanel(dataManager*, PspaApplication*);
+  virtual ~GWt_softwarePanel();
 
-    void addSectionToExecuteW();
-    void updateSections();
+  void addSectionToExecuteW();
+  void updateSections();
     
-    private :
-    //    void disableSectionExecute();
-    //    void checkSectionSelection();
-    bool updateSectionSelection();
-    void deleteSectionToExecuteW(int section);
-    string getSelection();
-    void executer();
-    bool areDataCoherent();
-    void fillComboWithElements(Wt::WComboBox* cBox);
-    void fillComboWithSoftwares(Wt::WComboBox* cBox);
-    Wt::WContainerWidget* createAddDeletePushButtons(int sectionIndex);
+ private :
+ 
+  bool updateSectionSelection();
+  void deleteSectionToExecuteW(int section);
+  string getSelection();
+  void executer();
+  bool areDataCoherent();
+  void fillComboWithElements(Wt::WComboBox* cBox);
+  void fillComboWithSoftwares(Wt::WComboBox* cBox);
+  Wt::WContainerWidget* createAddDeletePushButtons(int sectionIndex);
 
-    dataManager* dtmanage_;
-    WPushButton *exec_go_;
-    WContainerWidget* contenuSections_;
-    PspaApplication* pspa_;
+  dataManager* dtmanage_;
+  WPushButton *exec_go_;
+  WContainerWidget* contenuSections_;
+  PspaApplication* pspa_;
 
-    std::vector <GWt_sectionToExecute*> sections_;
+  std::vector <GWt_sectionToExecute*> sections_;
 };
-
 #endif /* defined(__PSPA__GWt_softwarePanel__) */
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_abstractElement.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_abstractElement.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_abstractElement.cc	(revision 431)
@@ -14,5 +14,6 @@
 #include "GWt_beam.h"
 #include "GWt_fit.h"
-#include "GWt_snapshot.h"
+//#include "GWt_snapshot.h"
+
 #include "GWt_draggableImage.h"
 #include "GWt_ligneFaisceau.h"
@@ -29,58 +30,48 @@
 
 GWt_abstractElement::GWt_abstractElement(abstractElement* elem)
-: WContainerWidget()
+  : WContainerWidget()
 {
-    abstractElement_ = elem;
+  abstractElement_ = elem;
 }
-
 
 void GWt_abstractElement::initialize()
 {
-    // make image
-    image_ = new WImage(getBigImageURL(),this);
-    
-    addWidget(image_);
-    updateLabelAndToolTipWidget();
+  image_ = new WImage(getBigImageURL(),this); // make image  
+  addWidget(image_);
+  updateLabelAndToolTipWidget();
 }
-
 
 string* GWt_abstractElement::beginDialog()
 {
-  string* param = abstractElement_-> getParametersString();
-    
-  if ( param == NULL )
-    {
-      if ( static_cast<GWt_console*> (wApp->findWidget ("console"))) {
-	GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));
-	console->addConsoleMessage(" GWt_abstractElement::beginDialog : empty parameter set for element " + abstractElement_->getNomdElement().getExpandedName());
-        }
+  string* param = abstractElement_->getParametersString();
+  
+  if ( param == NULL ) {
+    if ( static_cast<GWt_console*> (wApp->findWidget ("console"))) {
+      GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));
+      console->addConsoleMessage(" GWt_abstractElement::beginDialog : empty parameter set for element " + abstractElement_->getNomdElement().getExpandedName());
     }
-  //   int compteur = -1;
+  }
+
+  int nbparam = atoi(param->c_str());
+  if ( nbparam != abstractElement_->getNbParams()) {
+    if ( static_cast<GWt_console*> (wApp->findWidget ("console"))) {
+      GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));
+      console->addConsoleMessage(" element seems not to be a " + abstractElement_->getNomdElement().getExpandedName());
+    }
+  }
   
-  //  int nbparam = atoi(param[++compteur].c_str());
-  int nbparam = atoi(param->c_str());
-  if ( nbparam != abstractElement_->getNbParams())
-    {
-        if ( static_cast<GWt_console*> (wApp->findWidget ("console"))) {
-	  GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));
-	  console->addConsoleMessage(" element seems not to be a " + abstractElement_->getNomdElement().getExpandedName());
-        }
-    }
-  
-  dialog_ = new WDialog("element " + abstractElement_->getNomdElement().getExpandedName());
-    new WText(" label of the element : ",dialog_->contents());
-    //  labelEdit_ = new WLineEdit(param[++compteur].c_str(), dialog_->contents());
-    
-    labelEdit_ = new WLineEdit( (++param)->c_str(), dialog_->contents());
-    new WBreak(dialog_->contents());
-    return ++param;
+  dialog_ = new WDialog("element "+abstractElement_->getNomdElement().getExpandedName());
+  new WText(" label of the element : ",dialog_->contents());
+  labelEdit_ = new WLineEdit( (++param)->c_str(),dialog_->contents());
+  new WBreak(dialog_->contents());
+  return ++param;
 }
 
 void GWt_abstractElement::updateLabelAndToolTipWidget()
 {
-    if (abstractElement_ != NULL) {
+  if (abstractElement_ != NULL) {
     elementLigneFaiseauContainer_->setElementLabel(abstractElement_->getLabel());
     setToolTip(print());
-    }
+  }
 }
 
@@ -91,116 +82,105 @@
 }
 
-
 void GWt_abstractElement::deleteElement()
 {
-    StandardButton result = WMessageBox::show("PSPA : Delete element", WString("Delete '")+WString(getAbstractElement()->getLabel())+"' ?", Ok | Cancel);
+  StandardButton result = WMessageBox::show("PSPA : Delete element", WString("Delete '")+WString(getAbstractElement()->getLabel())+"' ?", Ok | Cancel);
+  
+  if (result == Cancel) {
+    return;
+  }
+  // get LigneFaiseau widget and add new elementLigneFaiseau
+  GWt_LigneFaisceau* ligneFaisceau = NULL;
+  if ( static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"))) {
+    ligneFaisceau = static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"));
+  } else {
+    return;
+  }
+  
+  ligneFaisceau->removeElement(this);
+}
 
-    if (result == Cancel ) {
-        return;
-    }
-    // get LigneFaiseau widget and add new elementLigneFaiseau
-    GWt_LigneFaisceau* ligneFaisceau = NULL;
-    if ( static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"))) {
-        ligneFaisceau = static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"));
-    } else {
-        return;
-    }
-    
-    ligneFaisceau->removeElement(this);
+void GWt_abstractElement::createDragImage(WContainerWidget* w)
+{
+  GWt_draggableImage *result= new GWt_draggableImage(getBigImageURL(),w);
+  
+  /*
+   * Set the image to be draggable, showing the other image (dragImage)
+   * to be used as the widget that is visually dragged.
+   */
+  result->setDraggable(getMimeType(),new WImage(getSmallImageURL(),w),true);
+  result->setToolTip(getName());
+}
+
+void GWt_abstractElement::FileInput(ifstream& ifs)
+{
+  getAbstractElement()->FileInput(ifs);
+  initilializeDialog();
+  updateLabelAndToolTipWidget();
+  
+  // update parameters
+  GWt_LigneFaisceau* ligneFaisceau = NULL;
+  if ( static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"))) {
+    ligneFaisceau = static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"));
+    ligneFaisceau->update();
+  }
+}
+
+abstractElement* GWt_abstractElement::getAbstractElement() {
+  return abstractElement_;
 }
 
 WContainerWidget* GWt_abstractElement::getWidget() {
-    return wc_;
-}
-
-abstractElement* GWt_abstractElement::getAbstractElement() {
-    return abstractElement_;
-}
-
-
-void GWt_abstractElement::createDragImage(WContainerWidget* w){
-
-    GWt_draggableImage *result = new GWt_draggableImage(getBigImageURL(),w);
-
-    /*
-     * Set the image to be draggable, showing the other image (dragImage)
-     * to be used as the widget that is visually dragged.
-     */
-    result->setDraggable(getMimeType(),new WImage(getSmallImageURL(),w),true);
-    result->setToolTip(getName());
-
+  return wc_;
 }
 
 WImage* GWt_abstractElement::getImage() {
-    return image_;
+  return image_;
 }
 
-
-void GWt_abstractElement::FileInput(ifstream& ifs){
-    getAbstractElement()->FileInput(ifs);
-    initilializeDialog();
-    updateLabelAndToolTipWidget();
-
-// update parameters
-    GWt_LigneFaisceau* ligneFaisceau = NULL;
-    if ( static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"))) {
-        ligneFaisceau = static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"));
-        ligneFaisceau->update();
+variant<int, string, bool, float, NullType> GWt_abstractElement::getParamValue(string elem) 
+{
+  if(parameterMapValue.find(elem) == parameterMapValue.end()) {
+    return new NullType();
+  }
+  
+  std::map<std::string, variant<int, string, bool, float, NullType> >::iterator it;
+  it = parameterMapValue.find(elem);
+  variant <int, string, bool, float, NullType> value = it->second;
+  
+  try {
+    int pi = boost::get<int>(value);
+    printf("%s Type is int\n",elem.c_str());
+    return pi;
+  }
+  catch (boost::bad_get v) {
+    try {
+      string si = boost::get<string>(value);
+      printf("%s Type is string\n",elem.c_str());
+      return si;
     }
+    catch (boost::bad_get v) {
+      try {
+	bool bi = boost::get<bool>(value);
+	printf("%s Type is bool\n",elem.c_str());
+	return bi;
+      }
+      catch (boost::bad_get v) {
+	printf("%s Type is NULL\n",elem.c_str());
+	return new NullType();
+      }
+    }
+  }
+  printf("%s Type is NULL NULL\n",elem.c_str());
+  return new NullType();
 }
 
-
-
-variant<int, string, bool, float, NullType> GWt_abstractElement::getParamValue(string elem) {
-
-    if (parameterMapValue.find(elem) == parameterMapValue.end() )
-    {
-        return new NullType();
-    }
-
-    std::map<std::string, variant<int, string, bool, float, NullType> >::iterator it;
-    it = parameterMapValue.find(elem);
-    
-    variant <int, string, bool, float, NullType> value = it->second;
-    
-    try {
-        int pi = boost::get<int>(value);
-        printf("%s Type is int\n",elem.c_str());
-        return pi;
-    }
-    catch (boost::bad_get v) {
-        try {
-            string si = boost::get<string>(value);
-            printf("%s Type is string\n",elem.c_str());
-            return si;
-        }
-        catch (boost::bad_get v) {
-            try {
-                bool bi = boost::get<bool>(value);
-                printf("%s Type is bool\n",elem.c_str());
-                return bi;
-            }
-            catch (boost::bad_get v) {
-                printf("%s Type is NULL\n",elem.c_str());
-                return new NullType();
-            }
-        }
-    }
-    printf("%s Type is NULL NULL\n",elem.c_str());
-    return new NullType();
+string GWt_abstractElement::getParamDescription(string elem)
+{    
+  if(parameterMapDescription.find(elem) == parameterMapDescription.end() ) {
+    printf("%s Descr is NULL NULL\n",elem.c_str());
+    return "";
+  } else {
+    printf("%s Descr is %s\n",elem.c_str(),parameterMapDescription.find(elem)->second.c_str());
+    return parameterMapDescription.find(elem)->second;
+  }
 }
-
-
-string GWt_abstractElement::getParamDescription(string elem) {
-    
-    if (parameterMapDescription.find(elem) == parameterMapDescription.end() )
-    {
-        printf("%s Descr is NULL NULL\n",elem.c_str());
-        return "";
-    } else {
-        printf("%s Descr is %s\n",elem.c_str(),parameterMapDescription.find(elem)->second.c_str());
-        return parameterMapDescription.find(elem)->second;
-    }
-}
-
-
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_abstractElementFactory.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_abstractElementFactory.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_abstractElementFactory.cc	(revision 431)
@@ -17,5 +17,6 @@
   isBeamElementEnable(false),
   isFitElementEnable(false),
-  isSnapshotElementEnable(false)
+  isSnapshotElementEnable(false),
+  isMPoleElementEnable(false)
 {}
 
@@ -30,4 +31,5 @@
   isFitElementEnable = false;
   isSnapshotElementEnable = false;
+  isMPoleElementEnable = false;
 }
 
@@ -96,4 +98,12 @@
 }
 
+GWt_mpole* GWt_abstractElementFactory::createMPoleElement() 
+{
+  if (isMPoleElementEnable) {
+    return new GWt_mpole();
+  }
+  return NULL;
+}
+
 vector <GWt_abstractElement*> GWt_abstractElementFactory::getAllElements()
 {
@@ -123,4 +133,7 @@
     elems.push_back(new GWt_snapshot());
   }
+  if (isMPoleElementEnable) {
+    elems.push_back(new GWt_mpole());
+  }
 
   return elems;
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc	(revision 431)
@@ -13,4 +13,5 @@
 #include "GWt_fit.h"
 #include "GWt_snapshot.h"
+#include "GWt_mpole.h"
 
 
@@ -55,5 +56,5 @@
 void GWt_elementLigneFaisceau::initialize_ligneFaisceau(nomdElements::typedElement eType)
 {   
-  cout<<"new GWt_elementLigneFaisceau : "<< this << endl;
+  cout << " new GWt_elementLigneFaisceau : "<< nomdElements::getLabelFromType(eType) << endl;
     
   // set layout
@@ -113,4 +114,7 @@
   case nomdElements::fit  :
     GWt_abstractElement_ = new GWt_fit(this);
+    break;
+  case nomdElements::mpole  :
+    GWt_abstractElement_ = new GWt_mpole(this);
     break;
   case nomdElements::snapshot :
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_globalParameters.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_globalParameters.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_globalParameters.cc	(revision 431)
@@ -15,7 +15,7 @@
 }
 
-void GWt_globalParameters::setText(WContainerWidget* wt)
+void GWt_globalParameters::setText(WText *st)
 {
-  status_ = new WText("Go ahead...",wt);
+  status_ = st;
 }
 
@@ -105,8 +105,8 @@
 void GWt_globalParameters::setStatus()
 {
-  WString out= WString("<p>frequency="+envoi_[1]+"</p>"
-	               "<p>step in phase="+envoi_[2]+"</p>"
-  	               "<p>max step number="+envoi_[3]+"</p>"
-   	               "<p>periodicity of s.c. computation="+envoi_[4]+"</p>");
+  WString out= WString("<p>frequency = "+envoi_[1]+"</p>"
+	               "<p>step in phase = "+envoi_[2]+"</p>"
+  	               "<p>max step number = "+envoi_[3]+"</p>"
+   	               "<p>periodicity of s.c. computation = "+envoi_[4]+"</p>");
   status_->setText(out);
 }
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc	(revision 431)
@@ -59,5 +59,5 @@
 
   GWt_abstractElement* GWtAbstractElem = NULL;  
-  cout << " Entree addElement element " << nomdElements::getLabelFromType(eType) << endl;
+  cout << " addElement::element : " << nomdElements::getLabelFromType(eType) << endl;
     
   // 3 cases :
@@ -288,12 +288,13 @@
 
 
-void GWt_LigneFaisceau::initializeSoftwares(){
-    
+void GWt_LigneFaisceau::initializeSoftwares()
+{    
   vector <abstractElement*> elems = getAllAbstractElements();
-    for (int a=0; a< elems.size(); a++) {
-      //     elems[a]->setSoftware(nomDeLogiciel::unknownSoftware);
-      elems[a]->setSoftware( NULL );
-    }
-}
-
-
+  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_mpole.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_mpole.cc	(revision 431)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_mpole.cc	(revision 431)
@@ -0,0 +1,58 @@
+
+#include "GWt_mpole.h"
+#include "mixedTools.h"
+
+#include <Wt/WText>
+#include <Wt/WLineEdit>
+#include <Wt/WBreak>
+#include <Wt/WDialog>
+#include <Wt/WPushButton>
+
+GWt_mpole::GWt_mpole(GWt_elementLigneFaisceau* elm) : GWt_abstractElement(new elementMultipole())
+{
+  elementLigneFaiseauContainer_ = elm;
+  initialize();
+}
+
+void GWt_mpole::initilializeDialog() 
+{
+  string* param = beginDialog();
+  new WText("order : ",dialog_->contents());
+  orderEdit_ = new WLineEdit(param->c_str(),dialog_->contents());
+  new WBreak(dialog_->contents());
+  new WText("component (m^-n) : ",dialog_->contents());
+  componentEdit_ = new WLineEdit((++param)->c_str(),dialog_->contents());
+  new WBreak(dialog_->contents());
+
+  WPushButton *annule= new WPushButton("cancel",dialog_->contents()); 
+  annule->clicked().connect(dialog_, &Wt::WDialog::reject);
+  WPushButton *submit= new WPushButton("OK",dialog_->contents());
+  submit->clicked().connect(dialog_, &Wt::WDialog::accept);
+  dialog_->finished().connect(this, &GWt_mpole::dialogDone);
+}
+
+void GWt_mpole::dialogDone(WDialog::DialogCode code)
+{
+  if (code != Wt::WDialog::Accepted) return;
+
+  unsigned nbParam = abstractElement_->getNbParams();
+  string* envoi = new string[nbParam+1];
+  int compteur = -1;
+
+  envoi[++compteur] = mixedTools::intToString(nbParam);
+  envoi[++compteur] = labelEdit_->text().toUTF8();
+  envoi[++compteur] = orderEdit_->text().toUTF8();
+  envoi[++compteur] = componentEdit_->text().toUTF8();
+  if ( compteur !=  (int)nbParam ) {
+    cerr << " GWt_mpole::dialogDone() : pb dans le nb de parametres, compteur = " << compteur << " nbParam= " << nbParam << endl;
+    return;
+  }
+
+  abstractElement_->setParametersString(envoi);
+  updateLabelAndToolTipWidget();
+  delete [] envoi;
+}
+
+WImage* GWt_mpole::getImage() {
+  return image_;
+}
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc	(revision 431)
@@ -1,12 +1,8 @@
 #include <stdio.h>
-#include <string.h>
-#include <vector>
 #include <ctime>
 
 #include "GWt_pspaApplication.h"
-#include "GWt_ligneFaisceau.h"
-#include "GWt_softwarePanel.h"
-#include "GWt_globalParameters.h"
 #include "GWt_draggableImage.h"
+#include "GWt_serverFileSelector.h"
 #include "particleBeam.h"
 #include "bareParticle.h"
@@ -15,6 +11,4 @@
 #include "nomdElements.h"
 #include "environmentVariables.h"
-#include "GWt_console.h"
-#include "GWt_serverFileSelector.h"
 #include "trivaluedBool.h"
 
@@ -26,14 +20,9 @@
 #include <Wt/WStackedWidget>
 #include <Wt/WBreak>
-#include <Wt/WDialog>
 #include <Wt/WStandardItemModel>
 #include <Wt/WFileUpload>
 #include <Wt/WPainter>
-#include <Wt/WPdfImage>
 #include <Wt/WScrollArea>
-#include <Wt/WLineEdit>
 #include <Wt/WRadioButton>
-
-#include <Wt/WPanel>
 #include <Wt/WMessageBox>
 
@@ -73,6 +62,7 @@
   abstractElementFactory_->setFitEnable(true);
   abstractElementFactory_->setSnapshotEnable(true);
-  
-  // include the styleSheet
+  abstractElementFactory_->setMPoleEnable(true);
+  
+  // include the styleSheetcd 
   WContainerWidget *widroot = root();
   useStyleSheet("htdocs/pspa.css");
@@ -144,4 +134,5 @@
 
   globalParam_ = new GWt_globalParameters(dtmanage_);
+  sectorParam_ = new GWt_sectorParameters(dtmanage_);
   WWidget* dboard = createDashBoard();
   dboard->setMinimumSize(300,100);
@@ -171,32 +162,16 @@
 }
 
-// WWidget* PspaApplication::createGlobalParamWidget()
-// {
-//   WContainerWidget* globalParam = new GWt_globalParameters(this);
-//   globalParam->setMinimumSize(300,100);
-//   return globalParam;
-// }
-
 WWidget* PspaApplication::createDashBoard()
 {
-  WContainerWidget *result = new WContainerWidget();
-  
-  WPanel *panel = new WPanel(result);
-  panel->setTitle("dashboard");
-  
-  WContainerWidget *textdiv;
-  textdiv = new WContainerWidget();
-  textdiv->setStyleClass("text");
-  globalParam_->setText(textdiv);
-
-  WContainerWidget *cnt = new WContainerWidget();
+  WContainerWidget *wt= new WContainerWidget();
+  wt->setStyleClass("text");
+  WText *st= new WText("Go ahead...",wt);  
+
   WContainerWidget *buttons = new WContainerWidget();
   buttons->setStyleClass("buttons");
-
   WPushButton *button;
-  button = new WPushButton("globalParameters", buttons);
+  button = new WPushButton("globalParameters",buttons);
   button->clicked().connect(this, &PspaApplication::messageBox1);
-  
-  button = new WPushButton("fodoCells", buttons);
+  button = new WPushButton("sectorParameters", buttons);
   button->clicked().connect(this, &PspaApplication::messageBox2);
  
@@ -205,7 +180,15 @@
   styleSheet().addRule("body", "margin: 0px;");
 
+  WContainerWidget *cnt = new WContainerWidget();
   cnt->addWidget(buttons);
-  cnt->addWidget(textdiv);
+  cnt->addWidget(wt);
+
+  WContainerWidget *result = new WContainerWidget();
+  WPanel *panel = new WPanel(result);
+  panel->setTitle("dashboard");
   panel->setCentralWidget(cnt);
+
+  globalParam_->setText(st);
+  sectorParam_->setText(st);
   return result;
 }
@@ -219,4 +202,5 @@
 void PspaApplication::messageBox2()
 {
+  sectorParam_->execDialog();
   return;
 }
@@ -382,7 +366,8 @@
 void PspaApplication::sauver()
 {
-  cout << " on sauve " << endl;
-  console_->addConsoleMessage("sauvegarde");
-  
+  cout << "***********************************" << endl;
+  cout << " on sauve " << endl<<endl;
+  
+  console_->addConsoleMessage("sauvegarde \n");  
   dialogSave_ = new WDialog("save");
   new WText("name of case : ",dialogSave_->contents());
@@ -405,5 +390,5 @@
   dialogSave_ = NULL;
 
-  globalParam_->updateGlobals();
+  //globalParam_->updateGlobals();
 
   //  dtmanage_->saveConfiguration(nameOfCase_);
@@ -416,4 +401,7 @@
 void PspaApplication::restaurer()
 {
+  cout << "***********************************" << endl;
+  cout << " on restaure " << endl<<endl;
+
   GWt_serverFileSelector * fs = new GWt_serverFileSelector("Select a configuration file",workingDir_);
   string fileName = fs->exec();
@@ -423,11 +411,10 @@
   }
     
-  removePathFromConfigName(nameOfCase_ );
+  removePathFromConfigName(nameOfCase_);
   cout << " nom sans path " << nameOfCase_ << endl;
   removeExtensionFromConfigName(nameOfCase_);
   cout << " nom sans extension " << nameOfCase_ << endl;
-  if (nameOfCase_ == "")
-    return;
-  cout << " PspaApplication:: restaure le fichier " << fileName << endl;
+  if (nameOfCase_ == "") return;
+  cout << " PspaApplication::restaure le fichier   : " << fileName << endl;
   dialogSave_ = NULL;
   
@@ -442,5 +429,6 @@
   }
   
-  globalParam_->renew();  
+  globalParam_->renew(); 
+  sectorParam_->renew();
   console_->addConsoleMessage(string("restauration terminee \n"));
 }
@@ -448,15 +436,10 @@
 void PspaApplication::openFileSelector()
 {
-    
   WContainerWidget *result = new WContainerWidget();
-  WVBoxLayout* myLayout = new WVBoxLayout();
-    
+  WVBoxLayout* myLayout = new WVBoxLayout();  
   uploadFileSelectorWidget_ = new WFileUpload();
-    
   uploadFileSelectorWidget_->setFileTextSize(40);
-    
   myLayout->addWidget(new WText("Select the configuration file for pspa : "));
   myLayout->addWidget(uploadFileSelectorWidget_);
-    
   result->setLayout (myLayout);
     
@@ -470,7 +453,5 @@
   uploadFileSelectorWidget_->fileTooLarge().connect(this, &PspaApplication::fileTooLarge);
   
-  
   GWt_dialog* fileSelectorDialog = new GWt_dialog("Load a file",result,false);
-  
   fileSelectorDialog->exec();
 }
@@ -485,20 +466,18 @@
   cout << " fichier client sans extension : " << nomDuFichier << endl;
   
-  if ( test )
-    {
-      nameOfCase_ = nomDuFichier;
-      console_->addConsoleMessage(string("restauration..."));
+  if ( test ) {
+    nameOfCase_ = nomDuFichier;
+    console_->addConsoleMessage(string("restauration..."));
       
-      if ( !dtmanage_->restoreElements(uploadFileSelectorWidget_->spoolFileName()) ) {
-	GWt_dialog restoreWarning(" element restoring", "failure in restoring elements !", GWt_dialog::Error, false,true);
-	restoreWarning.exec();
-      }
+    if ( !dtmanage_->restoreElements(uploadFileSelectorWidget_->spoolFileName()) ) {
+      GWt_dialog restoreWarning(" element restoring", "failure in restoring elements !", GWt_dialog::Error, false,true);
+      restoreWarning.exec();
+    }
       
-      GWt_globalParameters* bibi = static_cast<GWt_globalParameters*>(globalParam_);
-      bibi->renew();
-      
-      console_->addConsoleMessage(string("rechargement de config termine"));
-      message->show();
-    }
+    globalParam_->renew(); 
+    sectorParam_->renew();
+    console_->addConsoleMessage(string("rechargement de la config termine"));
+    message->show();
+  }
 }
 
@@ -513,6 +492,5 @@
   message += " bytes\n";
     
-  GWt_dialog*  messageBox= new GWt_dialog("Error during upload file" ,message ,GWt_dialog::Error,false,true);
-  
+  GWt_dialog*  messageBox= new GWt_dialog("Error during upload file" ,message ,GWt_dialog::Error,false,true); 
   messageBox->show();
 }
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc	(revision 431)
@@ -16,86 +16,82 @@
 softwarePanel(sPanel)
 {
-    Wt::WGridLayout* mainContainerLayout = new Wt::WGridLayout();
-    mainContainerLayout->setContentsMargins(0,0,0,0);
+  Wt::WGridLayout* mainContainerLayout = new Wt::WGridLayout();
+  mainContainerLayout->setContentsMargins(0,0,0,0);
 
-    Wt::WContainerWidget* labelAndComboContainer = new Wt::WContainerWidget();
-    Wt::WVBoxLayout* labelAndComboContainerLayout = new Wt::WVBoxLayout();
-    labelAndComboContainerLayout->setContentsMargins(0,0,0,0);
+  Wt::WContainerWidget* labelAndComboContainer = new Wt::WContainerWidget();
+  Wt::WVBoxLayout* labelAndComboContainerLayout = new Wt::WVBoxLayout();
+  labelAndComboContainerLayout->setContentsMargins(0,0,0,0);
 
-    Wt::WContainerWidget* labelAndComboInsideContainer = new Wt::WContainerWidget();
-    Wt::WHBoxLayout* labelAndComboInsideContainerLayout = new Wt::WHBoxLayout();
-    labelAndComboInsideContainerLayout->setContentsMargins(0,0,0,0);
-    
-    labelAndComboInsideContainerLayout->addWidget(new Wt::WText("from&nbsp;:&nbsp;"));
-    labelAndComboInsideContainerLayout->addWidget(first);
-    labelAndComboInsideContainerLayout->addWidget(new Wt::WText("to&nbsp;:&nbsp;"));
-    labelAndComboInsideContainerLayout->addWidget(last);
-    labelAndComboInsideContainerLayout->addWidget(soft);
+  Wt::WContainerWidget* labelAndComboInsideContainer = new Wt::WContainerWidget();
+  Wt::WHBoxLayout* labelAndComboInsideContainerLayout = new Wt::WHBoxLayout();
+  labelAndComboInsideContainerLayout->setContentsMargins(0,0,0,0);
+  
+  labelAndComboInsideContainerLayout->addWidget(new Wt::WText("from&nbsp;:&nbsp;"));
+  labelAndComboInsideContainerLayout->addWidget(first);
+  labelAndComboInsideContainerLayout->addWidget(new Wt::WText("to&nbsp;:&nbsp;"));
+  labelAndComboInsideContainerLayout->addWidget(last);
+  labelAndComboInsideContainerLayout->addWidget(soft);
+  
+    // add buttons
+  labelAndComboInsideContainerLayout->addWidget(buttonPanel);
+  labelAndComboInsideContainer->setLayout(labelAndComboInsideContainerLayout);
+  labelAndComboContainerLayout->addWidget(labelAndComboInsideContainer);
+  labelAndComboContainerLayout->addStretch (10);
+  labelAndComboContainer->setLayout(labelAndComboContainerLayout);
+  
+  // add errors and warning layout
+  warningsContainer_ = new Wt::WContainerWidget();
+  errorsContainer_ = new Wt::WContainerWidget();
+  
+  Wt::WContainerWidget* warningsAndErrorsContainer = new Wt::WContainerWidget();
+  Wt::WVBoxLayout* vWarningsAndErrorsLayoutContainer = new Wt::WVBoxLayout();
+  
+  Wt::WHBoxLayout* hLayoutContainerWarnings = new Wt::WHBoxLayout();
+  Wt::WHBoxLayout* hLayoutContainerErrors = new Wt::WHBoxLayout();
+  
+  
+  warningsLabel_ = new Wt::WText("",XHTMLText);
+  errorsLabel_ = new Wt::WText("",XHTMLText);
+  hLayoutContainerWarnings->addWidget(warningsLabel_);
+  hLayoutContainerErrors->addWidget(errorsLabel_);
 
-    // add buttons
-    labelAndComboInsideContainerLayout->addWidget(buttonPanel);
-
-    labelAndComboInsideContainer->setLayout(labelAndComboInsideContainerLayout);
-
-    labelAndComboContainerLayout->addWidget(labelAndComboInsideContainer);
-    labelAndComboContainerLayout->addStretch (10);
-    
-    labelAndComboContainer->setLayout(labelAndComboContainerLayout);
-    
-            
-    // add errors and warning layout
-    warningsContainer_ = new Wt::WContainerWidget();
-    errorsContainer_ = new Wt::WContainerWidget();
-
-    Wt::WContainerWidget* warningsAndErrorsContainer = new Wt::WContainerWidget();
-    Wt::WVBoxLayout* vWarningsAndErrorsLayoutContainer = new Wt::WVBoxLayout();
-    
-    Wt::WHBoxLayout* hLayoutContainerWarnings = new Wt::WHBoxLayout();
-    Wt::WHBoxLayout* hLayoutContainerErrors = new Wt::WHBoxLayout();
-
-    
-    warningsLabel_ = new Wt::WText("",XHTMLText);
-    errorsLabel_ = new Wt::WText("",XHTMLText);
-    hLayoutContainerWarnings->addWidget(warningsLabel_);
-    hLayoutContainerErrors->addWidget(errorsLabel_);
-
-    warningsAndErrorsContainer->addWidget(warningsLabel_);
-    warningsAndErrorsContainer->addWidget(errorsLabel_);
-    
-    
-    // set Layouts
-    warningsContainer_->setLayout(hLayoutContainerWarnings);
-    errorsContainer_->setLayout(hLayoutContainerErrors);
-    
-    vWarningsAndErrorsLayoutContainer->addWidget(errorsContainer_);
-    vWarningsAndErrorsLayoutContainer->addWidget(warningsContainer_);
-    vWarningsAndErrorsLayoutContainer->addStretch (100);
-
-    warningsAndErrorsContainer->setLayout(vWarningsAndErrorsLayoutContainer);
-
-    // add label and Combo containers
-    mainContainerLayout->addWidget(labelAndComboContainer,0,0);
-    // add warnings and errors containers
-    mainContainerLayout->addWidget(warningsAndErrorsContainer,1,0);
-
-    // manage margins
-    vWarningsAndErrorsLayoutContainer->setContentsMargins(20,0,0,0);
-    hLayoutContainerWarnings->setContentsMargins(0,0,0,0);
-    hLayoutContainerErrors->setContentsMargins(0,0,0,0);
-
-    setLayout(mainContainerLayout);
-    warningsContainer_->setStyleClass("warningsContainer");
-    errorsContainer_->setStyleClass("errorsContainer");
-
-    // resize combo
-    firstElement->setMinimumSize(80,12);
-    lastElement->setMinimumSize(80,12);
-    software->setMinimumSize(80,12);
-        
-    firstElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
-    lastElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
-    software->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
-
-    manageWarningsAndErrors();
+  warningsAndErrorsContainer->addWidget(warningsLabel_);
+  warningsAndErrorsContainer->addWidget(errorsLabel_);
+  
+  
+  // set Layouts
+  warningsContainer_->setLayout(hLayoutContainerWarnings);
+  errorsContainer_->setLayout(hLayoutContainerErrors);
+  
+  vWarningsAndErrorsLayoutContainer->addWidget(errorsContainer_);
+  vWarningsAndErrorsLayoutContainer->addWidget(warningsContainer_);
+  vWarningsAndErrorsLayoutContainer->addStretch (100);
+  
+  warningsAndErrorsContainer->setLayout(vWarningsAndErrorsLayoutContainer);
+  
+  // add label and Combo containers
+  mainContainerLayout->addWidget(labelAndComboContainer,0,0);
+  // add warnings and errors containers
+  mainContainerLayout->addWidget(warningsAndErrorsContainer,1,0);
+  
+  // manage margins
+  vWarningsAndErrorsLayoutContainer->setContentsMargins(20,0,0,0);
+  hLayoutContainerWarnings->setContentsMargins(0,0,0,0);
+  hLayoutContainerErrors->setContentsMargins(0,0,0,0);
+  
+  setLayout(mainContainerLayout);
+  warningsContainer_->setStyleClass("warningsContainer");
+  errorsContainer_->setStyleClass("errorsContainer");
+  
+  // resize combo
+  firstElement->setMinimumSize(80,12);
+  lastElement->setMinimumSize(80,12);
+  software->setMinimumSize(80,12);
+  
+  firstElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
+  lastElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
+  software->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
+  
+  manageWarningsAndErrors();
 }
 
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectorParameters.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectorParameters.cc	(revision 431)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectorParameters.cc	(revision 431)
@@ -0,0 +1,93 @@
+
+#include <Wt/WBreak>
+#include <Wt/WPushButton>
+
+#include "GWt_sectorParameters.h"
+#include "dataManager.h"
+
+GWt_sectorParameters::GWt_sectorParameters(dataManager* dt)
+{
+  dt_ = dt;
+}
+
+void GWt_sectorParameters::setText(WText *st)
+{
+  status_ = st;
+}
+
+string* GWt_sectorParameters::getSectorParameters()
+{
+  string* param = dt_->getSectorParameters()->getParametersString();
+  envoi_[0] = param[0].c_str();
+  envoi_[1] = param[1].c_str();
+  envoi_[2] = param[2].c_str();
+  envoi_[3] = param[3].c_str();
+  envoi_[4] = param[4].c_str();
+  return param;
+}
+
+void GWt_sectorParameters::execDialog()
+{
+  dialog_ = new WDialog("sector parameters");
+  string* param = getSectorParameters();
+
+  new WText("geometry : ",dialog_->contents());
+  geometry_ = new WLineEdit(param[1].c_str(),dialog_->contents());
+  geometry_->disable();
+  new WBreak(dialog_->contents());
+  new WText("Enter number of cells : ",dialog_->contents());
+  nCells_ = new WLineEdit(param[2].c_str(),dialog_->contents());
+  new WBreak(dialog_->contents());
+  new WText("Enter cell length (m): ",dialog_->contents());
+  lCell_ = new WLineEdit(param[3].c_str(),dialog_->contents());
+  new WBreak(dialog_->contents());
+  new WText("Enter particle momentum (GeV/c) : ",dialog_->contents());
+  pc_ = new WLineEdit(param[4].c_str(),dialog_->contents());
+  new WBreak(dialog_->contents());
+
+  WPushButton *ok =  new WPushButton("Ok", dialog_->contents());
+  ok->clicked().connect(dialog_, &WDialog::accept);
+  WPushButton *no = new WPushButton("Cancel", dialog_->contents());
+  no->clicked().connect(dialog_, &WDialog::reject);
+
+  dialog_->finished().connect(this,&GWt_sectorParameters::dialogDone);
+  dialog_->exec(WAnimation(WAnimation::SlideInFromTop));
+}
+
+void GWt_sectorParameters::dialogDone(WDialog::DialogCode code)
+{
+  if (code == WDialog::Accepted) {
+    update();
+    setStatus();
+  }
+  return;
+}
+
+void GWt_sectorParameters::update()
+{
+  envoi_[0] = string("4");
+  envoi_[1] = geometry_->text().toUTF8();
+  envoi_[2] = nCells_->text().toUTF8();
+  envoi_[3] = lCell_->text().toUTF8();
+  envoi_[4] = pc_->text().toUTF8();
+  dt_->getSectorParameters()->setParametersString(envoi_);
+}
+
+void GWt_sectorParameters::renew()
+{
+  string* param = getSectorParameters();
+  setStatus();
+  geometry_ = new WLineEdit(param[1].c_str());
+  nCells_ = new WLineEdit(param[2].c_str());
+  lCell_ = new WLineEdit(param[3].c_str());
+  pc_ = new WLineEdit(param[4].c_str());
+}
+
+void GWt_sectorParameters::setStatus()
+{
+  WString out= WString("<p>geometry = "+envoi_[1]+"</p>"
+	               "<p>number of cells = "+envoi_[2]+"</p>"
+  	               "<p>cell length = "+envoi_[3]+"</p>"
+   	               "<p>particle momentum = "+envoi_[4]+"</p>");
+  status_->setText(out);
+}
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 430)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 431)
@@ -21,4 +21,6 @@
 #include "GWt_pspaApplication.h"
 
+#define BAVARD 0
+
 GWt_softwarePanel::GWt_softwarePanel(dataManager* dataManager,PspaApplication* pspa)
   : WContainerWidget() 
@@ -49,4 +51,9 @@
 void GWt_softwarePanel::addSectionToExecuteW()
 {      
+#if BAVARD > 0
+  cout << "***********************************" << endl;
+  cout << " GWt_softwarePanel::addSectionToExecuteW() " << endl<<endl;
+#endif
+
   abstractElement* premierElement;
   abstractElement* dernierElement;
@@ -55,4 +62,6 @@
   int dernierIndex = 0;
   
+  cout << "sections_.size() = " << sections_.size() << endl;
+
   // if there is no section
   if(sections_.size() == 0) {
@@ -76,9 +85,6 @@
   dernierElement = pspa_->getBeamLine()->getAbstractElement(pspa_->getBeamLine()->getBeamLineSize()-1);
   dernierIndex = pspa_->getBeamLine()->getBeamLineSize()-1;
-  //  cout << "PspaApplication::addSectionToExecute() : " << premierText << " ââ   " << dernierText << endl;
-  
-  //  abstractSoftware* soft = NULL;
-  //  dtmanage_->addSectionToExecute(premierElement,premierIndex, dernierElement, dernierIndex, soft);
-  dtmanage_->addSectionToExecute(premierElement,premierIndex, dernierElement, dernierIndex, nomDeLogiciel());
+  
+  dtmanage_->addSectionToExecute(premierElement,premierIndex,dernierElement,dernierIndex,nomDeLogiciel());
 
   std::string premierElementLabel = "";
@@ -87,5 +93,4 @@
     premierElementLabel = premierElement->getLabel();
   }
-
   if (dernierElement) {
     dernierElementLabel = dernierElement->getLabel();
@@ -104,5 +109,5 @@
   fillComboWithSoftwares(softCombo);
 
-  GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo, lineToCombo, softCombo,createAddDeletePushButtons(sections_.size()),this);
+  GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(sections_.size()),this);
 
   stringstream st;
@@ -118,6 +123,42 @@
 }
 
+void GWt_softwarePanel::updateSections()
+{
+#if BAVARD > 0
+  cout << "***********************************" << endl;
+  cout << " GWt_softwarePanel::updateSections() " << endl<<endl;
+#endif
+
+  // update all sections in order to manage new/deleted items
+  for (int a = 0; a < sections_.size(); a++) {
+    fillComboWithElements(sections_[a]->getFirstElement());
+    fillComboWithElements(sections_[a]->getLastElement());
+    sections_[a]->getFirstElement()->setEnabled (true);
+    sections_[a]->getLastElement()->setEnabled (true);
+  }
+  
+  if (sections_.size() == 0) {
+    return;
+  }
+  
+  // the first element will always be the first element of the beamLine
+  sections_[0]->getFirstElement()->setCurrentIndex(0);
+  sections_[0]->getFirstElement()->setEnabled (false);
+
+  // the last element will always be the last element of the beamLine
+  sections_[sections_.size()-1]->getLastElement()->setCurrentIndex(sections_[sections_.size()-1]->getLastElement()->count());
+  sections_[sections_.size()-1]->getLastElement()->setEnabled(false);
+
+  // set default values
+  updateSectionSelection();
+}
+
 bool GWt_softwarePanel::updateSectionSelection()
 {
+#if BAVARD > 0
+  cout << "***********************************" << endl;
+  cout << " GWt_softwarePanel::updateSectionSelection() " << endl<<endl;
+#endif
+
   if ( dtmanage_->getJobListSize() == 0 ) return false;
   
@@ -134,12 +175,12 @@
   // si la fin est mal definie on prend toute la config par defaut
   if ( current <= 0 || current > dtmanage_->getBeamLineSize() )
-  {
-    current = dtmanage_->getBeamLineSize();
-    currentString =  dtmanage_->getLabelFromElementNumero(current);
-    if (sections_.size() > 0) {
-      sections_[0]->setLastElementCurrentSelection(currentString);
-//...
+    {
+      current = dtmanage_->getBeamLineSize();
+      currentString =  dtmanage_->getLabelFromElementNumero(current);
+      if (sections_.size() > 0) {
+	sections_[0]->setLastElementCurrentSelection(currentString);
+	//...
+      }
     }
-  }
   current++;
   currentString = dtmanage_->getLabelFromElementNumero(current);
@@ -184,6 +225,12 @@
 
   if (!areDataCoherent()) {
+#if BAVARD > 0
+    cout << " GWt_softwarePanel::addSectionToExecuteW() DISABLE" << endl;
+#endif
     exec_go_->disable();
   } else {
+#if BAVARD > 0
+    cout << " GWt_softwarePanel::addSectionToExecuteW() ENABLE" << endl;
+#endif
     exec_go_->enable();
   }
@@ -192,7 +239,11 @@
 }
 
-
 bool GWt_softwarePanel::areDataCoherent()
 {
+#if BAVARD > 0
+  cout << "***********************************" << endl;
+  cout << " GWt_softwarePanel::areDataCoherent() " << endl<<endl;
+#endif
+
   bool caMarche = true;
 
@@ -204,61 +255,47 @@
     pspa_->getBeamLine()->initializeSoftwares();
   }
-  
+        
   string diagnosticErrors;
   string diagnosticWarnings;
-  
-  for (int a = 0; a< sections_.size(); a++)
+  for (int a = 0; a < sections_.size(); a++) 
     {
-      string debString = sections_[a]->getFirstElementCurrentText().toUTF8();
-      string finString = sections_[a]->getLastElementCurrentText().toUTF8();
-    
-      // int debut = pspa_->getBeamLine()->getAbstractElementIndexFromLabel(debString)+1; // FIXME : Should NOT be +1
-      // int fin = pspa_->getBeamLine()->getAbstractElementIndexFromLabel(finString)+1; // FIXME : Should NOT be +1
-
+      string debString= sections_[a]->getFirstElementCurrentText().toUTF8();
+      string finString= sections_[a]->getLastElementCurrentText().toUTF8();
       int debut = pspa_->getBeamLine()->getAbstractElementNumeroFromLabel(debString);
       int fin = pspa_->getBeamLine()->getAbstractElementNumeroFromLabel(finString);
-    
-      nomDeLogiciel prog = nomDeLogiciel ( sections_[a]->getSoftwareCurrentText().toUTF8());
-      //      abstractSoftware* softToExec = dtmanage_->createSoftwareConnexion(prog);
-      sectionToExecute* sectToExec = dtmanage_->addSectionToExecute(pspa_->getBeamLine()->getAbstractElement(debut),
-				     debut,
-				     pspa_->getBeamLine()->getAbstractElement(fin),
-				     fin,
-				     prog);
+
+      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);
 
       abstractSoftware* softToExec = sectToExec->getSoftware(); 
       diagnosticErrors = "";
       diagnosticWarnings = "";
-
-      // check sections
-      for (int i=debut-1; i<fin; i++) {
-	if (pspa_->getBeamLine()) {
-	  if (pspa_->getBeamLine()->getAbstractElement(i)) {
-	    //         trivaluedBool tb = pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(prog.getString());
-
-
-	    trivaluedBool tb = softToExec->doAcceptElement(pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementType() );
-
-	    if (tb  == TBoolOk ) {
-	      pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(softToExec);
+      for(int i = debut-1; i < fin; i++) // check sections
+	{
+	  if (!pspa_->getBeamLine()) continue;
+	  abstractElement* elPtr= pspa_->getBeamLine()->getAbstractElement(i);	  
+	  if (!elPtr) continue; 
+
+	  trivaluedBool tb = softToExec->doAcceptElement(elPtr->getNomdElement().getElementType());
+	  if (tb  == TBoolOk ) {
+	    elPtr->setSoftware(softToExec);
+	  } else {
+	    elPtr->setSoftware(NULL);
+	    if (tb == TBoolIgnore) {
+	      if(prog.getString() != "unknownSoftware") diagnosticWarnings += elPtr->getLabel() + " will be ignored by  "+ prog.getString() + "<br /> ";           
 	    } else {
-	      pspa_->getBeamLine()->getAbstractElement(i)->setSoftware( NULL );
-
-	      if ( tb == TBoolIgnore ) {
-		diagnosticWarnings += pspa_->getBeamLine()->getAbstractElement(i)->getLabel() + " will be ignored by  "+ prog.getString()+"<br /> ";           
-	      } else {
-		// j'insiste pour remettre le nom generique de l'element refuse (glm / 30/03/2013)
-		diagnosticErrors += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getExpandedName() + " is not allowed with "+ prog.getString()+"<br /> ";
-		caMarche = false;
-	      }
+	      // j'insiste pour remettre le nom generique de l'element refuse (glm / 30/03/2013)
+	      diagnosticErrors += elPtr->getNomdElement().getExpandedName() + " is not allowed with " + prog.getString() + "<br /> ";
+	      caMarche = false;
 	    }
-	    pspa_->getBeamLine()->update(i);
 	  }
-	}
-      }
+	  pspa_->getBeamLine()->update(i);
+	} //i
+      
       // set errors and warnings
       sections_[a]->setErrors(diagnosticErrors);
       sections_[a]->setWarnings(diagnosticWarnings);
-    }
+    }//a
     
   return caMarche;
@@ -286,40 +323,14 @@
 }
 
-
-void GWt_softwarePanel::updateSections()
-{
-  // update all sections in order to manage new/deleted items
-  for (int a = 0; a< sections_.size(); a++) {
-    fillComboWithElements(sections_[a]->getFirstElement());
-    fillComboWithElements(sections_[a]->getLastElement());
-
-    sections_[a]->getFirstElement()->setEnabled (true);
-    sections_[a]->getLastElement()->setEnabled (true);
-  }
-  if (sections_.size() == 0) {
-    return;
-  }
-  // the first element will always be the first element of the beamLine
-  sections_[0]->getFirstElement()->setCurrentIndex(0);
-  sections_[0]->getFirstElement()->setEnabled (false);
-
-  // the last element will always be the last element of the beamLine
-  sections_[sections_.size()-1]->getLastElement()->setCurrentIndex(sections_[sections_.size()-1]->getLastElement()->count());
-  sections_[sections_.size()-1]->getLastElement()->setEnabled (false);
-
-  // set default values
-
-  // update
-  updateSectionSelection();
-}
-
 void GWt_softwarePanel::executer()
 {
-  
+  cout << "***********************************" << endl;
+  cout << " GWt_softwarePanel::executer() " << endl<<endl;
+
   if (!areDataCoherent()) {
     return;
   }  
   
-  static_cast<GWt_globalParameters*>(pspa_->getGlobalParam())->updateGlobals();
+  //static_cast<GWt_globalParameters*>(pspa_->getGlobalParam())->updateGlobals();
   
   GWt_dialog calculDialog("Calcul en cours", "Veuillez patienter...", GWt_dialog::Wait, true,false);
@@ -329,5 +340,5 @@
   
   if (!dtmanage_->executeAll()) {
-    GWt_dialog warningDialog("PSPA : Echec", " echec lors de l'exÃcution !", GWt_dialog::Error, true,true);
+    GWt_dialog warningDialog("PSPA : Echec", " echec lors de l'exÃ©cution !", GWt_dialog::Error, true,true);
     warningDialog.exec();
   }
@@ -338,20 +349,20 @@
 }
 
-
-void GWt_softwarePanel::fillComboWithElements(Wt::WComboBox* cBox) {
+void GWt_softwarePanel::fillComboWithElements(Wt::WComboBox* cBox) 
+{
   if (cBox == NULL) return;
 
   // get the last item selected
-  WString selectedString = cBox->currentText ();
+  WString selectedString = cBox->currentText();
   cBox->clear();
 
-  for (int a=0; a< pspa_->getBeamLine()->getBeamLineSize(); a++) {
+  for(int a = 0; a < pspa_->getBeamLine()->getBeamLineSize(); a++) {
     abstractElement* abs = pspa_->getBeamLine()->getAbstractElement(a);
-    if (abs != NULL){
+    if (abs != NULL) {
       cBox->addItem(abs->getLabel());
     }
   }
   
-  for (int a=0; a<cBox->count(); a++) {
+  for(int a = 0; a < cBox->count(); a++) {
     if (cBox->itemText (a) == selectedString) {
       cBox->setCurrentIndex(a);
@@ -361,6 +372,11 @@
 }
 
-
-void GWt_softwarePanel::fillComboWithSoftwares(Wt::WComboBox* cBox) {
+void GWt_softwarePanel::fillComboWithSoftwares(Wt::WComboBox* cBox) 
+{
+#if BAVARD > 0
+  cout << "***********************************" << endl;
+  cout << " GWt_softwarePanel::fillComboWithSoftwares " << endl<<endl;
+#endif
+
   if (cBox == NULL) return;
   cBox->clear();
@@ -368,13 +384,13 @@
   unsigned nb = nomDeLogiciel::getNumberOfSoftwares();
   unsigned k;
-  for(k = 0; k < nb; k++) {
+  for(k = 0; k <= nb; k++) { //xx
     cBox->addItem(nomDeLogiciel(k).getString());
   }
+  cBox->setCurrentIndex(nb); // xx
   cBox->refresh();
 }
 
-
-Wt::WContainerWidget* GWt_softwarePanel::createAddDeletePushButtons(int sectionNumber) {
-
+Wt::WContainerWidget* GWt_softwarePanel::createAddDeletePushButtons(int sectionNumber) 
+{
   WContainerWidget* buttonContainer= new WContainerWidget();
   
@@ -399,5 +415,4 @@
   buttonContainerLayout->addWidget(exec_add);
   buttonContainerLayout->addWidget(exec_delete);
-
   buttonContainer->setLayout(buttonContainerLayout);
 
