1 | #ifndef DATAMANAGER_SEEN |
---|
2 | #define DATAMANAGER_SEEN |
---|
3 | |
---|
4 | #include "abstractElement.h" |
---|
5 | #include "abstractSoftware.h" |
---|
6 | #include "globalParameters.h" |
---|
7 | #include "nomdElements.h" |
---|
8 | #include "particleBeam.h" |
---|
9 | #include "sectionToExecute.h" |
---|
10 | #include "nomDeLogiciel.h" |
---|
11 | #include "trivaluedBool.h" |
---|
12 | #include "beam2Moments.h" |
---|
13 | #include "parmelaParticle.h" |
---|
14 | #include "nomDeLogiciel.h" |
---|
15 | |
---|
16 | class PspaApplication; |
---|
17 | |
---|
18 | class dataManager |
---|
19 | { |
---|
20 | |
---|
21 | public: |
---|
22 | |
---|
23 | dataManager(PspaApplication*); |
---|
24 | virtual ~dataManager(); |
---|
25 | void consoleMessage(string message); |
---|
26 | int getBeamLineSize(); |
---|
27 | inline globalParameters* getGlobalParameters() {return &globParam_;} |
---|
28 | inline particleBeam* getCurrentBeam() {return currentBeam_;} |
---|
29 | |
---|
30 | particleBeam* getDiagnosticBeam(unsigned index); |
---|
31 | particleBeam* getDiagnosticBeam(string elementLabel); |
---|
32 | |
---|
33 | void addSectionToExecute(int debut, int fin, nomDeLogiciel prog); |
---|
34 | |
---|
35 | abstractElement* addElement(typedElement elemType); |
---|
36 | void removeElement(string); |
---|
37 | |
---|
38 | /** |
---|
39 | Get the label from the order number in the beam line |
---|
40 | @return return "" if not found |
---|
41 | */ |
---|
42 | string getLabelFromElementNumero(int numero); |
---|
43 | |
---|
44 | /** |
---|
45 | Get the numero from the label in the beam line |
---|
46 | @return return -1 if not found |
---|
47 | */ |
---|
48 | int getNumeroFromElementLabel(string); |
---|
49 | abstractElement* getElementPointerFromNumero(int); |
---|
50 | |
---|
51 | void initializeExecution(); |
---|
52 | // trivaluedBool checkExecute(string& diagnostic); |
---|
53 | // trivaluedBool checkElementsForExec(nomDeLogiciel logiciel, unsigned indexDeb, unsigned indexFin, string& diagnostic); |
---|
54 | bool executeAll(); |
---|
55 | |
---|
56 | void donneesRmsEnveloppe(string type,vector<double>& xcor,vector<double>& ycor, string& titre, string& legendx, string& legendy); |
---|
57 | |
---|
58 | /** |
---|
59 | Save a configuration file on the server |
---|
60 | @param folder |
---|
61 | @param filename |
---|
62 | */ |
---|
63 | void saveConfiguration(string folder, string filename); |
---|
64 | |
---|
65 | bool restoreElements(string inputFileName); |
---|
66 | |
---|
67 | |
---|
68 | // si newBeam = true, on cree un nouveau diag |
---|
69 | // si newBeam = false, on utilise le dernier |
---|
70 | inline particleBeam* updateCurrentDiagnostic(bool newBeam) { |
---|
71 | if ( newBeam ) { |
---|
72 | diagnosticBeam_.push_back(particleBeam()); |
---|
73 | } |
---|
74 | indexElementToIndexDiag_.push_back(diagnosticBeam_.size() -1); |
---|
75 | return &diagnosticBeam_.back(); |
---|
76 | } |
---|
77 | |
---|
78 | |
---|
79 | private: |
---|
80 | globalParameters globParam_; |
---|
81 | particleBeam* currentBeam_; |
---|
82 | PspaApplication* pspa_; |
---|
83 | unsigned firstComputedElemNumero_; |
---|
84 | unsigned lastComputedElemNumero_; |
---|
85 | |
---|
86 | vector<particleBeam> diagnosticBeam_; |
---|
87 | vector<unsigned> indexElementToIndexDiag_; |
---|
88 | // numeroElementToIndexDiag_[k] contient, pour l'element d'index k, l'indice ind tel que diagnosticBeam_[ind] |
---|
89 | // soit le faisceau resultat, en l'etat qu'il doit avoir apres l'element k |
---|
90 | |
---|
91 | vector<sectionToExecute*> jobList_; |
---|
92 | |
---|
93 | void removeFile(string nameOfFile); |
---|
94 | void clearSectionToExecute(); |
---|
95 | abstractSoftware* createSoftwareConnexion(nomDeLogiciel logi); |
---|
96 | |
---|
97 | }; |
---|
98 | #endif |
---|