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 | #include "sectorParameters.h" //xx |
---|
17 | |
---|
18 | class PspaApplication; |
---|
19 | |
---|
20 | class dataManager |
---|
21 | { |
---|
22 | |
---|
23 | public: |
---|
24 | |
---|
25 | dataManager() {;} |
---|
26 | dataManager(PspaApplication*); |
---|
27 | virtual ~dataManager(); |
---|
28 | void consoleMessage(string message); |
---|
29 | int getBeamLineSize(); |
---|
30 | inline globalParameters* getGlobalParameters() {return &globParam_;} |
---|
31 | inline particleBeam* getCurrentBeam() {return currentBeam_;} |
---|
32 | |
---|
33 | // xx |
---|
34 | inline sectorParameters* getSectorParameters() {return §orParam_;} |
---|
35 | |
---|
36 | particleBeam* getDiagnosticBeam(unsigned index); |
---|
37 | particleBeam* getDiagnosticBeam(string elementLabel); |
---|
38 | |
---|
39 | sectionToExecute* addSectionToExecute(abstractElement* debut,int debutIndex, abstractElement* fin, int finIndex, nomDeLogiciel logiciel); |
---|
40 | |
---|
41 | abstractElement* addElement(nomdElements::typedElement elemType); |
---|
42 | void removeElement(string); |
---|
43 | |
---|
44 | /** |
---|
45 | Get the label from the order number in the beam line |
---|
46 | @return return "" if not found |
---|
47 | */ |
---|
48 | string getLabelFromElementNumero(int numero); |
---|
49 | |
---|
50 | /** |
---|
51 | Get the numero from the label in the beam line |
---|
52 | @return return -1 if not found |
---|
53 | */ |
---|
54 | int getNumeroFromElementLabel(string); |
---|
55 | abstractElement* getElementPointerFromNumero(int); |
---|
56 | |
---|
57 | void initializeExecution(); |
---|
58 | |
---|
59 | bool executeAll(); |
---|
60 | |
---|
61 | void donneesRmsEnveloppe(string type,vector<double>& xcor,vector<double>& ycor, string& titre, string& legendx, string& legendy); |
---|
62 | |
---|
63 | /** |
---|
64 | Save a configuration file on the server |
---|
65 | @param folder |
---|
66 | @param filename |
---|
67 | */ |
---|
68 | void saveConfiguration(string folder, string filename); |
---|
69 | bool restoreElements(string inputFileName); |
---|
70 | |
---|
71 | void writeToAMLFile(string fileName); |
---|
72 | |
---|
73 | /** return the jobList size |
---|
74 | */ |
---|
75 | inline int getJobListSize() const { |
---|
76 | return jobList_.size(); |
---|
77 | } |
---|
78 | |
---|
79 | // si newBeam = true, on cree un nouveau diag |
---|
80 | // si newBeam = false, on utilise le dernier |
---|
81 | inline particleBeam* updateCurrentDiagnostic(bool newBeam) { |
---|
82 | if ( newBeam ) { |
---|
83 | diagnosticBeam_.push_back(particleBeam()); |
---|
84 | } |
---|
85 | indexElementToIndexDiag_.push_back(diagnosticBeam_.size() -1); |
---|
86 | return &diagnosticBeam_.back(); |
---|
87 | } |
---|
88 | |
---|
89 | /** Clear a specific jobList */ |
---|
90 | void clearSectionToExecute(int a); |
---|
91 | |
---|
92 | private: |
---|
93 | |
---|
94 | globalParameters globParam_; |
---|
95 | sectorParameters sectorParam_; //xx |
---|
96 | particleBeam* currentBeam_; |
---|
97 | PspaApplication* pspa_; |
---|
98 | unsigned firstComputedElemNumero_; |
---|
99 | unsigned lastComputedElemNumero_; |
---|
100 | |
---|
101 | vector<particleBeam> diagnosticBeam_; |
---|
102 | vector<unsigned> indexElementToIndexDiag_; |
---|
103 | vector<sectionToExecute*> jobList_; |
---|
104 | |
---|
105 | void removeFile(string nameOfFile); |
---|
106 | void clearSectionToExecute(); |
---|
107 | abstractSoftware* createSoftwareConnexion(nomDeLogiciel logi); |
---|
108 | }; |
---|
109 | #endif |
---|