#ifndef DATAMANAGER_SEEN #define DATAMANAGER_SEEN #include "abstractElement.h" #include "elementsCollection.h" #include "globalParameters.h" #include "nomdElements.h" #include "particleBeam.h" #include "sectionToExecute.h" #include "nomDeLogiciel.h" class dataManager { elementsCollection elementsGallery_; globalParameters globParam_; particleBeam* currentBeam_; vector diagnosticBeam_; vector jobList_; void createInputFileParmela( unsigned int indexDeb, unsigned int indexFin); bool createInputFileTransport( unsigned int numeroDeb, unsigned int numeroFin); void removeFile(string nameOfFile); void clearSectionToExecute(); public: dataManager() {currentBeam_ = NULL;} ~dataManager() { unsigned k; for (k=0; k < jobList_.size();k++) { if ( jobList_[k] != NULL ) delete jobList_[k]; } if ( currentBeam_ == NULL ) delete currentBeam_; } inline int beamLineSize() {return elementsGallery_.size();} inline globalParameters* getGlobalParameters() {return &globParam_;} inline elementsCollection* getCollection() {return &elementsGallery_;} inline particleBeam* getCurrentBeam() {return currentBeam_;} particleBeam* getDiagnosticBeam(int index); void addSectionToExecute(int debut, int fin, nomDeLogiciel prog); abstractElement* addElement(typedElement elemType); string getLabelFromElementNumero(int numero); void initializeExecution(); string checkExecute(); bool executeTransport( unsigned int indexDeb, unsigned int indexFin, string& resul); bool executeParmela( unsigned int indexDeb, unsigned int indexFin, string& resul); bool executeAll(string& resul); void saveConfiguration(string nameOfFile); void restoreElements(string inputFileName); void donneesRmsEnveloppe( string type, unsigned int numeroDeb, unsigned int numeroFin, vector& xcor, vector& ycor); }; #endif