Changeset 472 in PSPA
- Timestamp:
- Dec 19, 2013, 6:22:39 PM (10 years ago)
- Location:
- Interface_Web/trunk/pspaWT
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/History
r471 r472 5 5 PSPA - Plateforme de simulation en physique des accélérateurs 6 6 ========================================================= 7 8 19 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 7 24 8 25 19 Décembre 2013 : Laurent Garnier -
Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h
r455 r472 40 40 41 41 bool launchJob(string commandLine, string& resul); 42 bool initComputationLimits_deprecated(unsigned int numeroDeb,unsigned int numeroFin);43 42 bool ComputationLimitsOk_deprecated() const; 44 43 … … 51 50 public : 52 51 53 abstractSoftware(string, sectionToExecute* );52 abstractSoftware(string, sectionToExecute*, dataManager* ); 54 53 ~abstractSoftware() {;} 55 54 -
Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h
r455 r472 30 30 int getBeamLineSize_deprecated(); 31 31 inline globalParameters* getGlobalParameters() {return &globParam_;} 32 inline particleBeam* getCurrentBeam() {return currentBeam_;}33 32 34 33 particleBeam* getDiagnosticBeam(unsigned index); … … 99 98 100 99 globalParameters globParam_; 101 particleBeam* currentBeam_;102 100 PspaApplication* pspa_; 103 101 -
Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h
r469 r472 12 12 /** Create a new sectionToExecute and initialize it with the given element and software 13 13 */ 14 sectionToExecute(abstractElement*,abstractSoftware* );14 sectionToExecute(abstractElement*,abstractSoftware*,dataManager*); 15 15 16 16 /** Deprecated : To be removed ! */ … … 57 57 58 58 abstractSoftware* software_; 59 59 dataManager* dataManager_; 60 60 std::vector< abstractElement* > elements_; 61 61 }; -
Interface_Web/trunk/pspaWT/sources/controler/include/sector.h
r469 r472 7 7 #include "nomDeLogiciel.h" 8 8 #include "sectorParameters.h" 9 #include "particleBeam.h" 10 9 11 10 12 class sectionToExecute; … … 86 88 } 87 89 90 inline particleBeam* getParticleBeam() { 91 return currentBeam_; 92 } 93 94 inline void setParticleBeam(particleBeam* part) { 95 currentBeam_ = part; 96 } 97 88 98 private: 89 99 90 100 std::vector <sectionToExecute*> sectionToExecute_; 101 particleBeam* currentBeam_; 91 102 92 103 std::string name_; -
Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h
r455 r472 18 18 19 19 softwareGenerator(); 20 softwareGenerator(string inputFileName, sectionToExecute* );20 softwareGenerator(string inputFileName, sectionToExecute*, dataManager*); 21 21 22 22 virtual ~softwareGenerator() {;} -
Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h
r455 r472 13 13 14 14 softwareMadx(); 15 softwareMadx(string,sectionToExecute* );15 softwareMadx(string,sectionToExecute*, dataManager*); 16 16 virtual ~softwareMadx() {;} 17 17 -
Interface_Web/trunk/pspaWT/sources/controler/include/softwareParmela.h
r455 r472 36 36 softwareParmela(); 37 37 38 softwareParmela(string inputFileName, sectionToExecute* );38 softwareParmela(string inputFileName, sectionToExecute*, dataManager*); 39 39 40 40 virtual ~softwareParmela() {;} -
Interface_Web/trunk/pspaWT/sources/controler/include/softwareTest.h
r455 r472 18 18 softwareTest(); 19 19 20 softwareTest(string inputFileName, sectionToExecute* );20 softwareTest(string inputFileName, sectionToExecute*, dataManager*); 21 21 22 22 virtual ~softwareTest() {;} -
Interface_Web/trunk/pspaWT/sources/controler/include/softwareTransport.h
r455 r472 20 20 public : 21 21 softwareTransport(); 22 softwareTransport(string inputFileName, sectionToExecute* );22 softwareTransport(string inputFileName, sectionToExecute*, dataManager*); 23 23 24 24 virtual ~softwareTransport() {;} -
Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h
r455 r472 13 13 public : 14 14 softwareUsersprogram(); 15 softwareUsersprogram(string inputFileName, sectionToExecute* );15 softwareUsersprogram(string inputFileName, sectionToExecute*, dataManager*); 16 16 17 17 virtual ~softwareUsersprogram() {;} -
Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc
r455 r472 3 3 #include <algorithm> 4 4 #include <iostream> 5 6 5 7 6 abstractSoftware::abstractSoftware() … … 11 10 } 12 11 13 abstractSoftware::abstractSoftware(string inputFileName, sectionToExecute* sect )12 abstractSoftware::abstractSoftware(string inputFileName, sectionToExecute* sect, dataManager* data) 14 13 { 15 14 inputFileName_ = inputFileName; … … 17 16 numeroDeb_deprecated_ = 0; 18 17 numeroFin_deprecated_ = 0; 18 dataManager_ = data; 19 19 nameOfSoftware_ = nomDeLogiciel("unknownSoftware"); 20 20 } 21 21 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 }29 22 30 23 bool abstractSoftware::ComputationLimitsOk_deprecated() const 31 24 { 32 25 /* 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() ); 34 27 return false; 35 28 } else { -
Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
r469 r472 18 18 19 19 dataManager::dataManager(PspaApplication* pspa) : 20 currentBeam_(NULL),21 20 pspa_ (pspa) 22 21 {} … … 28 27 if ( jobList_[k] != NULL ) delete jobList_[k]; 29 28 } 30 if ( currentBeam_ == NULL ) delete currentBeam_;31 29 } 32 30 … … 82 80 diagnosticBeam_.clear(); 83 81 indexElementToIndexDiag_.clear(); 84 currentBeam_ = NULL;85 82 for (unsigned int a=0; a< jobList_.size(); a++) { 86 83 jobList_[a]->clearSectionToExecute(); … … 130 127 } 131 128 132 success = softw->createInputFile( currentBeam_,workingDir);129 success = softw->createInputFile(sector->getParticleBeam(),workingDir); 133 130 if ( success ) { 134 131 success = softw->execute(workingDir); … … 139 136 140 137 if ( success ) { 141 currentBeam_ = &diagnosticBeam_.at(indexElementToIndexDiag_.back());138 sector->setParticleBeam(&diagnosticBeam_.at(indexElementToIndexDiag_.back())); 142 139 cout << " execute termine avec succes " << endl; 143 140 } else { 144 currentBeam_ = NULL;141 sector->setParticleBeam(NULL); 145 142 cout << " execute termine en ECHEC " << endl; 146 143 } … … 157 154 } //l 158 155 } //k 159 // if ( currentBeam_ ) {156 // if ( currentBeam_deprecated_ ) { 160 157 // string aml_file = workingDir + "/" + "faisceau_final" + ".aml"; 161 // currentBeam_ ->writeToAMLFile(aml_file);158 // currentBeam_deprecated_->writeToAMLFile(aml_file); 162 159 // // TESTS 163 // currentBeam_ ->readFromAMLFile(aml_file);160 // currentBeam_deprecated_->readFromAMLFile(aml_file); 164 161 // } 165 162 cout << " dataManager::executeAll() " << endl; -
Interface_Web/trunk/pspaWT/sources/controler/src/sectionToExecute.cc
r469 r472 10 10 11 11 12 sectionToExecute::sectionToExecute(abstractElement* f, abstractSoftware* s) { 12 sectionToExecute::sectionToExecute(abstractElement* f, abstractSoftware* s,dataManager* data) { 13 dataManager_ = data; 14 13 15 elements_.push_back(f); 14 16 if (s == NULL) { … … 39 41 if(logiciel == "parmela") { 40 42 inputFileName = "parmin"; 41 prog = new softwareParmela(inputFileName, this );43 prog = new softwareParmela(inputFileName, this,dataManager_ ); 42 44 } else if (logiciel == "transport") { 43 45 inputFileName = "transport.input"; 44 prog = new softwareTransport(inputFileName, this );46 prog = new softwareTransport(inputFileName, this,dataManager_ ); 45 47 } else if (logiciel == "generator") { 46 48 inputFileName = "generator.in"; 47 prog = new softwareGenerator(inputFileName, this );49 prog = new softwareGenerator(inputFileName, this,dataManager_ ); 48 50 } else if (logiciel == "madx") { 49 51 inputFileName = "madx.input"; 50 prog = new softwareMadx(inputFileName,this );52 prog = new softwareMadx(inputFileName,this,dataManager_ ); 51 53 } else if (logiciel == "usersprogram") { 52 54 inputFileName = "dummy"; 53 prog = new softwareUsersprogram(inputFileName, this );55 prog = new softwareUsersprogram(inputFileName, this,dataManager_ ); 54 56 } else if (logiciel == "test") { 55 prog = new softwareTest(inputFileName, this );57 prog = new softwareTest(inputFileName, this,dataManager_ ); 56 58 } else { 57 59 prog = new softwareUnknown(); -
Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc
r469 r472 16 16 duplicatedFrom_(NULL), 17 17 repetitionNumber_(1), 18 currentBeam_(NULL), 18 19 name_(name), 19 20 dataManager_(data), … … 31 32 if (previousElement == NULL) { 32 33 if (sectionToExecute_.size() == 0) { 33 sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL ));34 sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL,dataManager_)); 34 35 } else { 35 36 sectionToExecute* section = sectionToExecute_.front(); -
Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc
r455 r472 12 12 } 13 13 14 softwareGenerator::softwareGenerator(string inputFileName, sectionToExecute* sect ) : abstractSoftware(inputFileName, sect)14 softwareGenerator::softwareGenerator(string inputFileName, sectionToExecute* sect,dataManager* data) : abstractSoftware(inputFileName, sect,data) 15 15 { 16 16 cout << " softwareUsersprogram::softwareGenerator ENREGISTREMENT " << endl; … … 57 57 58 58 ostringstream sortie; 59 sortie << " EXECUTION DE GENERATOR DE l'ELEMENT " << numeroDeb_deprecated_ << " A L'ELEMENT " << numeroFin_deprecated_<< endl;59 sortie << " EXECUTION DE GENERATOR " << endl; 60 60 61 61 string generatorJob = workingDir + "generator"; … … 94 94 if ( !ComputationLimitsOk_deprecated() ) return false; 95 95 96 if ( numeroDeb_deprecated_ != numeroFin_deprecated_) {96 if ( getSectionToExecute()->getElements().size() != 1 ) { 97 97 dataManager_->consoleMessage(" softwareGenerator::buildBeamAfterElements : only one element (rfgun) must be calculated " ); 98 98 return false; -
Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc
r455 r472 8 8 } 9 9 10 softwareMadx::softwareMadx(string inputFileName,sectionToExecute* sect ) : abstractSoftware(inputFileName,sect)10 softwareMadx::softwareMadx(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName,sect,data) 11 11 { 12 12 nameOfSoftware_ = nomDeLogiciel("madx"); -
Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc
r455 r472 12 12 } 13 13 14 softwareParmela::softwareParmela(string inputFileName,sectionToExecute* sect ) : abstractSoftware(inputFileName, sect)14 softwareParmela::softwareParmela(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect, data) 15 15 { 16 16 nameOfSoftware_ = nomDeLogiciel("parmela"); … … 118 118 119 119 ostringstream sortie; 120 sortie << " EXECUTION DE PARMELA DE l'ELEMENT " << numeroDeb_deprecated_ << " A L'ELEMENT " << numeroFin_deprecated_ <<endl;120 sortie << " EXECUTION DE PARMELA " << endl; 121 121 122 122 string parmelaJob = workingDir + "parmela"; -
Interface_Web/trunk/pspaWT/sources/controler/src/softwareTest.cc
r455 r472 14 14 15 15 16 softwareTest::softwareTest(string inputFileName,sectionToExecute* sect ) : abstractSoftware(inputFileName, sect)16 softwareTest::softwareTest(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data) 17 17 { 18 18 nameOfSoftware_ = nomDeLogiciel("test"); … … 38 38 dataManager_->consoleMessage(" softwareTest::buildBeamAfterElements " ); 39 39 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++ ) { 43 41 particleBeam* newDiag = dataManager_->updateCurrentDiagnostic(true); 44 42 // beams.push_back(particleBeam()); -
Interface_Web/trunk/pspaWT/sources/controler/src/softwareTransport.cc
r455 r472 11 11 } 12 12 13 softwareTransport::softwareTransport(string inputFileName,sectionToExecute* sect ) : abstractSoftware(inputFileName, sect)13 softwareTransport::softwareTransport(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data) 14 14 { 15 15 nameOfSoftware_ = nomDeLogiciel("transport"); … … 105 105 106 106 ostringstream sortie; 107 sortie << " EXECUTION DE TRANSPORT DE " << numeroDeb_deprecated_ << " a " << numeroFin_deprecated_<< endl;107 sortie << " EXECUTION DE TRANSPORT " << endl; 108 108 109 109 string transportJob = workingDir + "transport"; -
Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc
r455 r472 10 10 } 11 11 12 softwareUsersprogram::softwareUsersprogram(string inputFileName, sectionToExecute* sect ) : abstractSoftware(inputFileName, sect)12 softwareUsersprogram::softwareUsersprogram(string inputFileName, sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data) 13 13 { 14 14 cout << " softwareUsersprogram::softwareUsersprogram ENREGISTREMENT " << endl; -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
r471 r472 267 267 if (s > 0) { 268 268 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_)); 270 270 UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->removeLastElement(); 271 271 }
Note: See TracChangeset
for help on using the changeset viewer.