[41] | 1 | #ifndef PSPA_SEEN |
---|
| 2 | #define PSPA_SEEN |
---|
| 3 | |
---|
[131] | 4 | #include <cstdlib> |
---|
[58] | 5 | #include <list> |
---|
| 6 | |
---|
[41] | 7 | #include <Wt/WApplication> |
---|
| 8 | #include <Wt/WEnvironment> |
---|
| 9 | #include <Wt/WContainerWidget> |
---|
[177] | 10 | #include <Wt/WText> |
---|
[58] | 11 | #include <Wt/WPanel> |
---|
| 12 | #include <Wt/WComboBox> |
---|
[59] | 13 | #include <Wt/WPushButton> |
---|
[185] | 14 | #include <Wt/WDialog> |
---|
[200] | 15 | #include <Wt/WPdfImage> |
---|
| 16 | #include <Wt/Chart/WCartesianChart> |
---|
| 17 | #include <Wt/WLength> |
---|
[324] | 18 | #include <Wt/WButtonGroup> |
---|
[41] | 19 | |
---|
[233] | 20 | #include "GWt_dialog.h" |
---|
[41] | 21 | #include "dataManager.h" |
---|
[242] | 22 | #include "GWt_console.h" |
---|
[289] | 23 | #include "GWt_abstractElementFactory.h" |
---|
[302] | 24 | #include "GWt_softwarePanel.h" |
---|
[305] | 25 | #include "GWt_ligneFaisceau.h" |
---|
[41] | 26 | |
---|
| 27 | using namespace Wt; |
---|
| 28 | |
---|
| 29 | class PspaApplication : public WApplication |
---|
| 30 | { |
---|
[302] | 31 | |
---|
[324] | 32 | private : |
---|
[272] | 33 | |
---|
[324] | 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_; |
---|
[272] | 42 | |
---|
[324] | 43 | WWidget* globalParam_; |
---|
| 44 | GWt_dialog* graphicsDialog_; |
---|
| 45 | WButtonGroup *group_; |
---|
[340] | 46 | vector<GWt_dialog*> eDialog_; |
---|
| 47 | |
---|
[324] | 48 | WText* probleme_; |
---|
| 49 | WComboBox* choixElementDessin_; |
---|
| 50 | WComboBox* choixTypeDessinFaisceau_; |
---|
[340] | 51 | WComboBox* choixAbsPhase_; |
---|
| 52 | WComboBox* choixOrdPhase_; |
---|
[324] | 53 | WComboBox* choixEnveloppeDessin_; |
---|
| 54 | WComboBox* choixHistoDessin_; |
---|
[362] | 55 | WComboBox* choixVariableHisto_; |
---|
[324] | 56 | |
---|
| 57 | WContainerWidget* toto_; |
---|
[375] | 58 | WString applicationDefaultTitle_; |
---|
| 59 | |
---|
[324] | 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(); |
---|
[379] | 71 | |
---|
| 72 | // extensions (.001, .002,...) pour les fichiers "snapshot" |
---|
| 73 | int extensionFile_; |
---|
[336] | 74 | |
---|
[324] | 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(); |
---|
[381] | 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); |
---|
[386] | 89 | //void faireDessinParmela(WContainerWidget* toto, particleBeam* beam, string namex, string namey ); |
---|
| 90 | // void faireDessinTransport(WContainerWidget* toto, particleBeam* beam, string namex, string namey); |
---|
[324] | 91 | void faireDessinEnveloppe(WContainerWidget* toto, string type); |
---|
[354] | 92 | // void scatterPlot1D(WContainerWidget* toto, vector<double>& xcor, vector<double>& ycor); |
---|
[393] | 93 | |
---|
[381] | 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); |
---|
[393] | 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 | |
---|
[341] | 97 | bool removePathFromConfigName(string& config); |
---|
[324] | 98 | bool removeExtensionFromConfigName(string& config); |
---|
[376] | 99 | void removeBeamLine(); |
---|
| 100 | |
---|
[324] | 101 | void dessiner(); |
---|
| 102 | void dessinerEnveloppe(); |
---|
| 103 | void dessinerPhaseSpace(); |
---|
[393] | 104 | |
---|
| 105 | void old_dessinerHistogramme(); |
---|
[324] | 106 | void dessinerHistogramme(); |
---|
[333] | 107 | |
---|
[340] | 108 | public : |
---|
[324] | 109 | |
---|
| 110 | PspaApplication(const WEnvironment& env); |
---|
[340] | 111 | |
---|
[324] | 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 | } |
---|
[341] | 134 | |
---|
[379] | 135 | inline string getWorkingDir() const { |
---|
| 136 | return workingDir_; |
---|
| 137 | } |
---|
[341] | 138 | |
---|
[379] | 139 | inline void setExtensionFile(int n) { |
---|
| 140 | extensionFile_ = n; |
---|
| 141 | } |
---|
| 142 | |
---|
| 143 | inline int getExtensionFile() const { |
---|
| 144 | return extensionFile_; |
---|
| 145 | } |
---|
| 146 | |
---|
[41] | 147 | }; |
---|
| 148 | #endif |
---|