Changeset 355 in PSPA
- Timestamp:
- Mar 1, 2013, 9:10:43 PM (11 years ago)
- Location:
- Interface_Web/trunk/pspaWT/sources
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h
r347 r355 52 52 trivaluedBool checkElementsForExec(nomDeLogiciel logiciel, unsigned indexDeb, unsigned indexFin, string& diagnostic); 53 53 bool executeAll(); 54 void donneesRmsEnveloppe(string type,unsigned int lineSize,vector<double>& xcor,vector<double>& ycor);55 54 55 void donneesRmsEnveloppe(string type,vector<double>& xcor,vector<double>& ycor); 56 56 57 /** 57 58 Save a configuration file on the server … … 62 63 63 64 bool restoreElements(string inputFileName); 65 66 64 67 65 68 private : 66 69 67 70 68 void donneesRmsEnveloppe( string type, unsigned int numeroDeb, unsigned int numeroFin, vector<double>& xcor, vector<double>& ycor);71 // void donneesRmsEnveloppe( string type, unsigned int numeroDeb, unsigned int numeroFin, vector<double>& xcor, vector<double>& ycor); 69 72 /* inline void setWorkingDir(string wd) { */ 70 73 /* workingDir_ = wd; */ … … 74 77 globalParameters globParam_; 75 78 particleBeam* currentBeam_; 79 PspaApplication* pspa_; 76 80 77 81 vector<particleBeam> diagnosticBeam_; … … 81 85 void removeFile(string nameOfFile); 82 86 void clearSectionToExecute(); 83 84 PspaApplication* pspa_; 87 85 88 }; 86 89 #endif -
Interface_Web/trunk/pspaWT/sources/controler/src/beam2Moments.cc
r348 r355 79 79 // suppose qu'on est bien positionné dans le stream (a revoir) 80 80 void beam2Moments::readFromTransportOutput(stringstream& inp) { 81 string bidString;82 double bidon;81 string bidString, bidString1, bidString2; 82 double bidon, bidon1, bidon2; 83 83 84 // initialisation des moments 85 raz(); 86 bool test = false; 87 string buf; 88 // sauter les eventuels 'VARY' 89 while ( !test ) { 90 getline(inp, buf); 91 stringstream str(buf); 92 93 if (!(str >> bidon >> bidString >> bidon >> ( rij_secondOrderMoments_.at(0) ).at(0) >> bidString)) { 94 test = true; 95 } 96 97 cout << " beam2Moments::readFromTransportOutput TEST= " << test << endl; 84 // initialisation des moments 85 raz(); 86 bool notFound = true; 87 string buf; 88 // sauter les eventuels 'VARY' 89 while ( notFound ) { 90 getline(inp, buf); 91 stringstream str(buf); 92 if ( str >> bidon1 >> bidString1 >> bidon2 >> ( rij_secondOrderMoments_.at(0) ).at(0) >> bidString2 ) { 93 notFound = false; 98 94 } 99 // test = inp >> bidon >> bidString >> bidon >> ( rij_secondOrderMoments_.at(0) ).at(0) >> bidString; 100 // } 101 inp >> bidon >> ( rij_secondOrderMoments_.at(1) ).at(1) >> bidString >> ( rij_secondOrderMoments_.at(1) ).at(0); 102 inp >> bidon >> ( rij_secondOrderMoments_.at(2) ).at(2) >> bidString >> ( rij_secondOrderMoments_.at(2) ).at(0) >> ( rij_secondOrderMoments_.at(2) ).at(1); 103 inp >> bidon >> ( rij_secondOrderMoments_.at(3) ).at(3) >> bidString >> ( rij_secondOrderMoments_.at(3) ).at(0) >> ( rij_secondOrderMoments_.at(3) ).at(1) >> ( rij_secondOrderMoments_.at(3) ).at(2); 95 } 96 // test = inp >> bidon >> bidString >> bidon >> ( rij_secondOrderMoments_.at(0) ).at(0) >> bidString; 97 // cout << " beam2Moments::readFromTransportOutput TEST= " << test << endl; 98 // } 99 inp >> bidon >> ( rij_secondOrderMoments_.at(1) ).at(1) >> bidString >> ( rij_secondOrderMoments_.at(1) ).at(0); 100 inp >> bidon >> ( rij_secondOrderMoments_.at(2) ).at(2) >> bidString >> ( rij_secondOrderMoments_.at(2) ).at(0) >> ( rij_secondOrderMoments_.at(2) ).at(1); 101 inp >> bidon >> ( rij_secondOrderMoments_.at(3) ).at(3) >> bidString >> ( rij_secondOrderMoments_.at(3) ).at(0) >> ( rij_secondOrderMoments_.at(3) ).at(1) >> ( rij_secondOrderMoments_.at(3) ).at(2); 104 102 105 103 inp >> bidon >> ( rij_secondOrderMoments_.at(4) ).at(4) >> bidString >> ( rij_secondOrderMoments_.at(4) ).at(0) >> ( rij_secondOrderMoments_.at(4) ).at(1) >> ( rij_secondOrderMoments_.at(4) ).at(2) >> ( rij_secondOrderMoments_.at(4) ).at(3); 106 104 107 105 inp >> bidon >> ( rij_secondOrderMoments_.at(5) ).at(5) >> bidString >> ( rij_secondOrderMoments_.at(5) ).at(0) >> ( rij_secondOrderMoments_.at(5) ).at(1) >> ( rij_secondOrderMoments_.at(5) ).at(2) >> ( rij_secondOrderMoments_.at(5) ).at(3) >> ( rij_secondOrderMoments_.at(5) ).at(4); 108 106 109 107 } -
Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
r349 r355 298 298 } 299 299 300 void dataManager::donneesRmsEnveloppe(string type,unsigned int numeroDeb,unsigned int numeroFin, vector<double>& xcor,vector<double>& ycor)301 {302 unsigned k;303 if ( numeroDeb < 1 ) numeroDeb = 1;304 if ( numeroFin > diagnosticBeam_.size() ) numeroFin = diagnosticBeam_.size();300 // void dataManager::donneesRmsEnveloppe(string type,unsigned int numeroDeb,unsigned int numeroFin, vector<double>& xcor,vector<double>& ycor) 301 // { 302 // unsigned k; 303 // if ( numeroDeb < 1 ) numeroDeb = 1; 304 // if ( numeroFin > diagnosticBeam_.size() ) numeroFin = diagnosticBeam_.size(); 305 305 306 // double longueur = 0.0; 307 // double valeur = 0.0; 308 // xcor.clear(); 309 // ycor.clear(); 310 // if ( type == "x" ) 311 // { 312 // for (k= numeroDeb; k <= numeroFin; k++) 313 // { 314 // if ( !diagnosticBeam_.at(k-1).momentRepresentationOk() ) diagnosticBeam_.at(k-1).buildMomentRepresentation(); 315 // longueur += pspa_->getBeamLine()->getAbstractElement(k-1)->getLenghtOfElement(); 316 // valeur = diagnosticBeam_.at(k-1).getXmaxRms(); 317 // cout << " dataManager::donneesRmsEnveloppe longueur = " << longueur << " enveleloppe : " << valeur << endl; 318 // xcor.push_back(longueur); 319 // ycor.push_back(valeur); 320 // } 321 // } 322 // else 323 // { 324 // cerr << " dataManager::donneesRmsEnveloppe type " << type << " not programmed " << endl; 325 // return; 326 // } 327 // } 328 329 // on ne tient pas compte des elements "snapshot" presents dans la beamLine 330 void dataManager::donneesRmsEnveloppe(string type,vector<double>& xcor,vector<double>& ycor) 331 { 306 332 double longueur = 0.0; 307 333 double valeur = 0.0; 308 334 xcor.clear(); 309 335 ycor.clear(); 310 if ( type == "x" )311 {312 for (k= numeroDeb; k <= numeroFin; k++)313 {314 if ( !diagnosticBeam_.at(k-1).momentRepresentationOk() ) diagnosticBeam_.at(k-1).buildMomentRepresentation();315 longueur += pspa_->getBeamLine()->getAbstractElement(k-1)->getLenghtOfElement();316 valeur = diagnosticBeam_.at(k-1).getXmaxRms();317 xcor.push_back(longueur);318 ycor.push_back(valeur);319 }320 }321 else322 {323 cerr << " dataManager::donneesRmsEnveloppe type " << type << " not programmed " << endl;324 return;325 }326 }327 328 // on ne tient pas compte des elements "snapshot" presents dans la beamLine329 void dataManager::donneesRmsEnveloppe(string type,unsigned int lineSize,vector<double>& xcor,vector<double>& ycor)330 {331 double longueur = 0.0;332 double valeur = 0.0;333 xcor.clear();334 ycor.clear();335 336 336 337 if ( type == "x" ) { 337 338 unsigned i = 0; 338 for (unsigned k = 0; k < lineSize; k++) { 339 cout << " dataManager::donneesRmsEnveloppe BeamLineSize = " << getBeamLineSize() << endl; 340 for (unsigned k = 0; k < getBeamLineSize(); k++) { 339 341 abstractElement* elPtr = pspa_->getBeamLine()->getAbstractElement(k); 340 342 if(elPtr->getNomdElement().getElementType() == snapshot) continue; … … 347 349 longueur += elPtr->getLenghtOfElement(); 348 350 valeur = diagnosticBeam_.at(i).getXmaxRms(); 351 cout << " dataManager::donneesRmsEnveloppe index = " << k << " longueur = " << longueur << " enveleloppe : " << valeur << endl; 349 352 xcor.push_back(longueur); 350 353 ycor.push_back(valeur); -
Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc
r354 r355 333 333 } 334 334 335 // void particleBeam::donneesDessinEllipseXxp(vector<double>& xcor, vector<double>& ycor) {336 // int k;337 // double x,y;338 339 // if ( !momentRepresentationOk_ ) return;340 341 // xcor.clear();342 // ycor.clear();343 344 // double xm = ( rij_.getMatrix().at(0) ).at(0);345 // double ym = ( rij_.getMatrix().at(1) ).at(1);346 // double r = ( rij_.getMatrix().at(1) ).at(0);347 348 // cout << " racs11= " << xm << " racs22= " << ym << " r12= " << r << endl;349 350 351 // int nbintv = 50;352 // if ( xm == 0.0 ) return;353 // double pas = 2.0 * xm / nbintv;354 355 // // cout << " r= " << r << endl;356 // double rac = (1 - r*r);357 // if ( rac > 0.0 )358 // {359 // cout << " cas rac > " << endl;360 // rac = sqrt(1 - r*r);361 // double alpha = -r / rac;362 // double beta = xm / ( ym * rac);363 // // double gamma = ym / ( xm * rac );364 // double epsil = xm * ym * rac;365 // double fac1 = -1.0 / ( beta * beta);366 // double fac2 = epsil/beta;367 // double fac3 = -alpha/beta;368 // double aux;369 // for ( k=0; k < nbintv; k++)370 // {371 // x = -xm + k*pas;372 // aux = fac1 * x * x + fac2;373 // // cout << " aux2= " << aux << endl;374 // if ( aux <= 0.0 )375 // {376 // aux = 0.0;377 // }378 // else aux = sqrt(aux);379 380 // // y = fac3*x;381 // y = fac3*x + aux;382 // xcor.push_back(x);383 // ycor.push_back(y);384 // }385 386 // for ( k=0; k <= nbintv; k++)387 // {388 // x = xm - k*pas;389 // aux = fac1 * x * x + fac2;390 // if ( aux <= 0.0 )391 // {392 // aux = 0.0;393 // }394 // else aux = sqrt(aux);395 // // y = fac3*x;396 // y = fac3*x - aux;397 // xcor.push_back(x);398 // ycor.push_back(y);399 // }400 // }401 // else402 // // cas degenere403 // {404 // cout << " cas degenere " << endl;405 // double fac = ym/xm;406 // for ( k=0; k < nbintv; k++)407 // {408 // x = -xm + k*pas;409 // y = fac*x;410 // xcor.push_back(x);411 // ycor.push_back(y);412 // }413 414 // }415 // }416 335 417 336 void particleBeam::particlesPhaseSpaceData(vector<double>& xcor, vector<double>& ycor, unsigned indexAbs, unsigned indexOrd) { -
Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc
r354 r355 135 135 // sinon c'est un element de parmela d'index id 136 136 beams.push_back(particleBeam()); 137 cout << " creation diagn. no " << beams.size() << " par PARMELA " << endl; 137 138 vector<double> centroid; 138 139 bareParticle refPart; -
Interface_Web/trunk/pspaWT/sources/controler/src/softwareTransport.cc
r353 r355 157 157 158 158 beams.push_back(particleBeam()); 159 cout << " creation diagn. no " << beams.size() << " par TRANSPORT " << endl; 159 160 string elemLabel = ptr->getLabel(); 160 161 beam2Moments transpMoments; … … 166 167 result = false; 167 168 break; 168 } 169 } 169 170 beams.back().set2Moments(transpMoments); 170 171 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc
r354 r355 542 542 envDialog->show(); 543 543 544 unsigned nbel = dtmanage_->getBeamLineSize();544 // unsigned nbel = dtmanage_->getBeamLineSize(); 545 545 vector<double> xcor; 546 546 vector<double> ycor; 547 //dtmanage_->donneesRmsEnveloppe(type,1, nbel, xcor,ycor); 548 dtmanage_->donneesRmsEnveloppe(type,nbel,xcor,ycor); 549 // scatterPlot1D(envDialog->contents(),xcor,ycor); 547 // dtmanage_->donneesRmsEnveloppe(type,1, nbel, xcor,ycor); 548 dtmanage_->donneesRmsEnveloppe(type,xcor,ycor); 550 549 chartPlot2vec(envDialog->contents(), xcor, ycor, false); 551 550 } 552 553 // void PspaApplication::setModelComponentForPhaseSpace(WStandardItemModel* model, vector<bareParticle>& partic, unsigned indexParticleComponent, unsigned modelComponent) {554 // double valeur;555 // if ( indexParticleComponent > 5 ) return;556 557 // if ( indexParticleComponent <= 2 ) {558 // for (unsigned i = 0; i < partic.size(); ++i) {559 // valeur = partic.at(i).getPosition().getComponent(indexParticleComponent);560 // model->setData(i, modelComponent, valeur);561 // }562 // } else {563 // if ( indexParticleComponent == 5 ) {564 // cout << " PspaApplication::faireDessinParmela : deltap non programme " << endl;565 // return;566 // } else {567 // for (unsigned i = 0; i < partic.size(); ++i) {568 // double begamz = partic.at(i).getBetaGamma().getComponent(2);569 // if ( begamz != 0.0) {570 // valeur = 1.e3*partic.at(i).getBetaGamma().getComponent(indexParticleComponent-3)/begamz;571 // } else {572 // valeur = 0.0;573 // }574 // model->setData(i, modelComponent, valeur);575 // }576 // }577 // }578 // }579 551 580 552 void PspaApplication::faireDessinParmela(WContainerWidget* toto, particleBeam* beam, unsigned indexAbs, unsigned indexOrd, string namex, string namey )
Note: See TracChangeset
for help on using the changeset viewer.