Changeset 54 in PSPA


Ignore:
Timestamp:
Nov 6, 2012, 11:58:50 AM (12 years ago)
Author:
lemeur
Message:

reorganisation des widgets et essai dessin

Location:
Interface_Web/trunk/pspaWT
Files:
15 added
9 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/cmt/requirements

    r48 r54  
    2222#macro PSPSLib_linkopts     " -L${PSPAWTROOT}/$(Platform_bin) -lPSPSLib "
    2323
    24 application pspaWt GWt_cell.cc GWt_initialBeam.cc GWt_globalParameters.cc GWt_drift.cc dataManager.cc elementDrift.cc elementCell.cc elementInitialBeam.cc globalParameters.cc GWt_LigneFaisceau.cc GWt_pspaApplication.cc main.cc use_cppflags='" ${lib_PSPSLib_cppflags} "'
     24application pspaWt bareParticle.cc particleBeam.cc GWt_cell.cc GWt_initialBeam.cc GWt_globalParameters.cc GWt_drift.cc dataManager.cc elementDrift.cc elementCell.cc elementInitialBeam.cc globalParameters.cc GWt_LigneFaisceau.cc GWt_pspaApplication.cc main.cc use_cppflags='" ${lib_PSPSLib_cppflags} "'
    2525
    2626macro DrawWt_linkopts " ${PSPSLib_linkopts} ${Wt_linkopts} ${boost_linkopts} ${dld_linkopts}"
  • Interface_Web/trunk/pspaWT/include/GWt_globalParameters.h

    r50 r54  
    3737    void renew();
    3838
    39   void lancerCalcul();
     39    //  void lancerCalcul();
    4040
    4141};
  • Interface_Web/trunk/pspaWT/include/GWt_pspaApplication.h

    r50 r54  
    3535    return dtmanage_;
    3636  }
     37  void executer();
    3738  void sauver();
    3839  void restaurer();
  • Interface_Web/trunk/pspaWT/include/MathematicalConstants.h

    r29 r54  
    77#define PETIT 0.5e-38
    88#define GRAND 0.5e+38
     9#define EPSILON 1.e-10
    910#endif
  • Interface_Web/trunk/pspaWT/include/dataManager.h

    r52 r54  
    66#include "globalParameters.h"
    77#include "nomdElements.h"
     8#include "particleBeam.h"
     9
    810//using namespace std;
    911
     
    1315  elementsCollection elementsGallery_;
    1416  globalParameters globParam_;
    15 
     17  particleBeam currentBeam_;
    1618
    1719  void createInputFileParmela( unsigned int indexDeb, unsigned int indexFin);
  • Interface_Web/trunk/pspaWT/src/GWt_LigneFaisceau.cc

    r50 r54  
    135135      nomdElement nom = ptr->getName();
    136136      cout << "  GWt_LigneFaisceau:: je restaure element type " << nom << endl;
    137       WPushButton* dropped = NULL;
     137      //      WPushButton* dropped = NULL;
    138138      switch (nom)
    139139        {
     
    141141          {
    142142            GWt_initialBeam* gwInitialBeam = new GWt_initialBeam(pspa_,ptr, string("icons/beam.jpg"));
    143             dropped = gwInitialBeam->getButton();
    144             beamLayout_->addWidget(dropped);
     143            //      dropped = gwInitialBeam->getButton();
     144            beamLayout_->addWidget(gwInitialBeam->getButton());
    145145            break;
    146146          }
     
    148148          {
    149149            GWt_drift* gdrift = new GWt_drift(pspa_,ptr, string("icons/drift.jpg"));     
    150             dropped = gdrift->getButton();
    151             beamLayout_->addWidget(dropped);
     150            //      dropped = gdrift->getButton();
     151            beamLayout_->addWidget(gdrift->getButton());
    152152            break;
    153153          }
     
    155155          {
    156156              GWt_cell* gwCell = new GWt_cell(pspa_,ptr, string("icons/cell.jpg"));
    157               dropped = gwCell->getButton();
    158               beamLayout_->addWidget(dropped);
     157              //              dropped = gwCell->getButton();
     158              beamLayout_->addWidget(gwCell->getButton());
    159159              break;
    160160          }
  • Interface_Web/trunk/pspaWT/src/GWt_globalParameters.cc

    r53 r54  
    7676    globLayout->addWidget(result);
    7777
    78     WPushButton *buttonGo2 = new WPushButton("go!");
    79     buttonGo2->setMaximumSize(100,50);
    80     globLayout->addWidget(buttonGo2);
     78    // WPushButton *buttonGo2 = new WPushButton("go!");
     79    // buttonGo2->setMaximumSize(100,50);
     80    // globLayout->addWidget(buttonGo2);
    8181
    8282
    83     buttonGo2->clicked().connect(this, &GWt_globalParameters::lancerCalcul);
     83    // buttonGo2->clicked().connect(this, &GWt_globalParameters::lancerCalcul);
    8484
    8585
     
    117117  }
    118118
    119 void GWt_globalParameters::lancerCalcul()
    120   {
    121     pspa_->addConsoleMessage("on va peut etre y arriver");
    122     updateGlobals();
    123     string resultat = pspa_->getDataManager()->executeAll();
    124     pspa_->addConsoleMessage(resultat);
    125   }
     119// void GWt_globalParameters::lancerCalcul()
     120//   {
     121//     pspa_->addConsoleMessage("on va peut etre y arriver");
     122//     updateGlobals();
     123//     string resultat = pspa_->getDataManager()->executeAll();
     124//     pspa_->addConsoleMessage(resultat);
     125//   }
    126126
    127127
  • Interface_Web/trunk/pspaWT/src/GWt_pspaApplication.cc

    r50 r54  
    77#include <Wt/WGridLayout>
    88#include <Wt/WVBoxLayout>
     9#include <Wt/WHBoxLayout>
    910#include <Wt/WImage>
    1011#include <Wt/WTextArea>
    1112#include <Wt/WBreak>
    1213#include <Wt/WPushButton>
     14#include <Wt/WStandardItemModel>
     15#include <Wt/Chart/WCartesianChart>
    1316
    1417#include "GWt_pspaApplication.h"
     
    1619#include "GWt_globalParameters.h"
    1720
     21using namespace Wt::Chart;
    1822
    1923
     
    104108
    105109    WGridLayout* toolbarLayout = new WGridLayout();
    106 
    107     WPushButton* boutonSauve = new WPushButton(" sauvegarder");
    108     WPushButton* boutonRestaure = new WPushButton(" restaurer");
    109     toolbarLayout->addWidget(boutonSauve , 0, 0);
    110     toolbarLayout->addWidget(boutonRestaure , 0, 1);
    111 
     110    WPushButton *buttonGo2 = new WPushButton("go!");
     111    buttonGo2->setMaximumSize(100,50);
     112
     113    WPushButton *boutonGo = new WPushButton("execute!");
     114    WPushButton* boutonSauve = new WPushButton(" sauvegarder la config");
     115    WPushButton* boutonRestaure = new WPushButton(" restaurer la config");
     116    toolbarLayout->addWidget(boutonGo , 0, 0);
     117    toolbarLayout->addWidget(boutonSauve , 0, 1);
     118    toolbarLayout->addWidget(boutonRestaure , 0, 2);
     119
     120    boutonGo->clicked().connect(this, &PspaApplication::executer);
    112121    boutonSauve->clicked().connect(this, &PspaApplication::sauver);
    113122    boutonRestaure->clicked().connect(this, &PspaApplication::restaurer);
     
    116125  calculLayout->addWidget(beamLine_ , 0, 0);
    117126  globalParam_ = createGlobalParamWidget();
    118   calculLayout->addWidget(globalParam_,1,0);
     127
     128
     129  WGridLayout* globLayout = new WGridLayout();
     130  //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
     131
     132  WContainerWidget* toto = new WContainerWidget();
     133    new WText("scatter plot 2", toto);
     134  WStandardItemModel *model = new WStandardItemModel(40, 2, toto);
     135  model->setHeaderData(0, WString("X"));
     136  model->setHeaderData(1, WString("Y = sin(X)"));
     137
     138  for (unsigned i = 0; i < 40; ++i) {
     139    double x = (static_cast<double>(i) - 20) / 4;
     140
     141    model->setData(i, 0, x);
     142    model->setData(i, 1, sin(x));
     143  }
     144  WCartesianChart *chart = new WCartesianChart(toto);
     145  chart->setModel(model);        // set the model
     146  chart->setXSeriesColumn(0);    // set the column that holds the X data
     147  chart->setLegendEnabled(true); // enable the legend
     148
     149  chart->setType(ScatterPlot);   // set type to ScatterPlot
     150
     151  // Typically, for mathematical functions, you want the axes to cross
     152  // at the 0 mark:
     153  chart->axis(XAxis).setLocation(ZeroValue);
     154  chart->axis(YAxis).setLocation(ZeroValue);
     155
     156  // Provide space for the X and Y axis and title.
     157  chart->setPlotAreaPadding(80, Left);
     158  chart->setPlotAreaPadding(40, Top | Bottom);
     159  // Add the curves
     160  WDataSeries s(1, CurveSeries);
     161  s.setShadow(WShadow(3, 3, WColor(0, 0, 0, 127), 3));
     162  chart->addSeries(s);
     163
     164  chart->resize(400, 150); // WPaintedWidget must be given explicit size
     165
     166  chart->setMargin(10, Top | Bottom);            // add margin vertically
     167  chart->setMargin(WLength::Auto, Left | Right); // center horizontally
     168
     169  //  ChartConfig *config = new ChartConfig(chart, this);
     170  //  config->setValueFill(ZeroValueFill);
     171
     172  //  WPushButton* bidon = new WPushButton(" pourvoir");
     173  //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
     174  globLayout->addWidget(globalParam_,0,0);
     175  globLayout->addWidget(toto,0,1);
     176  calculLayout->addLayout(globLayout,1,0);
     177
     178  //  calculLayout->addWidget(globalParam_,1,0);
     179
     180
    119181  calculLayout->addLayout(toolbarLayout  ,2,0);
    120182  iconAndBeamLineLayout->addWidget(createPalette() , 0, 0);
     
    155217}
    156218
     219
     220void PspaApplication::executer()
     221{
     222  addConsoleMessage(string("on va peut etre y arriver"));
     223    static_cast<GWt_globalParameters*>(globalParam_)->updateGlobals();
     224    string resultat = dtmanage_->executeAll();
     225    addConsoleMessage(resultat);
     226}
     227
     228
    157229void PspaApplication::sauver()
    158230{
  • Interface_Web/trunk/pspaWT/src/dataManager.cc

    r53 r54  
    6363          sortie << buf << endl;
    6464        }
     65
     66      currentBeam_.setFromParmela(globParam_.getFrequency());
     67
     68      cout << " le faisceau a " << currentBeam_.getNbParticles() << " particules, les voici : " << endl;
     69 
     70      currentBeam_.printAllXYZ();
     71
    6572      return sortie.str();
    6673    }
Note: See TracChangeset for help on using the changeset viewer.