Changeset 472 in PSPA


Ignore:
Timestamp:
Dec 19, 2013, 6:22:39 PM (10 years ago)
Author:
garnier
Message:

Modification pour remettre en marche le Run. Desormais Transport passe, mais aucun test ne permet de dire si c est bon

Location:
Interface_Web/trunk/pspaWT
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/History

    r471 r472  
    55     PSPA - Plateforme de simulation en physique des accélérateurs
    66     =========================================================
     7
     819 Décembre 2013 : Laurent Garnier
     9- abstractSoftware:
     10  o Supression de initComputationLimits_deprecated()
     11  o Ajout d'un pointeur vers dataManager
     12
     13- dataManager:
     14  o Suppression de getCurrentBeam() qui n'a plus lieu d'être puisque le beamLine est maintenant dans le sector.
     15- sectionToExecute:
     16  o Ajout d'un pointeur vers dataManager
     17
     18- sector:
     19  o Ajout de méthodes pour gérér la particleBeam : getParticleBeam()/setParticleBeam()
     20
     21- softwareXX :
     22  o Ajout d'un pointeur vers dataManager
     23
    724
    82519 Décembre 2013 : Laurent Garnier
  • Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h

    r455 r472  
    4040
    4141  bool launchJob(string commandLine, string& resul);
    42   bool initComputationLimits_deprecated(unsigned int numeroDeb,unsigned int numeroFin);
    4342  bool ComputationLimitsOk_deprecated() const;
    4443
     
    5150  public :
    5251
    53   abstractSoftware(string, sectionToExecute*);
     52  abstractSoftware(string, sectionToExecute*, dataManager* );
    5453  ~abstractSoftware() {;}
    5554
  • Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h

    r455 r472  
    3030  int getBeamLineSize_deprecated();
    3131  inline globalParameters* getGlobalParameters()  {return &globParam_;}
    32   inline particleBeam* getCurrentBeam() {return currentBeam_;}
    3332   
    3433  particleBeam* getDiagnosticBeam(unsigned index);
     
    9998
    10099  globalParameters globParam_;
    101   particleBeam* currentBeam_;
    102100  PspaApplication* pspa_;
    103101 
  • Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h

    r469 r472  
    1212  /** Create a new sectionToExecute and initialize it with the given element and software
    1313   */
    14   sectionToExecute(abstractElement*,abstractSoftware*);
     14  sectionToExecute(abstractElement*,abstractSoftware*,dataManager*);
    1515 
    1616  /** Deprecated : To be removed ! */
     
    5757
    5858  abstractSoftware* software_;
    59 
     59  dataManager* dataManager_;
    6060  std::vector< abstractElement* > elements_;
    6161};
  • Interface_Web/trunk/pspaWT/sources/controler/include/sector.h

    r469 r472  
    77#include "nomDeLogiciel.h"
    88#include "sectorParameters.h"
     9#include "particleBeam.h"
     10
    911
    1012class sectionToExecute;
     
    8688  }
    8789
     90  inline particleBeam* getParticleBeam() {
     91    return currentBeam_;
     92  }
     93 
     94  inline void setParticleBeam(particleBeam* part) {
     95    currentBeam_ = part;
     96  }
     97 
    8898private:
    8999
    90100  std::vector <sectionToExecute*> sectionToExecute_;
     101  particleBeam* currentBeam_;
    91102
    92103  std::string name_;
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h

    r455 r472  
    1818 
    1919  softwareGenerator(); 
    20   softwareGenerator(string inputFileName, sectionToExecute*);
     20  softwareGenerator(string inputFileName, sectionToExecute*, dataManager*);
    2121
    2222  virtual ~softwareGenerator() {;}
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h

    r455 r472  
    1313 
    1414  softwareMadx();
    15   softwareMadx(string,sectionToExecute*);
     15  softwareMadx(string,sectionToExecute*, dataManager*);
    1616  virtual ~softwareMadx() {;}
    1717
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareParmela.h

    r455 r472  
    3636    softwareParmela();
    3737   
    38     softwareParmela(string inputFileName, sectionToExecute*);
     38    softwareParmela(string inputFileName, sectionToExecute*, dataManager*);
    3939
    4040  virtual ~softwareParmela() {;}
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareTest.h

    r455 r472  
    1818    softwareTest();
    1919   
    20     softwareTest(string inputFileName, sectionToExecute*);
     20    softwareTest(string inputFileName, sectionToExecute*, dataManager*);
    2121
    2222  virtual ~softwareTest() {;}
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareTransport.h

    r455 r472  
    2020 public :
    2121    softwareTransport();
    22     softwareTransport(string inputFileName, sectionToExecute*);
     22    softwareTransport(string inputFileName, sectionToExecute*, dataManager*);
    2323
    2424  virtual ~softwareTransport() {;}
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h

    r455 r472  
    1313 public :
    1414    softwareUsersprogram();
    15     softwareUsersprogram(string inputFileName, sectionToExecute*);
     15    softwareUsersprogram(string inputFileName, sectionToExecute*, dataManager*);
    1616
    1717  virtual ~softwareUsersprogram() {;}
  • Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc

    r455 r472  
    33#include <algorithm>
    44#include <iostream>
    5 
    65
    76abstractSoftware::abstractSoftware()
     
    1110}
    1211
    13 abstractSoftware::abstractSoftware(string inputFileName, sectionToExecute* sect)
     12abstractSoftware::abstractSoftware(string inputFileName, sectionToExecute* sect, dataManager* data)
    1413{
    1514  inputFileName_ = inputFileName;
     
    1716  numeroDeb_deprecated_ = 0;
    1817  numeroFin_deprecated_ = 0;
     18  dataManager_ = data;
    1919  nameOfSoftware_ = nomDeLogiciel("unknownSoftware");
    2020}
    2121
    22 bool abstractSoftware::initComputationLimits_deprecated(unsigned int numeroDeb,unsigned int numeroFin_deprecated_)
    23 {
    24 /*  numeroDeb_deprecated_ = numeroDeb;
    25   numeroFin_deprecated__ = numeroFin_deprecated_;
    26   return ComputationLimitsOk_deprecated();
    27 */
    28 }
    2922
    3023bool abstractSoftware::ComputationLimitsOk_deprecated() const
    3124{
    3225/*  if (numeroDeb_deprecated_ < 1 || numeroFin_deprecated__ < 1 || numeroDeb_deprecated_ > dataManager_->getBeamLineSize() || numeroFin_deprecated__ > dataManager_->getBeamLineSize() ) {
    33     dataManager_->consoleMessage(" abstractSoftware::initComputationLimit : num of element out of limits in software " + getName() );
     26    consoleMessage(" abstractSoftware::initComputationLimit : num of element out of limits in software " + getName() );
    3427    return false;
    3528  } else {
  • Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc

    r469 r472  
    1818
    1919dataManager::dataManager(PspaApplication* pspa) :
    20 currentBeam_(NULL),
    2120pspa_ (pspa)
    2221{}
     
    2827    if ( jobList_[k] != NULL ) delete jobList_[k];
    2928  }
    30   if ( currentBeam_ == NULL ) delete currentBeam_;
    3129}
    3230
     
    8280  diagnosticBeam_.clear();
    8381  indexElementToIndexDiag_.clear();
    84   currentBeam_ = NULL;
    8582  for (unsigned int a=0; a< jobList_.size(); a++) {
    8683      jobList_[a]->clearSectionToExecute();
     
    130127    }
    131128   
    132     success = softw->createInputFile(currentBeam_,workingDir);
     129    success = softw->createInputFile(sector->getParticleBeam(),workingDir);
    133130    if ( success ) {
    134131      success = softw->execute(workingDir);
     
    139136   
    140137    if ( success ) {
    141       currentBeam_ = &diagnosticBeam_.at(indexElementToIndexDiag_.back());
     138      sector->setParticleBeam(&diagnosticBeam_.at(indexElementToIndexDiag_.back()));
    142139      cout << " execute termine avec succes " << endl;
    143140    } else {
    144       currentBeam_ = NULL;
     141      sector->setParticleBeam(NULL);
    145142      cout << " execute termine en ECHEC " << endl;
    146143    }
     
    157154    } //l
    158155  } //k
    159   // if ( currentBeam_ ) {
     156  // if ( currentBeam_deprecated_ ) {
    160157  // string aml_file = workingDir + "/" + "faisceau_final" + ".aml";
    161   //   currentBeam_->writeToAMLFile(aml_file);
     158  //   currentBeam_deprecated_->writeToAMLFile(aml_file);
    162159  //   // TESTS
    163   //   currentBeam_->readFromAMLFile(aml_file);
     160  //   currentBeam_deprecated_->readFromAMLFile(aml_file);
    164161  // }
    165162  cout << " dataManager::executeAll() " << endl;
  • Interface_Web/trunk/pspaWT/sources/controler/src/sectionToExecute.cc

    r469 r472  
    1010
    1111
    12 sectionToExecute::sectionToExecute(abstractElement* f, abstractSoftware* s) {
     12sectionToExecute::sectionToExecute(abstractElement* f, abstractSoftware* s,dataManager* data) {
     13  dataManager_ = data;
     14 
    1315  elements_.push_back(f);
    1416  if (s == NULL) {
     
    3941  if(logiciel == "parmela") {
    4042    inputFileName = "parmin";
    41     prog = new softwareParmela(inputFileName, this);
     43    prog = new softwareParmela(inputFileName, this,dataManager_ );
    4244  } else if (logiciel  == "transport") {
    4345    inputFileName = "transport.input";
    44     prog =  new softwareTransport(inputFileName, this);
     46    prog =  new softwareTransport(inputFileName, this,dataManager_ );
    4547  } else if (logiciel == "generator") {
    4648    inputFileName = "generator.in";
    47     prog = new softwareGenerator(inputFileName, this);
     49    prog = new softwareGenerator(inputFileName, this,dataManager_ );
    4850  } else if (logiciel  == "madx") {
    4951    inputFileName = "madx.input";
    50     prog = new softwareMadx(inputFileName,this);
     52    prog = new softwareMadx(inputFileName,this,dataManager_ );
    5153  } else if (logiciel  == "usersprogram") {
    5254    inputFileName = "dummy";
    53     prog = new softwareUsersprogram(inputFileName, this);
     55    prog = new softwareUsersprogram(inputFileName, this,dataManager_ );
    5456  } else if (logiciel  == "test") {
    55     prog = new softwareTest(inputFileName, this);
     57    prog = new softwareTest(inputFileName, this,dataManager_ );
    5658  } else {
    5759    prog = new softwareUnknown();
  • Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc

    r469 r472  
    1616duplicatedFrom_(NULL),
    1717repetitionNumber_(1),
     18currentBeam_(NULL),
    1819name_(name),
    1920dataManager_(data),
     
    3132  if (previousElement == NULL) {
    3233    if (sectionToExecute_.size() == 0) {
    33       sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL));
     34      sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL,dataManager_));
    3435    } else {
    3536        sectionToExecute* section = sectionToExecute_.front();
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc

    r455 r472  
    1212}
    1313
    14 softwareGenerator::softwareGenerator(string inputFileName, sectionToExecute* sect) : abstractSoftware(inputFileName, sect)
     14softwareGenerator::softwareGenerator(string inputFileName, sectionToExecute* sect,dataManager* data) : abstractSoftware(inputFileName, sect,data)
    1515{
    1616  cout << " softwareUsersprogram::softwareGenerator ENREGISTREMENT " << endl;
     
    5757 
    5858  ostringstream sortie;
    59   sortie << " EXECUTION DE GENERATOR DE l'ELEMENT " << numeroDeb_deprecated_ << " A L'ELEMENT " << numeroFin_deprecated_ << endl;
     59  sortie << " EXECUTION DE GENERATOR  " << endl;
    6060
    6161  string generatorJob = workingDir + "generator";
     
    9494  if ( !ComputationLimitsOk_deprecated() ) return false;
    9595
    96   if ( numeroDeb_deprecated_ != numeroFin_deprecated_ ) {
     96  if ( getSectionToExecute()->getElements().size() != 1 ) {
    9797    dataManager_->consoleMessage(" softwareGenerator::buildBeamAfterElements : only one element (rfgun) must be calculated " );
    9898    return false;
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc

    r455 r472  
    88}
    99
    10 softwareMadx::softwareMadx(string inputFileName,sectionToExecute* sect) : abstractSoftware(inputFileName,sect)
     10softwareMadx::softwareMadx(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName,sect,data)
    1111{
    1212  nameOfSoftware_ = nomDeLogiciel("madx");
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc

    r455 r472  
    1212}
    1313
    14 softwareParmela::softwareParmela(string inputFileName,sectionToExecute* sect) : abstractSoftware(inputFileName, sect)
     14softwareParmela::softwareParmela(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect, data)
    1515{
    1616  nameOfSoftware_ = nomDeLogiciel("parmela");
     
    118118 
    119119  ostringstream sortie;
    120   sortie << " EXECUTION DE PARMELA DE l'ELEMENT " << numeroDeb_deprecated_ << " A L'ELEMENT " << numeroFin_deprecated_ << endl;
     120  sortie << " EXECUTION DE PARMELA " << endl;
    121121   
    122122  string parmelaJob = workingDir + "parmela";
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareTest.cc

    r455 r472  
    1414
    1515
    16 softwareTest::softwareTest(string inputFileName,sectionToExecute* sect) : abstractSoftware(inputFileName, sect)
     16softwareTest::softwareTest(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
    1717{
    1818  nameOfSoftware_ = nomDeLogiciel("test");
     
    3838  dataManager_->consoleMessage(" softwareTest::buildBeamAfterElements  " );
    3939  bool result = true;
    40   unsigned k;
    41   for ( k= numeroDeb_deprecated_; k <= numeroFin_deprecated_; k++)
    42     {
     40  for ( unsigned int k=0; k < getSectionToExecute()->getElements().size() ; k++ ) {
    4341      particleBeam* newDiag = dataManager_->updateCurrentDiagnostic(true);
    4442  //      beams.push_back(particleBeam());
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareTransport.cc

    r455 r472  
    1111}
    1212
    13 softwareTransport::softwareTransport(string inputFileName,sectionToExecute* sect) : abstractSoftware(inputFileName, sect)
     13softwareTransport::softwareTransport(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
    1414{
    1515  nameOfSoftware_ = nomDeLogiciel("transport");
     
    105105
    106106  ostringstream sortie;
    107   sortie << " EXECUTION DE TRANSPORT DE " << numeroDeb_deprecated_ << " a " << numeroFin_deprecated_ << endl;
     107  sortie << " EXECUTION DE TRANSPORT " << endl;
    108108 
    109109  string transportJob = workingDir + "transport";
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc

    r455 r472  
    1010}
    1111
    12 softwareUsersprogram::softwareUsersprogram(string inputFileName, sectionToExecute* sect) : abstractSoftware(inputFileName, sect)
     12softwareUsersprogram::softwareUsersprogram(string inputFileName, sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
    1313{
    1414  cout << " softwareUsersprogram::softwareUsersprogram ENREGISTREMENT " << endl;
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r471 r472  
    267267  if (s > 0) {
    268268    abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->getLastElement();
    269     UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL));
     269    UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL,dtmanage_));
    270270    UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->removeLastElement();
    271271  }
Note: See TracChangeset for help on using the changeset viewer.