Changeset 414 in PSPA
- Timestamp:
- Mar 30, 2013, 4:24:38 PM (11 years ago)
- Location:
- Interface_Web/trunk/pspaWT/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/controler/include/particleBeam.h
r381 r414 122 122 virtual bool FileInput(ifstream& ifs); 123 123 124 void histogramme(unsigned int index,vector<double>&xcor,vector<int>& hist, double out[3]);124 void histogramme(unsigned int index,vector<double>&xcor,vector<int>& hist,vector<string>& legende); 125 125 }; 126 126 #endif -
Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc
r410 r414 580 580 } 581 581 582 void particleBeam::histogramme(unsigned int iabs,vector<double>& xcor,vector<int>& hist, double out[3])582 void particleBeam::histogramme(unsigned int iabs,vector<double>& xcor,vector<int>& hist, vector<string>& legende) 583 583 { 584 double out[3]; 584 585 // out[0]= nbre de particules, out[1]= moyenne, out[2]= ecart-type 585 586 vector<double> vshf; … … 592 593 out[2] *= EREST_keV; // ecart-type en KeV 593 594 } 595 // legendes 596 string unites[2]; 597 if(iabs == 0 || iabs == 1 || iabs == 2) { 598 unites[0]= unites[1]= " mm"; 599 } 600 if(iabs == 3 || iabs == 4) { 601 unites[0]= unites[1]= " mrad"; 602 } 603 if(iabs == 5) { 604 unites[0]= " MeV"; unites[1]= " KeV"; 605 } 606 607 legende.clear(); 608 legende.push_back(" entries : "+ mixedTools::intToString((int)out[0]) ); 609 legende.push_back(" mean : "+ mixedTools::doubleToString(out[1])+unites[0]); 610 legende.push_back(" sigma rms : "+ mixedTools::doubleToString(out[2])+unites[1]); 594 611 } 595 612 -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h
r407 r414 84 84 85 85 void dialogOnGraphics(); 86 void faireDessinPhaseSpace(WContainerWidget* toto, particleBeam* beam, string namex, string namey, int typeFaisceau);86 void faireDessinPhaseSpace(WContainerWidget* toto, particleBeam* beam, string elementLabel, string namex, string namey, int typeFaisceau); 87 87 88 88 // void setModelComponentForPhaseSpace(WStandardItemModel* model, vector<bareParticle>& partic, unsigned indexParticleComponent, unsigned modelComponent); -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc
r413 r414 538 538 539 539 toto_->clear(); 540 faireDessinPhaseSpace(toto_, beam, nameAbs, nameOrd, typeFaisceau);540 faireDessinPhaseSpace(toto_, beam, elementLabel, nameAbs, nameOrd, typeFaisceau); 541 541 542 542 // if ( typeFaisceau == 0 ) … … 600 600 } 601 601 602 void PspaApplication::faireDessinPhaseSpace(WContainerWidget* toto, particleBeam* beam, string namex, string namey, int typeFaisceau)602 void PspaApplication::faireDessinPhaseSpace(WContainerWidget* toto, particleBeam* beam, string elementLabel, string namex, string namey, int typeFaisceau) 603 603 { 604 604 … … 628 628 phaseSpaceDialog->setMinimumSize(400,400); 629 629 phaseSpaceDialog->setClosable(true); 630 new WText(nameOfCase_, phaseSpaceDialog->contents()); 630 new WText(" case : " + nameOfCase_, phaseSpaceDialog->contents()); 631 new WBreak(phaseSpaceDialog->contents()); 632 new WText(" after element : " + elementLabel, phaseSpaceDialog->contents()); 631 633 632 634 for (int k=0 ; k < legende.size(); k++) { … … 951 953 toto_->clear(); 952 954 953 std::time_t result = std::time(NULL);954 GWt_dialog* histoDialog = new GWt_dialog(WString("histogramme (")+std::asctime(std::localtime(&result))+")",toto_,false);955 eDialog_.push_back(histoDialog);956 histoDialog->setMinimumSize(400,400);957 histoDialog->setClosable(true);955 // std::time_t result = std::time(NULL); 956 // GWt_dialog* histoDialog = new GWt_dialog(WString("histogramme (")+std::asctime(std::localtime(&result))+")",toto_,false); 957 // eDialog_.push_back(histoDialog); 958 // histoDialog->setMinimumSize(400,400); 959 // histoDialog->setClosable(true); 958 960 959 961 string elementLabel = choixHistoDessin_->currentText().toUTF8(); … … 971 973 } 972 974 973 histoDialog->show();975 unsigned iabs= choixVariableHisto_->currentIndex(); 974 976 vector<double> xcor; 975 977 vector<int> hist; 976 double out[3]= {0.0};977 unsigned iabs= choixVariableHisto_->currentIndex();978 beam->histogramme(iabs,xcor,hist, out);978 // double out[3]= {0.0}; 979 vector<string> legende; 980 beam->histogramme(iabs,xcor,hist,legende); 979 981 980 982 cout<<"xcor.size()= "<<xcor.size()<<", hist.size()= "<<hist.size()<<endl; … … 1010 1012 y.at(j)= 0.0; 1011 1013 ////////////////////////////////////////////////////////////////////////////////// 1014 std::time_t result = std::time(NULL); 1015 GWt_dialog* histoDialog = new GWt_dialog(WString("histogramme (")+std::asctime(std::localtime(&result))+")",toto_,false); 1016 eDialog_.push_back(histoDialog); 1017 histoDialog->setMinimumSize(400,400); 1018 histoDialog->setClosable(true); 1019 1020 histoDialog->show(); 1012 1021 1013 1022 WContainerWidget *w= histoDialog->contents(); 1014 1023 1015 // legendes1016 string unites[2];1017 if(iabs == 0 || iabs == 1 || iabs == 2) {1018 unites[0]= unites[1]= " mm";1019 }1020 if(iabs == 3 || iabs == 4) {1021 unites[0]= unites[1]= " mrad";1022 }1023 if(iabs == 5) {1024 unites[0]= " MeV"; unites[1]= " KeV";1025 }1026 1027 new WText(" entries : "+ mixedTools::intToString((int)out[0]),w);1024 // // legendes 1025 // string unites[2]; 1026 // if(iabs == 0 || iabs == 1 || iabs == 2) { 1027 // unites[0]= unites[1]= " mm"; 1028 // } 1029 // if(iabs == 3 || iabs == 4) { 1030 // unites[0]= unites[1]= " mrad"; 1031 // } 1032 // if(iabs == 5) { 1033 // unites[0]= " MeV"; unites[1]= " KeV"; 1034 // } 1035 1036 new WText(" case : " + nameOfCase_, w); 1028 1037 new WBreak(w); 1029 new WText(" mean : "+ mixedTools::doubleToString(out[1])+unites[0],w); 1030 new WBreak(w); 1031 new WText(" sigma rms : "+ mixedTools::doubleToString(out[2])+unites[1],w); 1038 new WText(" after element : " + elementLabel, w); 1039 1040 for (int k=0 ; k < legende.size(); k++) { 1041 new WBreak(w); 1042 new WText(legende.at(k), w); 1043 } 1044 1045 1046 // new WText(" entries : "+ mixedTools::intToString((int)out[0]),w); 1047 // new WBreak(w); 1048 // new WText(" mean : "+ mixedTools::doubleToString(out[1])+unites[0],w); 1049 // new WBreak(w); 1050 // new WText(" sigma rms : "+ mixedTools::doubleToString(out[2])+unites[1],w); 1032 1051 ////////////////////////////////////////////////////////////////////////////////// 1033 1052 … … 1055 1074 chartPlot2vec(w,x,y,seriesType,fillRange,location,isGridLinesEnabled,titre,xname,yname,500,300); 1056 1075 } 1076 1077
Note: See TracChangeset
for help on using the changeset viewer.