Changeset 340 in PSPA for Interface_Web/trunk


Ignore:
Timestamp:
Feb 20, 2013, 5:13:37 PM (11 years ago)
Author:
touze
Message:

réaménagement dans dessin histo

Location:
Interface_Web/trunk/pspaWT/sources/userInterface
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h

    r336 r340  
    4141  GWt_LigneFaisceau* beamLine_;
    4242   
    43   // WContainerWidget* console_;
    4443  WWidget* globalParam_;
    45   // WContainerWidget* leDessin_;
    4644  GWt_dialog* graphicsDialog_;
    4745  WButtonGroup *group_;
    48 
     46  vector<GWt_dialog*> eDialog_;
     47 
    4948  WText* probleme_;
    5049  WComboBox* choixElementDessin_;
    5150  WComboBox* choixTypeDessinFaisceau_;
    52     WComboBox* choixAbsPhase_;
    53     WComboBox* choixOrdPhase_;
     51  WComboBox* choixAbsPhase_;
     52  WComboBox* choixOrdPhase_;
    5453  WComboBox* choixEnveloppeDessin_;
    5554  WComboBox* choixHistoDessin_;
     
    7978 
    8079  void dialogOnGraphics();
    81     void faireDessinParmela(WContainerWidget* toto, particleBeam* beam, unsigned indexAbs, unsigned indexOrd );
     80  void faireDessinParmela(WContainerWidget* toto, particleBeam* beam, unsigned indexAbs, unsigned indexOrd );
    8281  void faireDessinTransport(WContainerWidget* toto, particleBeam* beam);
    8382  void faireDessinEnveloppe(WContainerWidget* toto, string type);
     
    8584   
    8685  bool removeExtensionFromConfigName(string& config);
    87    
     86 
    8887  void dessiner();
    8988  void dessinerEnveloppe();
     
    9190  void dessinerHistogramme();
    9291
    93     public :
     92 public :
    9493 
    9594  PspaApplication(const WEnvironment& env);
    96 
    97 
     95 
    9896  string getSelection();
    9997  void faireDessin();
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc

    r339 r340  
    297297{
    298298  cout << " close graphicsDialog_" << endl;
     299  for(unsigned i = 0; i < eDialog_.size(); i++) eDialog_[i]->done(WDialog::Rejected);
     300  eDialog_.clear();
    299301  graphicsDialog_->done(WDialog::Rejected);
    300302}
     
    518520   
    519521  GWt_dialog* envDialog = new GWt_dialog("enveloppe",toto,false);
     522  eDialog_.push_back(envDialog);
    520523  envDialog->setMinimumSize(400,400);
    521524  envDialog->setClosable(true);
     
    534537{
    535538  cout << " faireDessinParmela " << endl;
    536     GWt_dialog* pointsDialog = new GWt_dialog("space phase",toto,false);
    537     pointsDialog->setMinimumSize(400,400);
    538     pointsDialog->setClosable(true);
    539     // pointsDialog->show();
    540    
     539  GWt_dialog* pointsDialog = new GWt_dialog("space phase",toto,false);
     540  eDialog_.push_back(pointsDialog);
     541  pointsDialog->setMinimumSize(400,400);
     542  pointsDialog->setClosable(true);
     543  // pointsDialog->show();
     544 
    541545   
    542546   
     
    647651}
    648652
    649 
    650 // void PspaApplication::addElemToGlobals()
    651 // {
    652 //   static_cast<GWt_globalParameters*>(globalParam_)->addElem();
    653 // }
    654 
    655653void PspaApplication::faireDessinTransport(WContainerWidget* toto, particleBeam* beam)
    656654{
    657     //  WContainerWidget* toto = static_cast<WContainerWidget*>(leDessin_);
    658     //  toto->clear();
    659    
    660     //  new WText(nameOfCase_ + " : espace de phase x,x' "+ " nb partic. "+ mixedTools::intToString(partic.size()), toto);
    661    
    662     GWt_dialog* ellipseDialog = new GWt_dialog("ellipse",toto,false);
    663     ellipseDialog->setMinimumSize(400,400);
    664     ellipseDialog->setClosable(true);
    665     ellipseDialog->show();
    666    
    667    
    668     new WText(nameOfCase_ + " : emittance x,x' " + mixedTools::doubleToString(beam->getUnnormalizedEmittanceX()) + " pi.mm.mrad" , ellipseDialog->contents());
    669     new WBreak(ellipseDialog->contents());
    670     new WText(" xmax = " + mixedTools::doubleToString(beam->getSigmaTransportij(1,1)) + " cm ", ellipseDialog->contents());
    671     new WBreak(ellipseDialog->contents());
    672     new WText(" x' max = " + mixedTools::doubleToString(beam->getSigmaTransportij(2,2)) + " mrad ", ellipseDialog->contents());
    673     new WBreak(ellipseDialog->contents());
    674     new WText(" corr. 12 = " + mixedTools::doubleToString(beam->getSigmaTransportij(2,1))  + " sqrt(cm.rad) ", ellipseDialog->contents());
    675    
    676     vector<double> xcor;
    677     vector<double> ycor;
    678     //  dtmanage_->getCurrentBeam()->donneesDessinEllipseXxp(xcor,ycor);
    679     beam->donneesDessinEllipseXxp(xcor,ycor);
    680     scatterPlot1D(ellipseDialog->contents(),xcor,ycor);
    681    
     655  GWt_dialog* ellipseDialog = new GWt_dialog("ellipse",toto,false);
     656  eDialog_.push_back(ellipseDialog);
     657  ellipseDialog->setMinimumSize(400,400);
     658  ellipseDialog->setClosable(true);
     659  ellipseDialog->show();
     660   
     661  new WText(nameOfCase_ + " : emittance x,x' " + mixedTools::doubleToString(beam->getUnnormalizedEmittanceX()) + " pi.mm.mrad" , ellipseDialog->contents());
     662  new WBreak(ellipseDialog->contents());
     663  new WText(" xmax = " + mixedTools::doubleToString(beam->getSigmaTransportij(1,1)) + " cm ", ellipseDialog->contents());
     664  new WBreak(ellipseDialog->contents());
     665  new WText(" x' max = " + mixedTools::doubleToString(beam->getSigmaTransportij(2,2)) + " mrad ", ellipseDialog->contents());
     666  new WBreak(ellipseDialog->contents());
     667  new WText(" corr. 12 = " + mixedTools::doubleToString(beam->getSigmaTransportij(2,1))  + " sqrt(cm.rad) ", ellipseDialog->contents());
     668 
     669  vector<double> xcor;
     670  vector<double> ycor;
     671  //  dtmanage_->getCurrentBeam()->donneesDessinEllipseXxp(xcor,ycor);
     672  beam->donneesDessinEllipseXxp(xcor,ycor);
     673  scatterPlot1D(ellipseDialog->contents(),xcor,ycor); 
    682674}
    683675
     
    861853  // pour mon test : histo en energie
    862854  toto_->clear();
    863    
    864   GWt_dialog* pourVoir= new GWt_dialog("histogramme",toto_,false);
    865   pourVoir->setMinimumSize(400,400);
    866   pourVoir->setClosable(true);
    867   pourVoir->show();
     855 
     856  GWt_dialog* histoDialog = new GWt_dialog("histogramme",toto_,false);
     857  eDialog_.push_back(histoDialog);
     858  histoDialog->setMinimumSize(400,400);
     859  histoDialog->setClosable(true);
     860  histoDialog->show();
    868861 
    869862  int index = choixHistoDessin_->currentIndex();   
     
    889882  cout<<"xcor.size()= "<<xcor.size()<<", hist.size()= "<<hist.size()<<endl;
    890883  //////////////////////////////////////////////////////////////////////////////////
    891    
    892   WContainerWidget *w = toto_;
     884
     885  WContainerWidget *w= histoDialog->contents();
    893886  int nbpts= xcor.size()+cnts+1;
    894887  WStandardItemModel *model = new WStandardItemModel(nbpts,2,w);
Note: See TracChangeset for help on using the changeset viewer.