Ignore:
Timestamp:
Feb 5, 2013, 2:23:23 PM (12 years ago)
Author:
lemeur
Message:

suppression designation elements par index + fin generator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc

    r308 r312  
    5555
    5656
    57 abstractElement* dataManager::getElementPointerFromIndex(int k){
    58     return pspa_->getBeamLine()->getAbstractElement(k);
     57abstractElement* dataManager::getElementPointerFromNumero(int k){
     58    return pspa_->getBeamLine()->getAbstractElement(k-1);
    5959}
    6060
     
    8585  unsigned k,j;
    8686  diagnostic.clear();
    87   unsigned indexDeb, indexFin;
     87  unsigned numeroDeb, numeroFin;
    8888  cout << "controle execution : " << endl;
    8989  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 )
    9393      {
    9494        diagnostic += " last element before first  for job " + (jobList_[k]->software).getString() + " \n";
     
    9696        break;
    9797      }
    98     cout << " indexDeb= " << indexDeb << " indexFin= " << indexFin << endl;
    99     indexDeb--;
    100     indexFin--;
     98    cout << " numeroDeb= " << numeroDeb << " numeroFin= " << numeroFin << endl;
     99    // indexDeb--;
     100    // indexFin--;
    101101   
    102102    abstractElement* elPtr;
    103103    string checkCompatibility;
    104     resul = checkElementsForExec(jobList_[k]->software, indexDeb, indexFin, checkCompatibility);
     104    resul = checkElementsForExec(jobList_[k]->software, numeroDeb, numeroFin, checkCompatibility);
    105105    diagnostic += checkCompatibility;
    106106  }
     
    110110
    111111
    112 trivaluedBool dataManager::checkElementsForExec(nomDeLogiciel logiciel, unsigned indexDeb, unsigned indexFin, string& diagnostic)
     112trivaluedBool dataManager::checkElementsForExec(nomDeLogiciel logiciel, unsigned numeroDeb, unsigned numeroFin, string& diagnostic)
    113113{
    114114    trivaluedBool resul = ok;
     
    116116    trivaluedBool accepted;
    117117    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);
    120120        accepted = elPtr->is_accepted_by_software(logiciel);
    121121        if(accepted  == error  ) {
     
    192192        resultatPartiel += " error creating input file \n";
    193193      } else {
    194         success = softw->execute(debut,fin,workingDir_,resultatPartiel);
     194        success = softw->execute(inputFileName, debut,fin,workingDir_,resultatPartiel);
    195195        if ( success ) {
    196196          success = softw->buildBeamAfterElements(debut, fin, diagnosticBeam_, workingDir_);
    197197          if ( !success ) {
    198             resultatPartiel += " readingt results failed \n";
     198            resultatPartiel += " reading results failed \n";
    199199          }
    200200        }
    201201      }
    202202      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      }
    205210      resul += resultatPartiel;
    206211      if ( !success ) break;
     
    303308    if ( numeroDeb < 1 ) numeroDeb = 1;
    304309    if ( numeroFin > diagnosticBeam_.size() ) numeroFin = diagnosticBeam_.size();
    305    
    306     unsigned indexDeb = numeroDeb -1;
    307     unsigned indexFin = numeroFin -1;
    308    
     310       
    309311    double longueur = 0.0;
    310312    double valeur = 0.0;
     
    313315    if ( type == "x" )
    314316    {
    315         for (k= indexDeb; k <= indexFin; k++)
     317        for (k= numeroDeb; k <= numeroFin; k++)
    316318        {
    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();
    320322            xcor.push_back(longueur);
    321323            ycor.push_back(valeur);
Note: See TracChangeset for help on using the changeset viewer.