Changeset 414 in PSPA


Ignore:
Timestamp:
Mar 30, 2013, 4:24:38 PM (11 years ago)
Author:
lemeur
Message:

cosmetique diagrammes

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

Legend:

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

    r381 r414  
    122122  virtual bool FileInput(ifstream& ifs);
    123123
    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);
    125125};
    126126#endif
  • Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc

    r410 r414  
    580580}
    581581
    582 void particleBeam::histogramme(unsigned int iabs,vector<double>& xcor,vector<int>& hist,double out[3])
     582void particleBeam::histogramme(unsigned int iabs,vector<double>& xcor,vector<int>& hist, vector<string>& legende)
    583583{
     584  double out[3];
    584585  // out[0]= nbre de particules, out[1]= moyenne, out[2]= ecart-type
    585586  vector<double> vshf;
     
    592593    out[2] *= EREST_keV; // ecart-type en KeV
    593594  }
     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]);
    594611}
    595612
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h

    r407 r414  
    8484 
    8585  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);
    8787
    8888 //  void setModelComponentForPhaseSpace(WStandardItemModel* model, vector<bareParticle>& partic, unsigned indexParticleComponent, unsigned modelComponent);
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc

    r413 r414  
    538538   
    539539    toto_->clear();
    540     faireDessinPhaseSpace(toto_, beam, nameAbs, nameOrd, typeFaisceau);
     540    faireDessinPhaseSpace(toto_, beam, elementLabel, nameAbs, nameOrd, typeFaisceau);
    541541
    542542  // if ( typeFaisceau == 0 )
     
    600600}
    601601
    602 void PspaApplication::faireDessinPhaseSpace(WContainerWidget* toto, particleBeam* beam, string namex, string namey, int typeFaisceau)
     602void PspaApplication::faireDessinPhaseSpace(WContainerWidget* toto, particleBeam* beam, string elementLabel, string namex, string namey, int typeFaisceau)
    603603{
    604604
     
    628628  phaseSpaceDialog->setMinimumSize(400,400);
    629629  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());
    631633
    632634  for (int k=0 ; k < legende.size(); k++) {
     
    951953  toto_->clear();
    952954 
    953   std::time_t result = std::time(NULL);
    954   GWt_dialog* histoDialog = new GWt_dialog(WString("histogramme&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(")+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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(")+std::asctime(std::localtime(&result))+")",toto_,false);
     957  // eDialog_.push_back(histoDialog);
     958  // histoDialog->setMinimumSize(400,400);
     959  // histoDialog->setClosable(true);
    958960
    959961  string elementLabel = choixHistoDessin_->currentText().toUTF8();   
     
    971973  }
    972974
    973   histoDialog->show();
     975  unsigned iabs= choixVariableHisto_->currentIndex(); 
    974976  vector<double> xcor;
    975977  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);
    979981
    980982  cout<<"xcor.size()= "<<xcor.size()<<", hist.size()= "<<hist.size()<<endl;
     
    10101012  y.at(j)= 0.0;
    10111013  //////////////////////////////////////////////////////////////////////////////////
     1014  std::time_t result = std::time(NULL);
     1015  GWt_dialog* histoDialog = new GWt_dialog(WString("histogramme&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(")+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();
    10121021
    10131022  WContainerWidget *w= histoDialog->contents();
    10141023
    1015   // legendes
    1016   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);
    10281037  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);
    10321051  //////////////////////////////////////////////////////////////////////////////////
    10331052
     
    10551074  chartPlot2vec(w,x,y,seriesType,fillRange,location,isGridLinesEnabled,titre,xname,yname,500,300);
    10561075}
     1076
     1077
Note: See TracChangeset for help on using the changeset viewer.