Changeset 342 in PSPA for Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc
- Timestamp:
- Feb 26, 2013, 2:35:45 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc
r316 r342 1 1 2 #include "softwareGenerator.h" 2 3 #include "abstractElement.h" … … 4 5 #include "mathematicalConstants.h" 5 6 #include "PhysicalConstants.h" 6 //#include "dataManager.h"7 8 7 9 8 softwareGenerator::softwareGenerator() : abstractSoftware() 10 { 11 ; 12 } 13 14 15 9 {;} 16 10 17 11 softwareGenerator::softwareGenerator(string inputFileName, globalParameters* globals, dataManager* dt) : abstractSoftware(inputFileName, globals, dt) 18 { 19 ; 20 } 21 12 {;} 22 13 23 14 bool softwareGenerator::createInputFile(particleBeam* beamBefore, unsigned int numeroDeb, unsigned int numeroFin, string workingDir) … … 33 24 return false; 34 25 } 26 35 27 ofstream outfile; 36 28 string name = workingDir + inputFileName_; … … 53 45 } 54 46 55 56 bool softwareGenerator::execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir) { 47 bool softwareGenerator::execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir) { 48 49 bool ExecuteStatus = true; 50 57 51 ostringstream sortie; 58 bool ExecuteStatus = true;59 // resul.clear();60 52 sortie << " EXECUTION DE GENERATOR DE l'ELEMENT " << numeroDeb << " A L'ELEMENT " << numeroFin << endl; 61 53 62 char buf[132];63 54 string generatorJob = workingDir + "generator"; 64 55 generatorJob += string(" "); 65 56 generatorJob += workingDir + inputFileName_; 66 57 67 68 ofstream outfile;69 string nameOut = workingDir + "generator.output";70 58 string resultOfRun; 71 bool success = launchJob(generatorJob, 59 bool success = launchJob(generatorJob,resultOfRun); 72 60 sortie << resultOfRun << endl; 73 if ( !success ) {61 if ( !success ) { 74 62 sortie << " launching of generator failed " << endl; 75 63 ExecuteStatus = false; 76 } 77 else { 64 } else { 78 65 cout << " execution generator MARCHE " << endl; 79 66 sortie << resultOfRun; 67 string nameOut = workingDir + "generator.output"; 68 ofstream outfile; 80 69 outfile.open(nameOut.c_str(), ios::out); 81 if (!outfile) 82 { 83 sortie << " error first opening transport output stream " << nameOut << endl; 84 ExecuteStatus = false; 85 } 86 else { 70 if (!outfile) { 71 sortie << " error first opening transport output stream " << nameOut << endl; 72 ExecuteStatus = false; 73 } else { 87 74 // on copie la sortie dans un fichier 'generator.out' 88 75 outfile << resultOfRun << endl; … … 90 77 } 91 78 } 92 // resul = sortie.str();93 79 80 dataManager_->consoleMessage(sortie.str()); 94 81 return ExecuteStatus; 95 82 }
Note: See TracChangeset
for help on using the changeset viewer.