#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 "sectorParameters.h" //xx class PspaApplication; class dataManager { public: dataManager() {;} dataManager(PspaApplication*); virtual ~dataManager(); void consoleMessage(string message); int getBeamLineSize(); inline globalParameters* getGlobalParameters() {return &globParam_;} inline particleBeam* getCurrentBeam() {return currentBeam_;} // xx inline sectorParameters* getSectorParameters() {return §orParam_;} particleBeam* getDiagnosticBeam(unsigned index); particleBeam* getDiagnosticBeam(string elementLabel); sectionToExecute* addSectionToExecute(abstractElement* debut,int debutIndex, abstractElement* fin, int finIndex, nomDeLogiciel logiciel); abstractElement* addElement(nomdElements::typedElement elemType); void removeElement(string); /** Get the label from the order number in the beam line @return return "" if not found */ string getLabelFromElementNumero(int numero); /** Get the numero from the label in the beam line @return return -1 if not found */ int getNumeroFromElementLabel(string); abstractElement* getElementPointerFromNumero(int); 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); void writeToAMLFile(string fileName); /** return the jobList size */ inline int getJobListSize() const { return jobList_.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(); } /** Clear a specific jobList */ void clearSectionToExecute(int a); private: globalParameters globParam_; sectorParameters sectorParam_; //xx particleBeam* currentBeam_; PspaApplication* pspa_; unsigned firstComputedElemNumero_; unsigned lastComputedElemNumero_; vector diagnosticBeam_; vector indexElementToIndexDiag_; vector jobList_; void removeFile(string nameOfFile); void clearSectionToExecute(); abstractSoftware* createSoftwareConnexion(nomDeLogiciel logi); }; #endif