Changeset 431 in PSPA for Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc
- Timestamp:
- Nov 15, 2013, 3:30:50 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc
r419 r431 2 2 #include "dataManager.h" 3 3 #include <algorithm> 4 4 5 abstractSoftware::abstractSoftware() 5 6 { 6 7 globParamPtr_ = NULL; 8 sectParamPtr_ = NULL; //xx 7 9 dataManager_ = NULL; 8 10 nameOfSoftware_ = nomDeLogiciel("unknownSoftware"); 9 11 } 10 12 11 abstractSoftware::abstractSoftware(string inputFileName, globalParameters* globals, dataManager* dt) { 13 abstractSoftware::abstractSoftware(string inputFileName, globalParameters* globals, dataManager* dt) 14 { 12 15 inputFileName_ = inputFileName; 13 16 globParamPtr_ = globals; 17 sectParamPtr_ = NULL; //xx 14 18 dataManager_ = dt; 15 19 numeroDeb_ = 0; … … 18 22 } 19 23 20 bool abstractSoftware::initComputationLimits(unsigned int numeroDeb,unsigned int numeroFin) { 24 abstractSoftware::abstractSoftware(string inputFileName,sectorParameters* lattice,dataManager* dt) 25 { 26 inputFileName_ = inputFileName; 27 globParamPtr_ = NULL; 28 sectParamPtr_ = lattice; 29 dataManager_ = dt; 30 numeroDeb_ = 0; 31 numeroFin_ = 0; 32 nameOfSoftware_ = nomDeLogiciel("unknownSoftware"); 33 } 34 35 bool abstractSoftware::initComputationLimits(unsigned int numeroDeb,unsigned int numeroFin) 36 { 21 37 numeroDeb_ = numeroDeb; 22 38 numeroFin_ = numeroFin; … … 24 40 } 25 41 26 bool 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() ); 42 bool abstractSoftware::ComputationLimitsOk() const 43 { 44 if (numeroDeb_ < 1 || numeroFin_ < 1 || numeroDeb_ > dataManager_->getBeamLineSize() || numeroFin_ > dataManager_->getBeamLineSize() ) { 45 dataManager_->consoleMessage(" abstractSoftware::initComputationLimit : num of element out of limits in software " + getName() ); 29 46 return false; 30 47 } else { … … 33 50 } 34 51 35 36 void abstractSoftware::registerElement(nomdElements::typedElement nomdel,trivaluedBool b){52 void abstractSoftware::registerElement(nomdElements::typedElement nomdel,trivaluedBool b) 53 { 37 54 if (b == TBoolIgnore) { 38 55 ignoredElements_.push_back(nomdel); … … 42 59 } 43 60 44 trivaluedBool abstractSoftware::doAcceptElement(nomdElements::typedElement typdel) { 45 if (acceptedElements_.size() == 0) { 61 trivaluedBool abstractSoftware::doAcceptElement(nomdElements::typedElement typdel) 62 { 63 64 //xx 65 if (acceptedElements_.size() == 0 && nameOfSoftware_ != nomDeLogiciel::unknownSoftware) { 46 66 return TBoolError; 47 67 } 48 if ( std::find(acceptedElements_.begin(), acceptedElements_.end(), typdel) != acceptedElements_.end()) { 68 69 if (std::find(acceptedElements_.begin(),acceptedElements_.end(),typdel) != acceptedElements_.end()) { 49 70 return TBoolOk; 50 71 } 72 51 73 if (ignoredElements_.size() == 0) { 52 74 return TBoolError; 53 75 } 54 if ( std::find(ignoredElements_.begin(), ignoredElements_.end(), typdel) != ignoredElements_.end()) { 76 77 if (std::find(ignoredElements_.begin(),ignoredElements_.end(),typdel) != ignoredElements_.end()) { 55 78 return TBoolIgnore; 56 79 } 80 57 81 return TBoolOk; 58 82 } 59 60 83 61 84 bool abstractSoftware::launchJob(string commandLine, string& resul) … … 66 89 ostringstream sortie; 67 90 if (pp == NULL) { 68 sortie << " launching 91 sortie << " launching failed : " << commandLine << endl; 69 92 ExecuteStatus = false; 70 93 } else { 71 cout << " executing command : " << commandLine << endl;72 94 // on copie la sortie dans le fichier assigne 73 95 char buf[132];
Note: See TracChangeset
for help on using the changeset viewer.