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

Last change on this file since 431 was 431, checked in by touze, 11 years ago

systeme periodique (mailles) + multipoles + madx

File size: 2.9 KB
RevLine 
[27]1#ifndef DATAMANAGER_SEEN
2#define DATAMANAGER_SEEN
3
[41]4#include "abstractElement.h"
[316]5#include "abstractSoftware.h"
[38]6#include "globalParameters.h"
[50]7#include "nomdElements.h"
[54]8#include "particleBeam.h"
[58]9#include "sectionToExecute.h"
10#include "nomDeLogiciel.h"
[230]11#include "trivaluedBool.h"
[236]12#include "beam2Moments.h"
[295]13#include "parmelaParticle.h"
[359]14#include "nomDeLogiciel.h"
[236]15
[431]16#include "sectorParameters.h" //xx
17
[305]18class PspaApplication;
[236]19
[27]20class dataManager
21{
[342]22
23 public:
24 
[431]25  dataManager() {;}
[342]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_;}
[431]32
33  // xx
34  inline sectorParameters* getSectorParameters() {return &sectorParam_;}
[302]35   
[342]36  particleBeam* getDiagnosticBeam(unsigned index);
[386]37  particleBeam* getDiagnosticBeam(string elementLabel);
38
[419]39  sectionToExecute*  addSectionToExecute(abstractElement* debut,int debutIndex, abstractElement* fin, int finIndex, nomDeLogiciel logiciel);
[359]40
[418]41  abstractElement* addElement(nomdElements::typedElement elemType);
[342]42  void removeElement(string);
43 
44  /**
[305]45     Get the label from the order number in the beam line
46     @return return "" if not found
[342]47  */
48  string getLabelFromElementNumero(int numero);
49 
50  /**
[305]51     Get the numero from the label in the beam line
52     @return return -1 if not found
[342]53  */
54  int getNumeroFromElementLabel(string);
[424]55  abstractElement*  getElementPointerFromNumero(int);
[342]56 
57  void initializeExecution();
[431]58
[342]59  bool executeAll();
[344]60 
[381]61  void donneesRmsEnveloppe(string type,vector<double>& xcor,vector<double>& ycor, string& titre, string& legendx, string& legendy);
[355]62
[347]63  /**
64   Save a configuration file on the server
65   @param folder
66   @param filename
67   */
[424]68  void saveConfiguration(string folder, string filename);
69  bool restoreElements(string inputFileName);
70 
71  void writeToAMLFile(string fileName);
[347]72   
[424]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());
[401]84    }
[424]85    indexElementToIndexDiag_.push_back(diagnosticBeam_.size() -1);
86    return &diagnosticBeam_.back();
87  }
[302]88   
[431]89  /** Clear a specific jobList */
[424]90  void clearSectionToExecute(int a);
[401]91   
[424]92 private:
93
94  globalParameters globParam_;
[431]95  sectorParameters sectorParam_; //xx
[424]96  particleBeam* currentBeam_;
[355]97  PspaApplication* pspa_;
[368]98  unsigned firstComputedElemNumero_;
99  unsigned lastComputedElemNumero_;
[424]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};
[27]109#endif
Note: See TracBrowser for help on using the repository browser.