source: PSPA/Interface_Web/trunk/pspaWT/include/dataManager.h @ 227

Last change on this file since 227 was 227, checked in by lemeur, 11 years ago

usage de WApplication::appRoot() pour WORKINGAREA

File size: 2.0 KB
Line 
1#ifndef DATAMANAGER_SEEN
2#define DATAMANAGER_SEEN
3
4#include "abstractElement.h"
5#include "elementsCollection.h"
6#include "globalParameters.h"
7#include "nomdElements.h"
8#include "particleBeam.h"
9#include "sectionToExecute.h"
10#include "nomDeLogiciel.h"
11
12class dataManager
13{
14
15  elementsCollection elementsGallery_;
16  globalParameters globParam_;
17  particleBeam* currentBeam_;
18
19  vector<particleBeam> diagnosticBeam_;
20
21  vector<sectionToExecute*> jobList_;
22
23  bool createInputFileParmela( unsigned int numeroDeb, unsigned int numerpFin, string workingDir);
24  bool createInputFileTransport( unsigned int numeroDeb, unsigned int numeroFin, string workingDir);
25  void removeFile(string nameOfFile); 
26  void clearSectionToExecute();
27
28 public:
29
30  dataManager() {currentBeam_ = NULL;}
31  ~dataManager() {
32    unsigned k;
33    for (k=0; k < jobList_.size();k++) {
34      if ( jobList_[k] != NULL ) delete jobList_[k];
35    }
36    if ( currentBeam_ == NULL ) delete currentBeam_;
37  }
38
39  inline int beamLineSize() {return elementsGallery_.size();}
40  inline globalParameters* getGlobalParameters()  {return &globParam_;}
41  inline elementsCollection* getCollection() {return &elementsGallery_;}
42  inline particleBeam* getCurrentBeam() {return currentBeam_;}
43
44  particleBeam* getDiagnosticBeam(unsigned index);
45
46  void addSectionToExecute(int debut, int fin, nomDeLogiciel prog);
47 
48  abstractElement* addElement(typedElement elemType);
49  string getLabelFromElementNumero(int numero);
50  void initializeExecution(string workingDir);
51  string checkExecute();
52  bool executeTransport( unsigned int indexDeb, unsigned int indexFin, string workingDir,  string& resul);
53  bool executeParmela( unsigned int indexDeb, unsigned int indexFin, string workingDir, string& resul);
54  bool executeAll(string workingDir, string& resul);
55  void saveConfiguration(string workingDir, string nameOfFile);
56  bool restoreElements(string workingDir, string inputFileName);
57  void donneesRmsEnveloppe( string type, unsigned int numeroDeb, unsigned int numeroFin, vector<double>& xcor, vector<double>& ycor);
58};
59#endif
Note: See TracBrowser for help on using the repository browser.