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 "GWt_console.h" |
---|
22 | #include "GWt_abstractElementFactory.h" |
---|
23 | #include "GWt_softwarePanel.h" |
---|
24 | #include "GWt_ligneFaisceau.h" |
---|
25 | #include "GWt_globalParameters.h" |
---|
26 | |
---|
27 | #include "dataManager.h" |
---|
28 | |
---|
29 | using namespace Wt; |
---|
30 | |
---|
31 | class PspaApplication : public WApplication |
---|
32 | { |
---|
33 | |
---|
34 | private : |
---|
35 | |
---|
36 | dataManager* dtmanage_; |
---|
37 | string nameOfCase_; |
---|
38 | string workingDir_; |
---|
39 | WDialog* dialogSave_; |
---|
40 | WDialog* dialogOpen_; |
---|
41 | WLineEdit* saveNameEdit_; |
---|
42 | WLineEdit* openNameEdit_; |
---|
43 | GWt_LigneFaisceau* beamLine_; |
---|
44 | |
---|
45 | // WWidget* globalParam_; |
---|
46 | GWt_globalParameters* globalParam_; // xx |
---|
47 | |
---|
48 | GWt_dialog* graphicsDialog_; |
---|
49 | WButtonGroup *group_; |
---|
50 | vector<GWt_dialog*> eDialog_; |
---|
51 | |
---|
52 | WText* probleme_; |
---|
53 | WComboBox* choixElementDessin_; |
---|
54 | WComboBox* choixTypeDessinFaisceau_; |
---|
55 | WComboBox* choixAbsPhase_; |
---|
56 | WComboBox* choixOrdPhase_; |
---|
57 | WComboBox* choixEnveloppeDessin_; |
---|
58 | WComboBox* choixHistoDessin_; |
---|
59 | WComboBox* choixVariableHisto_; |
---|
60 | |
---|
61 | WContainerWidget* toto_; |
---|
62 | WString applicationDefaultTitle_; |
---|
63 | |
---|
64 | GWt_softwarePanel* executeWidget_; |
---|
65 | WFileUpload* uploadFileSelectorWidget_; |
---|
66 | GWt_console* console_; |
---|
67 | GWt_abstractElementFactory* abstractElementFactory_; |
---|
68 | |
---|
69 | WText* createTitle(const WString&); |
---|
70 | WWidget* createPalette(); |
---|
71 | WWidget* createBeamLine(); |
---|
72 | WWidget* createExecuteWidget(); |
---|
73 | WContainerWidget* createDrawingWidget(); |
---|
74 | |
---|
75 | //WWidget* createGlobalParamWidget(); |
---|
76 | WWidget* createDashBoard(); // xx |
---|
77 | void messageBox1(); // xx |
---|
78 | void messageBox2(); // xx |
---|
79 | |
---|
80 | // extensions (.001, .002,...) pour les fichiers "snapshot" |
---|
81 | int extensionFile_; |
---|
82 | void closeGraphicDialog(); |
---|
83 | |
---|
84 | void createDragImage(const char *url,const char *smallurl,const char *mimeType,WContainerWidget *p,WString()); |
---|
85 | void sauver(); |
---|
86 | void dialogSaveDone(WDialog::DialogCode code); |
---|
87 | void restaurer(); |
---|
88 | void chargerConfig(); |
---|
89 | void openFileSelector(); |
---|
90 | void fileTooLarge(); |
---|
91 | |
---|
92 | void dialogOnGraphics(); |
---|
93 | void faireDessinPhaseSpace(WContainerWidget* toto, particleBeam* beam, string elementLabel, string namex, string namey, int typeFaisceau); |
---|
94 | void faireDessinEnveloppe(WContainerWidget* toto, string type); |
---|
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 | void dessinerHistogramme(); |
---|
105 | |
---|
106 | public : |
---|
107 | |
---|
108 | PspaApplication(const WEnvironment& env); |
---|
109 | |
---|
110 | string getSelection(); |
---|
111 | void faireDessin(); |
---|
112 | |
---|
113 | inline dataManager* getDataManager() const { |
---|
114 | return dtmanage_; |
---|
115 | } |
---|
116 | |
---|
117 | inline GWt_globalParameters* getGlobalParam() const { |
---|
118 | return globalParam_; |
---|
119 | } |
---|
120 | |
---|
121 | |
---|
122 | /* inline WWidget* getGlobalParam() { */ |
---|
123 | /* return globalParam_; */ |
---|
124 | /* } */ |
---|
125 | |
---|
126 | inline GWt_softwarePanel* getExecuteWidget() { |
---|
127 | return executeWidget_; |
---|
128 | } |
---|
129 | |
---|
130 | inline GWt_LigneFaisceau* getBeamLine() { |
---|
131 | return beamLine_; |
---|
132 | } |
---|
133 | |
---|
134 | inline GWt_abstractElementFactory* getAbstractElementFactory() { |
---|
135 | return abstractElementFactory_; |
---|
136 | } |
---|
137 | |
---|
138 | inline string getWorkingDir() const { |
---|
139 | return workingDir_; |
---|
140 | } |
---|
141 | |
---|
142 | inline void setExtensionFile(int n) { |
---|
143 | extensionFile_ = n; |
---|
144 | } |
---|
145 | |
---|
146 | inline int getExtensionFile() const { |
---|
147 | return extensionFile_; |
---|
148 | } |
---|
149 | |
---|
150 | }; |
---|
151 | #endif |
---|