source: PSPA/Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h @ 455

Last change on this file since 455 was 455, checked in by garnier, 11 years ago

grosse modification pour intégrer les sections

File size: 2.6 KB
Line 
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#include "sector.h"
16
17#include "sectorParameters.h" //xx
18
19class PspaApplication;
20
21class dataManager
22{
23
24 public:
25 
26  dataManager() {;}
27  dataManager(PspaApplication*);
28  virtual ~dataManager();
29  void consoleMessage(string message);
30  int getBeamLineSize_deprecated();
31  inline globalParameters* getGlobalParameters()  {return &globParam_;}
32  inline particleBeam* getCurrentBeam() {return currentBeam_;}
33   
34  particleBeam* getDiagnosticBeam(unsigned index);
35  particleBeam* getDiagnosticBeam_deprecated(string elementLabel);
36
37/** Add a new sector
38 */
39  sector* addNewSector();
40 
41  /** return all sectors
42   */
43  inline std::vector <sector*> getSectors() {return jobList_;};
44 
45  /**
46     Get the label from the order number in the beam line
47     @return return "" if not found
48  */
49  string getLabelFromElementNumero_deprecated(int numero);
50 
51  /**
52     Get the numero from the label in the beam line
53     @return return -1 if not found
54  */
55  int getNumeroFromElementLabel_deprecated(string);
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 unsigned long 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 
90  /**
91   Return the application attatch to this controler
92   */
93  inline PspaApplication* getPspaApplication() {
94    return pspa_;
95  };
96
97 
98 private:
99
100  globalParameters globParam_;
101  particleBeam* currentBeam_;
102  PspaApplication* pspa_;
103 
104  vector<particleBeam> diagnosticBeam_;
105  vector<unsigned> indexElementToIndexDiag_;
106  vector <sector*> jobList_;
107  void removeFile(string nameOfFile);
108};
109#endif
Note: See TracBrowser for help on using the repository browser.