Index: /Interface_Web/trunk/pspaWT/cmt/requirements
===================================================================
--- /Interface_Web/trunk/pspaWT/cmt/requirements	(revision 492)
+++ /Interface_Web/trunk/pspaWT/cmt/requirements	(revision 493)
@@ -39,5 +39,4 @@
  ../sources/controler/src/softwareGenerator.cc \
  ../sources/controler/src/softwareUsersprogram.cc \
- ../sources/controler/src/sectionToExecute.cc \
  ../sources/controler/src/softwareTest.cc \
  ../sources/controler/src/softwareMadx.cc \
@@ -45,4 +44,6 @@
  ../sources/controler/src/sectorParameters.cc \
  ../sources/controler/src/sector.cc \
+ ../sources/controler/src/expandedMachine.cc \
+ ../sources/controler/src/computingBlock.cc \
  ../sources/userInterface/src/GWt_elementCell.cc \
  ../sources/userInterface/src/GWt_elementRfgun.cc \
@@ -70,6 +71,7 @@
  ../sources/userInterface/src/GWt_serverFileSelector.cc \
  ../sources/userInterface/src/GWt_sector.cc \
+ ../sources/userInterface/src/GWt_machine.cc \
  ../sources/userInterface/src/GWt_accelerator.cc \
- ../sources/userInterface/src/GWt_sectionToExecute.cc
+ ../sources/userInterface/src/GWt_computingBlock.cc
  
 #######################################################################
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h	(revision 493)
@@ -16,5 +16,5 @@
 class dataManager;
 class sectionToExecute;
-
+class computingBlock;
 class abstractSoftware
 {
@@ -42,11 +42,17 @@
   //  void registerElement(nomdElements::typedElement nomdel,trivaluedBool b);
 
-  sectionToExecute* getSectionToExecute() {
-    return sectionToExecute_;
+  /* sectionToExecute* getSectionToExecute() { */
+  /*      return sectionToExecute_; */
+  /* } */
+
+  computingBlock* getComputingBlock() {
+       return compBlock_;;
   }
 
   public :
 
-  abstractSoftware(string, sectionToExecute*, dataManager* );
+  //  abstractSoftware(string, sectionToExecute*, dataManager* );
+  abstractSoftware(string, computingBlock*, dataManager* );
+
   ~abstractSoftware() {
     delete nameOfSoftware_;
@@ -74,6 +80,6 @@
   }
   private :
-  sectionToExecute* sectionToExecute_;
-  
+  //  sectionToExecute* sectionToExecute_;
+  computingBlock* compBlock_;
 };
 #endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/computingBlock.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/computingBlock.h	(revision 493)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/computingBlock.h	(revision 493)
@@ -0,0 +1,115 @@
+#ifndef COMPUTINGBLOCK_SEEN
+#define COMPUTINGBLOCK_SEEN
+
+#include <iostream>
+#include <vector>
+
+#include "abstractElement.h"
+#include "abstractSoftware.h"
+#include "UAP/UAPNode.hpp"
+
+//#include "sectionToExecute.h"
+
+using namespace std;
+
+class expandedMachine;
+
+class computingBlock 
+{
+
+
+  friend class expandedMachine;
+
+
+
+ public:
+
+
+
+
+  inline  abstractSoftware* getSoftware() const {return software_;}
+
+  //  vector< abstractElement* > getElementsX(); 
+
+  inline expandedMachine* getMachine() {return machine_;}
+
+
+
+
+
+ inline unsigned getRankOfFirstElement() { return rankOfFirstElement_;}
+
+ inline unsigned getRankOfLastElement() {
+   return rankOfFirstElement_ + numberOfelements_ - 1;
+ }
+
+   abstractElement* getFirstElement();
+  abstractElement* getLastElement();
+ abstractElement* getElement(unsigned ind);
+
+  bool isEmpty() { 
+    if ( numberOfelements_ ) return false;
+    else return true;
+  }
+
+ inline  unsigned getNumberOfElements() { return numberOfelements_;}
+
+ private: 
+
+  computingBlock() {;}
+
+  computingBlock(unsigned premier, unsigned nombre, abstractSoftware* s,expandedMachine* mch);
+
+ computingBlock(expandedMachine* mac) : machine_(mac) {;}
+
+  void FileAMLOutput(UAPNode* root);
+  void FileAMLInput( UAPNode* entree);
+
+  inline void setSoftware(abstractSoftware* sw) {software_ = sw;}
+
+  inline bool removeFirstElement() {
+    rankOfFirstElement_++;
+    numberOfelements_--;
+    return checkCompatibilityWithMachine();
+  };
+
+  inline bool extendByTheEnd(unsigned nombre) {
+    numberOfelements_ += nombre;
+    return checkCompatibilityWithMachine();
+  };
+
+  inline bool suppressByTheEnd(unsigned nombre) {
+    numberOfelements_ -= nombre;
+    return checkCompatibilityWithMachine();
+  };
+
+  inline bool removeLastElement() {
+    numberOfelements_--;
+    return checkCompatibilityWithMachine();
+  }
+
+  bool checkCompatibilityWithMachine();
+
+  bool checkCoherence(string& diagnosticErrors, string& diagnosticWarnings);
+
+inline   void clearElements() { numberOfelements_ = 0; }
+ inline  void clearAll() { if ( software_ ) delete software_; software_=NULL;}
+ inline bool reinitialiseElements(unsigned first, unsigned number) {
+   rankOfFirstElement_ = first;
+   numberOfelements_ = number;
+   return checkCompatibilityWithMachine();   
+ }
+
+
+
+
+  abstractSoftware* software_;
+  unsigned rankOfFirstElement_;
+  unsigned numberOfelements_;
+  expandedMachine* machine_;
+};
+
+
+
+#endif
+
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h	(revision 493)
@@ -14,4 +14,6 @@
 #include "nomDeLogiciel.h"
 #include "sector.h"
+#include "expandedMachine.h"
+#include "computingBlock.h"
 
 #include "sectorParameters.h" //xx
@@ -24,5 +26,8 @@
  public:
   
-  dataManager() {;}
+ dataManager() :   
+  pspa_ (NULL),
+    currentMachine_(NULL)
+      {;}
   dataManager(PspaApplication*);
   virtual ~dataManager();
@@ -33,4 +38,22 @@
   particleBeam* getDiagnosticBeam_deprecated(string elementLabel);
 
+
+  //provisoire 
+  inline expandedMachine* getCurrentMachine() {return currentMachine_;}
+
+  inline expandedMachine* expandMachine() {
+    if ( !currentMachine_ ) currentMachine_ = new expandedMachine(this);
+    currentMachine_->fromSectors( sectors_, this );
+    return currentMachine_;
+  }
+
+  bool areDataCoherent() {
+    bool resultat = false;
+    if ( !currentMachine_ ) return false;
+    resultat = currentMachine_->areDataCoherent();
+    return resultat;
+  }
+
+
 /** Add a new sector
  */
@@ -39,5 +62,5 @@
   /** return all sectors
    */
-  inline std::vector <sector*> getSectors() {return jobList_;};
+  inline std::vector <sector*> getSectors() {return sectors_;};
   
   
@@ -60,9 +83,9 @@
   void writeToAMLFile(string fileName);
     
-  /** return the jobList size
+  /** return the sectors size
    */
-  inline unsigned long getJobListSize() const {
-    return jobList_.size();
-  }
+  //  inline unsigned long getSectorsSize() const {
+  //    return sectors_.size();
+  // }
   
   // si newBeam = true, on cree un nouveau diag
@@ -84,5 +107,11 @@
   };
 
-  
+  abstractElement* getElementInSectorsByLabel(string etiq);
+
+
+  void messageEcran(string niveau, string msg) const;
+
+
+
  private:
 
@@ -92,5 +121,7 @@
   vector<particleBeam> diagnosticBeam_;
   vector<unsigned> indexElementToIndexDiag_;
-  vector <sector*> jobList_;
+  //  vector <sector*> jobList_;
+  vector <sector*> sectors_;
+  expandedMachine* currentMachine_;
   void removeFile(string nameOfFile);
 };
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/expandedMachine.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/expandedMachine.h	(revision 493)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/expandedMachine.h	(revision 493)
@@ -0,0 +1,81 @@
+#ifndef EXPANDEDMACHINE_SEEN
+#define EXPANDEDMACHINE_SEEN
+
+#include <iostream>
+#include <vector>
+
+#include "abstractElement.h"
+#include "sector.h"
+#include "computingBlock.h"
+#include "UAP/UAPNode.hpp"
+
+using namespace std;
+
+class expandedMachine
+{
+
+
+
+  expandedMachine() {;}
+
+
+ public :
+
+
+ expandedMachine(dataManager* dtmg) : machineName_("dummy"), dataManager_(dtmg) {;}
+
+  ~expandedMachine() {
+    for ( unsigned k=0; k < computingBlocks_.size(); k++ ) delete computingBlocks_.at(k);
+  }
+
+  void setSoftware(std::string logiciel, computingBlock* cpblk);
+
+
+  void  fromSectors( const vector<sector*>& sect, dataManager* dtmg );
+  //  computingBlock* openBlock(dataManager* dmg); 
+
+
+
+   bool openNewLastBlock();
+
+
+  inline vector<abstractElement*>& getElements() {return elements_;}
+
+
+ inline vector<computingBlock*>& getComputingBlocks() {return computingBlocks_;}
+
+
+
+  abstractElement* getElementFromLabel(string lab);
+  int getElementRankFromLabel(string lab);
+  int getElementRankFromPointer(abstractElement* ptr);
+
+ void FileAMLOutput(UAPNode* root);
+ bool FileAMLInput( UAPNode* entree);
+
+ abstractSoftware* getSoftwarePointer(std::string logiciel, computingBlock* cpblk);
+
+ void setFirstElementOfBlock(computingBlock* bclk, int index);
+ void setLastElementOfBlock(computingBlock* bclk, int index);
+
+ abstractElement* getElementPointer( unsigned rang);
+ 
+ bool openNewBlockAfter(computingBlock* cpbl);
+
+
+ bool areDataCoherent();
+
+ bool eraseComputingBlock(computingBlock* );
+
+ inline unsigned numberOfElements() { return elements_.size(); }
+ private:
+
+ void clearComputingBlock(int a);
+
+  dataManager* dataManager_;
+  string machineName_;
+  vector<abstractElement*> elements_;
+  vector<computingBlock*> computingBlocks_;
+};
+
+#endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/nomDeLogiciel.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/nomDeLogiciel.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/nomDeLogiciel.h	(revision 493)
@@ -63,5 +63,5 @@
   }
 
-  trivaluedBool doAcceptElement(nomdElements::typedElement typdel); 
+  trivaluedBool doAcceptElement(nomdElements::typedElement typdel) const; 
 
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/sector.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/sector.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/sector.h	(revision 493)
@@ -10,5 +10,5 @@
 
 
-class sectionToExecute;
+//class sectionToExecute;
 class abstractElement;
 class dataManager;
@@ -60,12 +60,12 @@
    Return the vector of sectionToExecute of this
    */
-  inline std::vector <sectionToExecute*> getSectionsToExecute() { return sectionToExecute_;};
-  
+  //  inline std::vector <sectionToExecute*> getSectionsToExecute() { return sectionToExecute_;};
+  inline std::vector <abstractElement*>& getElements() { return elements_;};
   /**
    Add a sectionToExecute
    */
-  inline void addSectionToExecute(sectionToExecute* s) {
-    if (s) sectionToExecute_.push_back(s);
-  };
+  //  inline void addSectionToExecute(sectionToExecute* s) {
+  //    if (s) sectionToExecute_.push_back(s);
+  //  };
   
   /** Add an element after another one. Will put it in the same sectionToExecuteList. If the element after is NULL
@@ -85,9 +85,9 @@
  set the specific software for the given sectionToExecute number
  */
-  bool setSoftware(nomDeLogiciel, unsigned int sectionToExecuteNumber);
+  //  bool setSoftware(nomDeLogiciel, unsigned int sectionToExecuteNumber);
 
-  void clearSectionToExecute();
+  //  void clearSectionToExecute();
   /** Clear a specific jobList */
-  void clearSectionToExecute(int a);
+  //void clearSectionToExecute(int a);
 
   void removeElement(abstractElement* currentElement);
@@ -105,7 +105,17 @@
   }
   
+
+  bool isInside(abstractElement* previousElement);
+
 private:
 
-  std::vector <sectionToExecute*> sectionToExecute_;
+  bool insertAfter(abstractElement* previousElement,abstractElement* currentElement);
+
+
+
+
+  std::vector<abstractElement*>  elements_;
+  //  std::vector <sectionToExecute*> sectionToExecute_;
+
   particleBeam* currentBeam_;
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h	(revision 493)
@@ -18,5 +18,6 @@
   
   softwareGenerator();  
-  softwareGenerator(string inputFileName, sectionToExecute*, dataManager*);
+  //  softwareGenerator(string inputFileName, sectionToExecute*, dataManager*);
+  softwareGenerator(string inputFileName, computingBlock*, dataManager*);
 
   virtual ~softwareGenerator() {;}
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h	(revision 493)
@@ -17,5 +17,6 @@
   
   softwareMadx();
-  softwareMadx(string,sectionToExecute*,dataManager*);
+  //  softwareMadx(string,sectionToExecute*,dataManager*);
+  softwareMadx(string,computingBlock* ,dataManager*);
   virtual ~softwareMadx() {;}
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareParmela.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareParmela.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareParmela.h	(revision 493)
@@ -9,4 +9,6 @@
  protected : 
 
+     vector<int> relativeParmelaElementIndices_;
+
 
   bool beamFromParmela(string workingDir,unsigned numeroElement, double referencefrequency, vector<double>& centroid, bareParticle& refPart,vector<bareParticle>& particles );
@@ -14,4 +16,5 @@
   bool beamToParmela(string workingDir, particleBeam* partic );
 
+    void setRelativeParmelaElementIndices();
 
   string elementsData(const vector< pair<string, vector<string> > >& donnees) const ;
@@ -27,5 +30,6 @@
     softwareParmela();
     
-    softwareParmela(string inputFileName, sectionToExecute*, dataManager*);
+    //    softwareParmela(string inputFileName, sectionToExecute*, dataManager*);
+    softwareParmela(string inputFileName, computingBlock*, dataManager*);
 
   virtual ~softwareParmela() {;}
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTest.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTest.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTest.h	(revision 493)
@@ -18,5 +18,6 @@
     softwareTest();
     
-    softwareTest(string inputFileName, sectionToExecute*, dataManager*);
+    //    softwareTest(string inputFileName, sectionToExecute*, dataManager*);
+    softwareTest(string inputFileName, computingBlock*, dataManager*);
 
   virtual ~softwareTest() {;}
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTransport.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTransport.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareTransport.h	(revision 493)
@@ -20,5 +20,6 @@
  public : 
     softwareTransport();
-    softwareTransport(string inputFileName, sectionToExecute*, dataManager*);
+    //    softwareTransport(string inputFileName, sectionToExecute*, dataManager*);
+    softwareTransport(string inputFileName, computingBlock*, dataManager*);
 
   virtual ~softwareTransport() {;}
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h	(revision 493)
@@ -13,5 +13,6 @@
  public : 
     softwareUsersprogram();
-    softwareUsersprogram(string inputFileName, sectionToExecute*, dataManager*);
+    //    softwareUsersprogram(string inputFileName, sectionToExecute*, dataManager*);
+    softwareUsersprogram(string inputFileName, computingBlock*, dataManager*);
 
   virtual ~softwareUsersprogram() {;}
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc	(revision 493)
@@ -10,47 +10,23 @@
 }
 
-abstractSoftware::abstractSoftware(string inputFileName, sectionToExecute* sect, dataManager* data)
+// abstractSoftware::abstractSoftware(string inputFileName, sectionToExecute* sect, dataManager* data)
+// {
+//   inputFileName_ = inputFileName;
+//   //  sectionToExecute_ = sect;
+//   compBlock_ = NULL;
+//   dataManager_ = data;
+//   nameOfSoftware_ = new nomDeLogiciel("unknownSoftware");
+// }
+
+abstractSoftware::abstractSoftware(string inputFileName, computingBlock* cmpb, dataManager* data)
 {
   inputFileName_ = inputFileName;
-  sectionToExecute_ = sect;
+  compBlock_ = cmpb;
   dataManager_ = data;
+  cout << " abstractSoftware::abstractSoftware adresse manager " << dataManager_  << endl;
   nameOfSoftware_ = new nomDeLogiciel("unknownSoftware");
 }
 
 
-// void abstractSoftware::registerElement(nomdElements::typedElement nomdel,trivaluedBool b) 
-// {
-//   //  std::cout << " abstractSoftware::registerElement soft : " << nameOfSoftware_.getString() << std::endl;
-//   if (b == TBoolIgnore) {
-//     //    std::cout << " abstractSoftware::registerElement j'enregistre element " <<  nomdel << "   ignore " << std::endl;
-//     ignoredElements_.push_back(nomdel);
-//   } else if (b == TBoolOk) {
-//     //    std::cout << " abstractSoftware::registerElement j'enregistre element " <<  nomdel << "  OK " << std::endl;
-//     acceptedElements_.push_back(nomdel);
-//   }
-// }
-
-// 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()) {
-//     return TBoolOk;
-//   }
-
-//   if (ignoredElements_.size() == 0) {
-//     return TBoolError;
-//   }
-
-//   if (std::find(ignoredElements_.begin(),ignoredElements_.end(),typdel) != ignoredElements_.end()) {
-//     return TBoolIgnore;
-//   }
-
-//   return TBoolOk;
-// }
 
 bool abstractSoftware::launchJob(string commandLine, string& resul)
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/computingBlock.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/computingBlock.cc	(revision 493)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/computingBlock.cc	(revision 493)
@@ -0,0 +1,111 @@
+#include "computingBlock.h"
+#include "mixedTools.h"
+ #include "softwareUnknown.h"
+#include "expandedMachine.h"
+
+
+computingBlock::computingBlock(unsigned premier, unsigned nombre, abstractSoftware* s,expandedMachine* mch)  {
+  // dataManager_ = dtmg;
+  machine_ = mch;
+  if ( premier >= machine_->numberOfElements() ) {
+    rankOfFirstElement_ = 0;
+    numberOfelements_ = 0;
+  } else {
+    rankOfFirstElement_ = premier;
+    if ( nombre < machine_->numberOfElements() - rankOfFirstElement_ +1 ) {
+      numberOfelements_ = nombre;
+    } else numberOfelements_ = machine_->numberOfElements() - rankOfFirstElement_ +1;
+  }
+  if (s == NULL) {
+    software_ = new softwareUnknown();
+  } else {
+    software_ = s;
+  }
+}
+
+
+void computingBlock::FileAMLOutput(UAPNode* root)
+{
+  UAPNode* node = root->addChild("computingBlock");
+  node->addChild("software")->addAttribute("name",software_->getName());
+  unsigned noElem = rankOfFirstElement_;
+  UAPNode* blocNode = node->addChild("blocExtension");
+  blocNode->addAttribute("rankOfFirstElement",mixedTools::intToString(int(rankOfFirstElement_)));
+  blocNode->addAttribute("numberOfelements",mixedTools::intToString(int(numberOfelements_)));
+}
+
+
+void computingBlock::FileAMLInput( UAPNode* entree) {
+      string soft;
+      AMLtools::readAMLParameterAttribut(entree, "software", "name", soft);
+      software_ = machine_->getSoftwarePointer(soft, this);
+      int premier, nombre;
+      AMLtools::readAMLParameterAttribut(entree, "blocExtension", "rankOfFirstElement", premier);
+      AMLtools::readAMLParameterAttribut(entree, "blocExtension", "numberOfelements", nombre);
+      rankOfFirstElement_  = premier;
+      numberOfelements_ = nombre;
+      if ( !checkCompatibilityWithMachine() ) {
+	rankOfFirstElement_  = 0;
+	numberOfelements_ = 0;
+	cout << " computingBlock::FileAMLInput ERREUR lecture " << endl;
+      }
+}
+bool computingBlock::checkCompatibilityWithMachine() {
+  if ( !machine_ ) return false;
+  if ( rankOfFirstElement_ > machine_->numberOfElements() ) return false;
+  if ( numberOfelements_ > machine_->numberOfElements() - rankOfFirstElement_ + 1 ) return false;
+  return true;
+}
+bool computingBlock::checkCoherence(string& diagnosticErrors, string& diagnosticWarnings) {
+
+  cout << " computingBlock::checkCoherence() " << endl;
+  bool caMarche = true;
+
+  const nomDeLogiciel* prog = software_->getNomDeLogiciel();
+
+  for(unsigned k =0 ; k < numberOfelements_; k++)
+    {
+      abstractElement* elem = machine_->getElementPointer(rankOfFirstElement_ + k);
+      trivaluedBool tb = prog->doAcceptElement(elem->getNomdElement().getElementType());
+      cout << " GWt_softwarePanel::areDataCoherent() el " << elem->getLabel() << " tb= " << tb << endl;
+      if (tb  != TBoolOk ) {
+	if (tb == TBoolIgnore) {
+	  if(prog->getString() != "unknownSoftware") diagnosticWarnings += elem->getLabel() + " will be ignored by  "+ prog->getString() + "<br /> ";
+	  cout << " element " <<  elem->getLabel() << " ignore " << endl;
+	} else {
+	  diagnosticErrors += elem->getNomdElement().getExpandedName() + " is not allowed with " + prog->getString() + "<br /> ";
+	  cout << " element " <<  elem->getLabel() << " REFUSE " << endl;
+	  caMarche = false;
+	}
+      }
+    } //k
+  return caMarche;
+}
+
+
+//   vector< abstractElement* > computingBlock::getElements()  { 
+//     vector< abstractElement* > elems;
+//     for (unsigned k=0; k < numberOfelements_; k++ ) {
+//       elems.push_back( machine_->getElementPointer( rankOfFirstElement_ + k));
+//     }
+//     return elems;
+//   }
+
+abstractElement* computingBlock::getFirstElement() {
+  return machine_->getElementPointer( rankOfFirstElement_);
+}
+
+
+
+abstractElement*  computingBlock::getLastElement() {
+  cout << " computingBlock::getLastElement() premier " << machine_->getElementPointer( rankOfFirstElement_)->getLabel() << endl;
+  cout << "  nb elements : " << numberOfelements_ << endl;
+  cout << " computingBlock::getLastElement() dernier " << machine_->getElementPointer( rankOfFirstElement_ + numberOfelements_ - 1)->getLabel() << endl;
+  return machine_->getElementPointer( rankOfFirstElement_ + numberOfelements_ - 1);
+}
+
+
+ abstractElement* computingBlock::getElement(unsigned ind) { return machine_->getElementPointer( rankOfFirstElement_ + ind); }
+
+
+
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 493)
@@ -5,4 +5,5 @@
 #include "mathematicalConstants.h"
 #include "PhysicalConstants.h"
+#include "softwareUnknown.h"
 
 #include "GWt_pspaApplication.h"
@@ -16,8 +17,9 @@
 #include "AMLtools.h"
 
-#define BAVARD 0
+#define BAVARD 1
 
 dataManager::dataManager(PspaApplication* pspa) :
-pspa_ (pspa)
+  pspa_ (pspa),
+  currentMachine_(NULL)
 {}
 
@@ -25,16 +27,19 @@
 {
   unsigned k;
-  for (k=0; k < jobList_.size();k++) {
-    if ( jobList_[k] != NULL ) delete jobList_[k];
-  }
+  for (k=0; k < sectors_.size();k++) {
+    if ( sectors_[k] != NULL ) delete sectors_[k];
+  }
+  if ( currentMachine_ ) delete currentMachine_;
 }
 
 void dataManager::consoleMessage(string message)
 {
+  cout << " passage console message : " << endl;
+  cout << message << endl;
   GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));
   if (console) console->addConsoleMessage(message + "\n");
   pspa_->processEvents();
 }
-
+ 
 
 void dataManager::initializeExecution()
@@ -54,7 +59,7 @@
   diagnosticBeam_.clear();
   indexElementToIndexDiag_.clear();
-  for (unsigned int a=0; a< jobList_.size(); a++) {
-      jobList_[a]->clearSectionToExecute();
-  }
+  // for (unsigned int a=0; a< jobList_.size(); a++) {
+  //     jobList_[a]->clearSectionToExecute();
+  // }
 }
 
@@ -80,20 +85,27 @@
   
   // Main loop !
-  cout << " dataManager::executeAll #jobList_= " << jobList_.size() << endl;
-  for(unsigned k = 0; k < jobList_.size(); k++) 
-    {
-      sector* sector = jobList_[k];
-      cout << " dataManager::executeAll sector name= " << sector->getName() << endl;
-      cout << " dataManager::executeAll #sectionsToExecute= " << sector->getSectionsToExecute().size() << endl;
+  cout << " dataManager::executeAll #sectors_= " << sectors_.size() << endl;
+  //  expandedMachine machine;
+  //  machine.fromJoblist(jobList_);
+
+  // vecteur de blocs de calcul 
+  vector<computingBlock*> compblock = getCurrentMachine()->getComputingBlocks();
+  cout << " dataManager::executeAll() : nb blocs de calcul : " << compblock.size() << endl;
+
+  particleBeam* computedBeam = sectors_[0]->getParticleBeam();
+
+
+  //  for(unsigned k = 0; k < jobList_.size(); k++) 
+  // {
+      // sector* sector = jobList_[k];
+      // cout << " dataManager::executeAll sector name= " << sector->getName() << endl;
+      // cout << " dataManager::executeAll #sectionsToExecute= " << sector->getSectionsToExecute().size() << endl;
       
       // for the moment, we put everything in one line without loops
-      for(unsigned int l = 0; l < sector->getSectionsToExecute().size(); l++) 
+      //      for(unsigned int l = 0; l < sector->getSectionsToExecute().size(); l++) 
+      for (unsigned int l = 0; l < compblock.size(); l++) 
 	{
-	  sectionToExecute* section = sector->getSectionsToExecute()[l];
-	  abstractSoftware* softw = section->getSoftware();
-	  
+	  abstractSoftware* softw = compblock.at(l)->getSoftware();
 	  cout << " execution du SOFWARE " << softw->getName() << endl;
-	  cout << " adresse section " << section << endl;
-	  cout << " adresse faisceau " << sector->getParticleBeam() << endl;
 	  if (softw == NULL) {
 	    success = false;
@@ -102,5 +114,7 @@
 	  }
     
-	  success = softw->createInputFile(sector->getParticleBeam(),workingDir);
+	  //	  success = softw->createInputFile(sector->getParticleBeam(),workingDir);
+	  cout << " dataManager::executeAll() APPEL softw->createInputFile " << endl;
+	  success = softw->createInputFile(computedBeam,workingDir);
 	  if ( success ) {
 	    success = softw->execute(workingDir);
@@ -111,8 +125,10 @@
 	  cout << " dataManager::executeAll success = " << success << " y-a-ty du faisceau : " << diagnosticBeam_.size() << endl;
 	  if ( success  && (diagnosticBeam_.size() > 0)) {
-	    sector->setParticleBeam(&diagnosticBeam_.at(indexElementToIndexDiag_.back()));
+	    // sector->setParticleBeam(&diagnosticBeam_.at(indexElementToIndexDiag_.back()));
+	    computedBeam = &diagnosticBeam_.at(indexElementToIndexDiag_.back());
 	    cout << " dataManager::executeAll termine avec succes " << endl;
 	  } else {
-	    sector->setParticleBeam(NULL);
+	    //	    sector->setParticleBeam(NULL);
+	    computedBeam = NULL;
 	    cout << " dataManager::executeAll termine en ECHEC " << endl;
 	  }
@@ -121,12 +137,13 @@
 #if BAVARD > 0
 	  cout << "dataManager::executeAll #diagnosticBeam= " << diagnosticBeam_.size() << endl;
-	  cout << "dataManager::executeAll #getBeamLineSize()= " << getBeamLineSize() << endl;
-	  std::vector< abstractElement* > elements = section->getElements();
-	  for (unsigned j = 0; j < elements.size(); j++) {
-	    cout << "[" << j << "] " << elements[j]->getNomdElement().getExpandedName() << endl;
+	  //	  cout << "dataManager::executeAll #getBeamLineSize()= " << getBeamLineSize() << endl;
+	  //	  std::vector< abstractElement* > elements = section->getElements();
+	  //	  std::vector< abstractElement* > elements = compblock.at(l)->getElements();
+	  for (unsigned j = 0; j < compblock.at(l)->getNumberOfElements(); j++) {
+	    cout << "[" << j << "] " << compblock.at(l)->getElement(j)->getNomdElement().getExpandedName() << endl;
 	  }
 #endif
 	} //l
-    } //k
+      //    } //k
   
   // if ( currentBeam_deprecated_ ) {
@@ -179,4 +196,9 @@
 // }
 
+
+
+
+
+
 // ecriture sur fichier AML
 void dataManager::writeToAMLFile(string fileName)
@@ -199,19 +221,18 @@
   //sectorParam_.InputRep(lab);
 
-  // sequence of elements
-  UAPNode* sect = lab->addChild("sector");
-  sect->addAttribute("name","a_sect");
-
-  abstractElement* elPtr;
-  for (unsigned k = 0; k < jobList_.size(); k++) {
-    sector* sector = jobList_[k];
-    for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
-      sectionToExecute* section = sector->getSectionsToExecute()[l];
-      for (unsigned m = 0; m < section->getElements().size(); m++) {
-        elPtr = section->getElements()[m];
-        elPtr->InputRep(sect);
-      }
-    }
-  }
+  // sequence of sectors with elements
+
+  for ( unsigned k=0; k < sectors_.size(); k++) {
+    sector* secteur = sectors_.at(k);
+    UAPNode* sect = lab->addChild("sector");
+    sect->addAttribute("name",secteur->getName());
+    abstractElement* elPtr;
+    for ( unsigned j=0; j < secteur->getElements().size(); j++) {
+      elPtr = secteur->getElements().at(j);
+      elPtr->InputRep(sect);
+    }
+  }
+
+  if ( currentMachine_ ) currentMachine_->FileAMLOutput(lab);
   cout << "!Create the AML file ---------------------------" << endl;
   AMLReader reader;
@@ -220,62 +241,4 @@
 }
 
-// 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;
-  
-//   //NOTE:: je ne sais pas si les "secteurs" seront conservÃ©s, aussi pour ne pas trop changer les fichiers je lis les donnÃ©es aprÃšs "globals" dans la boucle 
-  
-//   // Clear the BeamLine
-//   jobList_.clear();
-
-//   // FIXME : For test purpose !!!
-//   sector* mySect = addNewSector();
-  
-//   nomdElements::typedElement elementType;
-//   string elementLabel;
-//   abstractElement* nouveau = NULL;
-//   while (infile >> elementLabel) {
-//     if (elementLabel == string("globals") ) {
-//       globParam_.raz();
-//       globParam_.FileInput(infile);
-//     } else if (elementLabel == string("sectors") ) {
-//       // FIXME Francois !!!!!!!
-// //      sectorParam_.raz();
-// //      sectorParam_.FileInput(infile);
-//       // END
-//     } else {
-//       elementType = nomdElements::getTypeFromLabel(elementLabel);
-//       nouveau = mySect->addElementAfter(elementType,nouveau);
-//       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_deprecated()->getAbstractElement(k);
-//     cout << "recupere " << ptr->getLabel() << endl;
-//   }
-// */
-// #endif
-
-//   infile.close();
-//   return true;
-// }
 
 bool dataManager::restoreAMLElements(string inputFileName)
@@ -296,5 +259,5 @@
 
 NodeVec laboratories = uap_root->getSubNodesByName(string("laboratory"));
- cout << " dataManager::restoreAMLElements nombre de <laboratory> : " << laboratories.size() << endl;
+// cout << " dataManager::restoreAMLElements nombre de <laboratory> : " << laboratories.size() << endl;
 
  uap_labname = *laboratories.begin();
@@ -302,6 +265,6 @@
  if ( !uap_labname ) {
    cout << " dataManager::restoreAMLElements : fichier non conforme, on ne trouve pas <laboratory...> " << endl;
- } else {
-   cout << " dataManager::restoreAMLElements : GO !" << endl;
+   // } else {
+   //   cout << " dataManager::restoreAMLElements : GO !" << endl;
  }
 
@@ -310,15 +273,16 @@
   
   // Clear the BeamLine
-  jobList_.clear();
+  sectors_.clear();
 
   // FIXME : For test purpose !!!
-  sector* mySect = addNewSector();
-  
+  //  sector* mySect = addNewSector();
+  //  if (  currentMachine_ ) delete currentMachine_;
+  //  currentMachine_ = new expandedMachine();
 
    UAPNode* parametresGlobaux = uap_labname->getChildByName(string("global"));
   if ( !parametresGlobaux ) {
     cout << " dataManager::restoreAMLElements GLOBAUX NON TROUVES " << endl;
-  } else {
-    cout << " dataManager::restoreAMLElements GENIAL ! " << endl;
+  // } else {
+  //   cout << " dataManager::restoreAMLElements GENIAL ! " << endl;
   }
   globParam_.raz();
@@ -326,7 +290,7 @@
 
 
+
   nomdElements::typedElement elementType;
   string elementLabel;
-  abstractElement* nouveau = NULL;
 
 
@@ -337,48 +301,62 @@
     return false;
   }
-
-
-  NodeVec& listElem = ( *sectorNode.begin() )->getChildren();
-  if (  !listElem.size() ) {
-    cout << " dataManager::restoreAMLElements ERREUR lecture fichier : pas d'elements ? " << endl;
-    return false;
-  } else {
-    cout << " dataManager::restoreAMLElements : liste elements non vide : SUCCES " << endl;
-  }
-
-  for (NodeVecIter iter = listElem.begin(); iter != listElem.end(); iter++) {
-
-    string nomNoeud = (*iter)->getName();
-    if ( nomNoeud != string("element") ) {
-      cout << " le secteur contient un non-element : " << nomNoeud << endl;
-      continue;
-    }
-
-    UAPAttribute* att = NULL;
-    att = (*iter)->getAttribute("name");
-
-    cout << " dataManager::restoreAMLElements trouve element " << att->getValue();
-
-    string nomGenerique;
-    AMLtools::readAMLParameterAttribut(*iter, "description", "type", nomGenerique);
-
-    // UAPNode*  genericName = (*iter)->getChildByName("description");
-    // att = genericName->getAttribute("type");
-
-    cout <<  " de type " << nomGenerique << endl;
-
-
-    elementType = nomdElements::getTypeFromLabel(nomGenerique);
-    nouveau = mySect->addElementAfter(elementType,nouveau);
-
+  for (NodeVecIter iterSect = sectorNode.begin(); iterSect != sectorNode.end(); iterSect++) {
+    UAPAttribute* att = (*iterSect)->getAttribute("name");
+    if ( !att ) continue;
+    sectors_.push_back( new sector(this, att->getValue()) );
+    NodeVec& listElem = (*iterSect)->getChildren();
+    if (  !listElem.size() ) {
+      cout << " dataManager::restoreAMLElements WARNING lecture fichier secteur " <<  att->getValue() << "  : pas d'elements ? " << endl;
+    }
+    abstractElement* nouveau = NULL;
+    for (NodeVecIter iterelem = listElem.begin(); iterelem != listElem.end(); iterelem++) {
+
+      string nomNoeud = (*iterelem)->getName();
+      if ( nomNoeud != string("element") ) {
+	cout << " le secteur contient un non-element : " << nomNoeud << endl;
+	continue;
+      }
+
+      att = NULL;
+      att = (*iterelem)->getAttribute("name");
+
+
+      string nomGenerique;
+      AMLtools::readAMLParameterAttribut(*iterelem, "description", "type", nomGenerique);
+      elementType = nomdElements::getTypeFromLabel(nomGenerique);
+      nouveau = sectors_.back()->addElementAfter(elementType,nouveau);
       if ( nouveau == NULL ) {
 	cerr << " dataManager::restoreAMLElements() : restore element " << att->getValue() << " failed " << endl;
 	return false;
       } else {
-	nouveau->FileAMLInput(*iter); 
+	nouveau->FileAMLInput(*iterelem); 
       }
-  }
-
-  
+    } // iterelem
+  } // itersect
+
+
+  // cout << " dataManager::restoreAMLElements BILAN DES SECTEURS " << endl;
+  // for ( unsigned m=0; m < sectors_.size(); m++ ) {
+  //   cout << " secteur " << m+1 << " nom : " << sectors_.at(m)->getName() << endl;
+  //   for ( unsigned j=0; j<sectors_.at(m)->getElements().size(); j++) {
+  //     cout << " el. : " << sectors_.at(m)->getElements().at(j)->getLabel() << endl;
+  //   }
+  // }
+
+  NodeVec machine = uap_root->getSubNodesByName(string("machine"));
+  if ( !machine.size()  ) {
+    cout << " dataManager::restoreAMLElements ne trouve pas de machine " << endl;
+  } else {
+    if ( machine.size() > 1 ) {
+      cout << " dataManager::restoreAMLElements PLUSIEURS MACHINES : cas non prevu " << endl;
+    }
+    //    cout << " dataManager::restoreAMLElements il y a une machine a lire dans   " << endl;
+    //    cout << currentMachine_ << endl;
+    if ( !currentMachine_ ) currentMachine_ = new expandedMachine(this);
+    currentMachine_->FileAMLInput(machine.at(0)); 
+  }
+  
+
+
   return true;
 }
@@ -397,25 +375,26 @@
 particleBeam* dataManager::getDiagnosticBeam_deprecated(string elementLabel)
 {
+  if ( !currentMachine_ ) return NULL;
+
   // FIXME : Devra etre changÃ© par une rÃ©cupÃ©ration par "abstractElement" et non pas par label
   unsigned int number = 0;
   abstractElement* elPtr;
-  for (unsigned k = 0; k < jobList_.size(); k++) {
-    sector* sector = jobList_[k];
-    for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
-      sectionToExecute* section = sector->getSectionsToExecute()[l];
-      for (unsigned m = 0; m < section->getElements().size(); m++) {
-        elPtr = section->getElements()[m];
-        if (elPtr->getLabel() == elementLabel) {
-          return getDiagnosticBeam(number);
-        }
-        number ++;
+
+  for (unsigned k = 0; k < currentMachine_->getComputingBlocks().size(); k++) {
+    computingBlock* block = currentMachine_->getComputingBlocks().at(k);
+    for (unsigned m = 0; m < block->getNumberOfElements(); m++) {
+      elPtr = block->getElement(m);
+      if (elPtr->getLabel() == elementLabel) {
+	return getDiagnosticBeam(number);
       }
-    }
-  }
+      number ++;
+    }
+  }
+
+
   return NULL;
 }
 
 
-// on ne tient pas compte des elements "snapshot" presents dans la beamLine
 void dataManager::donneesRmsEnveloppe(string type,vector<double>& xcor,vector<double>& ycor, string& titre, string& legendx, string& legendy)
 {
@@ -431,27 +410,54 @@
     unsigned i = 0;
     cout << " dataManager::donneesRmsEnveloppe " << endl;
-    //    for (unsigned k = 0; k < getBeamLineSize(); k++) {
-    for (unsigned k = 0; k < jobList_.size(); k++) {
-      sector* sector = jobList_[k];
-      for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
-        sectionToExecute* section = sector->getSectionsToExecute()[l];
-        for (unsigned m = 0; m < section->getElements().size(); m++) {
-          abstractElement* elPtr = section->getElements()[m];
-          //     if(elPtr->getNomdElement().getElementType() == snapshot) continue;
-          //      if(elPtr->getNomdElement().getElementType() == fit) continue;
-          particleBeam* beamToDraw = getDiagnosticBeam(i);
-          if ( !beamToDraw->momentRepresentationOk() ) {
-            beamToDraw->buildMomentRepresentation();
-          }
+
+    if ( !currentMachine_ ) {
+    cout << " dataManager::donneesRmsEnveloppe PAS DE MACHINE " << endl;
+    return;
+    }
+
+  for (unsigned k = 0; k < currentMachine_->getComputingBlocks().size(); k++) {
+    computingBlock* block = currentMachine_->getComputingBlocks().at(k);
+    for (unsigned m = 0; m < block->getNumberOfElements(); m++) {
+      abstractElement* elPtr = block->getElement(m);
+      particleBeam* beamToDraw = getDiagnosticBeam(i);
+      if ( !beamToDraw->momentRepresentationOk() ) {
+	beamToDraw->buildMomentRepresentation();
+      }
           
-          longueur += elPtr->getLenghtOfElement();
-          valeur = beamToDraw->getXmaxRms();
-          cout << " dataManager::donneesRmsEnveloppe index = " << k <<  " longueur = " << longueur << " enveloppe : " << valeur << endl;
-          xcor.push_back(0.01*longueur);  // on passe en metres
-          ycor.push_back(valeur);
-          i++;
-        }
-      }
-    }
+      longueur += elPtr->getLenghtOfElement();
+      valeur = beamToDraw->getXmaxRms();
+      cout << " dataManager::donneesRmsEnveloppe index = " << k <<  " longueur = " << longueur << " enveloppe : " << valeur << endl;
+      xcor.push_back(0.01*longueur);  // on passe en metres
+      ycor.push_back(valeur);
+      i++;      
+    }
+  }
+
+
+
+
+    // for (unsigned k = 0; k < jobList_.size(); k++) {
+    //   sector* sector = jobList_[k];
+    //   for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
+    //     sectionToExecute* section = sector->getSectionsToExecute()[l];
+    //     for (unsigned m = 0; m < section->getElements().size(); m++) {
+    //       abstractElement* elPtr = section->getElements()[m];
+    //       //     if(elPtr->getNomdElement().getElementType() == snapshot) continue;
+    //       //      if(elPtr->getNomdElement().getElementType() == fit) continue;
+    //       particleBeam* beamToDraw = getDiagnosticBeam(i);
+    //       if ( !beamToDraw->momentRepresentationOk() ) {
+    //         beamToDraw->buildMomentRepresentation();
+    //       }
+          
+    //       longueur += elPtr->getLenghtOfElement();
+    //       valeur = beamToDraw->getXmaxRms();
+    //       cout << " dataManager::donneesRmsEnveloppe index = " << k <<  " longueur = " << longueur << " enveloppe : " << valeur << endl;
+    //       xcor.push_back(0.01*longueur);  // on passe en metres
+    //       ycor.push_back(valeur);
+    //       i++;
+    //     }
+    //   }
+    // }
+
     legendy.clear();
     legendy = " x (cm) ";
@@ -468,6 +474,30 @@
   
   sector* sect = new sector(this, std::string("sector ") + result);
-  jobList_.push_back(sect);
+  sectors_.push_back(sect);
   return sect;
 }
 
+abstractElement* dataManager::getElementInSectorsByLabel(string etiq) {
+  for ( unsigned k=0; k < sectors_.size(); k++) {
+    for ( unsigned j=0; j < sectors_.at(k)->getElements().size(); j++) {
+      if ( etiq == sectors_.at(k)->getElements().at(j)->getLabel() ) return sectors_.at(k)->getElements().at(j);
+    }
+  }
+  return NULL;
+}
+
+
+  void dataManager::messageEcran(string niveau, string msg) const {
+    GWt_dialog::iconType icon;
+    if ( niveau == "ERROR" ) {
+      icon = GWt_dialog::Error;
+    } else if  ( niveau == "WARNING" ) {
+      icon = GWt_dialog::Warning;
+    } else if  ( niveau == "INFO" ) {
+      icon = GWt_dialog::Info;
+    } else {
+      icon = GWt_dialog::NoIcon;
+    }
+    GWt_dialog checkConfigNameDialog(niveau, msg, icon,true,true);
+    checkConfigNameDialog.exec();
+  }
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/elementSoleno.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/elementSoleno.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/elementSoleno.cc	(revision 493)
@@ -5,5 +5,4 @@
 elementSoleno::elementSoleno() :  abstractElement() 
 {
-  cout << " passage constructeur elementSoleno " << endl;
   setDefaultValues();
   setDefaults();
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/expandedMachine.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/expandedMachine.cc	(revision 493)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/expandedMachine.cc	(revision 493)
@@ -0,0 +1,479 @@
+#include "dataManager.h"
+#include "expandedMachine.h"
+#include "softwareUnknown.h"
+#include "softwareParmela.h"
+#include "softwareTransport.h"
+#include "softwareGenerator.h"
+#include "softwareGenerator.h"
+#include "softwareUsersprogram.h"
+#include "softwareTest.h"
+#include "softwareMadx.h" //xx
+
+void expandedMachine::clearComputingBlock(int a)
+{
+  cout << " expandedMachine::clearComputingBlock : effacement du bloc d'index = " << a << endl;
+  if (a < 0) return;
+  if (a >= (int)computingBlocks_.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 = computingBlocks_.at(a)->getSoftware();
+  //  if ( soft != NULL ) delete soft;
+  computingBlocks_.at(a)->clearAll();
+  delete computingBlocks_[a];
+  computingBlocks_.erase (computingBlocks_.begin()+a);
+}
+
+bool expandedMachine::eraseComputingBlock(computingBlock* cpbl) {
+  for ( unsigned k=0; k <  computingBlocks_.size(); k++) {
+    if ( cpbl == computingBlocks_.at(k) ) {
+      cout << " expandedMachine::eraseComputingBlock : J'AI TROUVE LE BLOC A DETRUIRE " << endl;
+      unsigned nbElem = computingBlocks_.at(k)->getNumberOfElements();
+      if ( k != 0 ) {
+	computingBlocks_.at(k-1)->extendByTheEnd(nbElem);
+      } else {
+	if ( computingBlocks_.size() == 1 ) return false;
+	computingBlocks_.at(k+1)->reinitialiseElements(computingBlocks_.at(k)->getRankOfFirstElement(),
+						       computingBlocks_.at(k+1)->getNumberOfElements() + nbElem);
+      }
+      clearComputingBlock(int(k) );	
+      return true;
+    }
+  }
+  return false;
+}
+
+abstractSoftware* expandedMachine::getSoftwarePointer(std::string logiciel, computingBlock* cpblk) {
+
+  cout << " expandedMachine::getSoftwarePointer .... logiciel  " << logiciel << endl;
+
+  abstractSoftware* prog;
+  
+  string inputFileName;
+  if(logiciel == "parmela") {
+    inputFileName = "parmin";
+    prog = new softwareParmela(inputFileName, cpblk,dataManager_ );
+  } else if (logiciel  == "transport") {
+    inputFileName = "transport.input";
+    prog =  new softwareTransport(inputFileName, cpblk,dataManager_ );
+  } else if (logiciel == "generator") {
+    inputFileName = "generator.in";
+    prog = new softwareGenerator(inputFileName, cpblk,dataManager_ );
+  } else if (logiciel  == "madx") {
+    inputFileName = "madx.input";
+    prog = new softwareMadx(inputFileName,cpblk,dataManager_ );
+  } else if (logiciel  == "usersprogram") {
+    inputFileName = "dummy";
+    prog = new softwareUsersprogram(inputFileName, cpblk,dataManager_ );
+  } else if (logiciel  == "test") {
+    prog = new softwareTest(inputFileName, cpblk,dataManager_ );
+  } else {
+    prog = new softwareUnknown();
+  }
+  return prog;
+
+}
+
+
+void expandedMachine::setSoftware(std::string logiciel, computingBlock* cpblk) {
+  int  a = -1;
+  for (unsigned k=0; k < computingBlocks_.size(); k++ ) {
+    if ( cpblk == computingBlocks_.at(k) ) a = k;
+  }
+  if ( a < 0) return;
+
+  abstractSoftware* prog = getSoftwarePointer(logiciel, computingBlocks_.at(a));
+  
+  // string inputFileName;
+  // if(logiciel == "parmela") {
+  //   inputFileName = "parmin";
+  //   prog = new softwareParmela(inputFileName, computingBlocks_.at(a),dataManager_ );
+  // } else if (logiciel  == "transport") {
+  //   inputFileName = "transport.input";
+  //   prog =  new softwareTransport(inputFileName, computingBlocks_.at(a),dataManager_ );
+  // } else if (logiciel == "generator") {
+  //   inputFileName = "generator.in";
+  //   prog = new softwareGenerator(inputFileName, computingBlocks_.at(a),dataManager_ );
+  // } else if (logiciel  == "madx") {
+  //   inputFileName = "madx.input";
+  //   prog = new softwareMadx(inputFileName,computingBlocks_.at(a),dataManager_ );
+  // } else if (logiciel  == "usersprogram") {
+  //   inputFileName = "dummy";
+  //   prog = new softwareUsersprogram(inputFileName, computingBlocks_.at(a),dataManager_ );
+  // } else if (logiciel  == "test") {
+  //   prog = new softwareTest(inputFileName, computingBlocks_.at(a),dataManager_ );
+  // } else {
+  //   prog = new softwareUnknown();
+  // }
+  
+  computingBlocks_.at(a)->setSoftware(prog);
+}
+
+  // methode provisoire 
+void expandedMachine::fromSectors( const vector<sector*>& secteurs, dataManager* dtmg  )
+{
+  cout << " methode expandedMachine::fromSectors " << endl;
+  unsigned k,j,m;
+  elements_.clear();
+  for (k=0; k < secteurs.size() ; k++) {
+
+    sector* sect = secteurs.at(k);
+    //    vector<sectionToExecute*> vecsec = sect->getSectionsToExecute();
+    //    for (j=0; j < vecsec.size() ; j++) {
+      vector< abstractElement* > lesElements = sect->getElements();
+      for ( m=0; m < lesElements.size(); m++) elements_.push_back(lesElements.at(m));
+      // }
+  }
+    cout << " expandedMachine::fromSectors la machine a " << elements_.size() << " elements " << endl;
+    computingBlocks_.clear();
+    //    computingBlocks_.push_back(new computingBlock(elements_,NULL, this));
+    computingBlocks_.push_back(new computingBlock(0, elements_.size(),NULL, this));
+}
+
+bool expandedMachine::openNewLastBlock() {
+    cout << " expandedMachine::openNewLastBlock()  " << endl;
+  abstractElement* s = computingBlocks_.back()->getLastElement();
+  if ( !s ) {
+    cout << " expandedMachine::openNewLastBlock() dernier element non reconnu " << endl;
+    return false;
+  }
+  computingBlocks_.back()->removeLastElement();
+
+
+  computingBlocks_.push_back(new computingBlock(getElementRankFromPointer(s), 1,NULL, this));
+}
+
+bool expandedMachine::openNewBlockAfter(computingBlock* cpbl) {
+    cout << " expandedMachine::openNewBlockAfter()  " << endl;
+  int  preceedingIndex = -1;
+  int compteur=0;
+  vector<computingBlock*>::iterator iter;
+  vector<computingBlock*>::iterator iterFound;
+  for ( iter = computingBlocks_.begin(); iter != computingBlocks_.end(); iter++, compteur++) {
+
+    if ( cpbl == *iter ) {
+      cout << " expandedMachine::openNewBlockAfter : J'AI TROUVE LE BLOC APRES LEQUEL INSERER " << endl;
+      iterFound = iter;
+      preceedingIndex = compteur;
+      break;
+    }
+  }
+  if ( preceedingIndex < 0 ) return false;
+  unsigned dernierPrecedent = computingBlocks_.at(preceedingIndex)->getRankOfLastElement();
+  computingBlocks_.at(preceedingIndex)->removeLastElement();
+  unsigned nbElemNew;
+  if ( preceedingIndex < computingBlocks_.size() - 1 ) {
+    computingBlocks_.at(preceedingIndex+1)->removeFirstElement();
+    nbElemNew = 2;
+  } else {
+    nbElemNew = 1;
+  }
+  computingBlocks_.insert(iter + 1, new computingBlock(dernierPrecedent, nbElemNew,NULL, this));
+ cout << " expandedMachine::openNewBlockAfter  il y a maintenant  " << computingBlocks_.size() << " blocs "  << endl;
+ for ( unsigned j=0; j < computingBlocks_.size(); j++) {
+   cout << "  bloc  "  << j << " : " <<  endl;
+   for ( unsigned k=0; k < computingBlocks_.at(j)->getNumberOfElements(); k++) {
+     cout << computingBlocks_.at(j)->getElement(k)->getLabel() << endl;
+   }
+ }
+}
+
+void expandedMachine::FileAMLOutput(UAPNode* root)
+{
+  UAPNode* node = root->addChild("machine");
+  node->addAttribute("name",machineName_);
+  UAPNode* lesElements = node->addChild("machineElements");
+  for ( unsigned k=0; k < elements_.size(); k++) {
+  lesElements->addChild("melement")->addAttribute("name",elements_.at(k)->getLabel());
+  }
+  UAPNode* lesBlocs = node->addChild("mcomputingBlocks");
+  for ( unsigned k=0; k < computingBlocks_.size(); k++) {
+    computingBlocks_.at(k)->FileAMLOutput(lesBlocs );
+  }
+}
+
+bool expandedMachine::FileAMLInput( UAPNode* entree) {
+  if ( !entree ) return false;
+
+  elements_.clear();
+  computingBlocks_.clear();
+  UAPNode* listElem = entree->getChildByName("machineElements");
+  if ( !listElem ) {
+    cout << " expandedMachine::FileAMLInput PAS D'ELEMENTS DANS LA MACHINE " <<  endl;
+  } else {
+    NodeVec lesElements = listElem->getSubNodesByName("melement");
+    for (unsigned k=0; k < lesElements.size(); k++ ) {
+      abstractElement* elem = dataManager_->getElementInSectorsByLabel(lesElements.at(k)->getAttribute("name")->getValue()); 
+      if ( elem ) elements_.push_back(elem);
+    }
+  }
+  UAPNode* lesBlocks = entree->getChildByName("mcomputingBlocks");
+  if ( !lesBlocks ) {
+    cout << " expandedMachine::FileAMLInput PAS DE BLOCS DANS LA MACHINE " <<  endl;
+  } else {
+    NodeVec listBlocks = lesBlocks->getSubNodesByName("computingBlock");
+    for ( unsigned k=0; k < listBlocks.size(); k++ ) {
+      computingBlocks_.push_back(new computingBlock(this));
+      computingBlocks_.back()->FileAMLInput( listBlocks.at(k));
+    }
+  }
+}
+
+
+abstractElement* expandedMachine::getElementFromLabel(string lab) {
+  abstractElement* resultat = NULL;
+  for ( unsigned k=0; k < elements_.size(); k++) {
+    if  ( elements_.at(k)->getLabel() == lab ) {
+      resultat = elements_.at(k);
+      break;
+    }
+  }
+  return resultat;
+}
+
+int expandedMachine::getElementRankFromLabel(string lab) {
+  for ( unsigned k=0; k < elements_.size(); k++) {
+    if  ( elements_.at(k)->getLabel() == lab ) {
+      return k;
+    }
+  }
+  return -1;
+}
+
+int expandedMachine::getElementRankFromPointer(abstractElement* ptr) {
+  for ( unsigned k=0; k < elements_.size(); k++) {
+    if  ( elements_.at(k)  == ptr ) {
+      return k;
+    }
+  }
+  return -1;
+}
+
+
+void expandedMachine::setFirstElementOfBlock(computingBlock* bclk, int index) {
+// This will set the beginning of a block to the element with the given name
+  
+  // Possible cases :
+  //
+  // | section 1 | section 2 | section 3   |  section 4 | section 5 |
+  // |  a b c d  |  e f g h  |  i j k l    |  m n o p   |  q r  | Before (example)
+
+  // Moved in a previous section :
+  // |  a b c d  |  e f      |  _g_ h i j k l  |  m n o p |  q r  |  Case 1 : move beginning of section 3 to "g"
+  // |  a b c    |           |  _d_ e f g h i j k l  |  m n o p  |  q r  |  Case 2 : move beginning of section 3 to "d" => section 2 will be removed !
+  // => all elements from "d"/"g" to "l" will be moved in the 3rd section
+  
+  // Moved in the same section :
+  // |  a b c d  |  e f g h i j  | _k_ l  |  m n o p   |  q r  | Case 3 : move beginning of section 3 to "k"
+  // => all elements from "i"(begin of 3rd section) to before "k" will be moved in the 2nd (3-1) section
+  
+  // Moved in a next section :
+  // |  a b c d  |  e f g h i j k l m |  _n_ | o p  |  q r  | Case 4 : move beginning of section 3 to "n"
+  // |  a b c d  |  e f g h i j k l m  n o p  |  _q_ |   | r  | Case 5 : move beginning of section 3 to "q" => remove section 4 !
+  // => all elements from "i"(begin of 3rd section) to before "n"/"q" will be moved in the 2nd (3-1) section
+  // => "n"/"q" element is set to be alone in 3rd section
+  
+  //  std::vector <computingBlock* >& mchVect = machine_->getComputingBlocks();
+
+  cout << " expandedMachine::setFirstElementOfBlock ENTREE " << endl;
+
+  if ( index < 0 || index >= elements_.size() ) {
+    cout << " expandedMachine::setFirstElementOfBlock index out of range " << index << endl;
+    return;
+  }
+  unsigned int blockNumber = 0;
+  int blockNumberOfNewBegin = 0;
+  
+  // get this block number
+  // get the block number of the new begin element
+  unsigned int curseur = 0;
+  if ( computingBlocks_.size() ) curseur = computingBlocks_[0]->getRankOfFirstElement();
+  bool newFoundInBlocks = false;
+  bool newFoundBeforeBlocks = false;
+
+  if ( curseur > index ) {
+    newFoundBeforeBlocks = true;
+  } else {
+    for (unsigned int a=0; a< computingBlocks_.size(); a++) {
+      if (computingBlocks_[a] == bclk) blockNumber = a;
+      curseur += computingBlocks_[a]->getNumberOfElements();
+      if ((curseur >index ) && (!newFoundInBlocks)) {
+	blockNumberOfNewBegin = a;
+	newFoundInBlocks = true;
+      }
+    }
+  }
+  
+  if (!newFoundInBlocks ) {
+    if ( newFoundBeforeBlocks ) {
+      unsigned nombre = computingBlocks_[blockNumber]->getRankOfLastElement() - index + 1;
+      computingBlocks_[blockNumber]->reinitialiseElements(index, nombre);
+      // on vide les blocs initiaux.
+      for (int a = 0 ; a < blockNumber; a++) computingBlocks_[a]->clearElements();
+    } else {
+      // le nouveau debut est apres les blocks presents
+
+      if ( blockNumber > 0 ) {
+	unsigned debutPrecedent = computingBlocks_[blockNumber-1]->getRankOfFirstElement();
+	unsigned nombre = index - debutPrecedent;
+	computingBlocks_[blockNumber-1]->reinitialiseElements(debutPrecedent, nombre);
+      } 
+      unsigned nombre = elements_.size() - index;
+      computingBlocks_[blockNumber]->reinitialiseElements(index, nombre);
+      // on vide les blocs finaux
+      for (int a = blockNumber + 1 ; a < computingBlocks_.size(); a++) computingBlocks_[a]->clearElements();
+    }
+  } else if ( blockNumberOfNewBegin < blockNumber ) { // index trouve dans les blocs 
+      // Moved in a previous section
+    cout << " expandedMachine::setFirstElementOfBlock Moved in a previous section new bloc = " << blockNumberOfNewBegin << endl;
+    unsigned debutPrecedent = computingBlocks_[blockNumberOfNewBegin]->getRankOfFirstElement();
+    unsigned nombre = index - debutPrecedent;
+    computingBlocks_[blockNumberOfNewBegin]->reinitialiseElements(debutPrecedent, nombre);
+    unsigned lastIndex  = computingBlocks_[blockNumber]->getRankOfLastElement();
+    computingBlocks_[blockNumber]->reinitialiseElements(index, lastIndex - index +1);
+    // on vide les blocs intermediaires.
+    for (int a = blockNumber-1 ; a > blockNumberOfNewBegin; a--) computingBlocks_[a]->clearElements();
+  } else if (  blockNumberOfNewBegin == blockNumber  ) {
+    // Moved in the same block :
+    cout << " expandedMachine::setFirstElementOfBlock Moved in the same block new bloc = " << blockNumberOfNewBegin << endl;
+    
+    // les elements precedant index sont affectes au bloc precedent
+    if ( blockNumber ) {
+      unsigned debutPrecedent = computingBlocks_[blockNumber-1]->getRankOfFirstElement();
+      unsigned nombre = index - debutPrecedent;
+      computingBlocks_[blockNumber-1]->reinitialiseElements(debutPrecedent, nombre);
+    }
+
+    unsigned ancienDebut = computingBlocks_[blockNumber]->getRankOfFirstElement();
+    unsigned offset = index - ancienDebut;
+    computingBlocks_[blockNumber]->reinitialiseElements(index, computingBlocks_[blockNumber]->getNumberOfElements() - offset);
+    
+  } else if ( blockNumberOfNewBegin > blockNumber ) {
+    // Moved in a next section :
+    if ( blockNumber > 0 ) {
+      unsigned debutPrecedent = computingBlocks_[blockNumber-1]->getRankOfFirstElement();
+      unsigned nombre = index - computingBlocks_[blockNumberOfNewBegin]->getRankOfFirstElement();
+      computingBlocks_[blockNumber-1]->reinitialiseElements(debutPrecedent, nombre);
+    }
+    
+    unsigned offset = index - computingBlocks_[blockNumberOfNewBegin]->getRankOfFirstElement();
+    unsigned nombre = computingBlocks_[blockNumberOfNewBegin]->getNumberOfElements() - offset;
+    computingBlocks_[blockNumberOfNewBegin]->reinitialiseElements(index, nombre);
+    // on vide les blocs intermediaires.
+    for (int a = blockNumber ; a < blockNumberOfNewBegin; a++) computingBlocks_[a]->clearElements();    
+  }
+
+// Suppress the empty blocs
+for (unsigned int a=0; a< computingBlocks_.size(); a++) {
+  if ( computingBlocks_[a]->isEmpty() ) {
+    clearComputingBlock(a);
+  }
+ }
+ cout << " expandedMachine::setFirstElementOfBlock Apres nettoyage, il reste  " << computingBlocks_.size() << " blocs "  << endl;
+ for ( unsigned j=0; j < computingBlocks_.size(); j++) {
+   cout << "  bloc  "  << j << " : " <<  endl;
+   for ( unsigned k=0; k < computingBlocks_.at(j)->getNumberOfElements(); k++) {
+     cout << computingBlocks_.at(j)->getElement(k)->getLabel() << endl;
+   }
+ }
+}
+
+void expandedMachine::setLastElementOfBlock(computingBlock* bclk, int index) {
+// This will set the end of a block to the element with the given name
+
+  if ( index < 0 || index >= elements_.size() ) {
+    cout << " expandedMachine::setLastElementOfBlock index out of range " << index << endl;
+    return;
+  }
+  unsigned int blockNumber = 0;
+  int blockNumberOfNewEnd = 0;
+
+  // get this block number
+  // get the block number of the new begin element
+  unsigned int curseur = 0;
+  if ( computingBlocks_.size() ) curseur = computingBlocks_.back()->getRankOfLastElement();
+  bool newFoundInBlocks = false;
+  bool newFoundAfterBlocks = false;
+
+  if ( curseur < index ) {
+    newFoundAfterBlocks = true;
+  } else {
+    //    for ( int a = computingBlocks_.size() -1; a >= 0; a--) {
+    // pour l'instant on ne peut que la fin du DERNIER BLOC
+    // a revoir si necessaire
+    if (computingBlocks_.back() !=  bclk) {
+      cout << " expandedMachine::setLastElementOfBlock, le bloc a modifer n'est pas le dernier : revoir la programmation du module " << endl;
+      return;
+    }
+    blockNumber = computingBlocks_.size() - 1;
+    for ( int a = computingBlocks_.size() -1; a >= 0 ; a--) {
+
+      curseur -= computingBlocks_[a]->getNumberOfElements();
+      if ((curseur < index ) && (!newFoundInBlocks)) {
+	blockNumberOfNewEnd = a;
+	newFoundInBlocks = true;
+      }
+    }
+  }
+
+  if (!newFoundInBlocks ) {
+    if ( newFoundAfterBlocks ) {
+      unsigned nombre = index - computingBlocks_.back()->getRankOfLastElement();
+      computingBlocks_.back()->extendByTheEnd(nombre);
+    } else {
+      // le nouveau debut est avant les blocks presents
+      computingBlocks_[0]->reinitialiseElements(0, index + 1);
+      // on vide les blocs restants
+      for (int a = 1 ; a < computingBlocks_.size(); a++) computingBlocks_[a]->clearElements();
+    }
+  } else  { // index trouve dans les blocs 
+      unsigned nombre = computingBlocks_[blockNumberOfNewEnd]->getRankOfLastElement() - index;
+      computingBlocks_[blockNumberOfNewEnd]->suppressByTheEnd(nombre);
+      // on vide les blocs restants
+	for (int a = blockNumberOfNewEnd + 1 ; a < computingBlocks_.size(); a++) computingBlocks_[a]->clearElements();
+      }
+// Suppress the empty blocs
+  for (unsigned int a=0; a< computingBlocks_.size(); a++) {
+    if ( computingBlocks_[a]->isEmpty() ) {
+      clearComputingBlock(a);
+    }
+  }
+ cout << " expandedMachine::setLastElementOfBlock Apres nettoyage, il reste  " << computingBlocks_.size() << " blocs "  << endl;
+ for ( unsigned j=0; j < computingBlocks_.size(); j++) {
+   cout << "  bloc  "  << j << " : " <<  endl;
+   for ( unsigned k=0; k < computingBlocks_.at(j)->getNumberOfElements(); k++) {
+     cout << computingBlocks_.at(j)->getElement(k)->getLabel() << endl;
+   }
+ }
+}
+
+bool expandedMachine::areDataCoherent()
+{
+  cout << "***********************************" << endl;
+  cout << "**  expandedMachine::areDataCoherent()   **" << endl;
+  cout << "***********************************" << endl;
+  
+  bool caMarche = true;
+  
+   
+   string diagnosticErrors;
+   string diagnosticWarnings;
+   for (int a = 0; a < computingBlocks_.size(); a++)
+   {
+     if ( !computingBlocks_.at(a)->checkCoherence(diagnosticErrors, diagnosticWarnings) ) caMarche = false;
+   }//a
+   cout << " erreurs : " << diagnosticErrors << endl;
+   if ( !diagnosticErrors.empty() ) dataManager_->messageEcran("ERROR", diagnosticErrors);
+   if ( !diagnosticWarnings.empty() ) {
+     cout << " y a des warnings " << diagnosticWarnings << endl;
+     dataManager_->messageEcran("WARNING",diagnosticWarnings);
+   }
+  return caMarche;
+}
+
+abstractElement* expandedMachine::getElementPointer( unsigned rang) {
+  if ( rang > elements_.size() ) return NULL;
+  return elements_.at(rang);
+}
+ 
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/nomDeLogiciel.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/nomDeLogiciel.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/nomDeLogiciel.cc	(revision 493)
@@ -81,5 +81,4 @@
 void nomDeLogiciel::setCompatiblesElements() 
 {
-  //cout << " nomDeLogiciel::setCompatiblesElements() " << program_ << endl;
   switch (program_) 
     {
@@ -134,10 +133,6 @@
 }
 
-trivaluedBool nomDeLogiciel::doAcceptElement(nomdElements::typedElement typdel) 
+trivaluedBool nomDeLogiciel::doAcceptElement(nomdElements::typedElement typdel) const
 {
-  //xx
-
-  //cout << " nomDeLogiciel::doAcceptElement type : " << typdel << endl;
-  //cout << " nomDeLogiciel::doAcceptElement nb el/ acc. " << acceptedElements_.size() << endl;
   if (acceptedElements_.size() == 0 ) {
     return TBoolError;
@@ -156,5 +151,5 @@
   }
   
-  return TBoolOk;
+  return TBoolError;
 }
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc	(revision 493)
@@ -9,5 +9,5 @@
 #include "sector.h"
 
-#include "sectionToExecute.h"
+//#include "sectionToExecute.h"
 #include "dataManager.h"
 #include "elementDrift.h"
@@ -100,56 +100,87 @@
   
   if (previousElement == NULL) {
-    if (sectionToExecute_.size() == 0) {
-      sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL,dataManager_,this));
-    } else {
-        sectionToExecute* section = sectionToExecute_.front();
-      section->insertAtFirst(currentElement);
-    }
+    elements_.insert ( elements_.begin() ,currentElement);
+    // if (sectionToExecute_.size() == 0) {
+    //   sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL,dataManager_,this));
+    // } else {
+    //     sectionToExecute* section = sectionToExecute_.front();
+    //   section->insertAtFirst(currentElement);
+    // }
   } else {
- 
-    for (unsigned int i=0; i<sectionToExecute_.size(); i++) {
-      sectionToExecute* section = sectionToExecute_[i];
-      if (section->insertAfter(previousElement,currentElement)) {
-        return;
-      }
-    }
-  }
-}
-
-void sector::removeElement(abstractElement* currentElement) {
-  if (currentElement == NULL) return;
-  
-  for (unsigned int i=0; i<sectionToExecute_.size(); i++) {
-    sectionToExecute* section = sectionToExecute_[i];
-    
-    if (section->isInside(currentElement)) {
-      section->removeElement(currentElement);
-    }
+    insertAfter(previousElement,currentElement);
+    // for (unsigned int i=0; i<sectionToExecute_.size(); i++) {
+    //   sectionToExecute* section = sectionToExecute_[i];
+    //   if (section->insertAfter(previousElement,currentElement)) {
+    //     return;
+    //   }
+    // }
   }
 }
 
 
-void sector::clearSectionToExecute()
-{
-  unsigned k;
-  for(k = 0; k < sectionToExecute_.size(); k++)
-  {
-    if ( sectionToExecute_[k] != NULL ) clearSectionToExecute(k);
+bool sector::insertAfter(abstractElement* previousElement,abstractElement* currentElement) {
+
+  std::vector<abstractElement*>::iterator it;
+  for (it = elements_.begin(); it < elements_.end(); it++) {
+    if (*it == previousElement ) {
+      elements_.insert (it+1,currentElement);
+      return true;
+    }
   }
-  sectionToExecute_.clear();
+  return false;
 }
 
-void sector::clearSectionToExecute(int a)
-{
-  cout << " dataManager::clearSectionToExecute : effacement de la section d'index = " << a << endl;
-  if (a < 0) return;
-  if (a >= (int)sectionToExecute_.size()) return;
+bool sector::isInside(abstractElement* previousElement) {
+  for (unsigned int a=0; a< elements_.size(); a++) {
+    if (elements_[a] == previousElement ) {
+      return true;
+    }
+  }
+  return false;
+}
+
+
+
+void sector::removeElement(abstractElement* currentElement) {
+  if (currentElement == NULL) return;
+  std::vector<abstractElement*>::iterator it;
+  for (it = elements_.begin(); it < elements_.end(); it++) {
+    if (*it == currentElement ) {
+      elements_.erase(it);
+      return;
+    }
+  }
+  // for (unsigned int i=0; i<sectionToExecute_.size(); i++) {
+  //   sectionToExecute* section = sectionToExecute_[i];
+    
+  //   if (section->isInside(currentElement)) {
+  //     section->removeElement(currentElement);
+  //   }
+  // }
+}
+
+
+// void sector::clearSectionToExecute()
+// {
+//   unsigned k;
+//   for(k = 0; k < sectionToExecute_.size(); k++)
+//   {
+//     if ( sectionToExecute_[k] != NULL ) clearSectionToExecute(k);
+//   }
+//   sectionToExecute_.clear();
+// }
+
+// void sector::clearSectionToExecute(int a)
+// {
+//   cout << " dataManager::clearSectionToExecute : effacement de la section d'index = " << a << endl;
+//   if (a < 0) return;
+//   if (a >= (int)sectionToExecute_.size()) return;
   
-  // lors de la creation de la section on a fait un 'new' d'un
-  // softwareXXXX : on fait ici le 'delete'
+//   // lors de la creation de la section on a fait un 'new' d'un
+//   // softwareXXXX : on fait ici le 'delete'
   
-  const abstractSoftware* soft = sectionToExecute_.at(a)->getSoftware();
-  if ( soft != NULL ) delete soft;
-  delete sectionToExecute_[a];
-  sectionToExecute_.erase (sectionToExecute_.begin()+a);
-}
+//   const abstractSoftware* soft = sectionToExecute_.at(a)->getSoftware();
+//   if ( soft != NULL ) delete soft;
+//   delete sectionToExecute_[a];
+//   sectionToExecute_.erase (sectionToExecute_.begin()+a);
+// }
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc	(revision 493)
@@ -12,5 +12,12 @@
 }
 
-softwareGenerator::softwareGenerator(string inputFileName, sectionToExecute* sect,dataManager* data) : abstractSoftware(inputFileName, sect,data)
+// softwareGenerator::softwareGenerator(string inputFileName, sectionToExecute* sect,dataManager* data) : abstractSoftware(inputFileName, sect,data)
+// {
+//   cout << " softwareUsersprogram::softwareGenerator ENREGISTREMENT " << endl;
+//   nameOfSoftware_ = new  nomDeLogiciel("generator");
+//   //  registerElement(nomdElements::RFgun,TBoolOk);
+// }
+
+softwareGenerator::softwareGenerator(string inputFileName, computingBlock* cmpb,dataManager* data) : abstractSoftware(inputFileName, cmpb,data)
 {
   cout << " softwareUsersprogram::softwareGenerator ENREGISTREMENT " << endl;
@@ -21,5 +28,5 @@
 bool softwareGenerator::createInputFile(particleBeam* beamBefore, string workingDir)
 {
-  abstractElement* firstElement = getSectionToExecute()->getElements().front();
+  abstractElement* firstElement = getComputingBlock()->getFirstElement();
   
   if ( firstElement->getNomdElement().getElementType() != nomdElements::RFgun ) {
@@ -93,5 +100,5 @@
   bool result = true;
 
-  if ( getSectionToExecute()->getElements().size() != 1 ) {
+  if ( getComputingBlock()->getNumberOfElements() != 1 ) {
     dataManager_->consoleMessage(" softwareGenerator::buildBeamAfterElements : only one element (rfgun) must be calculated " );
     return false;
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc	(revision 493)
@@ -13,5 +13,10 @@
 }
 
-softwareMadx::softwareMadx(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName,sect,data)
+// softwareMadx::softwareMadx(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName,sect,data)
+// {
+//   nameOfSoftware_ = new nomDeLogiciel("madx");
+// }
+
+softwareMadx::softwareMadx(string inputFileName,computingBlock* cmpb, dataManager* data) : abstractSoftware(inputFileName,cmpb,data)
 {
   nameOfSoftware_ = new nomDeLogiciel("madx");
@@ -33,6 +38,6 @@
   }
 
-  sector* sector= getSectionToExecute()->getSector();
-  cout << " softwareMadx::createInputFile sector " << sector->getName() << endl;
+  //  sector* sector= getSectionToExecute()->getSector();
+  //  cout << " softwareMadx::createInputFile sector " << sector->getName() << endl;
   ///////////////////////////////////////////
   
@@ -40,5 +45,6 @@
   string sbeam;
   abstractElement* elPtr;
-  elPtr = getSectionToExecute()->getElements().front();
+  //  elPtr = getSectionToExecute()->getElements().front();
+  elPtr = getComputingBlock()->getFirstElement();
   nomdElements::typedElement eType = elPtr->getNomdElement().getElementType();
 
@@ -85,8 +91,10 @@
   ostringstream os;
   os << "L: line=(";
-  unsigned nElts= getSectionToExecute()->getElements().size();
+  //  unsigned nElts= getSectionToExecute()->getElements().size();
+  unsigned nElts= getComputingBlock()->getNumberOfElements();
   for(unsigned k = firstIndex; k < nElts; k++)
     {
-      elPtr = getSectionToExecute()->getElements()[k];
+      //      elPtr = getSectionToExecute()->getElements()[k];
+      elPtr = getComputingBlock()->getElement(k);
       cout << " debug:: element [" << k << "] " << elPtr->getNomdElement().getExpandedName() << endl;
       vector<statements> v= elPtr->parametersToSoftware();
@@ -103,5 +111,7 @@
   
   // relection and repetition ///////////////
-  os << "all: " << "line=(" << sector->getRepetitionNumber() << "*L);";
+  //  os << "all: " << "line=(" << sector->getRepetitionNumber() << "*L);";
+  int bid = 1;
+os << "all: " << "line=(" << bid << "*L);";
   ///////////////////////////////////////////
   
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc	(revision 493)
@@ -13,24 +13,62 @@
 }
 
-softwareParmela::softwareParmela(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect, data)
+// softwareParmela::softwareParmela(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect, data)
+// {
+//   nameOfSoftware_ = new nomDeLogiciel("parmela");
+//   cout << " CONSTRUCTEUR softwareParmela() COMPLET " << endl;
+// }
+
+softwareParmela::softwareParmela(string inputFileName,computingBlock* cmpb, dataManager* data) : abstractSoftware(inputFileName, cmpb, data)
 {
   nameOfSoftware_ = new nomDeLogiciel("parmela");
-  cout << " CONSTRUCTEUR softwareParmela() COMPLET " << endl;
-  // registerElement(nomdElements::RFgun,TBoolOk);
-  // registerElement(nomdElements::drift,TBoolOk);
-  // registerElement(nomdElements::cell,TBoolOk);
-  // registerElement(nomdElements::bend,TBoolOk);
-  // registerElement(nomdElements::soleno,TBoolOk);
-  // registerElement(nomdElements::fit,TBoolIgnore);
-  // registerElement(nomdElements::snapshot,TBoolIgnore);
-}
-
+  cout << " CONSTRUCTEUR softwareParmela() COMPLET avec COMPUTING BLOCK = " << cmpb << endl;
+    cout << " softwareParmela::CONSTRUCTEUR adresse mamager " << dataManager_  << endl;
+    cout << " softwareParmela::CONSTRUCTEUR adresse GLOBAUX " << dataManager_->getGlobalParameters()  << endl;
+}
+
+void softwareParmela::setRelativeParmelaElementIndices() {
+    relativeParmelaElementIndices_.clear();
+
+  relativeParmelaElementIndices_.resize(getComputingBlock()->getNumberOfElements(), -1);
+  cout << " setRelativeParmelaElementIndices() taille a priori : " << relativeParmelaElementIndices_.size() << endl;
+  abstractElement* elPtr = getComputingBlock()->getFirstElement();
+  bool there_is_rfgun = (elPtr->getNomdElement().getElementType() == nomdElements::RFgun );
+
+  //  unsigned offsetNumElem;
+  // index du premier element de parmela
+  int id;
+  // les elements de parmela sont indexes de 1 Ã  max, s'il n'y a pas de rfgun
+  if ( !there_is_rfgun ) {
+    id = 1;
+    // les elements de parmela sont indexes de 0 Ã  max, s'il y a un rfgun
+  } else {
+    id = 0;
+  }
+
+  unsigned k;
+  unsigned curseur = 0;
+  //  for ( k=numeroDeb_; k <= numeroFin_ ; k++ ) {
+  for ( k = 0; k < getComputingBlock()->getNumberOfElements(); k ++) {
+    abstractElement* elem = getComputingBlock()->getElement(k);
+    cout << " liste PARMELA no absolu " << k << " relatif provisoire " << relativeParmelaElementIndices_.at(curseur) << endl;
+    // if ( elem->is_accepted_by_software(nameOfSoftware_) == TBoolOk ) {
+
+    if ( getNomDeLogiciel()->doAcceptElement(elem->getNomdElement().getElementType()) == TBoolOk  ) {
+      relativeParmelaElementIndices_.at(curseur) = id;
+      cout << " mis a " << id << endl;
+      id++;
+    }
+    curseur++;
+  }
+}
 
 
 bool softwareParmela::createInputFile(particleBeam* beamBefore, string workingDir)
 {
+
+  cout << " softwareParmela::createInputFile ENTREE " << endl;
   unsigned int k;
 
-//  setRelativeParmelaElementIndices();
+  setRelativeParmelaElementIndices();
   string name = workingDir + inputFileName_;
   ofstream outfile;
@@ -42,8 +80,11 @@
   }
   
-  abstractElement* elPtr = getSectionToExecute()->getElements().front();
+  //  abstractElement* elPtr = getSectionToExecute()->getElements().front();
+
+  abstractElement* elPtr = getComputingBlock()->getFirstElement();
   double initalKineticEnergy = 0.0;
+
   bool there_is_rfgun = (elPtr->getNomdElement().getElementType() == nomdElements::RFgun );
-  
+
   if ( !there_is_rfgun ) {
     string nameOfInput = workingDir + "parin.input0";
@@ -55,23 +96,24 @@
     elPtr->setPhaseStep( dataManager_->getGlobalParameters()->getIntegrationStep() );
     initalKineticEnergy = elPtr->getInitialKineticEnergy();
-    // les elements de parmela sont indexes de 0 Ã  max, s'il y a un rfgun
-  }
-  
+  }
+
   outfile << "TITLE" << endl;
   outfile << " titre provisoire " << endl;
   outfile << "RUN /n0=1 /ip=999 /freq=" << dataManager_->getGlobalParameters()->getFrequency() << "  /z0=0.0 /W0=" << initalKineticEnergy << "  /itype=1" << endl;
   outfile << "OUTPUT 0" << endl;
+
+  unsigned int premier = 0 ;
   if ( there_is_rfgun ) {
     outfile << elementsData(elPtr->parametersToSoftware());
+    premier++;
   } else {
     outfile << "INPUT 0 /NP=" << beamBefore->getNbParticles() << endl;
   }
-  
- // retrouver le sector !!
-  for ( k =1; k < getSectionToExecute()->getElements().size(); k++)
+
+  for ( k =premier++; k < getComputingBlock()->getNumberOfElements(); k++)
     {
-      outfile << elementsData(getSectionToExecute()->getElements()[k]->parametersToSoftware());
-    }
-    
+      outfile << elementsData(getComputingBlock()->getElement(k)->parametersToSoftware());
+    }
+  
   outfile << "ZOUT" << endl;
   outfile << "START /wt=0.0 /dwt=" << dataManager_->getGlobalParameters()->getIntegrationStep() << "  /nsteps=" << dataManager_->getGlobalParameters()->getNbSteps() << "  nsc=" << dataManager_->getGlobalParameters()->getScPeriod() << "  /nout=10" << endl;
@@ -121,6 +163,6 @@
 
   unsigned curseur;
-  for ( unsigned int k=0; k < getSectionToExecute()->getElements().size() ; k++ ) {
-    abstractElement* elem = getSectionToExecute()->getElements()[k];
+  for ( unsigned int k=0; k < getComputingBlock()->getNumberOfElements() ; k++ ) {
+    abstractElement* elem = getComputingBlock()->getElement(k);
       if ( elem == NULL ) {
 	dataManager_->consoleMessage(" softwareParmela::buildBeamAfterElements : null pointer on element " );
@@ -129,9 +171,10 @@
 
     curseur = k;
-    cout << " softwareParmela::buildBeamAfterElements : type element " << getSectionToExecute()->getElements()[curseur]->getNomdElement().getElementType() << endl;
-    if (!(nameOfSoftware_->doAcceptElement(getSectionToExecute()->getElements()[curseur]->getNomdElement().getElementType()) == TBoolOk)) {
-
-      cout << " softwareParmela::buildBeamAfterElements ELEMENT ETRANGER " << endl;
-//      if ( relativeParmelaElementIndices_.at(curseur) < 0 ) {
+    cout << " softwareParmela::buildBeamAfterElements : type element " << getComputingBlock()->getElement(curseur)->getNomdElement().getElementType() << endl;
+
+
+    //	    if (!(nameOfSoftware_->doAcceptElement(getComputingBlock()->getElements()[curseur]->getNomdElement().getElementType()) == TBoolOk)) {
+
+    if ( relativeParmelaElementIndices_.at(curseur) < 0 ) {
 
 	// si l'element doit etre ignore de parmela, on renvoie sur le diag precedent
@@ -149,7 +192,7 @@
 	  double freq= dataManager_->getGlobalParameters()->getFrequency();
 	  unsigned numeroParmel;
-//	  numeroParmel = (unsigned)relativeParmelaElementIndices_.at(curseur);
-    numeroParmel = curseur;
-	  cout << " lecture PARMELA el no absolu " << k << " numero relatif " << numeroParmel << " nom " << elem->getNomdElement().getExpandedName() << endl;
+	  numeroParmel = (unsigned)relativeParmelaElementIndices_.at(curseur);
+	  //    numeroParmel = curseur;
+	  cout << " lecture PARMELA el no relativement absolu " << k << " numero relatif " << numeroParmel << " nom " << elem->getNomdElement().getExpandedName() << endl;
       	// lecture sortie parmela
 	if(!beamFromParmela(workingDir,numeroParmel,freq,centroid,refPart,particles))
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTest.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTest.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTest.cc	(revision 493)
@@ -14,5 +14,10 @@
 
 
-softwareTest::softwareTest(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
+// softwareTest::softwareTest(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
+// {
+//   nameOfSoftware_ = new nomDeLogiciel("test");
+// }
+
+softwareTest::softwareTest(string inputFileName,computingBlock* cmpb, dataManager* data) : abstractSoftware(inputFileName, cmpb,data)
 {
   nameOfSoftware_ = new nomDeLogiciel("test");
@@ -38,5 +43,5 @@
   dataManager_->consoleMessage(" softwareTest::buildBeamAfterElements  " );
   bool result = true;
-  for ( unsigned int k=0; k < getSectionToExecute()->getElements().size() ; k++ ) {
+  for ( unsigned int k=0; k < getComputingBlock()->getNumberOfElements() ; k++ ) {
       particleBeam* newDiag = dataManager_->updateCurrentDiagnostic(true);
   //      beams.push_back(particleBeam());
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTransport.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTransport.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareTransport.cc	(revision 493)
@@ -11,13 +11,12 @@
 }
 
-softwareTransport::softwareTransport(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
+// softwareTransport::softwareTransport(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
+// {
+//   nameOfSoftware_ = new nomDeLogiciel("transport");
+// }
+
+softwareTransport::softwareTransport(string inputFileName,computingBlock* cmpb, dataManager* data) : abstractSoftware(inputFileName, cmpb,data)
 {
   nameOfSoftware_ = new nomDeLogiciel("transport");
-  // registerElement(nomdElements::beam,TBoolOk);
-  // registerElement(nomdElements::drift,TBoolOk);
-  // registerElement(nomdElements::bend,TBoolOk);
-  // registerElement(nomdElements::soleno,TBoolOk);
-  // registerElement(nomdElements::fit,TBoolOk);
-  // registerElement(nomdElements::snapshot,TBoolIgnore);
 }
 
@@ -26,5 +25,5 @@
 
 
-  abstractElement* premierEl = getSectionToExecute()->getElements().front();
+  abstractElement* premierEl = getComputingBlock()->getFirstElement();
 
   // ceinture et bretelles
@@ -84,7 +83,7 @@
 
   abstractElement* elPtr;
-  for (unsigned k = 0; k < getSectionToExecute()->getElements().size(); k++)
+  for (unsigned k = 0; k < getComputingBlock()->getNumberOfElements(); k++)
     {
-      elPtr = getSectionToExecute()->getElements()[k];
+      elPtr = getComputingBlock()->getElement(k);
       cout << "debug:: element [" << k << "] " << elPtr->getNomdElement().getExpandedName() << endl;
       //      outfile << elPtr->transportOutputFlow();
@@ -142,7 +141,7 @@
   bool result = true;
 
-  for (unsigned k = 0; k < getSectionToExecute()->getElements().size(); k++)
+  for (unsigned k = 0; k < getComputingBlock()->getNumberOfElements(); k++)
     {
-      abstractElement* ptr = getSectionToExecute()->getElements()[k];
+      abstractElement* ptr = getComputingBlock()->getElement(k);
       if ( ptr == NULL ) {
 	dataManager_->consoleMessage(" softwareTransport::buildBeamAfterElements : null pointer on element " );
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc	(revision 493)
@@ -10,5 +10,12 @@
 }
 
-softwareUsersprogram::softwareUsersprogram(string inputFileName, sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
+// softwareUsersprogram::softwareUsersprogram(string inputFileName, sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
+// {
+//   cout << " softwareUsersprogram::softwareUsersprogram ENREGISTREMENT " << endl;
+//   nameOfSoftware_ = new nomDeLogiciel("usersprogram");
+//   //  registerElement(nomdElements::snapshot,TBoolOk);
+// }
+
+softwareUsersprogram::softwareUsersprogram(string inputFileName, computingBlock* cmpb, dataManager* data) : abstractSoftware(inputFileName, cmpb,data)
 {
   cout << " softwareUsersprogram::softwareUsersprogram ENREGISTREMENT " << endl;
@@ -20,5 +27,5 @@
 { 
 
-  abstractElement* element = getSectionToExecute()->getElements().front();
+  abstractElement* element = getComputingBlock()->getFirstElement();
 
   // Dans le cas oÃ¹ l'element n'est pas snapshot
@@ -99,5 +106,5 @@
   //  for (unsigned k = numeroDeb_; k <= numeroFin_; k++)
   
-  abstractElement* ptr = getSectionToExecute()->getElements().front();
+  abstractElement* ptr = getComputingBlock()->getFirstElement();
       if ( ptr == NULL ) {
 	dataManager_->consoleMessage("ERROR  softwareUsersprogram::buildBeamAfterElements : null pointer on element " );
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_accelerator.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_accelerator.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_accelerator.h	(revision 493)
@@ -27,4 +27,5 @@
   virtual ~GWt_accelerator();
   inline WContainerWidget* getAcceleratorDetailledView() {return acceleratorDetailledView_;};
+  inline WContainerWidget* getAcceleratorComputingView() {return acceleratorComputingView_;};
   inline WLayout* getAcceleratorGlobalViewLayout() {return acceleratorGlobalViewLayout_;};
   inline dataManager* getDataManager() { return dataManager_;};
@@ -34,6 +35,8 @@
   private :
   WContainerWidget* acceleratorDetailledView_;
+  WContainerWidget* acceleratorComputingView_;
   void addSector();
   void readConfiguration();
+  void expandMachine();
   void run();
   void closeGraphicDialog();
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_computingBlock.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_computingBlock.h	(revision 493)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_computingBlock.h	(revision 493)
@@ -0,0 +1,72 @@
+#ifndef GWT_COMPUTINGBLOCK_SEEN
+#define GWT_COMPUTINGBLOCK_SEEN
+
+#include <Wt/WContainerWidget>
+#include <Wt/WComboBox>
+#include <Wt/WText>
+#include <Wt/WSignal>
+
+class GWt_softwarePanel;
+class GWt_machine;
+class computingBlock;
+
+class GWt_computingBlock : public Wt::WContainerWidget
+{
+    public :
+    GWt_computingBlock(Wt::WComboBox* ,Wt::WComboBox* ,Wt::WComboBox*,Wt::WContainerWidget* ,computingBlock*,GWt_machine* );
+
+    ~GWt_computingBlock() {;}
+
+    void setSoftware();
+  void changeFirstElement();
+  void changeLastElement();
+  
+    inline Wt::WString getFirstElementCurrentText() {
+        return firstElement_->currentText();
+    }
+    
+    inline Wt::WString getLastElementCurrentText() {
+        return lastElement_->currentText();
+    }
+    
+    inline Wt::WComboBox * getFirstElement() {
+        return firstElement_;
+    }
+    
+    inline Wt::WComboBox * getLastElement() {
+        return lastElement_;
+    }
+    
+    void setFirstElementCurrentSelection_deprecated(Wt::WString);
+    void setLastElementCurrentSelection_deprecated(Wt::WString);
+    void setSoftwareElementCurrentSelection_deprecated(Wt::WString);
+    
+    inline void setWarnings(Wt::WString warn){
+        warningsLabel_->setText(warn);
+        manageWarningsAndErrors();
+    }
+
+    inline void setErrors(Wt::WString err){
+        errorsLabel_->setText(err);
+        manageWarningsAndErrors();
+    }
+
+    Wt::Signal<void> redraw_;
+
+    private :
+    
+    void manageWarningsAndErrors();
+    Wt::WComboBox*  firstElement_;
+    Wt::WComboBox*  lastElement_;
+    Wt::WComboBox*  softElement_;
+    computingBlock* cpblock_;
+    GWt_machine* UImachine_;
+
+    Wt::WText* errorsLabel_;
+    Wt::WText* warningsLabel_;
+
+    Wt::WContainerWidget* warningsContainer_;
+    Wt::WContainerWidget* errorsContainer_;
+};
+
+#endif
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_machine.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_machine.h	(revision 493)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_machine.h	(revision 493)
@@ -0,0 +1,44 @@
+#ifndef GWTMACHINE_SEEN
+#define GWTMACHINE_SEEN
+
+#include <iostream>
+
+#include <Wt/WContainerWidget>
+#include "expandedMachine.h"
+#include "GWt_accelerator.h"
+#include "GWt_ligneFaisceau.h"
+#include "GWt_softwarePanel.h"
+
+using namespace Wt;
+
+using namespace std;
+
+class GWt_machine : public WObject
+{
+  
+public:
+
+  GWt_machine(GWt_accelerator*,expandedMachine*);
+  virtual ~GWt_machine();
+  void createWidgetComputing(WContainerWidget* parent);
+  void displayWidgetComputing();
+
+  //   Get the accelerator for this sector
+  inline GWt_accelerator* getAccelerator() {
+    return UI_Accelerator_;
+  }
+
+inline expandedMachine* getMachineControler() {return machineControler_;};
+ private:
+
+  void expandMachine();
+
+
+
+  //  GWt_ligneFaisceau* UI_beamLine_;
+  GWt_accelerator* UI_Accelerator_;
+expandedMachine* machineControler_;
+
+};
+
+#endif
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h	(revision 493)
@@ -18,5 +18,5 @@
 #include "GWt_dialog.h"
 #include "GWt_console.h"
-#include "GWt_softwarePanel.h"
+//#include "GWt_softwarePanel.h"
 #include "GWt_globalParameters.h"
 #include "GWt_sectorParameters.h"
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sector.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sector.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sector.h	(revision 493)
@@ -8,4 +8,5 @@
 #include "GWt_accelerator.h"
 #include "GWt_ligneFaisceau.h"
+//#include "GWt_softwarePanel.h"
 
 using namespace Wt;
@@ -22,7 +23,9 @@
   /* Return the controler sector element for this UI sector*/
   inline sector* getSectorControler() {return sectorControler_;};
-  inline GWt_softwarePanel* getExecuteWidget() {
-    return executeWidget_;
-  }
+
+  //    inline GWt_softwarePanel* getExecuteWidget() {
+  //      return executeWidget_;
+  //  }
+
   /**
    Get the accelerator for this sector
@@ -49,5 +52,5 @@
   GWt_accelerator* UI_Accelerator_;
   sector* sectorControler_;
-  GWt_softwarePanel* executeWidget_;
+  //    GWt_softwarePanel* executeWidget_;
 
 };
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h	(revision 493)
@@ -7,6 +7,6 @@
 //
 
-#ifndef GWt_softwarePanel_SEEN
-#define GWt_softwarePanel_SEEN
+#ifndef GWt_softwarePanelBis_SEEN
+#define GWt_softwarePanelBis_SEEN
 
 #include <iostream>
@@ -20,26 +20,27 @@
 
 class PspaApplication;
-class GWt_sector;
+class GWt_machine;
 
-class GWt_softwarePanel  : public WContainerWidget
+class GWt_softwarePanelBis  : public WContainerWidget
 {
  public :
   
-  GWt_softwarePanel(dataManager*, GWt_sector*);
-  virtual ~GWt_softwarePanel();
+  GWt_softwarePanelBis(dataManager*, GWt_machine*);
+  virtual ~GWt_softwarePanelBis();
 
   /**
    Read all sectionToExecute from the controler and build a newsoftware panel with it
    */
-  void displayFromControler();
-  void updateSections();
+    void displayFromControler();
+  //  void updateSections();
     
  private :
  
-  bool updateSectionSelection();
-  void addSectionToExecute();
-  void deleteSectionToExecute(int section);
-  string getSelection();
-  void fillComboWithElements(Wt::WComboBox* cBox);
+  //  bool updateSectionSelection();
+    void addComputingBlock(computingBlock* cpbl);
+    //    void deleteComputingBlock(int section);
+    void deleteComputingBlock(computingBlock* cpbl);
+  //  string getSelection();
+    void fillComboWithElements(Wt::WComboBox* cBox);
 
   /** Fill a ComboBox with the software list
@@ -47,9 +48,10 @@
    */
   void fillComboWithSoftwares(Wt::WComboBox* cBox, std::string );
-  Wt::WContainerWidget* createAddDeletePushButtons(int sectionIndex);
+  //  Wt::WContainerWidget* createAddDeletePushButtons(int sectionIndex);
+  Wt::WContainerWidget* createAddDeletePushButtons(computingBlock* cpbl);
 
   dataManager* dtmanage_;
-  WContainerWidget* contenuSections_;
-  GWt_sector* UIsector_;
+   WContainerWidget* contenuSections_;
+  GWt_machine* UImachine_;
 };
 #endif /* defined(__PSPA__GWt_softwarePanel__) */
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_accelerator.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_accelerator.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_accelerator.cc	(revision 493)
@@ -1,4 +1,5 @@
 #include "GWt_accelerator.h"
 #include "GWt_sector.h"
+#include "GWt_machine.h"
 
 #include <Wt/WLabel>
@@ -24,4 +25,5 @@
 dataManager_(dt)
 {
+  cout << " GWt_accelerator::GWt_accelerator CONSTRUCTION NOUVEL ACCELERATOR " << endl;
   setObjectName("accelerator");
   addStyleClass("acceleratorPanel");
@@ -58,4 +60,20 @@
   addSectorParameters->setMinimumSize(32,32);
   
+
+  // expand machine 
+  WPushButton* expandMachine = new WPushButton("init/expand machine",menu);
+  // set tooltips
+  expandMachine->setToolTip("expand the machine");
+  // Set class for actions elements
+  expandMachine->setStyleClass("Button WhiteButton expand");
+  expandMachine->setMaximumSize(128,32);
+  expandMachine->setMinimumSize(128,32);
+
+  // action
+  expandMachine->clicked().connect(this,&GWt_accelerator::expandMachine);
+
+
+
+
   // Run
   WPushButton* runParameters = new WPushButton("",menu);
@@ -84,6 +102,6 @@
 
   WContainerWidget* acceleratorGlobalView = new WGroupBox("Global view",acceleratorScrollArea);
-  acceleratorDetailledView_ = new WGroupBox("Detailled view",acceleratorScrollArea);
-
+  acceleratorDetailledView_ = new WGroupBox("Detailled view of sector",acceleratorScrollArea);
+  acceleratorComputingView_ = new WGroupBox("Computing view",acceleratorScrollArea);
   acceleratorGlobalViewLayout_= new WHBoxLayout();
   acceleratorGlobalView->setLayout(acceleratorGlobalViewLayout_);
@@ -121,5 +139,5 @@
   if (sect.size() == 0) {
     // Add the first sector
-    addSector();
+       addSector();
   } else {
     for (unsigned long a=0; a< sect.size(); a++) {
@@ -127,11 +145,19 @@
     }
   }
-}
-
+  //  cout << " INTERVENTION GWt_accelerator::readConfiguration  " << endl;
+  //  if ( dataManager_->getCurrentMachine() )   cout << " GWt_accelerator::readConfiguration nb elem. " <<  dataManager_->getCurrentMachine()->getNumberOfElements() <<   endl;
+    
+    new GWt_machine(this, dataManager_->getCurrentMachine());
+}
+
+void GWt_accelerator::expandMachine() {
+  cout << " coucou depuis GWt_accelerator::expandMachine() " << endl;
+  if (getDataManager()->expandMachine()) new GWt_machine(this, dataManager_->getCurrentMachine());
+}
 
 void GWt_accelerator::run()
 {
   cout << "***********************************" << endl;
-  cout << " GWt_softwarePanel::executer() " << endl<<endl;
+  cout << " GWt_accelerator::executer() " << endl<<endl;
   
   if (!areDataCoherent()) {
@@ -156,4 +182,6 @@
 }
 
+
+// recuperer les noms d'elements pour remplir les combos des menus de graphique
 void GWt_accelerator::faireDessin()
 {
@@ -161,13 +189,9 @@
   choixHistoDessin_->clear();
   
-  for (unsigned k = 0; k < getDataManager()->getSectors().size(); k++) {
-    sector* sector = getDataManager()->getSectors()[k];
-    for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
-      sectionToExecute* section = sector->getSectionsToExecute()[l];
-      for (unsigned m = 0; m < section->getElements().size(); m++) {
-        
-        abstractElement* elPtr = section->getElements()[m];
-        //    if(elPtr->getNomdElement().getElementType() == snapshot) continue;
-        
+  if ( getDataManager()->getCurrentMachine() ) {
+    for (unsigned k = 0; k < getDataManager()->getCurrentMachine()->getComputingBlocks().size(); k++) {
+      computingBlock* cpblk = getDataManager()->getCurrentMachine()->getComputingBlocks().at(k);
+      for (unsigned l = 0; l < cpblk->getNumberOfElements(); l++) {
+        abstractElement* elPtr = cpblk->getElement(k);
         choixElementDessin_->addItem(elPtr->getLabel());
         choixHistoDessin_->addItem(elPtr->getLabel());
@@ -175,4 +199,19 @@
     }
   }
+  // for (unsigned k = 0; k < getDataManager()->getSectors().size(); k++) {
+  //   sector* sector = getDataManager()->getSectors()[k];
+  //   for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
+  //     sectionToExecute* section = sector->getSectionsToExecute()[l];
+  //     for (unsigned m = 0; m < section->getElements().size(); m++) {
+        
+  //       abstractElement* elPtr = section->getElements()[m];
+  //       //    if(elPtr->getNomdElement().getElementType() == snapshot) continue;
+        
+  //       choixElementDessin_->addItem(elPtr->getLabel());
+  //       choixHistoDessin_->addItem(elPtr->getLabel());
+  //     }
+  //   }
+  // }
+
 }
 
@@ -675,13 +714,11 @@
   // FIXME
   cout << "***********************************" << endl;
-  cout << "**  To be move in controler  **" << endl;
+  cout << "**  GWt_accelerator::areDataCoherent()   **" << endl;
   cout << "***********************************" << endl;
-  return true;
-#if BAVARD > 0
-  cout << "***********************************" << endl;
-  cout << " GWt_softwarePanel::areDataCoherent() " << endl<<endl;
-#endif
-  
-  bool caMarche = true;
+  if ( !dataManager_ ) return false;
+  return dataManager_->areDataCoherent();
+    //  return true;
+  
+  //  bool caMarche = true;
   /*
    // initialize dataManager
@@ -737,5 +774,5 @@
    }//a
    */
-  return caMarche;
-}
-
+  //  return caMarche;
+}
+
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_computingBlock.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_computingBlock.cc	(revision 493)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_computingBlock.cc	(revision 493)
@@ -0,0 +1,175 @@
+
+#include <iostream>
+
+#include <Wt/WText>
+#include <Wt/WVBoxLayout>
+#include <Wt/WHBoxLayout>
+#include <Wt/WGridLayout>
+#include <Wt/WContainerWidget>
+#include <Wt/WImage>
+
+#include "GWt_computingBlock.h"
+//#include "GWt_softwarePanel.h"
+#include "GWt_machine.h"
+
+using namespace std;
+
+GWt_computingBlock::GWt_computingBlock(Wt::WComboBox* first,Wt::WComboBox* last,Wt::WComboBox* soft,Wt::WContainerWidget* buttonPanel, computingBlock* block,GWt_machine* machine)
+:WContainerWidget(),
+firstElement_(first),
+lastElement_(last),
+softElement_(soft),
+cpblock_(block),
+UImachine_(machine)
+{
+  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* 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(firstElement_);
+  labelAndComboInsideContainerLayout->addWidget(new Wt::WText("to&nbsp;:&nbsp;"));
+  labelAndComboInsideContainerLayout->addWidget(lastElement_);
+  labelAndComboInsideContainerLayout->addWidget(softElement_);
+  
+    // 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);
+  softElement_->setMinimumSize(80,12);
+  
+  firstElement_->activated().connect(this,&GWt_computingBlock::changeFirstElement);
+  lastElement_->activated().connect(this,&GWt_computingBlock::changeLastElement);
+//  lastElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
+  softElement_->activated().connect(this,&GWt_computingBlock::setSoftware);
+  this->redraw_.connect(UImachine_,&GWt_machine::displayWidgetComputing);
+  
+  manageWarningsAndErrors();
+}
+
+
+void GWt_computingBlock::setFirstElementCurrentSelection_deprecated(Wt::WString txt){
+    for (int a=0; a< firstElement_->count(); a++) {
+        if (firstElement_->itemText(a) == txt) {
+            firstElement_->setCurrentIndex (a);
+            return;
+        }
+    }
+}
+
+void GWt_computingBlock::setLastElementCurrentSelection_deprecated(Wt::WString txt){
+    for (int a=0; a< lastElement_->count(); a++) {
+        if (lastElement_->itemText(a) == txt) {
+            lastElement_->setCurrentIndex (a);
+            return;
+        }
+    }
+}
+
+void GWt_computingBlock::setSoftwareElementCurrentSelection_deprecated(Wt::WString txt){
+  for (int a=0; a< softElement_->count(); a++) {
+    if (softElement_->itemText(a) == txt) {
+      softElement_->setCurrentIndex (a);
+      return;
+    }
+  }
+}
+
+
+void GWt_computingBlock::manageWarningsAndErrors(){
+    if (warningsLabel_->text() == "") {
+        warningsContainer_->hide();
+    } else {
+        warningsContainer_->show();
+    }
+    if (errorsLabel_->text() == "") {
+        errorsContainer_->hide();
+    } else {
+        errorsContainer_->show();
+    }
+
+}
+
+
+ void GWt_computingBlock::setSoftware()
+{
+
+UImachine_->getMachineControler()->setSoftware(softElement_->currentText().toUTF8(), cpblock_);
+  //  UIsector_->getBeamLineWidget()->buildBeamLineWidget();
+}
+
+
+void GWt_computingBlock::changeFirstElement()
+{
+  if (!cpblock_) return;
+  if (!UImachine_) return;
+
+  UImachine_->getMachineControler()->setFirstElementOfBlock(cpblock_, firstElement_->currentIndex());
+  redraw_.emit();
+}
+
+void GWt_computingBlock::changeLastElement()
+{
+  if (!cpblock_) return;
+  if (!UImachine_) return;
+
+  UImachine_->getMachineControler()->setLastElementOfBlock(cpblock_, lastElement_->currentIndex());
+  redraw_.emit();
+}
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc	(revision 493)
@@ -66,5 +66,7 @@
   
   buildBeamLineWidget();
-  getUISector()->getExecuteWidget()->displayFromControler();
+
+ 
+  //  getUISector()->getExecuteWidget()->displayFromControler();
 
   return UIabstractElement;
@@ -112,5 +114,5 @@
   
   // FIXME
-  UI_sector_->getExecuteWidget()->updateSections();
+  //  UI_sector_->getExecuteWidget()->updateSections();
 }
 
@@ -125,11 +127,19 @@
 
   GWt_elementLigneFaisceau* elemLigneFaisceau = NULL;
-  for (unsigned int i =0; i< UI_sector_->getSectorControler()->getSectionsToExecute().size(); i++) {
-    std::vector <abstractElement*> abstractElem = UI_sector_->getSectorControler()->getSectionsToExecute()[i]->getElements();
+  //  for (unsigned int i =0; i< UI_sector_->getSectorControler()->getSectionsToExecute().size(); i++) {
+  //    std::vector <abstractElement*> abstractElem = UI_sector_->getSectorControler()->getSectionsToExecute()[i]->getElements();
+  std::vector <abstractElement*> abstractElem = UI_sector_->getSectorControler()->getElements();
     for (unsigned int j=0; j< abstractElem.size(); j++) {
 
-      elemLigneFaisceau = new GWt_elementLigneFaisceau(dataManager_,
+           // elemLigneFaisceau = new GWt_elementLigneFaisceau(dataManager_,
+           //                                             this,
+           //                                             abstractElem[j],UI_sector_->getSectorControler()->getSectionsToExecute()[i]->getSoftware()->getColor());
+
+
+           elemLigneFaisceau = new GWt_elementLigneFaisceau(dataManager_,
                                                        this,
-                                                       abstractElem[j],UI_sector_->getSectorControler()->getSectionsToExecute()[i]->getSoftware()->getColor());
+                                                       abstractElem[j],"#FFFFFF");
+
+
       
       // remove default text
@@ -150,5 +160,6 @@
       
     }
-  }
+    //  }
+
   // remove last line
   if (elemLigneFaisceau != NULL) {
@@ -171,5 +182,5 @@
   
   buildBeamLineWidget();
-  getUISector()->getExecuteWidget()->displayFromControler();
+  //  getUISector()->getExecuteWidget()->displayFromControler();
 /*
   // remove Widget
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_machine.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_machine.cc	(revision 493)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_machine.cc	(revision 493)
@@ -0,0 +1,82 @@
+#include "GWt_machine.h"
+
+#include <Wt/WPushButton>
+#include <Wt/WLabel>
+#include <Wt/WPanel>
+#include <Wt/WColor>
+#include <Wt/WVBoxLayout>
+#include <Wt/WHBoxLayout>
+#include <Wt/WComboBox>
+
+GWt_machine::GWt_machine(GWt_accelerator* parent,expandedMachine* mach) :
+UI_Accelerator_(parent),
+machineControler_(mach)
+{
+  displayWidgetComputing();
+}
+
+GWt_machine::~GWt_machine()
+{
+}
+
+void GWt_machine::createWidgetComputing(WContainerWidget* parent) {
+
+  // suppress old detailled view if present
+  parent->clear();
+  
+  // add the detailled view
+  WContainerWidget* wdg = new WContainerWidget(parent);
+
+  wdg->setObjectName("machine");
+  wdg->addStyleClass("machinePanel");
+  Wt::WVBoxLayout* vContainerLayout = new WVBoxLayout();
+  vContainerLayout->setContentsMargins(0,0,0,0);
+  Wt::WPanel *collapsiblePanel = new Wt::WPanel(wdg);
+  collapsiblePanel->setTitle("Machine panel");
+  collapsiblePanel->setCollapsible(true);
+  
+  WContainerWidget* menu = new WContainerWidget(wdg);
+  menu->addStyleClass("machineMenu");
+  
+  
+  //  new WLabel(sectorControler_->getName()+" ",menu);
+  
+  WPushButton* actionParameters = new WPushButton("",menu);
+  // set tooltips
+  actionParameters->setToolTip("change parameters");
+  
+  // Set class for actions elements
+  actionParameters->setStyleClass("Button WhiteButton parameters");
+  actionParameters->setMaximumSize(32,32);
+  actionParameters->setMinimumSize(32,32);
+  
+
+  
+  menu->setWidth(20+7+7+1+1+2);
+  
+  vContainerLayout->addWidget(menu);
+  
+  // Add beamLine for this sector
+  //  UI_beamLine_ = new GWt_ligneFaisceau(getAccelerator()->getDataManager(),this);
+  //  vContainerLayout->addWidget(UI_beamLine_);
+  
+  // add the software panel
+  cout << " GWt_machine::createWidgetComputing APPEL sofwarepanel" << endl;
+    GWt_softwarePanelBis*  computeWidget = new GWt_softwarePanelBis(getAccelerator()->getDataManager(),this);
+    vContainerLayout->addWidget(computeWidget);
+  
+
+  wdg->setLayout(vContainerLayout);
+}
+
+void GWt_machine::displayWidgetComputing() {
+  createWidgetComputing(getAccelerator()->getAcceleratorComputingView());
+}
+
+// void GWt_machine::expandMachine() {
+//   cout << " coucou depuis GWt_machine::expandMachine() " << endl;
+//   getAccelerator()->getDataManager()->expandMachine();
+//    cout << " GWt_machine::createWidgetComputing APPEL sofwarepanel" << endl;
+//        computeWidget_ = new GWt_softwarePanelBis(getAccelerator()->getDataManager(),this);
+//      vContainerLayout_->addWidget(computeWidget_);
+// }
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sector.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sector.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sector.cc	(revision 493)
@@ -116,6 +116,6 @@
   
   // add the software panel
-  executeWidget_ = new GWt_softwarePanel(getAccelerator()->getDataManager(),this);
-  vContainerLayout->addWidget(executeWidget_);
+  //    executeWidget_ = new GWt_softwarePanel(getAccelerator()->getDataManager(),this);
+  //   vContainerLayout->addWidget(executeWidget_);
   
 
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 492)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 493)
@@ -2,6 +2,5 @@
 //  PSPA
 //
-//  Created by Garnier Laurent on 30/01/13.
-//  Copyright (c) 2013 Garnier Laurent. All rights reserved.
+//  Created by Garnier Laurent on 30/01/13.//  Copyright (c) 2013 Garnier Laurent. All rights reserved.
 //
 
@@ -17,64 +16,74 @@
 #include "GWt_dialog.h"
 #include "GWt_console.h"
-#include "GWt_sector.h"
+#include "GWt_computingBlock.h"
 #include "GWt_globalParameters.h"
 #include "GWt_sectionToExecute.h"
 #include "GWt_pspaApplication.h"
-
-#define BAVARD 0
-
-GWt_softwarePanel::GWt_softwarePanel(dataManager* dataManager,GWt_sector* sect)
+#include "GWt_machine.h"
+#define BAVARD 1
+
+GWt_softwarePanelBis::GWt_softwarePanelBis(dataManager* dataManager,GWt_machine* mach)
   : WContainerWidget(),
 dtmanage_(dataManager),
-UIsector_(sect)
+UImachine_(mach)
 {
   
   // le panel
   WPanel *panelLogiciels = new WPanel(this);
-  panelLogiciels->setTitle(" sections of beam line for executing softwares ");
+  panelLogiciels->setTitle(" Computing blocks ");
   
   contenuSections_ = new WContainerWidget();
   contenuSections_->addWidget(new WBreak());
   contenuSections_->addWidget(new WBreak());
-  displayFromControler();
+  cout << " GWt_softwarePanelBis::GWt_softwarePanelBis DISPLAY SOFTWARE PANEL " << endl;
+      displayFromControler();
   
   panelLogiciels->setCentralWidget(contenuSections_);
 }
 
-GWt_softwarePanel::~GWt_softwarePanel() {
-}
-
-void GWt_softwarePanel::displayFromControler()
+GWt_softwarePanelBis::~GWt_softwarePanelBis() {
+}
+
+void GWt_softwarePanelBis::displayFromControler()
 {      
-#if BAVARD > 0
-  cout << "***********************************" << endl;
-  cout << " GWt_softwarePanel::addSectionToExecuteW() " << endl<<endl;
-#endif
+  cout << " GWt_softwarePanelBis::displayFromControler() " << endl<<endl;
 
   // Clear all
   contenuSections_->clear();
-  
-  // Get all sectionsToExecute from this sector
-  if (!UIsector_->getSectorControler()) {
+
+
+  // Get all sectionsToExecute from this machine
+  if (!UImachine_->getMachineControler()) {
+    cout << " GWt_softwarePanelBis::displayFromControler() PAS DE MACHINE " << endl;
     return;
-  }
-  
-  if (UIsector_->getSectorControler()->getSectionsToExecute().size() == 0) {
+  } else {
+    cout << " GWt_softwarePanelBis::displayFromControler() MACHINE TROUVEE " << endl;
+  }
+  
+  if (UImachine_->getMachineControler()->getComputingBlocks().size() == 0) {
     // FIXME : Add a message to tell the user to add first an element
+    cout << " GWt_softwarePanelBis::displayFromControler() PAS DE BLOCK " << endl;
   } else {
-
-    unsigned int firstSectionToExecuteIndex = 0;
-    for (unsigned int a=0; a<UIsector_->getSectorControler()->getSectionsToExecute().size(); a++) {
+    cout << " GWt_softwarePanelBis::displayFromControler() NOMBRE DE BLOCK " << UImachine_->getMachineControler()->getComputingBlocks().size() << endl;
+
+    unsigned int firstElemeOfComputingBlockIndex = 0;
+
+    for (unsigned int a=0; a<UImachine_->getMachineControler()->getComputingBlocks().size(); a++) {
+      cout << " GWt_softwarePanelBis::displayFromControler() BLOC No " << a+1 << endl;
       abstractElement* premierElement = NULL;
       abstractElement* dernierElement = NULL;
-      
       std::string premierElementLabel = "";
       std::string dernierElementLabel = "";
-      if (premierElement) {
-        premierElementLabel = premierElement->getLabel();
+
+      if ( !UImachine_->getMachineControler()->getComputingBlocks()[a]->isEmpty() ) {
+	premierElement = UImachine_->getMachineControler()->getComputingBlocks()[a]->getFirstElement();
+	firstElemeOfComputingBlockIndex = UImachine_->getMachineControler()->getComputingBlocks()[a]->getRankOfFirstElement();
+	dernierElement = UImachine_->getMachineControler()->getComputingBlocks()[a]->getLastElement();
       }
-      if (dernierElement) {
-        dernierElementLabel = dernierElement->getLabel();
-      }
+
+
+      if (premierElement) premierElementLabel = premierElement->getLabel();
+      if (dernierElement) dernierElementLabel = dernierElement->getLabel();
+      cout << " GWt_softwarePanelBis::displayFromControler() dernier element a afficher " << dernierElementLabel << endl;
       
       WComboBox* lineFromCombo = new WComboBox();
@@ -84,11 +93,10 @@
       
       // set to first
-      lineFromCombo->setCurrentIndex(firstSectionToExecuteIndex);
+      lineFromCombo->setCurrentIndex(firstElemeOfComputingBlockIndex);
       // set to last
-      lineToCombo->setCurrentIndex(firstSectionToExecuteIndex + (unsigned int)UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size() - 1);
-      
+      lineToCombo->setCurrentIndex(UImachine_->getMachineControler()->getComputingBlocks()[a]->getRankOfLastElement());
       WComboBox* softCombo = new WComboBox();
       
-      fillComboWithSoftwares(softCombo,UIsector_->getSectorControler()->getSectionsToExecute()[a]->getSoftware()->getName());
+      fillComboWithSoftwares(softCombo,UImachine_->getMachineControler()->getComputingBlocks()[a]->getSoftware()->getName());
 
       // disable the "to" comboBox
@@ -96,232 +104,46 @@
 
       // disable the first "from" comboBox
-      if (a==0) {
-        lineFromCombo->disable();
+      // if (a==0) {
+      //   lineFromCombo->disable();
+      // }
+
+      // enable the last "to" comboBox
+      if (a==UImachine_->getMachineControler()->getComputingBlocks().size()-1) {
+	        lineToCombo->enable();
       }
-      // disable the last "to" comboBox
-      if (a==UIsector_->getSectorControler()->getSectionsToExecute().size()-1) {
-        lineToCombo->disable();
-      }
-      
-      // Add the sectionToExecute Widget
-      GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(a),UIsector_->getSectorControler()->getSectionsToExecute()[a],UIsector_);
-      
-      /*      // FIXME ?
-       stringstream st;
-       st << UIsectionsToExecute_deprecated_.size();
-       
-       // this is the mean to identify this section!
-       newSection->setObjectName(st.str());
-       
-       // push back on sections vector
-       UIsectionsToExecute_deprecated_.push_back(newSection);
-       */
-      contenuSections_->addWidget(newSection);
-      //      updateSections();
-      
-      firstSectionToExecuteIndex += UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size();
+      
+      // // Add computingBlock Widget
+      
+      //      GWt_computingBlock* newBlock = new GWt_computingBlock(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(a),UImachine_->getMachineControler()->getComputingBlocks()[a],UImachine_);
+      computingBlock* blocPtr = UImachine_->getMachineControler()->getComputingBlocks()[a];
+      GWt_computingBlock* newBlock = new GWt_computingBlock(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(blocPtr),blocPtr,UImachine_);
+
+      cout << " GWt_softwarePanelBis::displayFromControler j'ajoute un bloc : " << newBlock << endl;
+      cout << " GWt_softwarePanelBis::displayFromControler nb widget avant : " << contenuSections_->count() << endl;
+      contenuSections_->addWidget(newBlock);
+      cout << " GWt_softwarePanelBis::displayFromControler nb widget apres : " << contenuSections_->count() << endl;
+      
     }
   }
- }
-
-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 < UIsectionsToExecute_deprecated_.size(); a++) {
-    fillComboWithElements(UIsectionsToExecute_deprecated_[a]->getFirstElement());
-    fillComboWithElements(UIsectionsToExecute_deprecated_[a]->getLastElement());
-    UIsectionsToExecute_deprecated_[a]->getFirstElement()->setEnabled (true);
-    UIsectionsToExecute_deprecated_[a]->getLastElement()->setEnabled (true);
-  }
-  
-  if (UIsectionsToExecute_deprecated_;.size() == 0) {
+}
+
+void GWt_softwarePanelBis::fillComboWithElements(Wt::WComboBox* cBox) 
+{
+
+  if (cBox == NULL) return;
+
+  if (!UImachine_->getMachineControler()) {
     return;
   }
-  
-  // the first element will always be the first element of the beamLine
-  UIsectionsToExecute_deprecated_[0]->getFirstElement()->setCurrentIndex(0);
-  UIsectionsToExecute_deprecated_[0]->getFirstElement()->setEnabled (false);
-
-  // the last element will always be the last element of the beamLine
-  UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_.size()-1]->getLastElement()->setCurrentIndex(UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_;.size()-1]->getLastElement()->count());
-  UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_.size()-1]->getLastElement()->setEnabled(false);
-
-  // set default values
-  updateSectionSelection();
-*/
-}
-
-bool GWt_softwarePanel::updateSectionSelection()
-{
-#if BAVARD > 0
-  cout << "***********************************" << endl;
-  cout << " GWt_softwarePanel::updateSectionSelection() " << endl<<endl;
-#endif
-
-  if ( dtmanage_->getJobListSize() == 0 ) return false;
-  
-  // traitement de la premiere ligne
-  // on impose le depart du calcul au premier element
-  string premier = "";
-  if (UIsector_->getSectorControler()) {
-    if (UIsector_->getSectorControler()->getSectionsToExecute().size() > 0) {
-      if (UIsector_->getSectorControler()->getSectionsToExecute()[0]->getElements().size() > 0) {
-        premier = UIsector_->getSectorControler()->getSectionsToExecute()[0]->getElements()[0]->getLabel();
-      }
-    }
-  }
-  
-  // FIXME :  A rÃ©Ã©crire
-  /*
-  if (UIsectionsToExecute_deprecated_.size() > 0) {
-    UIsectionsToExecute_deprecated_[0]->setFirstElementCurrentSelection(premier);
-  }
-  
-  Wt::WString currentString =  UIsectionsToExecute_deprecated_[0]->getLastElementCurrentText();
-  int current = dtmanage_->getNumeroFromElementLabel(currentString.toUTF8());
-  
-  // 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 (UIsectionsToExecute_deprecated_.size() > 0) {
-	UIsectionsToExecute_deprecated_[0]->setLastElementCurrentSelection(currentString);
-	//...
-      }
-    }
-  current++;
-  currentString = dtmanage_->getLabelFromElementNumero(current);
-  
-  // traitement des suivantes (on avance d'un cran dans la liste)
-  for (int a = 1; a< UIsectionsToExecute_deprecated_;.size(); a++)
-    {
-      // debut
-      if ( current > dtmanage_->getBeamLineSize() )
-        {
-          UIsectionsToExecute_deprecated_;[a]->setErrors("This section element could not be after previous session last element");
-          exec_go_->disable();
-          return false;
-        }
-      
-      UIsectionsToExecute_deprecated_;[a]->setFirstElementCurrentSelection(currentString);
-
-      // fin
-      string finString =  UIsectionsToExecute_deprecated_;[a]->getLastElementCurrentText().toUTF8();
-      
-      int numeroFin = dtmanage_->getNumeroFromElementLabel( finString);
-      
-      if ( numeroFin < current)
-      {
-        UIsectionsToExecute_deprecated_;[a]->setErrors("Last section element should be after first section element");
-        exec_go_->disable();
-        return false;
-      }
-
-      if (numeroFin > dtmanage_->getBeamLineSize())
-      {
-        UIsectionsToExecute_deprecated_;[a]->setErrors("Last section element number is greater than the beam line size");
-        exec_go_->disable();
-        return false;
-      }
-      
-      // preparation de la ligne suivante
-      current = numeroFin +1;
-      currentString = dtmanage_->getLabelFromElementNumero(current);
-    }
-  //  exec_go_->setDisabled(false);
-
-  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();
-  }
-*/
-  return true;
-}
-
-
-void GWt_softwarePanel::addSectionToExecute() {
-  // We put the last element of the previous sectionToExecute inside
-  
-  // Get the last element from previous section
-  if (!UIsector_->getSectorControler()) {
-    return;
-  }
-  unsigned long s = UIsector_->getSectorControler()->getSectionsToExecute().size();
-  if (s > 0) {
-    abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->getLastElement();
-    UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL,dtmanage_,UIsector_->getSectorControler()));
-    UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->removeLastElement();
-  }
-
- 
-  displayFromControler();
-  UIsector_->getBeamLineWidget()->buildBeamLineWidget();
-}
-
-
-void GWt_softwarePanel::deleteSectionToExecute(int sectionLabel)
-{
-#if BAVARD > 0
-  cout << "***********************************" << endl;
-  cout << " GWt_softwarePanel::deleteSectionToExecuteW()" << endl<<endl;
-#endif
-
-  stringstream st;
-  st << sectionLabel;
-  std::string sectionName = st.str();
-  //FIXME
-  
-/*  if ( dtmanage_->getJobListSize() == 0 ) return;
-  for (unsigned int sectionIndex = 0; sectionIndex< UIsectionsToExecute_deprecated_.size(); sectionIndex++) {
-    if (UIsectionsToExecute_deprecated_[sectionIndex]->objectName() == sectionName) {
-
-      // delete from dataManager
-      UIsector_->getSectorControler()->clearSectionToExecute(sectionIndex);
-
-      // delete from User Interface
-      contenuSections_->removeWidget(UIsectionsToExecute_deprecated_[sectionIndex]);
-      delete UIsectionsToExecute_deprecated_[sectionIndex];
-      UIsectionsToExecute_deprecated_.erase (UIsectionsToExecute_deprecated_.begin()+sectionIndex);
-    }
-  }  
-*/
-  displayFromControler();
-}
-
-
-void GWt_softwarePanel::fillComboWithElements(Wt::WComboBox* cBox) 
-{
-
-  if (cBox == NULL) return;
-
-  if (!UIsector_->getSectorControler()) {
-    return;
-  }
-  for (unsigned int a=0; a < UIsector_->getSectorControler()->getSectionsToExecute().size(); a++) {
-    for(unsigned int b=0; b < UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size(); b++) {
-      
-      abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements()[b];
+    for(unsigned int b=0; b < UImachine_->getMachineControler()->getElements().size(); b++) {
+      
+      abstractElement* abs = UImachine_->getMachineControler()->getElements()[b];
       if (abs != NULL) {
         cBox->addItem(abs->getLabel());
       }
     }
-  }
-}
-
-void GWt_softwarePanel::fillComboWithSoftwares(Wt::WComboBox* cBox, std::string selected)
+}
+
+void GWt_softwarePanelBis::fillComboWithSoftwares(Wt::WComboBox* cBox, std::string selected)
 {
 #if BAVARD > 0
@@ -344,5 +166,6 @@
 }
 
-Wt::WContainerWidget* GWt_softwarePanel::createAddDeletePushButtons(int sectionNumber) 
+
+Wt::WContainerWidget* GWt_softwarePanelBis::createAddDeletePushButtons(computingBlock* cpbl) 
 {
   WContainerWidget* buttonContainer= new WContainerWidget();
@@ -352,5 +175,6 @@
   // preparation du bouton add
   WPushButton* exec_add = new WPushButton("+");
-  exec_add->clicked().connect(this, &GWt_softwarePanel::addSectionToExecute);
+  //  exec_add->clicked().connect(this, &GWt_softwarePanelBis::addComputingBlock);
+  exec_add->clicked().connect(boost::bind(&GWt_softwarePanelBis::addComputingBlock, this, cpbl));
   exec_add->setStyleClass("roundButton");
   exec_add->setMaximumSize(20,20);
@@ -361,5 +185,5 @@
   //  warningsContainer_->setStyleClass("warningsContainer");
 
-  exec_delete->clicked().connect(boost::bind(&GWt_softwarePanel::deleteSectionToExecute, this, sectionNumber));
+  exec_delete->clicked().connect(boost::bind(&GWt_softwarePanelBis::deleteComputingBlock, this, cpbl));
   exec_delete->setStyleClass("roundButton");
   exec_delete->setMaximumSize(20,20);
@@ -372,2 +196,55 @@
   return buttonContainer;
 }
+
+void GWt_softwarePanelBis::addComputingBlock(computingBlock* cpbl) {
+  // We put the last element of the previous sectionToExecute inside
+  
+  if (!UImachine_->getMachineControler()) {
+    return;
+  }
+  //  UImachine_->getMachineControler()->openNewLastBlock();
+    UImachine_->getMachineControler()->openNewBlockAfter(cpbl);
+  displayFromControler();
+}
+
+
+// void GWt_softwarePanelBis::deleteComputingBlock(int sectionLabel)
+// {
+//   cout << " GWt_softwarePanelBis::deleteComputingBlock()" << endl;
+
+//   stringstream st;
+//   st << sectionLabel;
+//   std::string sectionName = st.str();
+//   //FIXME
+//   vector<computingBlock*>& compBloc = UImachine_->getMachineControler()->getComputingBlocks();
+//   cout << " GWt_softwarePanelBis::deleteComputingBlock() nb blocs = " << compBloc.size() << endl;
+//   cout << " GWt_softwarePanelBis::deleteComputingBlock() nb widgets = " << sectionName << endl;
+//   cout << " GWt_softwarePanelBis::deleteComputingBlock() nom bloc a detruire = " << contenuSections_->count() << endl;
+
+//   for ( unsigned k=0; k <  compBloc.size(); k++) {
+
+//   }
+// /*  if ( dtmanage_->getJobListSize() == 0 ) return;
+//   for (unsigned int sectionIndex = 0; sectionIndex< UIsectionsToExecute_deprecated_.size(); sectionIndex++) {
+//     if (UIsectionsToExecute_deprecated_[sectionIndex]->objectName() == sectionName) {
+
+//       // delete from dataManager
+//       UIsector_->getSectorControler()->clearSectionToExecute(sectionIndex);
+
+//       // delete from User Interface
+//       contenuSections_->removeWidget(UIsectionsToExecute_deprecated_[sectionIndex]);
+//       delete UIsectionsToExecute_deprecated_[sectionIndex];
+//       UIsectionsToExecute_deprecated_.erase (UIsectionsToExecute_deprecated_.begin()+sectionIndex);
+//     }
+//   }  
+// */
+//   displayFromControler();
+// }
+
+void GWt_softwarePanelBis::deleteComputingBlock(computingBlock* cpbl)
+{
+  cout << " GWt_softwarePanelBis::deleteComputingBlock(computingBlock*)" << endl;
+
+  UImachine_->getMachineControler()->eraseComputingBlock(cpbl);
+  displayFromControler();
+}
Index: /Interface_Web/trunk/pspaWT/workingArea/philFit.aml
===================================================================
--- /Interface_Web/trunk/pspaWT/workingArea/philFit.aml	(revision 492)
+++ /Interface_Web/trunk/pspaWT/workingArea/philFit.aml	(revision 493)
@@ -7,5 +7,5 @@
     <nsc value = "0" />
   </global>
-  <sector name = "a_sect">
+  <sector name = "sector 1">
     <element name = "rfgun01">
       <description type = "rfgun" />
@@ -55,9 +55,9 @@
       <length design = "3" />
       <aperture at = "EXIT" shape = "CIRCLE">
-        <xy_limit design = "1e+61" />
+        <xy_limit design = "1e+06" />
       </aperture>
       <solenoid>
         <ksol design = "1.0199" />
-        <vary is_on = "false" />
+        <vary is_on = "true" />
       </solenoid>
     </element>
@@ -82,4 +82,6 @@
       </bend>
     </element>
+  </sector>
+  <sector name = "sector 2">
     <element name = "drift03">
       <description type = "drift" />
@@ -94,3 +96,25 @@
     </element>
   </sector>
+  <machine name = "dummy">
+    <machineElements>
+      <melement name = "rfgun01" />
+      <melement name = "cell01" />
+      <melement name = "drift01" />
+      <melement name = "solnd01" />
+      <melement name = "drift02" />
+      <melement name = "bend01" />
+      <melement name = "drift03" />
+      <melement name = "fit01" />
+    </machineElements>
+    <mcomputingBlocks>
+      <computingBlock>
+        <software name = "parmela" />
+        <blocExtension rankOfFirstElement = "0" numberOfelements = "3" />
+      </computingBlock>
+      <computingBlock>
+        <software name = "transport" />
+        <blocExtension rankOfFirstElement = "3" numberOfelements = "5" />
+      </computingBlock>
+    </mcomputingBlocks>
+  </machine>
 </laboratory>
