Changeset 386 in PSPA


Ignore:
Timestamp:
Mar 12, 2013, 1:54:41 PM (11 years ago)
Author:
lemeur
Message:

amélioration fiabilité graphique

Location:
Interface_Web/trunk/pspaWT
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/History

    r382 r386  
    55     PSPA - Plateforme de simulation en physique des accélérateurs
    66     =========================================================
     712 mars : Guy Le Meur
     8-softwareXXX : changé l'indexation ders éléments pour tenir compte des éléments ignorés par les softwares.
     9-dataManager : création d'une méthode getDiagnosticBeam(string elementLabel);
    710
    81111 Mars : Laurent Garnier
  • Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h

    r375 r386  
    44#include "globalParameters.h"
    55#include "particleBeam.h"
    6 
     6#include "nomDeLogiciel.h"
    77#include <iostream>
    88#include <string>
     
    1717 protected :
    1818
     19  unsigned numeroDeb_, numeroFin_;
    1920  globalParameters* globParamPtr_;
    2021  dataManager* dataManager_;
    2122  string inputFileName_;
    22 
     23  nomDeLogiciel nameOfSoftware_;
    2324  abstractSoftware();
    2425
    2526  bool launchJob(string commandLine, string& resul);
    26 
     27  bool initComputationLimits(unsigned int numeroDeb,unsigned int numeroFin);
     28  bool ComputationLimitsOk() const;
    2729 public :
    2830
     
    3032  ~abstractSoftware() {;}
    3133
     34  inline nomDeLogiciel getNomDeLogiciel() const {
     35    return nameOfSoftware_;
     36  }
     37
    3238  virtual bool createInputFile(particleBeam* beamBefore,unsigned int numeroDeb, unsigned int numeroFin, string workingDir) = 0;
    3339
    3440
    35   virtual bool  execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir) = 0;
     41  virtual bool  execute(string workingDir) = 0;
    3642
    37  virtual bool buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir) = 0;
     43 virtual bool buildBeamAfterElements(string workingDir) = 0;
    3844
    3945    /** Color of the background of this sofware
     
    4450    /** Name of this software
    4551     */
    46     virtual string getName() = 0;
     52    inline string getName() const {
     53      return nameOfSoftware_.getString();
     54    }
    4755
    4856};
  • Interface_Web/trunk/pspaWT/sources/controler/include/beam2Moments.h

    r257 r386  
    3636
    3737 // void readFromTransportOutput(ifstream& inp);
    38  void readFromTransportOutput(stringstream& inp);
     38 bool readFromTransportOutput(stringstream& inp);
    3939 string writeToTransportInput(double P0) const;
    4040
  • Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h

    r381 r386  
    2929   
    3030  particleBeam* getDiagnosticBeam(unsigned index);
    31    
     31  particleBeam* getDiagnosticBeam(string elementLabel);
     32
    3233  void addSectionToExecute(int debut, int fin, nomDeLogiciel prog);
    3334
     
    6465    bool restoreElements(string inputFileName);
    6566   
    66    
     67
     68    // si newBeam = true, on cree un nouveau diag
     69    // si newBeam = false, on utilise le dernier
     70    inline particleBeam* updateCurrentDiagnostic(bool newBeam) {
     71      if ( newBeam ) {
     72        diagnosticBeam_.push_back(particleBeam());
     73      }
     74      indexElementToIndexDiag_.push_back(diagnosticBeam_.size() -1);
     75      return &diagnosticBeam_.back();
     76    }
    6777
    6878   
     
    7383  unsigned firstComputedElemNumero_;
    7484  unsigned lastComputedElemNumero_;
     85
    7586    vector<particleBeam> diagnosticBeam_;
    76    
     87    vector<unsigned> indexElementToIndexDiag_;
     88    // numeroElementToIndexDiag_[k] contient, pour l'element d'index k, l'indice ind tel que diagnosticBeam_[ind]
     89    // soit le faisceau resultat, en l'etat qu'il doit avoir apres l'element k
     90
    7791    vector<sectionToExecute*> jobList_;
    7892   
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h

    r375 r386  
    2727
    2828
    29   virtual bool  execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir);
     29  virtual bool  execute(string workingDir);
    3030
    3131
    32   virtual bool buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir);
     32  virtual bool buildBeamAfterElements(string workingDir);
    3333
    3434    inline string getColor() {
     
    3636    }
    3737
    38     inline string getName() {
    39         return "generator";
    40     }
     38    /* inline string getName() const { */
     39    /*     return "generator"; */
     40    /* } */
    4141};
    4242
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareParmela.h

    r381 r386  
    99 protected :
    1010
     11
     12 
    1113  //    les elements de parmela sont indexes à partir du premier, il faut
    1214  // donc prevoir un offset pour le raccord a pspa
    13   unsigned offsetNumElem_;
    14   //  vector<unsigned> relativeParmelaElementNumbers_;
     15  //  unsigned offsetNumElem_;
     16
     17    vector<int> relativeParmelaElementIndices_;
    1518
    1619  bool beamFromParmela(string workingDir,unsigned numeroElement, double referencefrequency, vector<double>& centroid, bareParticle& refPart,vector<bareParticle>& particles );
    1720
    1821  bool beamToParmela(string workingDir, particleBeam* partic );
    19 
     22  void setRelativeParmelaElementIndices();
    2023 public :
    2124    softwareParmela();
     
    2831  virtual bool createInputFile(particleBeam* beamBefore, unsigned int numeroDeb, unsigned int numeroFin, string workingDir);
    2932
    30   virtual bool  execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir);
     33  virtual bool  execute(string workingDir);
    3134
    3235
    33 virtual bool buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir);
     36virtual bool buildBeamAfterElements(string workingDir);
    3437
    3538    inline string getColor() {
     
    3740    }
    3841
    39     inline string getName() {
    40         return "parmela";
    41     }
     42    /* inline string getName() const { */
     43    /*     return "parmela"; */
     44    /* } */
    4245
    4346};
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareTest.h

    r375 r386  
    2626
    2727
    28   virtual bool  execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir);
     28  virtual bool  execute(string workingDir);
    2929
    3030
    31   virtual bool buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir);
     31  virtual bool buildBeamAfterElements(string workingDir);
    3232
    3333  inline string getColor() {
     
    3535  }
    3636   
    37   inline string getName() {
    38         return "test";
    39     }
     37  /* inline string getName() const { */
     38  /*       return "test"; */
     39  /*   } */
    4040
    4141};
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareTransport.h

    r375 r386  
    1818  virtual bool createInputFile( particleBeam* beamBefore,unsigned int numeroDeb, unsigned int numeroFin, string workingDir);
    1919
    20   virtual bool  execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir);
     20  virtual bool  execute(string workingDir);
    2121
    2222
    23 virtual bool buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir);
     23virtual bool buildBeamAfterElements(string workingDir);
    2424
    2525    inline string getColor() {
     
    2727    }
    2828   
    29     inline string getName() {
    30         return "transport";
    31     }
     29    /* inline string getName() const { */
     30    /*     return "transport"; */
     31    /* } */
    3232
    3333};
  • Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc

    r342 r386  
    66  globParamPtr_ = NULL;
    77  dataManager_ = NULL;
     8  nameOfSoftware_ = nomDeLogiciel("unknownSoftware");
    89}
    910
     
    1213  globParamPtr_ = globals;
    1314  dataManager_ = dt;
     15  numeroDeb_ = 0;
     16  numeroFin_ = 0;
     17  nameOfSoftware_ = nomDeLogiciel("unknownSoftware");
    1418}
    1519
     20bool abstractSoftware::initComputationLimits(unsigned int numeroDeb,unsigned int numeroFin) {
     21  numeroDeb_ = numeroDeb;
     22  numeroFin_ = numeroFin;
     23  return ComputationLimitsOk();
     24}
     25
     26bool abstractSoftware::ComputationLimitsOk() const {
     27  if (   numeroDeb_ < 1 ||  numeroFin_ < 1 || numeroDeb_ > dataManager_->getBeamLineSize() || numeroFin_ > dataManager_->getBeamLineSize() ) {
     28  dataManager_->consoleMessage(" abstractSoftware::initComputationLimit : numero of element out of limits in software " + getName() );
     29    return false;
     30  } else {
     31    return true;
     32  }
     33}
    1634
    1735bool abstractSoftware::launchJob(string commandLine, string& resul)
  • Interface_Web/trunk/pspaWT/sources/controler/src/beam2Moments.cc

    r355 r386  
    7878
    7979// suppose qu'on est bien positionné dans le stream (a revoir)
    80 void beam2Moments::readFromTransportOutput(stringstream& inp) {
     80bool beam2Moments::readFromTransportOutput(stringstream& inp) {
    8181  string bidString, bidString1, bidString2;
    8282  double bidon, bidon1, bidon2;
     
    8787  string buf;
    8888  // sauter les eventuels 'VARY'
     89
     90  string varied = "VARIED:";
     91  // while ( varied == "VARIED:" ) {
     92  //   getline(inp, buf);
     93  //   cout << " beam2Moments::readFromTransportOutput ligne lue : " << buf << endl;
     94  //   stringstream str(buf);
     95  //   str >> varied;
     96  // }
     97
     98  string testVary;
    8999  while ( notFound ) {
    90100    getline(inp, buf);
    91     stringstream str(buf);       
     101    //    cout << " beam2Moments::readFromTransportOutput ligne lue : " << buf << endl;
     102    stringstream str(buf);
    92103    if ( str >> bidon1 >>  bidString1 >>  bidon2 >>  ( rij_secondOrderMoments_.at(0) ).at(0) >> bidString2 )  {
    93        notFound = false;
    94     }
    95   }
    96   //     test = inp >> bidon >>  bidString >>  bidon >>  ( rij_secondOrderMoments_.at(0) ).at(0) >> bidString;
    97   //   cout << " beam2Moments::readFromTransportOutput TEST= " << test << endl;
    98   //  }
    99   inp >> bidon >> ( rij_secondOrderMoments_.at(1) ).at(1) >>  bidString >> ( rij_secondOrderMoments_.at(1) ).at(0);
    100   inp >> bidon >> ( rij_secondOrderMoments_.at(2) ).at(2) >>  bidString >> ( rij_secondOrderMoments_.at(2) ).at(0)  >> ( rij_secondOrderMoments_.at(2) ).at(1);
    101   inp >> bidon >> ( rij_secondOrderMoments_.at(3) ).at(3) >>  bidString >> ( rij_secondOrderMoments_.at(3) ).at(0)  >> ( rij_secondOrderMoments_.at(3) ).at(1) >> ( rij_secondOrderMoments_.at(3) ).at(2);
    102    
    103   inp >> bidon >> ( rij_secondOrderMoments_.at(4) ).at(4) >>  bidString >> ( rij_secondOrderMoments_.at(4) ).at(0)  >> ( rij_secondOrderMoments_.at(4) ).at(1) >> ( rij_secondOrderMoments_.at(4) ).at(2) >> ( rij_secondOrderMoments_.at(4) ).at(3);
    104    
    105   inp >> bidon >> ( rij_secondOrderMoments_.at(5) ).at(5) >>  bidString >> ( rij_secondOrderMoments_.at(5) ).at(0)  >> ( rij_secondOrderMoments_.at(5) ).at(1) >> ( rij_secondOrderMoments_.at(5) ).at(2) >> ( rij_secondOrderMoments_.at(5) ).at(3) >> ( rij_secondOrderMoments_.at(5) ).at(4);
    106    
     104      // le format semble correct
     105      if ( bidString1 != "M" ) {
     106        // c'est bien ce qu'on attend : la longuer en metres
     107        cout << " beam2Moments::readFromTransportOutput ON N'A PAS 'M' ligne lue : " << buf << endl;
     108        notFound = true;
     109        break;
     110      } else {
     111        // on a trouve la bonne ligne
     112        cout << " beam2Moments::readFromTransportOutput lecture OK :  ligne lue : " << buf << endl;
     113        notFound = false;
     114      }
     115    } else {
     116      // la ligne lue n'est pas au format
     117      cout << "  beam2Moments::readFromTransportOutput format non conforme ligne lue : " << buf << endl;
     118      stringstream test(buf);
     119      if ( test >> testVary ) {
     120        if ( testVary == varied ) {
     121          // ca peut arriver... on continue
     122          cout << "  beam2Moments::readFromTransportOutput VARIED RENCONTRE ligne lue : " << buf << endl;
     123          notFound = true;
     124        } else {
     125          // on essaie de voir ce qui se passe (ce sera probablement a completer)
     126          if ( testVary == "(" ) {
     127          // on est trop loin, on est sur l'element suivant, on arrete
     128          cout << "  beam2Moments::readFromTransportOutput ON EST TOMBE SUR ELEMNT SUIVANT ligne lue : " << buf << endl;
     129            notFound = true;
     130            break;
     131          }
     132          if ( testVary == "0" ) {
     133            // on doit etre a la fin du fichier, ce qu'on verifie
     134            if ( test >> bidString ) {
     135              if ( bidString == "*LENGTH*" ) {
     136                // c'est bien ca, on arrete
     137                cout << "  beam2Moments::readFromTransportOutput ON EST A LA FIN DU FICHIER ligne lue : " << buf << endl;
     138                notFound = true;
     139                break;
     140              } else {
     141                // on n'y comprend plus grans chose, on arrete de toute facon
     142                cout << "  beam2Moments::readFromTransportOutput SITUATION NON PREVUE 1 ligne lue : " << buf << endl;
     143                notFound = true;
     144                break;
     145              }                // fin test lecture d'une chaine de caracteres
     146            } else {
     147              // on n'a pas pu lire la chaine, on n'y comprend rien, on arrete
     148                cout << "  beam2Moments::readFromTransportOutput SITUATION NON PREVUE 2 ligne lue : " << buf << endl;
     149                notFound = true;
     150                break;
     151            }
     152          } else {
     153            // le premier element lu n'est pas 0, on n'est pas a la fin
     154            // mais il n'y a pas de faisceau a cet endroit, sortie normale
     155                cout << "  beam2Moments::readFromTransportOutput SORTIE NORMALE ligne lue : " << buf << endl;
     156            notFound = true;
     157            break;
     158          }
     159          // si on arrive la, on est en pleine panade
     160                cout << "  beam2Moments::readFromTransportOutput SITUATION NON PREVUE 4 ligne lue : " << buf << endl;
     161            notFound = true;
     162            break;
     163        }
     164      } else {
     165        // on n'a pas pu lire le premier element de la ligne (bizarre)
     166                cout << "  beam2Moments::readFromTransportOutput SITUATION NON PREVUE 5 ligne lue : " << buf << endl;
     167        notFound = true;
     168        break;
     169      }
     170    }
     171  } // fin de boucle sur les lignes
     172
     173  if ( notFound ) return false;
     174
     175
     176  if ( ! ( inp >> bidon >> ( rij_secondOrderMoments_.at(1) ).at(1) >>  bidString >> ( rij_secondOrderMoments_.at(1) ).at(0) ) ) return false;
     177  if ( ! (inp >> bidon >> ( rij_secondOrderMoments_.at(2) ).at(2) >>  bidString >> ( rij_secondOrderMoments_.at(2) ).at(0)  >> ( rij_secondOrderMoments_.at(2) ).at(1) ) ) return false;
     178  if ( ! (inp >> bidon >> ( rij_secondOrderMoments_.at(3) ).at(3) >>  bidString >> ( rij_secondOrderMoments_.at(3) ).at(0)  >> ( rij_secondOrderMoments_.at(3) ).at(1) >> ( rij_secondOrderMoments_.at(3) ).at(2) ) ) return false;
     179   
     180  if ( ! ( inp >> bidon >> ( rij_secondOrderMoments_.at(4) ).at(4) >>  bidString >> ( rij_secondOrderMoments_.at(4) ).at(0)  >> ( rij_secondOrderMoments_.at(4) ).at(1) >> ( rij_secondOrderMoments_.at(4) ).at(2) >> ( rij_secondOrderMoments_.at(4) ).at(3) ) ) return false;
     181   
     182  if ( ! (inp >> bidon >> ( rij_secondOrderMoments_.at(5) ).at(5) >>  bidString >> ( rij_secondOrderMoments_.at(5) ).at(0)  >> ( rij_secondOrderMoments_.at(5) ).at(1) >> ( rij_secondOrderMoments_.at(5) ).at(2) >> ( rij_secondOrderMoments_.at(5) ).at(3) >> ( rij_secondOrderMoments_.at(5) ).at(4) ) ) return false;
     183
     184  return true;   
    107185}
    108186
  • Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc

    r381 r386  
    9898  removeFile(workingDir + "generator.output");
    9999  diagnosticBeam_.clear();
     100  indexElementToIndexDiag_.clear();
    100101  currentBeam_ = NULL;
    101102  firstComputedElemNumero_ = getBeamLineSize();
     
    136137      success = softw->createInputFile(currentBeam_,debut,fin,workingDir);
    137138      if ( success ) {
    138         success = softw->execute(debut,fin,workingDir);
     139        success = softw->execute(workingDir);
    139140        if ( success ) {
    140           success = softw->buildBeamAfterElements(debut,fin,diagnosticBeam_,workingDir);
     141          success = softw->buildBeamAfterElements(workingDir);
    141142        }
    142143      }
     
    144145      delete softw;
    145146      if ( success ) {
    146         currentBeam_ = &diagnosticBeam_.back();
     147        currentBeam_ = &diagnosticBeam_.at(indexElementToIndexDiag_.back());
    147148        cout << " execute termine avec succes " << endl;
    148149      } else {
     
    251252particleBeam* dataManager::getDiagnosticBeam(unsigned index)
    252253{
    253     if (index >= diagnosticBeam_.size()) {
    254         return NULL;
    255     } else {
    256         return &diagnosticBeam_.at(index);
    257     }
    258 }
    259 
     254  if (index >= indexElementToIndexDiag_.size() ) {
     255    return NULL;
     256  } else {
     257    int indDiag = indexElementToIndexDiag_.at(index);
     258    return &diagnosticBeam_.at(indDiag);
     259  }
     260}
     261
     262particleBeam* dataManager::getDiagnosticBeam(string elementLabel)
     263{
     264  return getDiagnosticBeam( getNumeroFromElementLabel(elementLabel) -1);
     265}
    260266
    261267
     
    277283    for (unsigned k = firstComputedElemNumero_ -1 ; k < lastComputedElemNumero_ ; k++) {
    278284      abstractElement* elPtr = pspa_->getBeamLine()->getAbstractElement(k);
    279            if(elPtr->getNomdElement().getElementType() == snapshot) continue;
     285      //     if(elPtr->getNomdElement().getElementType() == snapshot) continue;
    280286      //      if(elPtr->getNomdElement().getElementType() == fit) continue;
    281 
    282       if ( !diagnosticBeam_.at(i).momentRepresentationOk() ) {
    283         diagnosticBeam_.at(i).buildMomentRepresentation();
     287      particleBeam* beamToDraw = getDiagnosticBeam(i);
     288      if ( !beamToDraw->momentRepresentationOk() ) {
     289        beamToDraw->buildMomentRepresentation();
    284290      }
    285291
    286292      longueur += elPtr->getLenghtOfElement();
    287       valeur = diagnosticBeam_.at(i).getXmaxRms();
     293      valeur = beamToDraw->getXmaxRms();
    288294      cout << " dataManager::donneesRmsEnveloppe index = " << k <<  " longueur = " << longueur << " enveloppe : " << valeur << endl;
    289295      xcor.push_back(0.01*longueur);  // on passe en metres
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc

    r359 r386  
    88
    99softwareGenerator::softwareGenerator() : abstractSoftware()
    10 {;}
     10{
     11  nameOfSoftware_ = nomDeLogiciel("generator");
     12}
    1113
    1214softwareGenerator::softwareGenerator(string inputFileName, globalParameters* globals, dataManager* dt) : abstractSoftware(inputFileName, globals, dt)
    13 {;}
     15{
     16  nameOfSoftware_ = nomDeLogiciel("generator");
     17}
    1418
    1519bool softwareGenerator::createInputFile(particleBeam* beamBefore, unsigned int numeroDeb, unsigned int numeroFin, string workingDir)
    1620{
    17   if ( numeroDeb != numeroFin ) return false;
     21  if ( !initComputationLimits(numeroDeb,numeroFin) ) return false;
     22
     23  if ( numeroDeb_ != numeroFin_ ) return false;
    1824
    1925  abstractElement* elPtr;
    20   elPtr = dataManager_->getElementPointerFromNumero(numeroDeb);
     26  elPtr = dataManager_->getElementPointerFromNumero(numeroDeb_);
    2127
    2228  if ( elPtr->getNomdElement().getElementType() != RFgun ) {
     
    4652}
    4753
    48 bool softwareGenerator::execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir) {
     54bool softwareGenerator::execute(string workingDir) {
    4955 
    5056  bool ExecuteStatus = true;
    5157 
    5258  ostringstream sortie;
    53   sortie << " EXECUTION DE GENERATOR DE l'ELEMENT " << numeroDeb << " A L'ELEMENT " << numeroFin << endl;
     59  sortie << " EXECUTION DE GENERATOR DE l'ELEMENT " << numeroDeb_ << " A L'ELEMENT " << numeroFin_ << endl;
    5460
    5561  string generatorJob = workingDir + "generator";
     
    8389}
    8490
    85 bool  softwareGenerator::buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir) {
     91bool  softwareGenerator::buildBeamAfterElements( string workingDir) {
    8692
    8793  bool result = true;
    88   if ( numeroDeb != numeroFin ) {
     94  if ( !ComputationLimitsOk() ) return false;
     95
     96  if ( numeroDeb_ != numeroFin_ ) {
    8997    dataManager_->consoleMessage(" softwareGenerator::buildBeamAfterElements : only one element (rfgun) must be calculated " );
    9098    return false;
    9199  }
    92 
    93   beams.push_back(particleBeam());
     100  // on initialise une nouvelle sortie diagnostic
     101  particleBeam* newDiag = dataManager_->updateCurrentDiagnostic(true);
     102
     103  //  beams.push_back(particleBeam());
    94104  vector<double> centroid;
    95105  bareParticle refPart;
     
    97107  vector<bareParticle> particlesPassives; // on ne fait rien de ces particules pour l'instant
    98108  if (beamFromGenerator(string("faisceau.ini"),workingDir, centroid, refPart,particles, particlesPassives )) {
    99     beams.back().setWithParticles(centroid, refPart,particles);
     109    newDiag->setWithParticles(centroid, refPart,particles);
    100110  } else {
    101111    dataManager_->consoleMessage(" softwareGenerator::buildBeamAfterElements : error  " );
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc

    r381 r386  
    66#include "dataManager.h"
    77#include "mixedTools.h"
    8 
     8//#include "nomDeLogiciel.h"
    99softwareParmela::softwareParmela() : abstractSoftware()
    10 {;}
     10{
     11  nameOfSoftware_ = nomDeLogiciel("parmela");
     12}
    1113
    1214softwareParmela::softwareParmela(string inputFileName, globalParameters* globals, dataManager* dt) : abstractSoftware(inputFileName, globals, dt)
    13 {;}
     15{
     16  nameOfSoftware_ = nomDeLogiciel("parmela");
     17}
     18
     19void softwareParmela::setRelativeParmelaElementIndices() {
     20  relativeParmelaElementIndices_.clear();
     21  relativeParmelaElementIndices_.resize(numeroFin_ - numeroDeb_ + 1, -1);
     22  cout << " setRelativeParmelaElementIndices() taille a priori : " << relativeParmelaElementIndices_.size() << endl;
     23  abstractElement* elPtr = dataManager_->getElementPointerFromNumero(numeroDeb_);
     24  bool there_is_rfgun = ( elPtr->getNomdElement().getElementType() == RFgun );
     25  unsigned offsetNumElem;
     26  // les elements de parmela sont indexes de 1 à max, s'il n'y a pas de rfgun
     27  if ( !there_is_rfgun ) {
     28    offsetNumElem = numeroDeb_ -1;
     29    // les elements de parmela sont indexes de 0 à max, s'il y a un rfgun
     30  } else {
     31    offsetNumElem = numeroDeb_;
     32  }
     33
     34  // index du premier element de parmela
     35  int id= numeroDeb_ - offsetNumElem;
     36  unsigned k;
     37  unsigned curseur = 0;
     38  for ( k=numeroDeb_; k <= numeroFin_ ; k++ ) {
     39    abstractElement* elem = dataManager_->getElementPointerFromNumero(k);
     40    cout << " liste PARMELA no absolu " << k << " relatif provisoire " << relativeParmelaElementIndices_.at(curseur) << endl;
     41    if ( elem->is_accepted_by_software(nameOfSoftware_) == TBoolOk ) {
     42      relativeParmelaElementIndices_.at(curseur) = id;
     43      cout << " mis a " << id << endl;
     44      id++;
     45    }
     46    curseur++;
     47  }
     48}
     49
    1450
    1551bool softwareParmela::createInputFile(particleBeam* beamBefore,unsigned int numeroDeb,unsigned int numeroFin,string workingDir)
    1652{
    1753  unsigned int k;
    18    
    19   if ( numeroDeb < 1 || numeroFin > dataManager_->getBeamLineSize() ) {
    20     dataManager_->consoleMessage(" softwareParmela::createInputFile : numero of element out of limits " );
    21     cerr << " numero of element out of limits " << endl;
    22     return false;
    23   }
    24    
     54  if ( !initComputationLimits(numeroDeb,numeroFin) ) return false;
     55  setRelativeParmelaElementIndices();
    2556  string name = workingDir + inputFileName_;
    2657  ofstream outfile;
     
    3465  abstractElement* elPtr;
    3566  double initalKineticEnergy = 0.0;
    36   elPtr = dataManager_->getElementPointerFromNumero(numeroDeb);
     67  elPtr = dataManager_->getElementPointerFromNumero(numeroDeb_);
    3768  bool there_is_rfgun = ( elPtr->getNomdElement().getElementType() == RFgun );
    3869 
     
    4273    initalKineticEnergy = beamBefore->referenceKineticEnergyMeV();
    4374    // les elements de parmela sont indexes de 1 à max, s'il n'y a pas de rfgun
    44     offsetNumElem_ = numeroDeb -1;
     75    //    offsetNumElem_ = numeroDeb_ -1;
    4576  } else {
    4677    elPtr->setPhaseStep( globParamPtr_->getIntegrationStep() );
    4778    initalKineticEnergy = elPtr->getInitialKineticEnergy();
    4879    // les elements de parmela sont indexes de 0 à max, s'il y a un rfgun
    49     offsetNumElem_ = numeroDeb;
     80    //    offsetNumElem_ = numeroDeb_;
    5081  }
    5182 
     
    5485  outfile << "RUN /n0=1 /ip=999 /freq=" << globParamPtr_->getFrequency() << "  /z0=0.0 /W0=" << initalKineticEnergy << "  /itype=1" << endl;
    5586  outfile << "OUTPUT 0" << endl;
    56   unsigned int premier = numeroDeb ;
     87  unsigned int premier = numeroDeb_ ;
    5788  if ( there_is_rfgun ) {
    58     outfile << dataManager_->getElementPointerFromNumero(numeroDeb)->parmelaOutputFlow() << endl;
     89    outfile << dataManager_->getElementPointerFromNumero(numeroDeb_)->parmelaOutputFlow() << endl;
    5990    premier++;
    6091  } else {
     
    6394 
    6495  // commentaire :  si l'element est un snapshot ne rien ecrire dans inputFileName_ (= parmin) un saut de ligne perturbe l'execution de parmela
    65   for ( k = premier; k <= numeroFin; k++)
     96  for ( k = premier; k <= numeroFin_; k++)
    6697    {
    6798      elPtr = dataManager_->getElementPointerFromNumero(k);
     
    80111}
    81112
    82 bool softwareParmela::execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir)
     113bool softwareParmela::execute(string workingDir)
    83114{
    84115  bool ExecuteStatus = true;
    85116 
    86117  ostringstream sortie;
    87   sortie << " EXECUTION DE PARMELA DE l'ELEMENT " << numeroDeb << " A L'ELEMENT " << numeroFin << endl;
     118  sortie << " EXECUTION DE PARMELA DE l'ELEMENT " << numeroDeb_ << " A L'ELEMENT " << numeroFin_ << endl;
    88119   
    89120  string parmelaJob = workingDir + "parmela";
     
    114145
    115146
    116 bool softwareParmela::buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir)
     147bool softwareParmela::buildBeamAfterElements( string workingDir)
    117148{
    118149  bool result = true;
    119   //cout << "debug:: debut " << numeroDeb << ", fin " << numeroFin << endl;
    120  
    121   // index du premier element de parmela
    122   int id= numeroDeb-offsetNumElem_;
    123  
    124   for(unsigned k = numeroDeb; k <= numeroFin; k++)
     150
     151  if ( !ComputationLimitsOk() ) return false;
     152  unsigned curseur;
     153  for(unsigned k = numeroDeb_; k <= numeroFin_; k++)
    125154    {
    126155      abstractElement* elem = dataManager_->getElementPointerFromNumero(k);
    127    
    128       // si l'element est un snapshot, recuperer la sortie precedente
    129       if(elem->getNomdElement().getElementType() == snapshot) {
    130         int avantDernier = beams.size() - 1;
    131         string* param = elem->getParametersString();
    132         string cliche = workingDir + param[2].c_str();
    133         if( beamToParmela(cliche,&beams.at(avantDernier)) ) {
    134           cout  <<  "["  <<  k  <<  "] : ecrit sur fichier " << cliche << " le contenu de beam["<<avantDernier<<"]"<<endl;
     156      if ( elem == NULL ) {
     157        dataManager_->consoleMessage(" softwareParmela::buildBeamAfterElements : null pointer on element " );
     158        return  false;       
     159      }
     160
     161      curseur = k - numeroDeb_;
     162
     163      if ( relativeParmelaElementIndices_.at(curseur) < 0 ) {
     164
     165        // si l'element doit etre ignore de parmela, on renvoie sur le diag precedent
     166        particleBeam* lastDiag = dataManager_->updateCurrentDiagnostic(false);
     167
     168        if(elem->getNomdElement().getElementType() == snapshot) {
     169          // si cet element est un snapshot, on organise la sortie correspondante
     170          string* param = elem->getParametersString();
     171          string cliche = workingDir + param[2].c_str();
     172          if( beamToParmela(cliche,lastDiag) ) {
     173              //            cout  <<  "["  <<  k  <<  "] : ecrit sur fichier " << cliche << " le contenu de beam["<<avantDernier<<"]"<<endl;
     174            cout  <<  "["  <<  k  <<  "] : ecrit sur fichier " << cliche << " le contenu de beam[ ]"<<endl;
     175          }
    135176        }
    136         // continue;
    137       }
    138      
    139       // sinon c'est un element de parmela d'index id
    140       beams.push_back(particleBeam());
    141       cout << " creation diagn. no " << beams.size() << " par PARMELA " << endl;
    142 
    143       vector<double> centroid;
    144       bareParticle refPart;
    145       vector<bareParticle> particles;
    146       double freq= globParamPtr_->getFrequency();
    147      
    148       cout << " lecture PARMELA el no absolu " << k << " nom " << elem->getNomdElement().getElementName() << endl;
    149       if(!beamFromParmela(workingDir,id,freq,centroid,refPart,particles))
    150         {
    151           if(elem->is_accepted_by_software(nomDeLogiciel::parmela) == TBoolIgnore) {
    152             int avantDernier = beams.size() -2;
    153             beams.back() = beams.at(avantDernier);
     177        // si le numero est reconnu de parmela
     178      } else {
     179       
     180        // on initialise une nouvelle sortie diagnostic
     181          particleBeam* newDiag = dataManager_->updateCurrentDiagnostic(true);
     182          vector<double> centroid;
     183          bareParticle refPart;
     184          vector<bareParticle> particles;
     185          double freq= globParamPtr_->getFrequency();
     186          unsigned numeroParmel;
     187          numeroParmel = (unsigned)relativeParmelaElementIndices_.at(curseur);
     188          cout << " lecture PARMELA el no absolu " << k << " numero relatif " << numeroParmel << " nom " << elem->getNomdElement().getElementName() << endl;
     189        // lecture sortie parmela
     190        if(!beamFromParmela(workingDir,numeroParmel,freq,centroid,refPart,particles))
     191          {
     192            // si echec, fin
     193            dataManager_->consoleMessage(" softwareParmela::buildBeamAfterElements : failure in reading parmela result for element " + elem->getLabel() + " for unknown reason " );
     194            return  false;
    154195          } else {
    155             dataManager_->consoleMessage("softwareParmela::buildBeamAfterElements : reading parmdesz failed");
    156             result = false;
    157             break;
    158           }
    159          
    160         } else {
    161         beams.back().setWithParticles(centroid,refPart,particles);
    162       }
    163      
    164       // l'element de parmela suivant
    165       id++;
    166     }
    167  
     196          // si succes, on complete le diagnostic
     197          newDiag->setWithParticles(centroid,refPart,particles);
     198        }
     199      }
     200    }
    168201  return result;
    169202}
    170 
    171203bool softwareParmela::beamFromParmela(string workingDir,unsigned numeroParmel, double referencefrequency, vector<double>& centroid, bareParticle& refPart,vector<bareParticle>& particles )
    172204{   
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareTest.cc

    r333 r386  
    88softwareTest::softwareTest() : abstractSoftware()
    99{
    10   ;
     10  nameOfSoftware_ = nomDeLogiciel("test");
    1111}
    1212
     
    1616softwareTest::softwareTest(string inputFileName, globalParameters* globals, dataManager* dt) : abstractSoftware( inputFileName, globals, dt)
    1717{
    18   ;
     18  nameOfSoftware_ = nomDeLogiciel("test");
    1919}
    2020
     
    3030}
    3131
    32 bool  softwareTest::execute( unsigned int numeroDeb,unsigned int numeroFin,string workingDir) {
     32bool  softwareTest::execute(string workingDir) {
    3333    dataManager_->consoleMessage(" softwareTest::execute  " );
    3434  return true;
    3535}
    3636
    37 bool  softwareTest::buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir) {
     37bool  softwareTest::buildBeamAfterElements(string workingDir) {
    3838  dataManager_->consoleMessage(" softwareTest::buildBeamAfterElements  " );
    3939  bool result = true;
    4040  unsigned k;
    41   for ( k= numeroDeb; k <= numeroFin; k++)
     41  for ( k= numeroDeb_; k <= numeroFin_; k++)
    4242    {
    43       beams.push_back(particleBeam());
     43      particleBeam* newDiag = dataManager_->updateCurrentDiagnostic(true);
     44  //      beams.push_back(particleBeam());
    4445      vector<double> centroid = vector<double>(6,0.0);
    4546      bareParticle refPart;
     
    5556      else {
    5657        bareParticle refPart (particles.at(0));
    57         beams.back().setWithParticles(centroid, refPart,particles);
     58        newDiag->setWithParticles(centroid, refPart,particles);
    5859      }
    5960    }
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareTransport.cc

    r381 r386  
    77
    88softwareTransport::softwareTransport() : abstractSoftware()
    9 {;}
     9{
     10  nameOfSoftware_ = nomDeLogiciel("transport");
     11}
    1012
    1113softwareTransport::softwareTransport(string inputFileName,globalParameters* globals, dataManager* dt) : abstractSoftware(inputFileName, globals, dt)
    12 {;}
     14{
     15  nameOfSoftware_ = nomDeLogiciel("transport");
     16}
    1317
    1418bool softwareTransport::createInputFile(particleBeam* beamBefore, unsigned int numeroDeb, unsigned int numeroFin, string workingDir)
    1519{
    16   if ( numeroDeb < 1 || numeroFin > dataManager_->getBeamLineSize() ) {
    17     dataManager_->consoleMessage(" softwareTransport::createInputFile : numero of element out of limits " );
    18     cerr << " numero of element out of limits " << endl;
    19     return false;
    20   }
     20
     21  if ( !initComputationLimits(numeroDeb,numeroFin) ) return false;
    2122
    2223  abstractElement* premierEl = NULL;
    23   premierEl = dataManager_->getElementPointerFromNumero(numeroDeb);
     24  premierEl = dataManager_->getElementPointerFromNumero(numeroDeb_);
    2425
    2526  // ceinture et bretelles
     
    7980
    8081  abstractElement* elPtr;
    81   for (unsigned k = numeroDeb; k <= numeroFin; k++)
     82  for (unsigned k = numeroDeb_; k <= numeroFin_; k++)
    8283    {
    8384      elPtr = dataManager_->getElementPointerFromNumero(k);
    8485      cout << "debug:: element [" << k << "] " << elPtr->getNomdElement().getElementName() << endl;
    85       if(elPtr->getNomdElement().getElementType() == snapshot) continue;
    8686      outfile << elPtr->transportOutputFlow() << endl;
    8787    }
     
    9595}
    9696
    97 bool softwareTransport::execute( unsigned int numeroDeb, unsigned int numeroFin, string workingDir)
     97bool softwareTransport::execute(string workingDir)
    9898{
    9999  bool ExecuteStatus = true;
    100100
    101101  ostringstream sortie;
    102   sortie << " EXECUTION DE TRANSPORT DE " << numeroDeb << " a " << numeroFin << endl;
     102  sortie << " EXECUTION DE TRANSPORT DE " << numeroDeb_ << " a " << numeroFin_ << endl;
    103103 
    104104  string transportJob = workingDir + "transport";
     
    132132}
    133133
    134 bool softwareTransport::buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams,string workingDir)
     134bool softwareTransport::buildBeamAfterElements(string workingDir)
    135135{
    136136
    137137  bool result = true;
    138  
    139   for (unsigned k = numeroDeb; k <= numeroFin; k++)
     138  if ( !ComputationLimitsOk() ) return false;
     139
     140  for (unsigned k = numeroDeb_; k <= numeroFin_; k++)
    140141    {
    141142      abstractElement* ptr = dataManager_->getElementPointerFromNumero(k);
     
    143144        dataManager_->consoleMessage(" softwareTransport::buildBeamAfterElements : null pointer on element " );
    144145        cout << " softwareTransport::buildBeamAfterElements : null pointer on element " << endl;
    145         result = false;
    146         break;       
    147       }
    148 
     146        return false;         
     147      }
     148
     149
     150      if ( ptr->is_accepted_by_software(nameOfSoftware_) != TBoolOk ) {
     151        // si l'element doit etre ignore, on renvoie sur le diag precedent
     152        dataManager_->updateCurrentDiagnostic(false);
    149153      // si l'element est un snapshot, recuperer la sortie precedente
    150       if(ptr->getNomdElement().getElementType() == snapshot) {
    151         int avantDernier = beams.size() - 1;
    152         string* param = ptr->getParametersString();
    153         string cliche = workingDir + param[2].c_str();
    154          cout<<"["<<k<<"] : ecrit sur fichier " << cliche << " le contenu de beam["<<avantDernier<<"]"<<endl;
    155          //      continue;
    156       }
    157 
    158       beams.push_back(particleBeam());
    159       cout << " creation diagn. no " << beams.size() << " par TRANSPORT " << endl;
    160       string elemLabel = ptr->getLabel();
    161       beam2Moments transpMoments;
    162      
    163       if (!moments2FromTransport(workingDir,elemLabel,ptr->getNomdElement(),transpMoments) )
    164         {
    165           dataManager_->consoleMessage(" softwareTransport::buildBeamAfterElements : failure in reading moments " );
    166           cout << " softwareTransport::buildBeamAfterElements plantage dans lecture moments " << endl;
    167           result = false;
    168           break;
    169         }
    170       beams.back().set2Moments(transpMoments);
     154        if(ptr->getNomdElement().getElementType() == snapshot) {
     155          string* param = ptr->getParametersString();
     156          string cliche = workingDir + param[2].c_str();
     157          cout<<"["<<k<<"] : ecrit sur fichier " << cliche << " le contenu de beam[ ]"<<endl;
     158        }
     159      } else {
     160        // si le numero est reconnu de transport
     161
     162
     163
     164        string elemLabel = ptr->getLabel();
     165        beam2Moments transpMoments;
     166        // lecture sortie transport
     167        if (!moments2FromTransport(workingDir,elemLabel,ptr->getNomdElement(),transpMoments) )
     168          {
     169            // si echec, on renvoie sur le diag precedent
     170            dataManager_->updateCurrentDiagnostic(false);
     171
     172            dataManager_->consoleMessage(" softwareTransport::buildBeamAfterElements : element skipped in reading moments from transport output :  " + elemLabel);
     173            //   cout << " softwareTransport::buildBeamAfterElements plantage dans lecture moments " << endl;
     174            return true;
     175          } else {
     176          // si succes,
     177        // on initialise une nouvelle sortie diagnostic
     178          particleBeam* newDiag = dataManager_->updateCurrentDiagnostic(true);
     179        // et on la complete
     180          newDiag->set2Moments(transpMoments);
     181        }
     182      }
    171183    }
    172184  return result;
    173185}
    174 
    175186bool softwareTransport::moments2FromTransport(string workingDir,string elLab,const nomdElements elem,beam2Moments& moments) const
    176187{
     
    226237  }
    227238
    228   moments.readFromTransportOutput(fichierStream);
    229   return true;
    230 }
     239  return moments.readFromTransportOutput(fichierStream);
     240}
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h

    r381 r386  
    8787
    8888 //  void setModelComponentForPhaseSpace(WStandardItemModel* model, vector<bareParticle>& partic, unsigned indexParticleComponent, unsigned modelComponent);
    89 void faireDessinParmela(WContainerWidget* toto, particleBeam* beam, string namex, string namey  );
    90   void faireDessinTransport(WContainerWidget* toto, particleBeam* beam, string namex, string namey);
     89  //void faireDessinParmela(WContainerWidget* toto, particleBeam* beam, string namex, string namey  );
     90  //  void faireDessinTransport(WContainerWidget* toto, particleBeam* beam, string namex, string namey);
    9191  void faireDessinEnveloppe(WContainerWidget* toto, string type);
    9292  //  void scatterPlot1D(WContainerWidget* toto, vector<double>& xcor, vector<double>& ycor);
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc

    r381 r386  
    500500  for(int i = 1; i <= nombre; i++) {
    501501    abstractElement* elPtr = dtmanage_->getElementPointerFromNumero(i);
    502     if(elPtr->getNomdElement().getElementType() == snapshot) continue;
     502    //    if(elPtr->getNomdElement().getElementType() == snapshot) continue;
    503503
    504504    choixElementDessin_->addItem(elPtr->getLabel());
     
    511511   
    512512  int typeFaisceau = choixTypeDessinFaisceau_->currentIndex();
    513   int index = choixElementDessin_->currentIndex();
     513  //  int index = choixElementDessin_->currentIndex();
    514514  string nameAbs = choixAbsPhase_->currentText().toUTF8();
    515515  string nameOrd = choixOrdPhase_->currentText().toUTF8();
     
    519519        return;
    520520  }
    521 
    522   particleBeam* beam = dtmanage_->getDiagnosticBeam(index);
     521  string elementLabel = choixElementDessin_->currentText().toUTF8();
     522  particleBeam* beam = dtmanage_->getDiagnosticBeam(elementLabel);
     523  //  particleBeam* beam = dtmanage_->getDiagnosticBeam(index);
    523524   
    524525  if ( beam == NULL ) {
     
    626627
    627628
    628 void PspaApplication::faireDessinParmela(WContainerWidget* toto, particleBeam* beam, string namex, string namey )
    629 {
    630   cout << " faireDessinParmela " << endl;
    631   GWt_dialog* pointsDialog = new GWt_dialog("space phase",toto,false);
    632   eDialog_.push_back(pointsDialog);
    633   pointsDialog->setMinimumSize(400,400);
    634   pointsDialog->setClosable(true);
    635   // pointsDialog->show();
     629// void PspaApplication::faireDessinParmela(WContainerWidget* toto, particleBeam* beam, string namex, string namey )
     630// {
     631//   cout << " faireDessinParmela " << endl;
     632//   GWt_dialog* pointsDialog = new GWt_dialog("space phase",toto,false);
     633//   eDialog_.push_back(pointsDialog);
     634//   pointsDialog->setMinimumSize(400,400);
     635//   pointsDialog->setClosable(true);
     636//   // pointsDialog->show();
    636637     
    637   new WText(nameOfCase_, pointsDialog->contents());
    638 
    639 
    640   vector<double> xcor;
    641   vector<double> ycor;
    642   vector<string> legende;
    643   beam->particlesPhaseSpaceData(xcor, ycor, legende, namex, namey);
    644   for (int k=0 ; k < legende.size(); k++) {
    645     new WBreak(pointsDialog->contents());
    646     new WText(legende.at(k), pointsDialog->contents());
    647   }
    648   string titre = " phase space ";
    649   chartPlot2vec(pointsDialog->contents(), xcor, ycor, true,titre,namex, namey,400,400);
    650 
    651 
    652    
    653   pointsDialog->show();
    654    
    655   //  chart->setMargin(10, Top | Bottom);            // add margin vertically
    656   //  chart->setMargin(WLength::Auto, Left | Right); // center horizontally
    657 }
    658 
    659 void PspaApplication::faireDessinTransport(WContainerWidget* toto, particleBeam* beam, string namex, string namey)
    660 {
    661   GWt_dialog* ellipseDialog = new GWt_dialog("ellipse",toto,false);
    662   eDialog_.push_back(ellipseDialog);
    663   ellipseDialog->setMinimumSize(400,400);
    664   ellipseDialog->setClosable(true);
    665   ellipseDialog->show();
    666   new WText(nameOfCase_, ellipseDialog->contents());
    667  
    668   vector<double> xcor;
    669   vector<double> ycor;
    670   vector<string> legende;
    671   beam->donneesDessinEllipse(xcor,ycor,legende, namex, namey);
    672 
    673   for (int k=0 ; k < legende.size(); k++) {
    674     new WBreak(ellipseDialog->contents());
    675     new WText(legende.at(k), ellipseDialog->contents());
    676   }
    677   string titre = "phase space rms";
    678   chartPlot2vec(ellipseDialog->contents(), xcor, ycor, false,titre, namex, namey,500,300);
    679 }
     638//   new WText(nameOfCase_, pointsDialog->contents());
     639
     640
     641//   vector<double> xcor;
     642//   vector<double> ycor;
     643//   vector<string> legende;
     644//   beam->particlesPhaseSpaceData(xcor, ycor, legende, namex, namey);
     645//   for (int k=0 ; k < legende.size(); k++) {
     646//     new WBreak(pointsDialog->contents());
     647//     new WText(legende.at(k), pointsDialog->contents());
     648//   }
     649//   string titre = " phase space ";
     650//   chartPlot2vec(pointsDialog->contents(), xcor, ycor, true,titre,namex, namey,400,400);
     651
     652
     653   
     654//   pointsDialog->show();
     655   
     656//   //  chart->setMargin(10, Top | Bottom);            // add margin vertically
     657//   //  chart->setMargin(WLength::Auto, Left | Right); // center horizontally
     658// }
     659
     660// void PspaApplication::faireDessinTransport(WContainerWidget* toto, particleBeam* beam, string namex, string namey)
     661// {
     662//   GWt_dialog* ellipseDialog = new GWt_dialog("ellipse",toto,false);
     663//   eDialog_.push_back(ellipseDialog);
     664//   ellipseDialog->setMinimumSize(400,400);
     665//   ellipseDialog->setClosable(true);
     666//   ellipseDialog->show();
     667//   new WText(nameOfCase_, ellipseDialog->contents());
     668 
     669//   vector<double> xcor;
     670//   vector<double> ycor;
     671//   vector<string> legende;
     672//   beam->donneesDessinEllipse(xcor,ycor,legende, namex, namey);
     673
     674//   for (int k=0 ; k < legende.size(); k++) {
     675//     new WBreak(ellipseDialog->contents());
     676//     new WText(legende.at(k), ellipseDialog->contents());
     677//   }
     678//   string titre = "phase space rms";
     679//   chartPlot2vec(ellipseDialog->contents(), xcor, ycor, false,titre, namex, namey,500,300);
     680// }
    680681
    681682
     
    848849  histoDialog->setClosable(true);
    849850 
    850   int index = choixHistoDessin_->currentIndex();   
    851   particleBeam* beam = dtmanage_->getDiagnosticBeam(index);
     851  // int index = choixHistoDessin_->currentIndex();   
     852  // particleBeam* beam = dtmanage_->getDiagnosticBeam(index);
     853   string elementLabel = choixHistoDessin_->currentText().toUTF8();   
     854   particleBeam* beam = dtmanage_->getDiagnosticBeam(elementLabel);
    852855  if (beam == NULL) {
    853856    GWt_dialog warningBeamState("histogram","the beam does not exist at the end of this element !", GWt_dialog::Error, false,true);
Note: See TracChangeset for help on using the changeset viewer.