Index: /Interface_Web/trunk/pspaWT/cmt/requirements
===================================================================
--- /Interface_Web/trunk/pspaWT/cmt/requirements	(revision 441)
+++ /Interface_Web/trunk/pspaWT/cmt/requirements	(revision 442)
@@ -36,4 +36,5 @@
  ../sources/controler/src/softwareTransport.cc \
  ../sources/controler/src/softwareGenerator.cc \
+ ../sources/controler/src/softwareUsersprogram.cc \
  ../sources/controler/src/sectionToExecute.cc \
  ../sources/controler/src/softwareTest.cc \
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/elementSnapshot.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/elementSnapshot.h	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/elementSnapshot.h	(revision 442)
@@ -10,5 +10,7 @@
 {
   int incr_;
-  string snapshotFile_;
+  string programFile_;
+  string inputBeamFile_;
+  string outputBeamFile_;
   void setDefaultValues();
   void setDefaults();
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/mathematicalTools.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/mathematicalTools.h	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/mathematicalTools.h	(revision 442)
@@ -150,4 +150,6 @@
 inline double getComponent(int index ) const {return vec_[index];}
 
+ inline double& component(int index ) {return vec_[index];}
+
  inline void setComponent(int index, double value )  {vec_[index] = value;}
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/nomDeLogiciel.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/nomDeLogiciel.h	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/nomDeLogiciel.h	(revision 442)
@@ -13,5 +13,5 @@
   enum Logiciel
   {
-    parmela, transport, generator, useraction, test, madx, unknownSoftware
+    parmela, transport, generator, test, madx, usersprogram, unknownSoftware
   };
   
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/particleBeam.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/particleBeam.h	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/particleBeam.h	(revision 442)
@@ -138,4 +138,6 @@
   virtual string fileOutputFlow() const;
   virtual bool FileInput(ifstream& ifs);
+  virtual void writeToAMLFile(string fileName);
+  virtual bool readFromAMLFile(string fileName);
 
   void histogramme(unsigned int index,vector<double>&xcor,vector<int>& hist,vector<string>& legende);
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h	(revision 442)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h	(revision 442)
@@ -0,0 +1,30 @@
+#ifndef SOFTWAREUSERSPROGRAM_SEEN
+#define SOFTWAREUSERSPROGRAM_SEEN
+
+#include "abstractSoftware.h"
+
+class softwareUsersprogram : public abstractSoftware
+{
+
+    protected :
+
+  string nomProgram_;
+  string outputFileName_;
+ public : 
+    softwareUsersprogram();
+    softwareUsersprogram(string inputFileName, globalParameters* globals, dataManager* beamLine);
+
+  virtual ~softwareUsersprogram() {;}
+  virtual bool createInputFile( particleBeam* beamBefore,unsigned int numeroDeb, unsigned int numeroFin, string workingDir);
+
+  virtual bool  execute(string workingDir);
+
+
+virtual bool buildBeamAfterElements(string workingDir);
+
+    inline string getColor() {
+        return "#4e4747";
+    }
+    
+};
+#endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc	(revision 442)
@@ -2,4 +2,6 @@
 #include "dataManager.h"
 #include <algorithm>
+#include <iostream>
+
 
 abstractSoftware::abstractSoftware()
@@ -52,7 +54,10 @@
 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);
   }
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/bareParticle.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/bareParticle.cc	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/bareParticle.cc	(revision 442)
@@ -119,5 +119,4 @@
 
 
-
 bool bareParticle::FileInput( ifstream& ifs)
  {
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 442)
@@ -12,4 +12,6 @@
 #include "softwareTransport.h"
 #include "softwareGenerator.h"
+#include "softwareGenerator.h"
+#include "softwareUsersprogram.h"
 #include "softwareTest.h"
 #include "softwareMadx.h" //xx
@@ -89,9 +91,12 @@
     inputFileName = "generator.in";
     prog = new softwareGenerator(inputFileName, &globParam_, this);
-  } else if (logiciel  == nomDeLogiciel::test) {
-    prog = new softwareTest(inputFileName, &globParam_, this);
   } else if (logiciel  == nomDeLogiciel::madx) {
     inputFileName = "madx.input";
     prog = new softwareMadx(inputFileName,&sectorParam_,this);  
+  } else if (logiciel  == nomDeLogiciel::usersprogram) {
+    inputFileName = "dummy";
+    prog = new softwareUsersprogram(inputFileName, &globParam_, this);
+  } else if (logiciel  == nomDeLogiciel::test) {
+    prog = new softwareTest(inputFileName, &globParam_, this);
   } else {
     prog = new softwareUnknown(); // xx
@@ -230,5 +235,10 @@
 
   } //k
-  
+  // if ( currentBeam_ ) {
+  // string aml_file = workingDir + "/" + "faisceau_final" + ".aml";
+  //   currentBeam_->writeToAMLFile(aml_file);
+  //   // TESTS
+  //   currentBeam_->readFromAMLFile(aml_file);
+  // }
   cout << " dataManager::executeAll() : premier element = " << firstComputedElemNumero_ << " dernier = " << lastComputedElemNumero_ << endl;
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/elementDrift.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/elementDrift.cc	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/elementDrift.cc	(revision 442)
@@ -13,7 +13,4 @@
   nbParam_ = elementName_.getElementNbParameters();
   parametersString_ = new string[nbParam_+1];
-  // registerAcceptableSoftware(nomDeLogiciel::transport, TBoolOk);
-  // registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolOk);
-  // registerAcceptableSoftware(nomDeLogiciel::test, TBoolOk);
 }
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/elementSnapshot.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/elementSnapshot.cc	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/elementSnapshot.cc	(revision 442)
@@ -13,10 +13,4 @@
   nbParam_ = elementName_.getElementNbParameters();
   parametersString_ = new string[nbParam_+1];
-  // registerAcceptableSoftware(nomDeLogiciel::transport, TBoolIgnore);
-  // registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolIgnore);
-  // registerAcceptableSoftware(nomDeLogiciel::generator, TBoolIgnore);
-  // registerAcceptableSoftware(nomDeLogiciel::useraction, 
-  //                                           TBoolOk);
-  // registerAcceptableSoftware(nomDeLogiciel::test, TBoolIgnore);
 }
 
@@ -30,11 +24,11 @@
   specificName_ = defaultSpecificName_;
 
-  if(incr_ < 10) {
-    snapshotFile_= string("cliche")+string(".00")+mixedTools::intToString(incr_);
-  } else if(incr_ >= 10 && incr_ < 100) {
-    snapshotFile_= string("cliche")+string(".0")+mixedTools::intToString(incr_);
-  } else {
-    snapshotFile_= string("cliche")+string(".")+mixedTools::intToString(incr_);
-  }
+  // if(incr_ < 10) {
+  //   snapshotFile_= string("cliche")+string(".00")+mixedTools::intToString(incr_);
+  // } else if(incr_ >= 10 && incr_ < 100) {
+  //   snapshotFile_= string("cliche")+string(".0")+mixedTools::intToString(incr_);
+  // } else {
+  //   snapshotFile_= string("cliche")+string(".")+mixedTools::intToString(incr_);
+  // }
 }
 
@@ -44,5 +38,7 @@
   parametersString_[++compteur] = mixedTools::intToString(nbParam_);
   parametersString_[++compteur] = specificName_;
-  parametersString_[++compteur] = snapshotFile_;
+  parametersString_[++compteur] = programFile_;
+  parametersString_[++compteur] = inputBeamFile_;
+  parametersString_[++compteur] = outputBeamFile_;
   
   if ( compteur != nbParam_ ) {
@@ -64,9 +60,12 @@
   int nbparam = atoi(param[++compteur].c_str());
   if ( nbparam != nbParam_ )  {
-    cerr << " elementSnaphot:: setParametersString parameters do not match for a DRIFT";
+    cerr << " elementSnaphot:: setParametersString parameters do not match for a SNAPSHOT";
     return;
   }
   
   specificName_ = param[++compteur];
+  programFile_  = param[++compteur];
+  inputBeamFile_  = param[++compteur];
+  outputBeamFile_  = param[++compteur];
 }
 
@@ -88,5 +87,7 @@
   sortie << elementName_.getGenericLabel() << endl;
   sortie  << specificName_ << endl;
-  sortie << snapshotFile_ << endl;
+  sortie << programFile_ << endl;
+  sortie << inputBeamFile_ << endl;
+  sortie << outputBeamFile_ << endl;
   return sortie.str();
 }
@@ -97,6 +98,8 @@
   sortie.back().second.push_back(elementName_.getGenericLabel());
   sortie.back().second.push_back(specificName_);
-  sortie.push_back( pair<string, vector<string> >("snapshotFile",  vector<string>() ) );
-  sortie.back().second.push_back(snapshotFile_);
+  sortie.push_back( pair<string, vector<string> >("nameOfFiles",  vector<string>() ) );
+  sortie.back().second.push_back(programFile_);
+  sortie.back().second.push_back(inputBeamFile_);
+  sortie.back().second.push_back(outputBeamFile_);
   return sortie;
 }
@@ -105,5 +108,7 @@
 {
   ifs >> specificName_;
-  ifs >> snapshotFile_;
+  ifs >> programFile_;
+  ifs >> inputBeamFile_;
+  ifs >> outputBeamFile_;;
 }
 
@@ -112,6 +117,10 @@
   string txt = "";  
   txt += specificName_;
-  txt += "\nname of file for snapshot : ";
-  txt += snapshotFile_;
+  txt += "\nname of file for user's program : ";
+  txt += programFile_;
+  txt += "\nname of input beam file for user's program : ";
+  txt += inputBeamFile_;
+  txt += "\nname of output beam file for user's program : ";
+  txt += outputBeamFile_;
   return txt;
 }
@@ -121,3 +130,8 @@
   UAPNode* node= root->addChild("snapshot");
   node->addAttribute("name",specificName_);
+
+  UAPNode* fichiers = node->addChild("names_of_files");
+  fichiers->addAttribute("program",programFile_);
+  fichiers->addAttribute("inputf",inputBeamFile_);
+  fichiers->addAttribute("outputf",outputBeamFile_);
 }
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/nomDeLogiciel.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/nomDeLogiciel.cc	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/nomDeLogiciel.cc	(revision 442)
@@ -6,7 +6,7 @@
     else if ( s == "transport" ) return transport;
     else if ( s == "generator" ) return generator;
-    else if ( s == "useraction" ) return useraction;
     else if ( s == "test" ) return test;
     else if ( s == "madx" ) return madx;
+    else if ( s == "usersprogram" ) return usersprogram;
     return unknownSoftware;
   }
@@ -19,7 +19,7 @@
     case transport : { return "transport"; }
     case generator : { return "generator"; }
-    case useraction : { return "useraction"; }
     case test : { return "test"; }
     case madx : { return "madx"; }
+    case usersprogram : { return "usersprogram"; }
     case unknownSoftware : { return "unknownSoftware"; }
     }
@@ -37,5 +37,4 @@
     case transport : { return "#c0ea8e"; }
     case generator : { return "#a3c0ed"; }
-    case useraction : { return "#FFFFFF"; }
     case test : { return "#ecc38e"; }
     case madx : { return "#ecc38e"; } //{ return "#FFFF00"; }
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/nomdElements.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/nomdElements.cc	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/nomdElements.cc	(revision 442)
@@ -74,5 +74,5 @@
   case soleno :   return 5;
   case fit :   return 4;
-  case snapshot : return 2;
+  case snapshot : return 4;
   case mpole :   return 3;
   default : return 0;
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc	(revision 442)
@@ -5,4 +5,7 @@
 #include "mathematicalTools.h"
 #include "mixedTools.h"
+
+#include "UAP/UAPUtilities.hpp"
+#include "AML/AMLReader.hpp"
 
 #include <stdio.h>
@@ -203,4 +206,101 @@
   sortie << endl;
   return sortie.str();
+}
+
+
+void particleBeam::writeToAMLFile(string fileName) {
+  UAPNode* uap_root = new UAPNode("UAP_root");
+  UAPNode* rep = uap_root->addChild("AML_representation");
+
+  // root node in the hierarchy
+  UAPNode* lab = rep->addChild("laboratory");
+  lab->addAttribute("name","PSPA lab");
+
+
+
+  // root node in the hierarchy
+  UAPNode* par = lab->addChild("particles");
+  par->addAttribute("name","PSPA particles");
+
+  unsigned int k;
+  if ( particleRepresentationOk_ ) {
+  for ( k = 0 ; k < relativePartic_.size(); k++)
+    {
+      TRIDVECTOR& position = relativePartic_.at(k).getReferenceToPosition();
+      TRIDVECTOR& betgam = relativePartic_.at(k).getReferenceToBetaGamma();
+      UAPNode* partic = par->addChild("particle");
+      string txt;
+      txt = mixedTools::doubleToString(position.getComponent(0));
+      partic->addAttribute("x",txt);
+      txt = mixedTools::doubleToString(position.getComponent(1));
+      partic->addAttribute("y",txt);
+      txt = mixedTools::doubleToString(position.getComponent(2));
+      partic->addAttribute("cdeltat",txt);
+      txt = mixedTools::doubleToString(betgam.getComponent(0));
+      partic->addAttribute("betagamma_x",txt);
+      txt = mixedTools::doubleToString(betgam.getComponent(1));
+      partic->addAttribute("betagamma_y",txt);
+      txt = mixedTools::doubleToString(betgam.getComponent(2));
+      partic->addAttribute("betagamma_z",txt);
+    }
+
+  } else {
+    cout << " particleBeam::writeToAMLFile : representation 'particules' indisponible" << endl;
+  }
+
+  cout << "!Create the AML particle file ---------------------------" << endl;
+  AMLReader reader;
+  reader.AMLRepToAMLFile (uap_root, fileName);
+
+}
+
+bool particleBeam::readFromAMLFile(string fileName) {
+
+  cout << "!read the AML particle file ---------------------------" << endl;
+  AMLReader reader;
+  UAPNode* uap_root = NULL;
+  uap_root = reader.AMLFileToAMLRep (fileName);
+  if ( !uap_root ) {
+    cout << " particleBeam::readFromAMLFile ERREUR lecture fichier particules " << endl;
+    return false;
+  }
+
+
+  NodeVec lesParticules = uap_root->getSubNodesByName(string("particles"));
+
+  NodeVec& listPart = (*lesParticules.begin())->getChildren();
+
+  if (  !listPart.size() ) {
+    cout << " particleBeam::readFromAMLFile ERREUR lecture fichier : pas de particules ? " << endl;
+    return false;
+  }
+
+  vector<bareParticle> vecteurParticules;
+  bareParticle reference;
+  for (NodeVecIter iter = listPart.begin(); iter != listPart.end(); iter++) {
+    TRIDVECTOR position, betagamma;
+    UAPAttribute* att = NULL;
+    att = (*iter)->getAttribute("x");
+    if ( att ) att->getDouble(position.component(0));
+    att = (*iter)->getAttribute("y");
+    if ( att ) att->getDouble(position.component(1));
+    att = (*iter)->getAttribute("cdeltat");
+    if ( att ) att->getDouble(position.component(2));
+
+    att = (*iter)->getAttribute("betagamma_x");
+    if ( att ) att->getDouble(betagamma.component(0));
+    att = (*iter)->getAttribute("betagamma_y");
+    if ( att ) att->getDouble(betagamma.component(1));
+    att = (*iter)->getAttribute("betagamma_z");
+    if ( att ) att->getDouble(betagamma.component(2));
+    
+    if ( fabs(position.component(0)) < PETIT &&  fabs(position.component(1)) < PETIT && fabs(position.component(2)) < PETIT ) {
+      reference = bareParticle(position, betagamma);
+    }
+    vecteurParticules.push_back(bareParticle(position, betagamma));
+  }
+  vector<double> centroid(6,0.0);
+  setWithParticles(centroid, reference, vecteurParticules);
+  return true;
 }
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc	(revision 442)
@@ -14,4 +14,5 @@
 softwareGenerator::softwareGenerator(string inputFileName, globalParameters* globals, dataManager* dt) : abstractSoftware(inputFileName, globals, dt)
 {
+  cout << " softwareUsersprogram::softwareGenerator ENREGISTREMENT " << endl;
   nameOfSoftware_ = nomDeLogiciel("generator");
   registerElement(nomdElements::RFgun,TBoolOk);
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc	(revision 442)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc	(revision 442)
@@ -0,0 +1,133 @@
+#include "softwareUsersprogram.h"
+#include "abstractElement.h"
+#include "dataManager.h"
+
+#include <algorithm>
+
+softwareUsersprogram::softwareUsersprogram() : abstractSoftware()
+{
+  nameOfSoftware_ = nomDeLogiciel("usersprogram");
+}
+
+softwareUsersprogram::softwareUsersprogram(string inputFileName,globalParameters* globals, dataManager* dt) : abstractSoftware(inputFileName, globals, dt)
+{
+  cout << " softwareUsersprogram::softwareUsersprogram ENREGISTREMENT " << endl;
+  nameOfSoftware_ = nomDeLogiciel("usersprogram");
+  registerElement(nomdElements::snapshot,TBoolOk);
+}
+
+bool softwareUsersprogram::createInputFile(particleBeam* beamBefore, unsigned int numeroDeb, unsigned int numeroFin, string workingDir)
+{ 
+
+
+  if ( !initComputationLimits(numeroDeb,numeroFin) ) return false;
+  if ( numeroDeb_ != numeroFin_ ) {
+    cout << " ERROR softwareUsersprogram::createInputFile : plusieurs elements  " << endl;
+    return false;
+  }
+
+  abstractElement* element = NULL;
+  element = dataManager_->getElementPointerFromNumero(numeroDeb_);
+  // Dans le cas oÃ¹ l'element n'est pas snapshot
+  if ( element->getNomdElement().getElementType() != nomdElements::snapshot ) {
+    cout << " ERROR softwareUsersprogram::execute : element non snapshot " << endl;
+    return false;
+  }
+
+  vector< pair<string, vector<string> > > donnees = element->parametersToSoftware();
+  nomProgram_ = "";
+  outputFileName_ = "";
+  for (int k=0; k < donnees.size(); k++) {
+    if ( donnees.at(k).first == "nameOfFiles" ) {
+      if ( donnees.at(k).second.size() < 3 ) {
+	cout << " ERROR softwareUsersprogram::createInputFile " << endl;
+	return false;
+      }
+      nomProgram_ = donnees.at(k).second.at(0).c_str();
+      inputFileName_ = donnees.at(k).second.at(1).c_str();
+      outputFileName_ = donnees.at(k).second.at(2).c_str();
+      break;
+    }
+  }
+
+  string aml_file = workingDir  + inputFileName_ + ".aml";
+    beamBefore->writeToAMLFile(aml_file);
+
+  return true;
+}
+
+bool softwareUsersprogram::execute(string workingDir)
+{
+  bool ExecuteStatus = true;
+
+
+  ostringstream sortie;
+  sortie << " EXECUTION DE " << nomProgram_ << " element " << numeroDeb_  << endl;
+  
+  string usersprogramJob = workingDir + nomProgram_;
+  usersprogramJob += " " + workingDir + inputFileName_;
+  usersprogramJob += " " + workingDir + outputFileName_;
+  cout << " job utilisateur= " << usersprogramJob << endl;
+  
+  string resultOfRun;
+  bool success = launchJob(usersprogramJob,resultOfRun);
+  sortie << resultOfRun << endl;
+  if ( !success ) {
+    sortie << " launching of transport failed " << endl;
+    ExecuteStatus = false;
+  } else {
+    string nameOut = workingDir + outputFileName_;
+    ofstream outfile;
+    outfile.open(nameOut.c_str(), ios::out);
+    if (!outfile) {
+      sortie << " error first opening user's program output stream " << nameOut << endl;
+      ExecuteStatus = false;
+    } else {
+      outfile.close();
+    }
+  }
+
+  dataManager_->consoleMessage(sortie.str());
+  return ExecuteStatus;
+}
+
+bool softwareUsersprogram::buildBeamAfterElements(string workingDir) 
+{
+
+  bool result = true;
+
+
+
+
+
+
+
+  if ( !ComputationLimitsOk() ) return false;
+
+  //  for (unsigned k = numeroDeb_; k <= numeroFin_; k++)
+    
+      abstractElement* ptr = dataManager_->getElementPointerFromNumero(numeroDeb_);
+      if ( ptr == NULL ) {
+	dataManager_->consoleMessage("ERROR  softwareUsersprogram::buildBeamAfterElements : null pointer on element " );
+	cout << " ERROR softwareUsersprogram::buildBeamAfterElements : null pointer on element " << endl;
+	return false;	      
+      }
+
+
+      if ( doAcceptElement(ptr->getNomdElement().getElementType())  != TBoolOk ) {
+	dataManager_->consoleMessage("ERROR  softwareUsersprogram::buildBeamAfterElements : element rejected by user's program " );
+	cout << "ERROR  softwareUsersprogram::buildBeamAfterElements : element rejected by user's program " << endl;
+
+      } else {
+	// si le numero est reconnu
+	string elemLabel = ptr->getLabel();
+	// on initialise une nouvelle sortie diagnostic 
+	  particleBeam* newDiag = dataManager_->updateCurrentDiagnostic(true);
+	// et on la complete
+	  string aml_file = workingDir  + outputFileName_ + ".aml";
+
+	  newDiag->readFromAMLFile(aml_file);
+	
+      }
+  return result;
+}
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementSnapshot.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementSnapshot.h	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementSnapshot.h	(revision 442)
@@ -14,6 +14,8 @@
 class GWt_elementSnapshot : public GWt_abstractElement
 {
-  WLineEdit* snapshotFile_;
-   
+   WLineEdit* programFile_;
+  WLineEdit* inputBeamFile_;
+  WLineEdit* outputBeamFile_;
+  
  public:
     
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementSnapshot.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementSnapshot.cc	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementSnapshot.cc	(revision 442)
@@ -19,6 +19,15 @@
   string* param = beginDialog();
 
-  new WText("name of file for snapshot : ",dialog_->contents());
-  snapshotFile_ = new WLineEdit(param->c_str(),dialog_->contents());
+  new WText("name of user's program : ",dialog_->contents());
+  programFile_ = new WLineEdit(param->c_str(),dialog_->contents());
+  new WBreak(dialog_->contents());
+
+
+  new WText("name of input beam file, output from pspa : ",dialog_->contents());
+  inputBeamFile_ = new WLineEdit( (++param)->c_str(),dialog_->contents());
+  new WBreak(dialog_->contents());
+
+  new WText("name of output beam file (input for pspa) : ",dialog_->contents());
+  outputBeamFile_ = new WLineEdit( (++param)->c_str(),dialog_->contents());
   new WBreak(dialog_->contents());
 
@@ -40,5 +49,9 @@
   envoi[++compteur] = mixedTools::intToString(nbParam);
   envoi[++compteur] = labelEdit_->text().toUTF8();
-  envoi[++compteur] = snapshotFile_->text().toUTF8();
+  envoi[++compteur] = programFile_->text().toUTF8();
+  envoi[++compteur] = inputBeamFile_->text().toUTF8();
+  envoi[++compteur] = outputBeamFile_->text().toUTF8();
+
+
   if ( compteur !=  (int)nbParam ) {
     cerr << " GWt_elementSnapshot::dialogDone() : pb dans le nb de parametres, compteur = " << compteur << " nbParam= " << nbParam << endl;
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_snapshot.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_snapshot.cc	(revision 442)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_snapshot.cc	(revision 442)
@@ -0,0 +1,68 @@
+
+#include "GWt_snapshot.h"
+#include "mixedTools.h"
+
+#include <Wt/WText>
+#include <Wt/WBreak>
+#include <Wt/WLineEdit>
+#include <Wt/WDialog>
+#include <Wt/WPushButton>
+
+GWt_snapshot::GWt_snapshot(GWt_elementLigneFaisceau* elemLigne, int num) : GWt_abstractElement(new elementSnapshot(num))
+{
+  elementLigneFaiseauContainer_ = elemLigne;
+  initialize();
+}
+
+void GWt_snapshot::initilializeDialog() 
+{
+  string* param = beginDialog();
+
+  new WText("name of user's program : ",dialog_->contents());
+  programFile_ = new WLineEdit(param->c_str(),dialog_->contents());
+  new WBreak(dialog_->contents());
+
+
+  new WText("name of input beam file, output from pspa : ",dialog_->contents());
+  inputBeamFile_ = new WLineEdit( (++param)->c_str(),dialog_->contents());
+  new WBreak(dialog_->contents());
+
+  new WText("name of output beam file (input for pspa) : ",dialog_->contents());
+  outputBeamFile_ = new WLineEdit( (++param)->c_str(),dialog_->contents());
+  new WBreak(dialog_->contents());
+
+  WPushButton *annule= new WPushButton("cancel",dialog_->contents()); 
+  annule->clicked().connect(dialog_,&Wt::WDialog::reject);
+  WPushButton *submit= new WPushButton("OK",dialog_->contents());
+  submit->clicked().connect(dialog_,&Wt::WDialog::accept);
+  dialog_->finished().connect(this, &GWt_snapshot::dialogDone);
+}
+
+void GWt_snapshot::dialogDone(WDialog::DialogCode code)
+{
+  if (code != Wt::WDialog::Accepted) return;
+  
+  unsigned nbParam = abstractElement_->getNbParams();
+  string* envoi = new string[nbParam+1];
+  int compteur = -1;
+  
+  envoi[++compteur] = mixedTools::intToString(nbParam);
+  envoi[++compteur] = labelEdit_->text().toUTF8();
+  envoi[++compteur] = programFile_->text().toUTF8();
+
+  envoi[++compteur] = inputBeamFile_->text().toUTF8();
+  envoi[++compteur] = outputBeamFile_->text().toUTF8();
+
+
+  if ( compteur !=  (int)nbParam ) {
+    cerr << " GWt_snapshot::dialogDone() : pb dans le nb de parametres, compteur = " << compteur << " nbParam= " << nbParam << endl;
+    return;
+  }
+
+  abstractElement_->setParametersString(envoi);
+  delete [] envoi;
+}
+
+WImage* GWt_snapshot::getImage() {
+  return image_;
+}
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 441)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 442)
@@ -279,4 +279,5 @@
 
 	  trivaluedBool tb = softToExec->doAcceptElement(elPtr->getNomdElement().getElementType());
+	  cout << " GWt_softwarePanel::areDataCoherent() el " << elPtr->getLabel() << " tb= " << tb << endl;
 	  if (tb  == TBoolOk ) {
 	    elPtr->setSoftware(softToExec);
