Changeset 371 in PSPA


Ignore:
Timestamp:
Mar 6, 2013, 3:19:19 PM (11 years ago)
Author:
touze
Message:

nvx histos

Location:
Interface_Web/trunk/pspaWT/sources
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/controler/include/particleBeam.h

    r366 r371  
    4343  unsigned indexFromPspaToTransport(unsigned index) const;
    4444
    45   void preparationDesHistogrammes(int index,vector<double>& vshf,double out[3]);
    46   void remplissageDesHistogrammes(double val[2],vector<double>vshf,vector<double>&xcor,vector<int>& hist,int& cnts);
     45  void histogramComponent(vector<double>& coord,unsigned int index);
     46  void histogramInitialize(unsigned int index,vector<double>& vshf,double out[3]);
     47  void histogramPacking(double ecatyp,vector<double>vshf,vector<double>&xcor,vector<int>& hist);
    4748
    4849  double getSigmaTransportij(unsigned indexI, unsigned indexJ);
     
    112113  virtual string FileOutputFlow() const;
    113114  virtual bool FileInput(ifstream& ifs);
    114   //void histogramme(vector<double>&xcor,vector<int>& hist,int& cnts,double out[3]);
    115   void histogramme(int index,vector<double>&xcor,vector<int>& hist,int& cnts,double out[3]);
     115
     116  void histogramme(unsigned int index,vector<double>&xcor,vector<int>& hist,double out[3]);
    116117};
    117118#endif
  • Interface_Web/trunk/pspaWT/sources/controler/src/abstractElement.cc

    r361 r371  
    119119        tb = TBoolError;
    120120    }
     121
    121122    if ((tb == TBoolOk) || (tb == TBoolIgnore)) {
    122         if (prog == nomDeLogiciel::parmela){
    123             abstractSoftware_ = new softwareParmela();
    124         } else if (prog == nomDeLogiciel::transport) {
    125             abstractSoftware_ = new softwareTransport();
    126         } else if (prog == nomDeLogiciel::generator) {
    127             abstractSoftware_ = new softwareGenerator();
    128         } else if (prog == nomDeLogiciel::test) {
    129             abstractSoftware_ = new softwareTest();
    130         } else if (prog == nomDeLogiciel::unknownSoftware) {
    131             abstractSoftware_ = NULL;
    132         }
     123      if (prog == nomDeLogiciel::parmela) {
     124        abstractSoftware_ = new softwareParmela();
     125      } else if (prog == nomDeLogiciel::transport) {
     126        abstractSoftware_ = new softwareTransport();
     127      } else if (prog == nomDeLogiciel::generator) {
     128        abstractSoftware_ = new softwareGenerator();
     129      } else if (prog == nomDeLogiciel::test) {
     130        abstractSoftware_ = new softwareTest();
     131      } else if (prog == nomDeLogiciel::unknownSoftware) {
     132        abstractSoftware_ = NULL;
     133      }
    133134    }
    134135    return tb;
  • Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc

    r368 r371  
    6161abstractElement* dataManager::getElementPointerFromNumero(int k)
    6262{
    63     return pspa_->getBeamLine()->getAbstractElement(k-1);
    64 }
    65 
     63  return pspa_->getBeamLine()->getAbstractElement(k-1);
     64}
    6665
    6766void dataManager::addSectionToExecute(int debut, int fin, nomDeLogiciel prog)
     
    8483
    8584
    86 
    87 
    88 
    8985void dataManager::initializeExecution()
    9086{
    91     string workingDir = pspa_->getWorkingDir();
    92     if (workingDir == "") {
    93         return;
    94     }
    95     removeFile(workingDir + "parmdesz");
    96     removeFile(workingDir + "parmin");
    97     removeFile(workingDir + "parin.input0");
    98     removeFile(workingDir + "transport.input");
    99     removeFile(workingDir + "transport.output");
    100     removeFile(workingDir + "generator.in");
    101     removeFile(workingDir + "faisceau.ini");
    102     removeFile(workingDir + "generator.output");
    103     diagnosticBeam_.clear();
    104     currentBeam_ = NULL;
    105     firstComputedElemNumero_ = getBeamLineSize();
    106     lastComputedElemNumero_ = 1;
    107     clearSectionToExecute();
     87  string workingDir = pspa_->getWorkingDir();
     88  if (workingDir == "") {
     89    return;
     90  }
     91  removeFile(workingDir + "parmdesz");
     92  removeFile(workingDir + "parmin");
     93  removeFile(workingDir + "parin.input0");
     94  removeFile(workingDir + "transport.input");
     95  removeFile(workingDir + "transport.output");
     96  removeFile(workingDir + "generator.in");
     97  removeFile(workingDir + "faisceau.ini");
     98  removeFile(workingDir + "generator.output");
     99  diagnosticBeam_.clear();
     100  currentBeam_ = NULL;
     101  firstComputedElemNumero_ = getBeamLineSize();
     102  lastComputedElemNumero_ = 1;
     103  clearSectionToExecute();
    108104}
    109105
     
    120116bool dataManager::executeAll()
    121117{
    122     bool success = true;
    123     abstractSoftware* softw = NULL;
    124     string workingDir = pspa_->getWorkingDir();
    125    
    126     for(unsigned k = 0; k < jobList_.size(); k++)
     118  bool success = true;
     119  abstractSoftware* softw = NULL;
     120  string workingDir = pspa_->getWorkingDir();
     121 
     122  for(unsigned k = 0; k < jobList_.size(); k++)
    127123    {
    128         cout << " dataManager::executeAll je m'apprete a executer : " << (jobList_[k]->software).getString() << endl;
     124      cout << " dataManager::executeAll je m'apprete a executer : " << (jobList_[k]->software).getString() << endl;
     125     
     126      int debut = jobList_[k]->firstElement;
     127      int fin = jobList_[k]->lastElement;
     128      softw = createSoftwareConnexion(jobList_[k]->software);
     129     
     130      if (softw == NULL) {
     131        success = false;
     132        consoleMessage("dataManager::executeAll : unknown software");
     133        break;
     134      }
    129135       
    130         int debut = jobList_[k]->firstElement;
    131         int fin = jobList_[k]->lastElement;
    132         softw = createSoftwareConnexion(jobList_[k]->software);
     136      success = softw->createInputFile(currentBeam_,debut,fin,workingDir);
     137      if ( success ) {
     138        success = softw->execute(debut,fin,workingDir);
     139        if ( success ) {
     140          success = softw->buildBeamAfterElements(debut,fin,diagnosticBeam_,workingDir);
     141        }
     142      }
    133143       
    134         if (softw == NULL) {
    135             success = false;
    136             consoleMessage("dataManager::executeAll : unknown software");
    137             break;
    138         }
    139        
    140         success = softw->createInputFile(currentBeam_,debut,fin,workingDir);
    141         if ( success ) {
    142             success = softw->execute(debut,fin,workingDir);
    143             if ( success ) {
    144                 success = softw->buildBeamAfterElements(debut,fin,diagnosticBeam_,workingDir);
    145             }
    146         }
    147        
    148         delete softw;
    149         if ( success ) {
    150             currentBeam_ = &diagnosticBeam_.back();
    151             cout << " execute termine avec succes " << endl;
    152         } else {
    153             currentBeam_ = NULL;
    154             cout << " execute termine en ECHEC " << endl;
    155         }
    156         if ( !success ) break;
    157        
    158 
    159         if ( debut < firstComputedElemNumero_ ) firstComputedElemNumero_ = debut;
    160         if ( fin > lastComputedElemNumero_ ) lastComputedElemNumero_ = fin;
    161 
    162         //debug
    163         cout << "dataManager::executeAll #diagnosticBeam= " << diagnosticBeam_.size() << endl;
    164         cout << "dataManager::executeAll #getBeamLineSize()= " << getBeamLineSize() << endl;
    165         for (int j = debut; j <= fin; j++) {
    166             abstractElement* elPtr= getElementPointerFromNumero(j);
    167             cout << "[" << j << "] " << elPtr->getNomdElement().getElementName() << endl;
    168         }
    169        
     144      delete softw;
     145      if ( success ) {
     146        currentBeam_ = &diagnosticBeam_.back();
     147        cout << " execute termine avec succes " << endl;
     148      } else {
     149        currentBeam_ = NULL;
     150        cout << " execute termine en ECHEC " << endl;
     151      }
     152      if ( !success ) break;
     153     
     154     
     155      if ( debut < firstComputedElemNumero_ ) firstComputedElemNumero_ = debut;
     156      if ( fin > lastComputedElemNumero_ ) lastComputedElemNumero_ = fin;
     157     
     158      //debug
     159      cout << "dataManager::executeAll #diagnosticBeam= " << diagnosticBeam_.size() << endl;
     160      cout << "dataManager::executeAll #getBeamLineSize()= " << getBeamLineSize() << endl;
     161      for (int j = debut; j <= fin; j++) {
     162        abstractElement* elPtr= getElementPointerFromNumero(j);
     163        cout << "[" << j << "] " << elPtr->getNomdElement().getElementName() << endl;
     164      }
    170165    } //k
    171     cout << " dataManager::executeAll premier element : " << firstComputedElemNumero_ << " dernier : " << lastComputedElemNumero_ << endl;
    172     return success;
     166 
     167  cout << " dataManager::executeAll premier element : " << firstComputedElemNumero_ << " dernier : " << lastComputedElemNumero_ << endl;
     168 
     169  return success;
    173170}
    174171
  • Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc

    r366 r371  
    350350}
    351351
    352 void particleBeam::particlesPhaseSpaceComponent(vector<double>& coord, unsigned index) {
     352void particleBeam::particlesPhaseSpaceComponent(vector<double>& coord, unsigned index)
     353{
    353354  if ( !particleRepresentationOk_ ) return;
     355 
    354356  coord.clear();
    355357  coord.resize(goodPartic_.size(), 0.0 );
     
    527529}
    528530
    529 void particleBeam::histogramme(int iabs,vector<double>&xcor,vector<int>& hist,int& cnts,double out[3])
    530 { 
     531void particleBeam::histogramme(unsigned int iabs,vector<double>&xcor,vector<int>& hist,double out[3])
     532{
    531533  vector<double> vshf;
    532   preparationDesHistogrammes(iabs,vshf,out);
    533  
    534   double val[2];
    535   if(iabs < 3) {
    536      val[0] = 100.0;
    537      val[1] = out[2];
    538    } else {
    539      val[0] = out[1];
    540      val[1] = out[2];
    541    }
    542   remplissageDesHistogrammes(val,vshf,xcor,hist,cnts);
    543 
    544   // sortie pour la legende: out[0]= entries, out[1]= mean, out[2]= std deviation
    545   if(iabs < 3) {
    546     out[1] *= 1.0 ; // en m ?
    547     out[2] *= 1000.0; //mm
    548   } else {
    549     out[1] *= EREST_MeV ; //MeV
    550     out[2] *= EREST_keV; //KeV
    551   }
    552 }
    553 
    554 void particleBeam::preparationDesHistogrammes(int index,vector<double>& vshf,double out[3])
     534  histogramComponent(vshf,iabs);
     535  histogramInitialize(iabs,vshf,out);
     536  histogramPacking(out[2],vshf,xcor,hist);
     537
     538  // out[0]= nbre de particules, out[1]= moyenne, out[2]= ecart-type
     539  if(iabs == 0 || iabs == 1 || iabs == 2) {
     540    out[2] *= 1000.0; // ecart-type en mm
     541  }
     542
     543  if(iabs == 5) {
     544    for (unsigned int i = 0; i <= xcor.size(); ++i) {
     545      xcor[i] = 100.*xcor[i]/out[1]; // en %
     546    }
     547    out[1] *= EREST_MeV; // moyenne en MeV
     548    out[2] *= EREST_keV; // ecart-type en KeV
     549  }
     550}
     551
     552void particleBeam::histogramComponent(vector<double>& coord,unsigned int index)
     553
     554  coord.clear();
     555  coord.resize(goodPartic_.size(),0.0);
     556 
     557  if(index == 0 || index == 1 || index == 2)
     558    {
     559      // collecte d'une coordonnee x(index= 0), y(index= 1) ou z(index= 2) des particules
     560      for (unsigned int k = 0; k < goodPartic_.size(); k++) {
     561        coord.at(k) = goodPartic_.at(k).getPosition().getComponent(index);
     562      }
     563    }
     564
     565  if(index == 3 || index == 4)
     566    {
     567      // collecte de begamx (index= 3), begamy (index= 4)
     568      for (unsigned int k = 0; k < goodPartic_.size(); k++) {
     569        double begamz = goodPartic_.at(k).getBetaGamma().getComponent(2);
     570        if (begamz == 0.0) continue;
     571        double begam = goodPartic_.at(k).getBetaGamma().getComponent(index-3);
     572        coord.at(k) = 1000.0*begam/begamz;  //pi.mm.mradians
     573      }
     574    }
     575 
     576  if(index == 5)
     577    {
     578      // collecte de l'energie acquise par les particules
     579      for (unsigned int k = 0; k < goodPartic_.size(); k++) {
     580        double gamma = goodPartic_.at(k).getGamma();
     581        coord.at(k) = gamma-1.0;
     582      }
     583    }
     584}
     585
     586void particleBeam::histogramInitialize(unsigned int index,vector<double>& vshf,double out[3])
    555587{
    556588  double vmin= GRAND;
     
    558590  double vmoy= 0.0;
    559591  double ecatyp= 0.0;
     592 
     593  for (unsigned int k = 0; k < goodPartic_.size(); k++) {
     594    if (vshf[k] < vmin) vmin = vshf[k];
     595    else if (vshf[k] > vmax) vmax = vshf[k];
     596    vmoy += vshf[k];
     597    ecatyp += vshf[k]*vshf[k];
     598  }
    560599
    561600  double sum= (float)goodPartic_.size();
    562   if(index < 3)
    563     {
    564       // collecte d'une coordonnee x(index= 0), y(index= 1) ou z(index= 2) des particules
    565       for (unsigned int k = 0; k < goodPartic_.size(); k++) {
    566         double val = goodPartic_.at(k).getPosition().getComponent(index);
    567         if (val < vmin) vmin = val;
    568         else if (val > vmax) vmax = val;
    569         vmoy += val;
    570         ecatyp += val*val;
    571       }
    572 
    573       out[0]= sum;
    574       vmoy /= sum;
    575       out[1]= vmoy;
    576       ecatyp /= sum;
    577       ecatyp = sqrt(abs(ecatyp-vmoy*vmoy));
    578       out[2]= ecatyp;
    579     }
    580   else
    581     {
    582       // collecte de l'energie acquise par les particules
    583       for (unsigned int k = 0; k < goodPartic_.size(); k++) {
    584         double gamma = goodPartic_.at(k).getGamma();
    585         if (gamma < vmin) vmin = gamma;
    586         else if (gamma > vmax) vmax = gamma;
    587         double val = gamma-1.0;
    588         vmoy += val;
    589         ecatyp += val*val;
    590       }
    591      
    592       out[0]= sum;
    593       vmoy /= sum;
    594       out[1]= vmoy;
    595       ecatyp /= sum;
    596       ecatyp = sqrt(abs(ecatyp-vmoy*vmoy));
    597       out[2]= ecatyp;
    598     }
    599  
     601  out[0]= sum;
     602  vmoy /= sum;
     603  out[1]= vmoy;
     604  ecatyp /= sum;
     605  ecatyp = sqrt(abs(ecatyp-vmoy*vmoy));
     606  out[2]= ecatyp;
     607
    600608  if(index == 0) {
    601     cout << "position X -moyenne " << vmoy << " m " << "-mini " << vmin << " m " << "-maxi " << vmax << " m " << "ecart type " << ecatyp*1000.0 << " mm" << endl;
    602   } else if(index == 1) {
    603     cout << "position Y -moyenne " << vmoy << " m " << "-mini " << vmin << " m " << "-maxi " << vmax << " m " << "ecart type " << ecatyp*1000.0 << " mm" << endl;
    604   } else if(index == 2) {
    605     cout << "position Z -moyenne " << vmoy << " m " << "-mini " << vmin << " m " << "-maxi " << vmax << " m " << "ecart type " << ecatyp*1000.0 << " mm" << endl;
    606   } else {
     609    cout << "position x -moyenne " << vmoy << " m " << "-mini " << vmin << " m " << "-maxi " << vmax << " m " << "ecart type " << ecatyp*1000.0 << " mm" << endl;
     610  }
     611  if(index == 1) {
     612    cout << "position y -moyenne " << vmoy << " m " << "-mini " << vmin << " m " << "-maxi " << vmax << " m " << "ecart type " << ecatyp*1000.0 << " mm" << endl;
     613  }
     614  if(index == 2) {
     615    cout << "position z -moyenne " << vmoy << " m " << "-mini " << vmin << " m " << "-maxi " << vmax << " m " << "ecart type " << ecatyp*1000.0 << " mm" << endl;
     616  }
     617  if(index == 3) {
     618    cout << "divergence xp -moyenne " << vmoy << " pi.mm.mrad " << "-mini " << vmin << " pi.mm.mrad " << "-maxi " << vmax << " pi.mm.mrad " << "ecart type " << ecatyp << " pi.mm.mrad" << endl;
     619  }
     620  if(index == 4) {
     621    cout << "divergence yp -moyenne " << vmoy << " pi.mm.mrad " << "-mini " << vmin << " pi.mm.mrad " << "-maxi " << vmax << " pi.mm.mrad " << "ecart type " << ecatyp << " pi.mm.mrad" << endl;
     622  }
     623  if(index == 5) {
    607624    double gmin = vmin-1.0;
    608625    double gmax = vmax-1.0;
     
    610627  }
    611628
    612   //pouVoir: autre maniere de calculer l'ecart-type
    613   double stdev= 0.0;
    614 
    615   if(!vshf.empty()) vshf.clear();
    616   vshf.resize(goodPartic_.size()); 
    617   if(index < 3)
    618     {
    619       for (unsigned int k = 0; k < goodPartic_.size(); k++) {
    620         double val = goodPartic_.at(k).getPosition().getComponent(index);
    621         vshf[k]= val-vmoy;
    622         stdev += vshf[k]*vshf[k];
    623       }
    624     }
    625   else
    626     {
    627       for (unsigned int k = 0; k < goodPartic_.size(); k++) {
    628         double gamma = goodPartic_.at(k).getGamma();
    629         double val = gamma-1.0;
    630         vshf[k]= val-vmoy;
    631         stdev += vshf[k]*vshf[k];
    632       }
    633     }
    634 
    635   stdev /= sum;
    636   stdev = sqrt(stdev);
    637   cout << "stdev " << stdev << ", ecatyp " << ecatyp << ", diff " << stdev-ecatyp << endl;
    638 }
    639 
    640 void particleBeam::remplissageDesHistogrammes(double val[2],vector<double>vshf,vector<double>&xcor,vector<int>& hist,int& cnts)
     629  for (unsigned int k = 0; k < goodPartic_.size(); k++) {
     630    vshf[k] -= vmoy;
     631  }
     632}
     633
     634void particleBeam::histogramPacking(double ecatyp,vector<double>vshf,vector<double>&xcor,vector<int>& hist)
    641635{
    642   double vmoy  = val[0];
    643   double ecatyp= val[1];
    644 
    645636  // demi fenetre hfene= max(3.*ecatyp-vmoy,vmoy-3.*ecatyp);
    646637  double hfene= 3.*ecatyp;
     
    661652  double vmax= vmin+hpas*ihist;
    662653 
    663   cout << "'xAxisNumberOfBins= " << ihist <<", xAxisMinimum= " << vmin << ", xAxisMaximum= " << vmax << ", NParticules= " << vshf.size() << ", phist " << phist << endl;
    664 
     654  cout << "xAxisNumberOfBins= " << ihist <<", xAxisMinimum= " << vmin << ", xAxisMaximum= " << vmax << ", NParticules= " << vshf.size() << ", phist " << phist << endl;
     655 
    665656  if(!xcor.empty()) xcor.clear();
    666  
    667   // pourVoir /////////////////////////////////////
    668   // xcor.resize(ihist); 
    669   // for (int i = 0; i < ihist; ++i) {
    670   //   // on gradue l'abscisse en pourcents
    671   //   xcor[i]= 100.*( vmin+i*hpas )/vmoy;
    672   // }
    673 
    674657  xcor.resize(ihist+1); 
    675658  for (int i = 0; i <= ihist; ++i) {
    676     xcor[i]= 100.*( vmin+i*hpas )/vmoy;
    677   }
     659    xcor[i] = vmin+i*hpas;
     660  }
     661
    678662  /////////////////////////////////////
    679663
    680664  if(!hist.empty()) hist.clear();
    681665  hist.resize(ihist,0); 
    682   for (unsigned i = 0; i < vshf.size(); ++i) {
     666  for (unsigned int i = 0; i < vshf.size(); ++i) {
    683667    double var= vshf[i]-vmin;
    684668    if(var < 0 ) {
     
    695679    hist[kk]++;
    696680  }
    697 
    698   cnts= 0;
    699   for (int i = 0; i < ihist; ++i) {
    700     if(hist.at(i) > 0) cnts++;
    701   }
    702   cout<< " ... cnts=  " << cnts << endl;
    703 }
    704 
    705 // void particleBeam::histogramme(vector<double>&xcor,vector<int>& hist,int& cnts,double out[3])
    706 // {
    707 //   // sortie pour la legende: out[0]= entries, out[1]= mean, out[2]= rms
    708 
    709 //   // on calcule avec les gammas ; les MeV c'est pour les sorties
    710 
    711 //   double gammin= GRAND;
    712 //   double gammax= -gammin;
    713 //   //  double Emoy= 0.0;
    714 //   double ecatyp= 0.0;
    715 //   double gmoy=0.0;
    716 //   for (unsigned int k = 0; k < goodPartic_.size(); k++)
    717 //     {
    718 //       double gamma = goodPartic_.at(k).getGamma();
    719 //       //      double EMev = (gamma-1.0)*ERESTMeV;
    720 //       if (gamma < gammin) gammin = gamma;
    721 //       else if (gamma > gammax) gammax = gamma;
    722 //       //      Emoy += EMev;
    723 //       double g = gamma-1.0;
    724 //       gmoy += g;
    725 //       //      ecatyp += EMev*EMev;
    726 //       ecatyp += g*g;
    727 //     }
    728 
    729 //   double sum= (float)goodPartic_.size();
    730 //   out[0]= sum;
    731 //   //  Emoy /= sum;
    732 //   gmoy /= sum;
    733 //   //  out[1]= Emoy; //MeV
    734 //   out[1]= gmoy*EREST_MeV ; //MeV
    735 //   ecatyp /= sum;
    736 //   //  out[2]= 1000.0*sqrt(ecatyp); //KeV
    737 //   //  ecatyp = sqrt(abs(ecatyp-Emoy*Emoy));
    738 
    739 //   ecatyp = sqrt(abs(ecatyp-gmoy*gmoy));
    740 //   out[2]= ecatyp*EREST_keV; //KeV
    741 
    742 //   double gmin = gammin-1.0;
    743 //   double gmax = gammax-1.0;
    744 //   cout << "energie cinetique -moyenne " << gmoy*EREST_MeV << " Mev " << "-mini " << gmin*EREST_MeV << " Mev " << "-maxi " << gmax*EREST_MeV << " Mev " << "ecart type " << ecatyp*EREST_keV << " Kev" << endl;
    745 
    746 //   vector<double> Eshf;
    747 //   for (unsigned int k = 0; k < goodPartic_.size(); k++)
    748 //     {
    749 //       double gamma = goodPartic_.at(k).getGamma();
    750 //       // double EMev = (gamma-1.0)*ERESTMeV;
    751 //       // Eshf.push_back(EMev-Emoy);
    752 //       // modif glm 2/03/2013
    753 //       double g = (gamma-1.0);
    754 //       Eshf.push_back( (g-gmoy) );
    755 //     }
    756 
    757 //   //////////////////////////////////////////////////////////////////////////////
    758  
    759 //   // demi fenetre en energie, et pas de l'histogramme
    760 //   //  double hfene= max(3.*ecatyp-Emoy,Emoy-3.*ecatyp);
    761 //   double hfene= 3.*ecatyp;
    762 //   double hpas = hfene/25.;
    763 
    764 //   cout << "demi fenetre " << hfene << ", hpas= " << hpas << endl;
    765 
    766 //   double vmin = -hfene;
    767 //   double dfen = 2.*hfene;
    768 //   int ihist = dfen/hpas;
    769 //   double phist = ihist*hpas;
    770 //   double dpas = hpas-(dfen-phist);
    771 //   if(dpas <= hpas*1.e-03) {
    772 //     ihist++;
    773 //     phist= ihist*hpas;
    774 //   }
    775 //   double vmax= vmin+hpas*ihist;
    776  
    777 //   cout << "'xAxisNumberOfBins= " << ihist <<", xAxisMinimum= " << vmin << ", xAxisMaximum= " << vmax << ", NParticules= " << Eshf.size() << ", phist " << phist << endl;
    778 
    779 //   xcor= vector<double>(ihist);
    780 //   for (int i = 0; i < ihist; ++i) {
    781 
    782 //     // on gradue l'abscisse en pourcents
    783 //     //   xcor[i]= 100.*( vmin+i*hpas );
    784 //     xcor[i]= 100.*( vmin+i*hpas )/gmoy;
    785 //   }
    786 
    787 //   hist= vector<int>(ihist,0);
    788 //   for (unsigned i = 0; i < Eshf.size(); ++i) {
    789 //     double var= Eshf[i]-vmin;
    790 //     //    if(var < 0 || var >= phist) cout<<"out of range "<<var<<", ("<< i<<")"<< endl;
    791 //     if(var < 0 ) {
    792 //       cout<<"lesser that the minimum "<<var<<", ("<< i<<")"<< endl;
    793 //       hist[0]++;
    794 //     }
    795 //     if(var >= phist) {
    796 //       cout<<"greater that the maximum "<<var<<", ("<< i<<")"<< endl;
    797 //       hist[ihist-1]++;
    798 //     }
    799 //     //    int k= var/hpas;
    800 //     int kk= (int)floor(var/hpas);
    801 //     //if(i%20 == 0) cout<<"v("<<i<<")= " <<var<<" ["<<k<<"-"<<kk<<"], "<<endl;
    802 //     hist[kk]++;
    803 //   }
    804 
    805 //   cnts= 0;
    806 //   for (int i = 0; i < ihist; ++i) {
    807 //     if(hist.at(i) > 0) cnts++;
    808 //     //cout<<"("<<xcor.at(i)<<","<<hist.at(i)<<") ";
    809 //   }
    810 //   cout<< " ... cnts=  " << cnts << endl;
    811 // }
     681}
     682
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc

    r359 r371  
    1515bool softwareParmela::createInputFile(particleBeam* beamBefore,unsigned int numeroDeb,unsigned int numeroFin,string workingDir)
    1616{
    17     unsigned int k;
    18    
    19     if ( numeroDeb < 1 || numeroFin > dataManager_->getBeamLineSize() ) {
    20         dataManager_->consoleMessage(" softwareParmela::createInputFile : numero of element out of limits " );
    21         cerr << " numero of element out of limits " << endl;
    22         return false;
    23     }
    24    
    25     string name = workingDir + inputFileName_;
    26     ofstream outfile;
    27     outfile.open(name.c_str(), ios::out);
    28     if (!outfile) {
    29         dataManager_->consoleMessage(" softwareParmela::createInputFile : error opening output stream " );
    30         cerr << " softwareParmela::createInputFile : error opening output stream " << name << endl;
    31         return false;
    32     }
    33    
    34     abstractElement* elPtr;
    35     double initalKineticEnergy = 0.0;
    36     elPtr = dataManager_->getElementPointerFromNumero(numeroDeb);
    37     bool there_is_rfgun = ( elPtr->getNomdElement().getElementType() == RFgun );
    38    
    39     if ( !there_is_rfgun ) {
    40         string nameOfInput = workingDir + "parin.input0";
    41         if ( !beamToParmela(nameOfInput,beamBefore) ) return false;
    42         initalKineticEnergy = beamBefore->referenceKineticEnergyMeV();
    43         // les elements de parmela sont indexes de 1 à max, s'il n'y a pas de rfgun
    44         offsetNumElem_ = numeroDeb -1;
    45     } else {
    46         elPtr->setPhaseStep( globParamPtr_->getIntegrationStep() );
    47         initalKineticEnergy = elPtr->getInitialKineticEnergy();
    48         // les elements de parmela sont indexes de 0 à max, s'il y a un rfgun
    49         offsetNumElem_ = numeroDeb;
    50     }
    51    
    52     outfile << "TITLE" << endl;
    53     outfile << " titre provisoire " << endl;
    54     outfile << "RUN /n0=1 /ip=999 /freq=" << globParamPtr_->getFrequency() << "  /z0=0.0 /W0=" << initalKineticEnergy << "  /itype=1" << endl;
    55     outfile << "OUTPUT 0" << endl;
    56     unsigned int premier = numeroDeb ;
    57     if ( there_is_rfgun ) {
    58         outfile << dataManager_->getElementPointerFromNumero(numeroDeb)->parmelaOutputFlow() << endl;
    59         premier++;
    60     } else {
    61         outfile << "INPUT 0 /NP=" << beamBefore->getNbParticles() << endl;
    62     }
    63    
    64     // commentaire :  si l'element est un snapshot ne rien ecrire dans inputFileName_ (= parmin) un saut de ligne perturbe l'execution de parmela
    65     for ( k = premier; k <= numeroFin; k++)
    66     {
    67         elPtr = dataManager_->getElementPointerFromNumero(k);
    68         if (elPtr) {
    69             if(elPtr->getNomdElement().getElementType() == snapshot) continue;
    70             outfile << elPtr->parmelaOutputFlow() << endl;
    71         }
    72     }
    73    
    74     outfile << "ZOUT" << endl;
    75     outfile << "START /wt=0.0 /dwt=" << globParamPtr_->getIntegrationStep() << "  /nsteps=" << globParamPtr_->getNbSteps() << "  nsc=" << globParamPtr_->getScPeriod() << "  /nout=10" << endl;
    76     outfile << "END" << endl;
    77     outfile.close();
    78     dataManager_->consoleMessage("fichier input termine pour PARMELA");
    79     return true;
     17  unsigned int k;
     18   
     19  if ( numeroDeb < 1 || numeroFin > dataManager_->getBeamLineSize() ) {
     20    dataManager_->consoleMessage(" softwareParmela::createInputFile : numero of element out of limits " );
     21    cerr << " numero of element out of limits " << endl;
     22    return false;
     23  }
     24   
     25  string name = workingDir + inputFileName_;
     26  ofstream outfile;
     27  outfile.open(name.c_str(), ios::out);
     28  if (!outfile) {
     29    dataManager_->consoleMessage(" softwareParmela::createInputFile : error opening output stream " );
     30    cerr << " softwareParmela::createInputFile : error opening output stream " << name << endl;
     31    return false;
     32  }
     33 
     34  abstractElement* elPtr;
     35  double initalKineticEnergy = 0.0;
     36  elPtr = dataManager_->getElementPointerFromNumero(numeroDeb);
     37  bool there_is_rfgun = ( elPtr->getNomdElement().getElementType() == RFgun );
     38 
     39  if ( !there_is_rfgun ) {
     40    string nameOfInput = workingDir + "parin.input0";
     41    if ( !beamToParmela(nameOfInput,beamBefore) ) return false;
     42    initalKineticEnergy = beamBefore->referenceKineticEnergyMeV();
     43    // les elements de parmela sont indexes de 1 à max, s'il n'y a pas de rfgun
     44    offsetNumElem_ = numeroDeb -1;
     45  } else {
     46    elPtr->setPhaseStep( globParamPtr_->getIntegrationStep() );
     47    initalKineticEnergy = elPtr->getInitialKineticEnergy();
     48    // les elements de parmela sont indexes de 0 à max, s'il y a un rfgun
     49    offsetNumElem_ = numeroDeb;
     50  }
     51 
     52  outfile << "TITLE" << endl;
     53  outfile << " titre provisoire " << endl;
     54  outfile << "RUN /n0=1 /ip=999 /freq=" << globParamPtr_->getFrequency() << "  /z0=0.0 /W0=" << initalKineticEnergy << "  /itype=1" << endl;
     55  outfile << "OUTPUT 0" << endl;
     56  unsigned int premier = numeroDeb ;
     57  if ( there_is_rfgun ) {
     58    outfile << dataManager_->getElementPointerFromNumero(numeroDeb)->parmelaOutputFlow() << endl;
     59    premier++;
     60  } else {
     61    outfile << "INPUT 0 /NP=" << beamBefore->getNbParticles() << endl;
     62  }
     63 
     64  // commentaire :  si l'element est un snapshot ne rien ecrire dans inputFileName_ (= parmin) un saut de ligne perturbe l'execution de parmela
     65  for ( k = premier; k <= numeroFin; k++)
     66    {
     67      elPtr = dataManager_->getElementPointerFromNumero(k);
     68      if (elPtr) {
     69        if(elPtr->getNomdElement().getElementType() == snapshot) continue;
     70        outfile << elPtr->parmelaOutputFlow() << endl;
     71      }
     72    }
     73   
     74  outfile << "ZOUT" << endl;
     75  outfile << "START /wt=0.0 /dwt=" << globParamPtr_->getIntegrationStep() << "  /nsteps=" << globParamPtr_->getNbSteps() << "  nsc=" << globParamPtr_->getScPeriod() << "  /nout=10" << endl;
     76  outfile << "END" << endl;
     77  outfile.close();
     78  dataManager_->consoleMessage("fichier input termine pour PARMELA");
     79  return true;
    8080}
    8181
    8282bool softwareParmela::execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir)
    8383{
    84     bool ExecuteStatus = true;
    85    
    86     ostringstream sortie;
    87     sortie << " EXECUTION DE PARMELA DE l'ELEMENT " << numeroDeb << " A L'ELEMENT " << numeroFin << endl;
    88    
    89     string parmelaJob = workingDir + "parmela";
    90     parmelaJob += string("   ");
    91     parmelaJob += workingDir;
    92    
    93     string resultOfRun;
    94     bool success = launchJob(parmelaJob,resultOfRun);
    95     sortie << resultOfRun << endl;
    96     if ( !success ) {
    97         sortie << " launching of parmela failed " << endl;
    98         ExecuteStatus = false;
    99     } else {
    100         sortie << " successful launching of parmela " << endl;
    101         cout << " execution parmela MARCHE " << endl;
    102         string::size_type nn = (resultOfRun).find("normal");
    103         if ( nn == string::npos )
     84  bool ExecuteStatus = true;
     85 
     86  ostringstream sortie;
     87  sortie << " EXECUTION DE PARMELA DE l'ELEMENT " << numeroDeb << " A L'ELEMENT " << numeroFin << endl;
     88   
     89  string parmelaJob = workingDir + "parmela";
     90  parmelaJob += string("   ");
     91  parmelaJob += workingDir;
     92 
     93  string resultOfRun;
     94  bool success = launchJob(parmelaJob,resultOfRun);
     95  sortie << resultOfRun << endl;
     96  if ( !success ) {
     97    sortie << " launching of parmela failed " << endl;
     98    ExecuteStatus = false;
     99  } else {
     100    sortie << " successful launching of parmela " << endl;
     101    cout << " execution parmela MARCHE " << endl;
     102    string::size_type nn = (resultOfRun).find("normal");
     103    if ( nn == string::npos )
     104      {
     105        sortie << " abnormal exit of parmela " << endl;
     106        ExecuteStatus = false;
     107      }
     108  }
     109 
     110  dataManager_->consoleMessage(sortie.str());
     111  return ExecuteStatus;
     112}
     113
     114bool softwareParmela::buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir)
     115{
     116  bool result = true;
     117  cout << "debug:: debut " << numeroDeb << ", fin " << numeroFin << endl;
     118 
     119  // index du premier element de parmela
     120  int id= numeroDeb-offsetNumElem_;
     121 
     122  for(unsigned k = numeroDeb; k <= numeroFin; k++)
     123    {
     124      abstractElement* elem = dataManager_->getElementPointerFromNumero(k);
     125     
     126      // si l'element est un snapshot, recuperer la sortie precedente
     127      if(elem->getNomdElement().getElementType() == snapshot) {
     128        int avantDernier = beams.size() - 1;
     129        string* param = elem->getParametersString();
     130        string cliche = workingDir + param[2].c_str();
     131        if( beamToParmela(cliche,&beams.at(avantDernier)) ) {
     132          cout<<"["<<k<<"] : ecrit sur fichier " << cliche << " le contenu de beam["<<avantDernier<<"]"<<endl;
     133        }
     134        continue;
     135      }
     136     
     137      // sinon c'est un element de parmela d'index id
     138      beams.push_back(particleBeam());
     139      cout << " creation diagn. no " << beams.size() << " par PARMELA " << endl;
     140      vector<double> centroid;
     141      bareParticle refPart;
     142      vector<bareParticle> particles;
     143      double freq= globParamPtr_->getFrequency();
     144     
     145      if(!beamFromParmela(workingDir,id,freq,centroid,refPart,particles))
    104146        {
    105             sortie << " abnormal exit of parmela " << endl;
    106             ExecuteStatus = false;
    107         }
    108     }
    109    
    110     dataManager_->consoleMessage(sortie.str());
    111     return ExecuteStatus;
    112 }
    113 
    114 bool softwareParmela::buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir)
    115 {
    116     bool result = true;
    117     cout << "debug:: debut " << numeroDeb << ", fin " << numeroFin << endl;
    118    
    119     // index du premier element de parmela
    120     int id= numeroDeb-offsetNumElem_;
    121    
    122     for(unsigned k = numeroDeb; k <= numeroFin; k++)
    123     {
    124         abstractElement* elem = dataManager_->getElementPointerFromNumero(k);
    125        
    126         // si l'element est un snapshot, recuperer la sortie precedente
    127         if(elem->getNomdElement().getElementType() == snapshot) {
    128             int avantDernier = beams.size() - 1;
    129             string* param = elem->getParametersString();
    130             string cliche = workingDir + param[2].c_str();
    131             if( beamToParmela(cliche,&beams.at(avantDernier)) ) {
    132                 cout<<"["<<k<<"] : ecrit sur fichier " << cliche << " le contenu de beam["<<avantDernier<<"]"<<endl;
    133             }
    134             continue;
    135         }
    136        
    137         // sinon c'est un element de parmela d'index id
    138         beams.push_back(particleBeam());
    139         cout << " creation diagn. no " << beams.size() << " par PARMELA " << endl;
    140         vector<double> centroid;
    141         bareParticle refPart;
    142         vector<bareParticle> particles;
    143         double freq= globParamPtr_->getFrequency();
    144        
    145         if(!beamFromParmela(workingDir,id,freq,centroid,refPart,particles))
    146         {
    147             if(elem->is_accepted_by_software(nomDeLogiciel::parmela) == TBoolIgnore) {
    148                 int avantDernier = beams.size() -2;
    149                 beams.back() = beams.at(avantDernier);
    150             } else {
    151                 dataManager_->consoleMessage("softwareParmela::buildBeamAfterElements : reading parmdesz failed");
    152                 result = false;
    153                 break;
    154             }
    155            
     147          if(elem->is_accepted_by_software(nomDeLogiciel::parmela) == TBoolIgnore) {
     148            int avantDernier = beams.size() -2;
     149            beams.back() = beams.at(avantDernier);
     150          } else {
     151            dataManager_->consoleMessage("softwareParmela::buildBeamAfterElements : reading parmdesz failed");
     152            result = false;
     153            break;
     154          }
     155         
    156156        } else {
    157             beams.back().setWithParticles(centroid,refPart,particles);
    158         }
    159        
    160         // l'element de parmela suivant
    161         id++;
    162     }
    163    
    164     return result;
     157        beams.back().setWithParticles(centroid,refPart,particles);
     158      }
     159     
     160      // l'element de parmela suivant
     161      id++;
     162    }
     163 
     164  return result;
    165165}
    166166
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc

    r370 r371  
    277277  choixVariableHisto_->addItem("y");
    278278  choixVariableHisto_->addItem("z");
     279  choixVariableHisto_->addItem("xp");
     280  choixVariableHisto_->addItem("yp");
    279281  choixVariableHisto_->addItem("dE/E");
    280   choixVariableHisto_->setCurrentIndex(3);
     282  choixVariableHisto_->setCurrentIndex(5);
    281283
    282284  choixHistoDessin_ = new WComboBox();
     
    286288  glayout->addWidget(button3,3,1);
    287289  glayout->addWidget(choixHistoDessin_,3,2);
    288   //  glayout->addWidget(new WText(" of "),3,3);
    289290  glayout->addWidget(choixVariableHisto_,3,3);
    290291  /////////////////////////////////////////////////////////////////////
     
    600601  vector<string> legende;
    601602  beam->donneesDessinEllipse(xcor,ycor,legende, indexAbs, indexOrd);
    602   unsigned k;
     603
    603604  for (int k=0 ; k < legende.size(); k++) {
    604   new WBreak(ellipseDialog->contents());
     605    new WBreak(ellipseDialog->contents());
    605606    new WText(legende.at(k), ellipseDialog->contents());
    606607  }
    607608  //  beam->donneesDessinEllipseXxp(xcor,ycor);
    608609  //  scatterPlot1D(ellipseDialog->contents(),xcor,ycor); 
    609 chartPlot2vec(ellipseDialog->contents(), xcor, ycor, false,500,300);
    610 
    611 }
    612 
    613 
     610  chartPlot2vec(ellipseDialog->contents(), xcor, ycor, false,500,300);
     611}
    614612
    615613// void PspaApplication::scatterPlot1D(WContainerWidget* toto, vector<double>& xcor, vector<double>& ycor)
     
    844842  vector<double> xcor;
    845843  vector<int> hist;
    846   int cnts;
    847844  double out[3]= {0.0};
    848845
    849846  unsigned iabs= choixVariableHisto_->currentIndex(); 
    850   string xname= choixVariableHisto_->currentText().toUTF8();
    851   beam->histogramme(iabs,xcor,hist,cnts,out);
     847  beam->histogramme(iabs,xcor,hist,out);
    852848
    853849  cout<<"xcor.size()= "<<xcor.size()<<", hist.size()= "<<hist.size()<<endl;
     
    918914 
    919915  // legendes
     916  string unites[2];
     917  if(iabs == 0 || iabs == 1 || iabs == 2) {
     918    unites[0]= " m"; unites[1]= " mm";
     919  }
     920  if(iabs == 3 || iabs == 4) {
     921    unites[0]= unites[1]= " pi.mm.mrad";
     922  }
     923  if(iabs == 5) {
     924    unites[0]= " MeV"; unites[1]= " KeV";
     925  }
     926
    920927  new WText(" entries : "+ mixedTools::intToString((int)out[0]),w);
    921928  new WBreak(w);
    922   if(iabs < 3) {
    923     new WText(" mean : "+ mixedTools::doubleToString(out[1])+" m",w);
    924     new WBreak(w);
    925     new WText(" sigma rms : "+ mixedTools::doubleToString(1000.0*out[2])+" mm",w);
    926   } else {
    927     new WText(" mean : "+ mixedTools::doubleToString(out[1])+" MeV",w);
    928     new WBreak(w);
    929     new WText(" sigma rms : "+ mixedTools::doubleToString(out[2])+" KeV",w);
    930   }
    931    
     929  new WText(" mean : "+ mixedTools::doubleToString(out[1])+unites[0],w);
     930  new WBreak(w);
     931  new WText(" sigma rms : "+ mixedTools::doubleToString(out[2])+unites[1],w);
     932   
    932933  WCartesianChart *chart = new WCartesianChart(w);
    933934
    934   if(iabs == 0) {
    935     chart->setTitle("Histogram of particle x-coordinate");
    936   } else if(iabs == 1) {
    937     chart->setTitle("Histogram of particle y-coordinate");
    938   } else if(iabs == 2) {
    939     chart->setTitle("Histogram of particle z-coordinate");
    940   } else {
    941     chart->setTitle("Histogram of kinetic energy");
    942   }
    943 
     935  if(iabs == 0) chart->setTitle("Histogram of x-coordinate");
     936  if(iabs == 1) chart->setTitle("Histogram of y-coordinate");
     937  if(iabs == 2) chart->setTitle("Histogram of z-coordinate");
     938  if(iabs == 3) chart->setTitle("Histogram of xp- ??? ");
     939  if(iabs == 4) chart->setTitle("Histogram of yp- ???");
     940  if(iabs == 5) chart->setTitle("Histogram of kinetic energy");
     941 
    944942  chart->setModel(model);        // set the model
    945943  chart->setXSeriesColumn(0);    // set the column that holds the categories
     
    957955  axis.setGridLinesEnabled(true);
    958956
    959   if(iabs < 3) {
    960     axis.setTitle(WString(" ??? (%)"));
     957  if(iabs < 5) {
     958    axis.setTitle(WString(" ???"));
    961959  } else {
    962960    axis.setTitle(WString(" dEcin/Ecin (%)"));
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r367 r371  
    264264bool GWt_softwarePanel::areDataCoherent()
    265265{
    266     bool caMarche = true;
    267     trivaluedBool tbResume = TBoolOk;
    268     dtmanage_->initializeExecution();
    269     string diagnostic;
    270    
    271     list<GWt_sectionToExecute*>::iterator itr;
    272     for(itr = selectedSections_.begin(); itr != selectedSections_.end(); itr++)
     266  bool caMarche = true;
     267  trivaluedBool tbResume = TBoolOk;
     268  dtmanage_->initializeExecution();
     269  string diagnostic;
     270   
     271  list<GWt_sectionToExecute*>::iterator itr;
     272  for(itr = selectedSections_.begin(); itr != selectedSections_.end(); itr++)
    273273    {
    274         string debString = (*itr)->debut->text().toUTF8();
    275         string finString = (*itr)->fin->text().toUTF8();
     274      string debString = (*itr)->debut->text().toUTF8();
     275      string finString = (*itr)->fin->text().toUTF8();
     276     
     277      int debut = dtmanage_->getNumeroFromElementLabel(debString);
     278      int fin = dtmanage_->getNumeroFromElementLabel(finString);
     279      nomDeLogiciel prog = nomDeLogiciel ( (*itr)->selection->currentIndex() );
     280      dtmanage_->addSectionToExecute(debut,fin,prog);
    276281       
    277         int debut = dtmanage_->getNumeroFromElementLabel(debString);
    278         int fin = dtmanage_->getNumeroFromElementLabel(finString);
    279         nomDeLogiciel prog = nomDeLogiciel ( (*itr)->selection->currentIndex() );
    280         dtmanage_->addSectionToExecute(debut,fin,prog);
    281        
    282         // check sections
    283         for (int i=debut-1; i<fin; i++) {
    284             if (pspa_->getBeamLine()) {
    285                 if (pspa_->getBeamLine()->getAbstractElement(i)) {
    286                   trivaluedBool tb = pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(prog.getString());
    287                     if (tb  == TBoolError ) {
    288                       diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " is not allowed with "+ prog.getString()+"\n ";
    289                         caMarche = false;
    290                         tbResume = tb;
    291                     } else if ( tb == TBoolIgnore ) {
    292                       diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " will be ignored by  "+ prog.getString()+"\n ";
    293                       if ( tbResume != TBoolError ) tbResume = tb;
    294                     } else {
    295                         pspa_->getBeamLine()->update(i);
    296                     }
    297                 }
    298             }
    299         }
    300     }
    301    
    302     if ( tbResume == TBoolError ) {
    303         GWt_dialog calculDialog("PSPA check execute : ERROR", diagnostic , GWt_dialog::Error,true,true);
    304         calculDialog.exec();
    305     } else if (tbResume == TBoolIgnore ) {
    306         GWt_dialog calculDialog("PSPA check execute : WARNING", diagnostic , GWt_dialog::Warning,false,true);
    307         calculDialog.exec();
    308     }
    309 /*
    310  } else if ( essai == warning )  {
    311         GWt_dialog calculDialog("PSPA check execute : warning ", diagnostic , GWt_dialog::Warning, false,true);
    312         calculDialog.exec();
    313 */
    314    
    315    
    316     return caMarche;
     282      // check sections
     283      for (int i=debut-1; i<fin; i++) {
     284        if (pspa_->getBeamLine()) {
     285          if (pspa_->getBeamLine()->getAbstractElement(i)) {
     286            trivaluedBool tb = pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(prog.getString());
     287            if (tb  == TBoolError ) {
     288              diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " is not allowed with "+ prog.getString()+"\n ";
     289              caMarche = false;
     290              tbResume = tb;
     291            } else if ( tb == TBoolIgnore ) {
     292              diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " will be ignored by  "+ prog.getString()+"\n ";
     293              if ( tbResume != TBoolError ) tbResume = tb;
     294            } else {
     295              pspa_->getBeamLine()->update(i);
     296            }
     297          }
     298        }
     299      }
     300    }
     301
     302  if ( tbResume == TBoolError ) {
     303    GWt_dialog calculDialog("PSPA check execute : ERROR", diagnostic , GWt_dialog::Error,true,true);
     304    calculDialog.exec();
     305  } else if (tbResume == TBoolIgnore ) {
     306    GWt_dialog calculDialog("PSPA check execute : WARNING", diagnostic , GWt_dialog::Warning,false,true);
     307    calculDialog.exec();
     308  }
     309
     310  /*
     311    } else if ( essai == warning )  {
     312    GWt_dialog calculDialog("PSPA check execute : warning ", diagnostic , GWt_dialog::Warning, false,true);
     313    calculDialog.exec();
     314  */
     315   
     316  return caMarche;
    317317}
    318318
Note: See TracChangeset for help on using the changeset viewer.