Changeset 54 in PSPA
- Timestamp:
- Nov 6, 2012, 11:58:50 AM (12 years ago)
- Location:
- Interface_Web/trunk/pspaWT
- Files:
-
- 15 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/cmt/requirements
r48 r54 22 22 #macro PSPSLib_linkopts " -L${PSPAWTROOT}/$(Platform_bin) -lPSPSLib " 23 23 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} "'24 application 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} "' 25 25 26 26 macro DrawWt_linkopts " ${PSPSLib_linkopts} ${Wt_linkopts} ${boost_linkopts} ${dld_linkopts}" -
Interface_Web/trunk/pspaWT/include/GWt_globalParameters.h
r50 r54 37 37 void renew(); 38 38 39 void lancerCalcul();39 // void lancerCalcul(); 40 40 41 41 }; -
Interface_Web/trunk/pspaWT/include/GWt_pspaApplication.h
r50 r54 35 35 return dtmanage_; 36 36 } 37 void executer(); 37 38 void sauver(); 38 39 void restaurer(); -
Interface_Web/trunk/pspaWT/include/MathematicalConstants.h
r29 r54 7 7 #define PETIT 0.5e-38 8 8 #define GRAND 0.5e+38 9 #define EPSILON 1.e-10 9 10 #endif -
Interface_Web/trunk/pspaWT/include/dataManager.h
r52 r54 6 6 #include "globalParameters.h" 7 7 #include "nomdElements.h" 8 #include "particleBeam.h" 9 8 10 //using namespace std; 9 11 … … 13 15 elementsCollection elementsGallery_; 14 16 globalParameters globParam_; 15 17 particleBeam currentBeam_; 16 18 17 19 void createInputFileParmela( unsigned int indexDeb, unsigned int indexFin); -
Interface_Web/trunk/pspaWT/src/GWt_LigneFaisceau.cc
r50 r54 135 135 nomdElement nom = ptr->getName(); 136 136 cout << " GWt_LigneFaisceau:: je restaure element type " << nom << endl; 137 WPushButton* dropped = NULL;137 // WPushButton* dropped = NULL; 138 138 switch (nom) 139 139 { … … 141 141 { 142 142 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()); 145 145 break; 146 146 } … … 148 148 { 149 149 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()); 152 152 break; 153 153 } … … 155 155 { 156 156 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()); 159 159 break; 160 160 } -
Interface_Web/trunk/pspaWT/src/GWt_globalParameters.cc
r53 r54 76 76 globLayout->addWidget(result); 77 77 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); 81 81 82 82 83 buttonGo2->clicked().connect(this, &GWt_globalParameters::lancerCalcul);83 // buttonGo2->clicked().connect(this, &GWt_globalParameters::lancerCalcul); 84 84 85 85 … … 117 117 } 118 118 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 // } 126 126 127 127 -
Interface_Web/trunk/pspaWT/src/GWt_pspaApplication.cc
r50 r54 7 7 #include <Wt/WGridLayout> 8 8 #include <Wt/WVBoxLayout> 9 #include <Wt/WHBoxLayout> 9 10 #include <Wt/WImage> 10 11 #include <Wt/WTextArea> 11 12 #include <Wt/WBreak> 12 13 #include <Wt/WPushButton> 14 #include <Wt/WStandardItemModel> 15 #include <Wt/Chart/WCartesianChart> 13 16 14 17 #include "GWt_pspaApplication.h" … … 16 19 #include "GWt_globalParameters.h" 17 20 21 using namespace Wt::Chart; 18 22 19 23 … … 104 108 105 109 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); 112 121 boutonSauve->clicked().connect(this, &PspaApplication::sauver); 113 122 boutonRestaure->clicked().connect(this, &PspaApplication::restaurer); … … 116 125 calculLayout->addWidget(beamLine_ , 0, 0); 117 126 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 119 181 calculLayout->addLayout(toolbarLayout ,2,0); 120 182 iconAndBeamLineLayout->addWidget(createPalette() , 0, 0); … … 155 217 } 156 218 219 220 void 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 157 229 void PspaApplication::sauver() 158 230 { -
Interface_Web/trunk/pspaWT/src/dataManager.cc
r53 r54 63 63 sortie << buf << endl; 64 64 } 65 66 currentBeam_.setFromParmela(globParam_.getFrequency()); 67 68 cout << " le faisceau a " << currentBeam_.getNbParticles() << " particules, les voici : " << endl; 69 70 currentBeam_.printAllXYZ(); 71 65 72 return sortie.str(); 66 73 }
Note: See TracChangeset
for help on using the changeset viewer.