Changeset 312 in PSPA for Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
- Timestamp:
- Feb 5, 2013, 2:23:23 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
r308 r312 55 55 56 56 57 abstractElement* dataManager::getElementPointerFrom Index(int k){58 return pspa_->getBeamLine()->getAbstractElement(k );57 abstractElement* dataManager::getElementPointerFromNumero(int k){ 58 return pspa_->getBeamLine()->getAbstractElement(k-1); 59 59 } 60 60 … … 85 85 unsigned k,j; 86 86 diagnostic.clear(); 87 unsigned indexDeb, indexFin;87 unsigned numeroDeb, numeroFin; 88 88 cout << "controle execution : " << endl; 89 89 for(k = 0; k < jobList_.size(); k++) { 90 indexDeb = jobList_[k]->firstElement;91 indexFin = jobList_[k]->lastElement;92 if ( indexFin < indexDeb )90 numeroDeb = jobList_[k]->firstElement; 91 numeroFin = jobList_[k]->lastElement; 92 if ( numeroFin < numeroDeb ) 93 93 { 94 94 diagnostic += " last element before first for job " + (jobList_[k]->software).getString() + " \n"; … … 96 96 break; 97 97 } 98 cout << " indexDeb= " << indexDeb << " indexFin= " << indexFin << endl;99 indexDeb--;100 indexFin--;98 cout << " numeroDeb= " << numeroDeb << " numeroFin= " << numeroFin << endl; 99 // indexDeb--; 100 // indexFin--; 101 101 102 102 abstractElement* elPtr; 103 103 string checkCompatibility; 104 resul = checkElementsForExec(jobList_[k]->software, indexDeb, indexFin, checkCompatibility);104 resul = checkElementsForExec(jobList_[k]->software, numeroDeb, numeroFin, checkCompatibility); 105 105 diagnostic += checkCompatibility; 106 106 } … … 110 110 111 111 112 trivaluedBool dataManager::checkElementsForExec(nomDeLogiciel logiciel, unsigned indexDeb, unsigned indexFin, string& diagnostic)112 trivaluedBool dataManager::checkElementsForExec(nomDeLogiciel logiciel, unsigned numeroDeb, unsigned numeroFin, string& diagnostic) 113 113 { 114 114 trivaluedBool resul = ok; … … 116 116 trivaluedBool accepted; 117 117 abstractElement* elPtr; 118 for(unsigned j = indexDeb; j <= indexFin; j++) {119 elPtr = pspa_->getBeamLine()->getAbstractElement(j );118 for(unsigned j = numeroDeb; j <= numeroFin; j++) { 119 elPtr = pspa_->getBeamLine()->getAbstractElement(j-1); 120 120 accepted = elPtr->is_accepted_by_software(logiciel); 121 121 if(accepted == error ) { … … 192 192 resultatPartiel += " error creating input file \n"; 193 193 } else { 194 success = softw->execute( debut,fin,workingDir_,resultatPartiel);194 success = softw->execute(inputFileName, debut,fin,workingDir_,resultatPartiel); 195 195 if ( success ) { 196 196 success = softw->buildBeamAfterElements(debut, fin, diagnosticBeam_, workingDir_); 197 197 if ( !success ) { 198 resultatPartiel += " reading t resultsfailed \n";198 resultatPartiel += " reading results failed \n"; 199 199 } 200 200 } 201 201 } 202 202 delete softw; 203 if ( success ) currentBeam_ = &diagnosticBeam_.back(); 204 else currentBeam_ = NULL; 203 if ( success ) { 204 currentBeam_ = &diagnosticBeam_.back(); 205 cout << " execute termine avec succes " << endl; 206 } else { 207 currentBeam_ = NULL; 208 cout << " execute termine en ECHEC " << endl; 209 } 205 210 resul += resultatPartiel; 206 211 if ( !success ) break; … … 303 308 if ( numeroDeb < 1 ) numeroDeb = 1; 304 309 if ( numeroFin > diagnosticBeam_.size() ) numeroFin = diagnosticBeam_.size(); 305 306 unsigned indexDeb = numeroDeb -1; 307 unsigned indexFin = numeroFin -1; 308 310 309 311 double longueur = 0.0; 310 312 double valeur = 0.0; … … 313 315 if ( type == "x" ) 314 316 { 315 for (k= indexDeb; k <= indexFin; k++)317 for (k= numeroDeb; k <= numeroFin; k++) 316 318 { 317 if ( !diagnosticBeam_.at(k ).momentRepresentationOk() ) diagnosticBeam_.at(k).buildMomentRepresentation();318 longueur += pspa_->getBeamLine()->getAbstractElement(k )->getLenghtOfElement();319 valeur = diagnosticBeam_.at(k ).getXmaxRms();319 if ( !diagnosticBeam_.at(k-1).momentRepresentationOk() ) diagnosticBeam_.at(k-1).buildMomentRepresentation(); 320 longueur += pspa_->getBeamLine()->getAbstractElement(k-1)->getLenghtOfElement(); 321 valeur = diagnosticBeam_.at(k-1).getXmaxRms(); 320 322 xcor.push_back(longueur); 321 323 ycor.push_back(valeur);
Note: See TracChangeset
for help on using the changeset viewer.