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 | |
---|
15 | #include "dataManager.h" |
---|
16 | |
---|
17 | using namespace Wt; |
---|
18 | |
---|
19 | /* |
---|
20 | * ESSAI PSPA |
---|
21 | */ |
---|
22 | class PspaApplication : public WApplication |
---|
23 | { |
---|
24 | |
---|
25 | typedef struct { |
---|
26 | WLineEdit* debut; |
---|
27 | WLineEdit* fin; |
---|
28 | WComboBox* selection; |
---|
29 | WContainerWidget* ligneDeWidget; |
---|
30 | } GWt_sectionToExecute; |
---|
31 | |
---|
32 | private : |
---|
33 | |
---|
34 | dataManager* dtmanage_; |
---|
35 | string nameOfCase_; |
---|
36 | |
---|
37 | WDialog* dialogSave_; |
---|
38 | WLineEdit* saveNameEdit_; |
---|
39 | |
---|
40 | |
---|
41 | WContainerWidget* console_; |
---|
42 | WWidget* globalParam_; |
---|
43 | WWidget* beamLine_; |
---|
44 | WContainerWidget* leDessin_; |
---|
45 | WPushButton *exec_go_; |
---|
46 | WText* probleme_; |
---|
47 | WComboBox* choixElementDessin_; |
---|
48 | WComboBox* choixTypeDessinFaisceau_; |
---|
49 | WComboBox* choixEnveloppeDessin_; |
---|
50 | WContainerWidget* toto_; |
---|
51 | WContainerWidget* contenuSections_; |
---|
52 | list<GWt_sectionToExecute*> selectedSections_; |
---|
53 | WFileUpload* uploadFileSelectorWidget; |
---|
54 | |
---|
55 | WText* createTitle(const WString&); |
---|
56 | WWidget* createPalette(); |
---|
57 | WWidget* createBeamLine(); |
---|
58 | WWidget* createGlobalParamWidget(); |
---|
59 | WWidget* createExecuteWidget(); |
---|
60 | WContainerWidget* createDrawingWidget(); |
---|
61 | |
---|
62 | void createDragImage(const char *url,const char *smallurl,const char *mimeType,WContainerWidget *p,WString name); |
---|
63 | void executer(); |
---|
64 | void sauver(); |
---|
65 | void dialogSaveDone(); |
---|
66 | void restaurer(); |
---|
67 | void chargerConfig(); |
---|
68 | void openFileSelector(); |
---|
69 | void fileTooLarge(); |
---|
70 | void dessiner(); |
---|
71 | |
---|
72 | void addSectionToExecuteW(); |
---|
73 | void deleteSectionToExecuteW(); |
---|
74 | void checkSectionSelection(); |
---|
75 | void disableSectionExecute(); |
---|
76 | bool areDataCoherent(); |
---|
77 | void faireDessin(); |
---|
78 | void faireDessinParmela(WContainerWidget* toto, particleBeam* beam); |
---|
79 | void faireDessinTransport(WContainerWidget* toto, particleBeam* beam); |
---|
80 | |
---|
81 | void dessinerEnveloppe(); |
---|
82 | void faireDessinEnveloppe(WContainerWidget* toto, string type); |
---|
83 | void scatterPlot1D(WContainerWidget* toto, vector<double>& xcor, vector<double>& ycor); |
---|
84 | |
---|
85 | public : |
---|
86 | |
---|
87 | PspaApplication(const WEnvironment& env); |
---|
88 | |
---|
89 | inline dataManager* getDataManager() const { |
---|
90 | return dtmanage_; |
---|
91 | } |
---|
92 | |
---|
93 | void addConsoleMessage(WString msg); |
---|
94 | |
---|
95 | void updateSelections(); |
---|
96 | string getSelection(); |
---|
97 | }; |
---|
98 | #endif |
---|