source: PSPA/Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h @ 393

Last change on this file since 393 was 393, checked in by touze, 11 years ago

unification des traces

File size: 4.1 KB
Line 
1#ifndef PSPA_SEEN
2#define  PSPA_SEEN
3
4#include <cstdlib>
5#include <list>
6
7#include <Wt/WApplication>
8#include <Wt/WEnvironment>
9#include <Wt/WContainerWidget>
10#include <Wt/WText>
11#include <Wt/WPanel>
12#include <Wt/WComboBox>
13#include <Wt/WPushButton>
14#include <Wt/WDialog>
15#include <Wt/WPdfImage>
16#include <Wt/Chart/WCartesianChart>
17#include <Wt/WLength>
18#include <Wt/WButtonGroup>
19
20#include "GWt_dialog.h"
21#include "dataManager.h"
22#include "GWt_console.h"
23#include "GWt_abstractElementFactory.h"
24#include "GWt_softwarePanel.h"
25#include "GWt_ligneFaisceau.h"
26
27using namespace Wt;
28
29class PspaApplication : public WApplication
30{
31       
32 private :
33   
34  dataManager* dtmanage_;
35  string nameOfCase_;
36  string workingDir_;
37  WDialog* dialogSave_;
38  WDialog* dialogOpen_;
39  WLineEdit* saveNameEdit_;
40  WLineEdit* openNameEdit_;
41  GWt_LigneFaisceau* beamLine_;
42   
43  WWidget* globalParam_;
44  GWt_dialog* graphicsDialog_;
45  WButtonGroup *group_;
46  vector<GWt_dialog*> eDialog_;
47 
48  WText* probleme_;
49  WComboBox* choixElementDessin_;
50  WComboBox* choixTypeDessinFaisceau_;
51  WComboBox* choixAbsPhase_;
52  WComboBox* choixOrdPhase_;
53  WComboBox* choixEnveloppeDessin_;
54  WComboBox* choixHistoDessin_;
55  WComboBox* choixVariableHisto_;
56
57  WContainerWidget* toto_;
58  WString applicationDefaultTitle_;
59   
60  GWt_softwarePanel* executeWidget_;
61  WFileUpload* uploadFileSelectorWidget_;
62  GWt_console* console_;
63  GWt_abstractElementFactory* abstractElementFactory_;
64     
65  WText* createTitle(const WString&);
66  WWidget* createPalette();
67  void createBeamLine();
68  WWidget* createGlobalParamWidget();
69  WWidget* createExecuteWidget();
70  WContainerWidget* createDrawingWidget();
71
72  // extensions (.001, .002,...) pour les fichiers "snapshot"
73  int extensionFile_;
74 
75  void closeGraphicDialog();
76 
77  void createDragImage(const char *url,const char *smallurl,const char *mimeType,WContainerWidget *p,WString());
78  void sauver();
79  void dialogSaveDone(WDialog::DialogCode code);
80  void restaurer();
81  void chargerConfig();
82  void openFileSelector();
83  void fileTooLarge();
84 
85  void dialogOnGraphics();
86  void faireDessinPhaseSpace(WContainerWidget* toto, particleBeam* beam, string namex, string namey, int typeFaisceau);
87
88 //  void setModelComponentForPhaseSpace(WStandardItemModel* model, vector<bareParticle>& partic, unsigned indexParticleComponent, unsigned modelComponent);
89  //void faireDessinParmela(WContainerWidget* toto, particleBeam* beam, string namex, string namey  );
90  //  void faireDessinTransport(WContainerWidget* toto, particleBeam* beam, string namex, string namey);
91  void faireDessinEnveloppe(WContainerWidget* toto, string type);
92  //  void scatterPlot1D(WContainerWidget* toto, vector<double>& xcor, vector<double>& ycor);
93
94  void chartPlot2vec(WContainerWidget* toto, vector<double>& xcor, vector<double>& ycor, bool drawPoints, string title, string legendx, string legendy, int width, int height, bool makeIcon=false);
95  void chartPlot2vec(WContainerWidget* toto,vector<double>& xcor,vector<double>& ycor,Wt::Chart::SeriesType seriesType,Wt::Chart::FillRangeType fillRange,Wt::Chart::AxisValue value,bool isGridLinesEnables,string title,string legendx,string legendy,int width,int height,bool makeIcon = false);
96
97  bool removePathFromConfigName(string& config);
98  bool removeExtensionFromConfigName(string& config);
99  void removeBeamLine();
100   
101  void dessiner();
102  void dessinerEnveloppe();
103  void dessinerPhaseSpace();
104
105  void old_dessinerHistogramme();
106  void dessinerHistogramme();
107
108 public :
109 
110  PspaApplication(const WEnvironment& env);
111 
112  string getSelection();
113  void faireDessin();
114
115  inline dataManager* getDataManager() const  {
116    return dtmanage_;
117  }
118 
119  inline WWidget* getGlobalParam() {
120    return globalParam_;
121  }
122
123  inline GWt_softwarePanel* getExecuteWidget() {
124    return executeWidget_;
125  }
126
127  inline GWt_LigneFaisceau* getBeamLine() {
128    return beamLine_;
129  }
130
131  inline GWt_abstractElementFactory* getAbstractElementFactory() {
132    return abstractElementFactory_;
133  }
134
135  inline string getWorkingDir() const {
136    return workingDir_;
137  }
138
139  inline void setExtensionFile(int n) {
140    extensionFile_ = n;
141  }
142
143  inline int getExtensionFile() const {
144    return extensionFile_;
145  }
146
147};
148#endif
Note: See TracBrowser for help on using the repository browser.