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

Last change on this file since 495 was 495, checked in by lemeur, 10 years ago

maj de History

File size: 3.0 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"
[449]15#include "sector.h"
[493]16#include "expandedMachine.h"
17#include "computingBlock.h"
[236]18
[431]19#include "sectorParameters.h" //xx
20
[305]21class PspaApplication;
[236]22
[27]23class dataManager
24{
[342]25
26 public:
27 
[493]28 dataManager() :   
29  pspa_ (NULL),
30    currentMachine_(NULL)
31      {;}
[342]32  dataManager(PspaApplication*);
33  virtual ~dataManager();
34  void consoleMessage(string message);
35  inline globalParameters* getGlobalParameters()  {return &globParam_;}
[302]36   
[342]37  particleBeam* getDiagnosticBeam(unsigned index);
[455]38  particleBeam* getDiagnosticBeam_deprecated(string elementLabel);
[386]39
[493]40
41  //provisoire
42  inline expandedMachine* getCurrentMachine() {return currentMachine_;}
43
44  inline expandedMachine* expandMachine() {
45    if ( !currentMachine_ ) currentMachine_ = new expandedMachine(this);
[495]46    currentMachine_->fromSectors( sectors_ );
[493]47    return currentMachine_;
48  }
49
50  bool areDataCoherent() {
51    bool resultat = false;
52    if ( !currentMachine_ ) return false;
53    resultat = currentMachine_->areDataCoherent();
54    return resultat;
55  }
56
57
[449]58/** Add a new sector
59 */
60  sector* addNewSector();
61 
62  /** return all sectors
63   */
[493]64  inline std::vector <sector*> getSectors() {return sectors_;};
[449]65 
[342]66 
67 
68  void initializeExecution();
[431]69
[342]70  bool executeAll();
[344]71 
[381]72  void donneesRmsEnveloppe(string type,vector<double>& xcor,vector<double>& ycor, string& titre, string& legendx, string& legendy);
[355]73
[347]74  /**
75   Save a configuration file on the server
76   @param folder
77   @param filename
78   */
[488]79  //  void saveConfiguration(string folder, string filename);
80  //  bool restoreElements(string inputFileName);
81  bool restoreAMLElements(string inputFileName);
82
[424]83  void writeToAMLFile(string fileName);
[347]84   
[493]85  /** return the sectors size
[424]86   */
[493]87  //  inline unsigned long getSectorsSize() const {
88  //    return sectors_.size();
89  // }
[424]90 
91  // si newBeam = true, on cree un nouveau diag
92  // si newBeam = false, on utilise le dernier
93  inline particleBeam* updateCurrentDiagnostic(bool newBeam) {
94    if ( newBeam ) {
95      diagnosticBeam_.push_back(particleBeam());
[401]96    }
[424]97    indexElementToIndexDiag_.push_back(diagnosticBeam_.size() -1);
98    return &diagnosticBeam_.back();
99  }
[302]100   
[455]101 
102  /**
103   Return the application attatch to this controler
104   */
105  inline PspaApplication* getPspaApplication() {
106    return pspa_;
107  };
108
[493]109  abstractElement* getElementInSectorsByLabel(string etiq);
110
111
112  void messageEcran(string niveau, string msg) const;
113
114
115
[424]116 private:
117
118  globalParameters globParam_;
[355]119  PspaApplication* pspa_;
[424]120 
121  vector<particleBeam> diagnosticBeam_;
122  vector<unsigned> indexElementToIndexDiag_;
[493]123  //  vector <sector*> jobList_;
124  vector <sector*> sectors_;
125  expandedMachine* currentMachine_;
[424]126  void removeFile(string nameOfFile);
127};
[27]128#endif
Note: See TracBrowser for help on using the repository browser.