#ifndef DATAMANAGER_SEEN #define DATAMANAGER_SEEN #include "abstractElement.h" #include "abstractSoftware.h" #include "globalParameters.h" #include "nomdElements.h" #include "particleBeam.h" #include "sectionToExecute.h" #include "nomDeLogiciel.h" #include "trivaluedBool.h" #include "beam2Moments.h" #include "parmelaParticle.h" #include "nomDeLogiciel.h" #include "sector.h" #include "expandedMachine.h" #include "computingBlock.h" #include "sectorParameters.h" //xx class PspaApplication; class dataManager { public: dataManager() : pspa_ (NULL), currentMachine_(NULL) {;} dataManager(PspaApplication*); virtual ~dataManager(); void consoleMessage(string message); inline globalParameters* getGlobalParameters() {return &globParam_;} particleBeam* getDiagnosticBeam(unsigned index); particleBeam* getDiagnosticBeam_deprecated(string elementLabel); //provisoire inline expandedMachine* getCurrentMachine() {return currentMachine_;} inline expandedMachine* expandMachine() { if ( !currentMachine_ ) currentMachine_ = new expandedMachine(this); currentMachine_->fromSectors( sectors_ ); return currentMachine_; } bool areDataCoherent() { bool resultat = false; if ( !currentMachine_ ) return false; resultat = currentMachine_->areDataCoherent(); return resultat; } /** Add a new sector */ sector* addNewSector(); /** return all sectors */ inline std::vector getSectors() {return sectors_;}; void initializeExecution(); bool executeAll(); void donneesRmsEnveloppe(string type,vector& xcor,vector& ycor, string& titre, string& legendx, string& legendy); /** Save a configuration file on the server @param folder @param filename */ // void saveConfiguration(string folder, string filename); // bool restoreElements(string inputFileName); bool restoreAMLElements(string inputFileName); void writeToAMLFile(string fileName); /** return the sectors size */ // inline unsigned long getSectorsSize() const { // return sectors_.size(); // } // si newBeam = true, on cree un nouveau diag // si newBeam = false, on utilise le dernier inline particleBeam* updateCurrentDiagnostic(bool newBeam) { if ( newBeam ) { diagnosticBeam_.push_back(particleBeam()); } indexElementToIndexDiag_.push_back(diagnosticBeam_.size() -1); return &diagnosticBeam_.back(); } /** Return the application attatch to this controler */ inline PspaApplication* getPspaApplication() { return pspa_; }; abstractElement* getElementInSectorsByLabel(string etiq); void messageEcran(string niveau, string msg) const; private: globalParameters globParam_; PspaApplication* pspa_; vector diagnosticBeam_; vector indexElementToIndexDiag_; // vector jobList_; vector sectors_; expandedMachine* currentMachine_; void removeFile(string nameOfFile); }; #endif