Changeset 493 in PSPA


Ignore:
Timestamp:
Mar 11, 2014, 11:21:43 AM (10 years ago)
Author:
lemeur
Message:

refection generale des secteurs et applications de softwares (suite)

Location:
Interface_Web/trunk/pspaWT
Files:
8 added
31 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/cmt/requirements

    r488 r493  
    3939 ../sources/controler/src/softwareGenerator.cc \
    4040 ../sources/controler/src/softwareUsersprogram.cc \
    41  ../sources/controler/src/sectionToExecute.cc \
    4241 ../sources/controler/src/softwareTest.cc \
    4342 ../sources/controler/src/softwareMadx.cc \
     
    4544 ../sources/controler/src/sectorParameters.cc \
    4645 ../sources/controler/src/sector.cc \
     46 ../sources/controler/src/expandedMachine.cc \
     47 ../sources/controler/src/computingBlock.cc \
    4748 ../sources/userInterface/src/GWt_elementCell.cc \
    4849 ../sources/userInterface/src/GWt_elementRfgun.cc \
     
    7071 ../sources/userInterface/src/GWt_serverFileSelector.cc \
    7172 ../sources/userInterface/src/GWt_sector.cc \
     73 ../sources/userInterface/src/GWt_machine.cc \
    7274 ../sources/userInterface/src/GWt_accelerator.cc \
    73  ../sources/userInterface/src/GWt_sectionToExecute.cc
     75 ../sources/userInterface/src/GWt_computingBlock.cc
    7476 
    7577#######################################################################
  • Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h

    r485 r493  
    1616class dataManager;
    1717class sectionToExecute;
    18 
     18class computingBlock;
    1919class abstractSoftware
    2020{
     
    4242  //  void registerElement(nomdElements::typedElement nomdel,trivaluedBool b);
    4343
    44   sectionToExecute* getSectionToExecute() {
    45     return sectionToExecute_;
     44  /* sectionToExecute* getSectionToExecute() { */
     45  /*      return sectionToExecute_; */
     46  /* } */
     47
     48  computingBlock* getComputingBlock() {
     49       return compBlock_;;
    4650  }
    4751
    4852  public :
    4953
    50   abstractSoftware(string, sectionToExecute*, dataManager* );
     54  //  abstractSoftware(string, sectionToExecute*, dataManager* );
     55  abstractSoftware(string, computingBlock*, dataManager* );
     56
    5157  ~abstractSoftware() {
    5258    delete nameOfSoftware_;
     
    7480  }
    7581  private :
    76   sectionToExecute* sectionToExecute_;
    77  
     82  //  sectionToExecute* sectionToExecute_;
     83  computingBlock* compBlock_;
    7884};
    7985#endif
  • Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h

    r488 r493  
    1414#include "nomDeLogiciel.h"
    1515#include "sector.h"
     16#include "expandedMachine.h"
     17#include "computingBlock.h"
    1618
    1719#include "sectorParameters.h" //xx
     
    2426 public:
    2527 
    26   dataManager() {;}
     28 dataManager() :   
     29  pspa_ (NULL),
     30    currentMachine_(NULL)
     31      {;}
    2732  dataManager(PspaApplication*);
    2833  virtual ~dataManager();
     
    3338  particleBeam* getDiagnosticBeam_deprecated(string elementLabel);
    3439
     40
     41  //provisoire
     42  inline expandedMachine* getCurrentMachine() {return currentMachine_;}
     43
     44  inline expandedMachine* expandMachine() {
     45    if ( !currentMachine_ ) currentMachine_ = new expandedMachine(this);
     46    currentMachine_->fromSectors( sectors_, this );
     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
    3558/** Add a new sector
    3659 */
     
    3962  /** return all sectors
    4063   */
    41   inline std::vector <sector*> getSectors() {return jobList_;};
     64  inline std::vector <sector*> getSectors() {return sectors_;};
    4265 
    4366 
     
    6083  void writeToAMLFile(string fileName);
    6184   
    62   /** return the jobList size
     85  /** return the sectors size
    6386   */
    64   inline unsigned long getJobListSize() const {
    65     return jobList_.size();
    66   }
     87  //  inline unsigned long getSectorsSize() const {
     88  //    return sectors_.size();
     89  // }
    6790 
    6891  // si newBeam = true, on cree un nouveau diag
     
    84107  };
    85108
    86  
     109  abstractElement* getElementInSectorsByLabel(string etiq);
     110
     111
     112  void messageEcran(string niveau, string msg) const;
     113
     114
     115
    87116 private:
    88117
     
    92121  vector<particleBeam> diagnosticBeam_;
    93122  vector<unsigned> indexElementToIndexDiag_;
    94   vector <sector*> jobList_;
     123  //  vector <sector*> jobList_;
     124  vector <sector*> sectors_;
     125  expandedMachine* currentMachine_;
    95126  void removeFile(string nameOfFile);
    96127};
  • Interface_Web/trunk/pspaWT/sources/controler/include/nomDeLogiciel.h

    r486 r493  
    6363  }
    6464
    65   trivaluedBool doAcceptElement(nomdElements::typedElement typdel);
     65  trivaluedBool doAcceptElement(nomdElements::typedElement typdel) const;
    6666
    6767
  • Interface_Web/trunk/pspaWT/sources/controler/include/sector.h

    r483 r493  
    1010
    1111
    12 class sectionToExecute;
     12//class sectionToExecute;
    1313class abstractElement;
    1414class dataManager;
     
    6060   Return the vector of sectionToExecute of this
    6161   */
    62   inline std::vector <sectionToExecute*> getSectionsToExecute() { return sectionToExecute_;};
    63  
     62  //  inline std::vector <sectionToExecute*> getSectionsToExecute() { return sectionToExecute_;};
     63  inline std::vector <abstractElement*>& getElements() { return elements_;};
    6464  /**
    6565   Add a sectionToExecute
    6666   */
    67   inline void addSectionToExecute(sectionToExecute* s) {
    68     if (s) sectionToExecute_.push_back(s);
    69   };
     67  //  inline void addSectionToExecute(sectionToExecute* s) {
     68  //    if (s) sectionToExecute_.push_back(s);
     69  //  };
    7070 
    7171  /** Add an element after another one. Will put it in the same sectionToExecuteList. If the element after is NULL
     
    8585 set the specific software for the given sectionToExecute number
    8686 */
    87   bool setSoftware(nomDeLogiciel, unsigned int sectionToExecuteNumber);
     87  //  bool setSoftware(nomDeLogiciel, unsigned int sectionToExecuteNumber);
    8888
    89   void clearSectionToExecute();
     89  //  void clearSectionToExecute();
    9090  /** Clear a specific jobList */
    91   void clearSectionToExecute(int a);
     91  //void clearSectionToExecute(int a);
    9292
    9393  void removeElement(abstractElement* currentElement);
     
    105105  }
    106106 
     107
     108  bool isInside(abstractElement* previousElement);
     109
    107110private:
    108111
    109   std::vector <sectionToExecute*> sectionToExecute_;
     112  bool insertAfter(abstractElement* previousElement,abstractElement* currentElement);
     113
     114
     115
     116
     117  std::vector<abstractElement*>  elements_;
     118  //  std::vector <sectionToExecute*> sectionToExecute_;
     119
    110120  particleBeam* currentBeam_;
    111121
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h

    r472 r493  
    1818 
    1919  softwareGenerator(); 
    20   softwareGenerator(string inputFileName, sectionToExecute*, dataManager*);
     20  //  softwareGenerator(string inputFileName, sectionToExecute*, dataManager*);
     21  softwareGenerator(string inputFileName, computingBlock*, dataManager*);
    2122
    2223  virtual ~softwareGenerator() {;}
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareMadx.h

    r484 r493  
    1717 
    1818  softwareMadx();
    19   softwareMadx(string,sectionToExecute*,dataManager*);
     19  //  softwareMadx(string,sectionToExecute*,dataManager*);
     20  softwareMadx(string,computingBlock* ,dataManager*);
    2021  virtual ~softwareMadx() {;}
    2122
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareParmela.h

    r481 r493  
    99 protected :
    1010
     11     vector<int> relativeParmelaElementIndices_;
     12
    1113
    1214  bool beamFromParmela(string workingDir,unsigned numeroElement, double referencefrequency, vector<double>& centroid, bareParticle& refPart,vector<bareParticle>& particles );
     
    1416  bool beamToParmela(string workingDir, particleBeam* partic );
    1517
     18    void setRelativeParmelaElementIndices();
    1619
    1720  string elementsData(const vector< pair<string, vector<string> > >& donnees) const ;
     
    2730    softwareParmela();
    2831   
    29     softwareParmela(string inputFileName, sectionToExecute*, dataManager*);
     32    //    softwareParmela(string inputFileName, sectionToExecute*, dataManager*);
     33    softwareParmela(string inputFileName, computingBlock*, dataManager*);
    3034
    3135  virtual ~softwareParmela() {;}
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareTest.h

    r472 r493  
    1818    softwareTest();
    1919   
    20     softwareTest(string inputFileName, sectionToExecute*, dataManager*);
     20    //    softwareTest(string inputFileName, sectionToExecute*, dataManager*);
     21    softwareTest(string inputFileName, computingBlock*, dataManager*);
    2122
    2223  virtual ~softwareTest() {;}
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareTransport.h

    r472 r493  
    2020 public :
    2121    softwareTransport();
    22     softwareTransport(string inputFileName, sectionToExecute*, dataManager*);
     22    //    softwareTransport(string inputFileName, sectionToExecute*, dataManager*);
     23    softwareTransport(string inputFileName, computingBlock*, dataManager*);
    2324
    2425  virtual ~softwareTransport() {;}
  • Interface_Web/trunk/pspaWT/sources/controler/include/softwareUsersprogram.h

    r472 r493  
    1313 public :
    1414    softwareUsersprogram();
    15     softwareUsersprogram(string inputFileName, sectionToExecute*, dataManager*);
     15    //    softwareUsersprogram(string inputFileName, sectionToExecute*, dataManager*);
     16    softwareUsersprogram(string inputFileName, computingBlock*, dataManager*);
    1617
    1718  virtual ~softwareUsersprogram() {;}
  • Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc

    r485 r493  
    1010}
    1111
    12 abstractSoftware::abstractSoftware(string inputFileName, sectionToExecute* sect, dataManager* data)
     12// abstractSoftware::abstractSoftware(string inputFileName, sectionToExecute* sect, dataManager* data)
     13// {
     14//   inputFileName_ = inputFileName;
     15//   //  sectionToExecute_ = sect;
     16//   compBlock_ = NULL;
     17//   dataManager_ = data;
     18//   nameOfSoftware_ = new nomDeLogiciel("unknownSoftware");
     19// }
     20
     21abstractSoftware::abstractSoftware(string inputFileName, computingBlock* cmpb, dataManager* data)
    1322{
    1423  inputFileName_ = inputFileName;
    15   sectionToExecute_ = sect;
     24  compBlock_ = cmpb;
    1625  dataManager_ = data;
     26  cout << " abstractSoftware::abstractSoftware adresse manager " << dataManager_  << endl;
    1727  nameOfSoftware_ = new nomDeLogiciel("unknownSoftware");
    1828}
    1929
    2030
    21 // void abstractSoftware::registerElement(nomdElements::typedElement nomdel,trivaluedBool b)
    22 // {
    23 //   //  std::cout << " abstractSoftware::registerElement soft : " << nameOfSoftware_.getString() << std::endl;
    24 //   if (b == TBoolIgnore) {
    25 //     //    std::cout << " abstractSoftware::registerElement j'enregistre element " <<  nomdel << "   ignore " << std::endl;
    26 //     ignoredElements_.push_back(nomdel);
    27 //   } else if (b == TBoolOk) {
    28 //     //    std::cout << " abstractSoftware::registerElement j'enregistre element " <<  nomdel << "  OK " << std::endl;
    29 //     acceptedElements_.push_back(nomdel);
    30 //   }
    31 // }
    32 
    33 // trivaluedBool abstractSoftware::doAcceptElement(nomdElements::typedElement typdel)
    34 // {
    35 
    36 //   //xx
    37 //   if (acceptedElements_.size() == 0 && nameOfSoftware_ != nomDeLogiciel::unknownSoftware) {
    38 //     return TBoolError;
    39 //   }
    40 
    41 //   if (std::find(acceptedElements_.begin(),acceptedElements_.end(),typdel) != acceptedElements_.end()) {
    42 //     return TBoolOk;
    43 //   }
    44 
    45 //   if (ignoredElements_.size() == 0) {
    46 //     return TBoolError;
    47 //   }
    48 
    49 //   if (std::find(ignoredElements_.begin(),ignoredElements_.end(),typdel) != ignoredElements_.end()) {
    50 //     return TBoolIgnore;
    51 //   }
    52 
    53 //   return TBoolOk;
    54 // }
    5531
    5632bool abstractSoftware::launchJob(string commandLine, string& resul)
  • Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc

    r488 r493  
    55#include "mathematicalConstants.h"
    66#include "PhysicalConstants.h"
     7#include "softwareUnknown.h"
    78
    89#include "GWt_pspaApplication.h"
     
    1617#include "AMLtools.h"
    1718
    18 #define BAVARD 0
     19#define BAVARD 1
    1920
    2021dataManager::dataManager(PspaApplication* pspa) :
    21 pspa_ (pspa)
     22  pspa_ (pspa),
     23  currentMachine_(NULL)
    2224{}
    2325
     
    2527{
    2628  unsigned k;
    27   for (k=0; k < jobList_.size();k++) {
    28     if ( jobList_[k] != NULL ) delete jobList_[k];
    29   }
     29  for (k=0; k < sectors_.size();k++) {
     30    if ( sectors_[k] != NULL ) delete sectors_[k];
     31  }
     32  if ( currentMachine_ ) delete currentMachine_;
    3033}
    3134
    3235void dataManager::consoleMessage(string message)
    3336{
     37  cout << " passage console message : " << endl;
     38  cout << message << endl;
    3439  GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));
    3540  if (console) console->addConsoleMessage(message + "\n");
    3641  pspa_->processEvents();
    3742}
    38 
     43 
    3944
    4045void dataManager::initializeExecution()
     
    5459  diagnosticBeam_.clear();
    5560  indexElementToIndexDiag_.clear();
    56   for (unsigned int a=0; a< jobList_.size(); a++) {
    57       jobList_[a]->clearSectionToExecute();
    58   }
     61  // for (unsigned int a=0; a< jobList_.size(); a++) {
     62  //     jobList_[a]->clearSectionToExecute();
     63  // }
    5964}
    6065
     
    8085 
    8186  // Main loop !
    82   cout << " dataManager::executeAll #jobList_= " << jobList_.size() << endl;
    83   for(unsigned k = 0; k < jobList_.size(); k++)
    84     {
    85       sector* sector = jobList_[k];
    86       cout << " dataManager::executeAll sector name= " << sector->getName() << endl;
    87       cout << " dataManager::executeAll #sectionsToExecute= " << sector->getSectionsToExecute().size() << endl;
     87  cout << " dataManager::executeAll #sectors_= " << sectors_.size() << endl;
     88  //  expandedMachine machine;
     89  //  machine.fromJoblist(jobList_);
     90
     91  // vecteur de blocs de calcul
     92  vector<computingBlock*> compblock = getCurrentMachine()->getComputingBlocks();
     93  cout << " dataManager::executeAll() : nb blocs de calcul : " << compblock.size() << endl;
     94
     95  particleBeam* computedBeam = sectors_[0]->getParticleBeam();
     96
     97
     98  //  for(unsigned k = 0; k < jobList_.size(); k++)
     99  // {
     100      // sector* sector = jobList_[k];
     101      // cout << " dataManager::executeAll sector name= " << sector->getName() << endl;
     102      // cout << " dataManager::executeAll #sectionsToExecute= " << sector->getSectionsToExecute().size() << endl;
    88103     
    89104      // for the moment, we put everything in one line without loops
    90       for(unsigned int l = 0; l < sector->getSectionsToExecute().size(); l++)
     105      //      for(unsigned int l = 0; l < sector->getSectionsToExecute().size(); l++)
     106      for (unsigned int l = 0; l < compblock.size(); l++)
    91107        {
    92           sectionToExecute* section = sector->getSectionsToExecute()[l];
    93           abstractSoftware* softw = section->getSoftware();
    94          
     108          abstractSoftware* softw = compblock.at(l)->getSoftware();
    95109          cout << " execution du SOFWARE " << softw->getName() << endl;
    96           cout << " adresse section " << section << endl;
    97           cout << " adresse faisceau " << sector->getParticleBeam() << endl;
    98110          if (softw == NULL) {
    99111            success = false;
     
    102114          }
    103115   
    104           success = softw->createInputFile(sector->getParticleBeam(),workingDir);
     116          //      success = softw->createInputFile(sector->getParticleBeam(),workingDir);
     117          cout << " dataManager::executeAll() APPEL softw->createInputFile " << endl;
     118          success = softw->createInputFile(computedBeam,workingDir);
    105119          if ( success ) {
    106120            success = softw->execute(workingDir);
     
    111125          cout << " dataManager::executeAll success = " << success << " y-a-ty du faisceau : " << diagnosticBeam_.size() << endl;
    112126          if ( success  && (diagnosticBeam_.size() > 0)) {
    113             sector->setParticleBeam(&diagnosticBeam_.at(indexElementToIndexDiag_.back()));
     127            // sector->setParticleBeam(&diagnosticBeam_.at(indexElementToIndexDiag_.back()));
     128            computedBeam = &diagnosticBeam_.at(indexElementToIndexDiag_.back());
    114129            cout << " dataManager::executeAll termine avec succes " << endl;
    115130          } else {
    116             sector->setParticleBeam(NULL);
     131            //      sector->setParticleBeam(NULL);
     132            computedBeam = NULL;
    117133            cout << " dataManager::executeAll termine en ECHEC " << endl;
    118134          }
     
    121137#if BAVARD > 0
    122138          cout << "dataManager::executeAll #diagnosticBeam= " << diagnosticBeam_.size() << endl;
    123           cout << "dataManager::executeAll #getBeamLineSize()= " << getBeamLineSize() << endl;
    124           std::vector< abstractElement* > elements = section->getElements();
    125           for (unsigned j = 0; j < elements.size(); j++) {
    126             cout << "[" << j << "] " << elements[j]->getNomdElement().getExpandedName() << endl;
     139          //      cout << "dataManager::executeAll #getBeamLineSize()= " << getBeamLineSize() << endl;
     140          //      std::vector< abstractElement* > elements = section->getElements();
     141          //      std::vector< abstractElement* > elements = compblock.at(l)->getElements();
     142          for (unsigned j = 0; j < compblock.at(l)->getNumberOfElements(); j++) {
     143            cout << "[" << j << "] " << compblock.at(l)->getElement(j)->getNomdElement().getExpandedName() << endl;
    127144          }
    128145#endif
    129146        } //l
    130     } //k
     147      //    } //k
    131148 
    132149  // if ( currentBeam_deprecated_ ) {
     
    179196// }
    180197
     198
     199
     200
     201
     202
    181203// ecriture sur fichier AML
    182204void dataManager::writeToAMLFile(string fileName)
     
    199221  //sectorParam_.InputRep(lab);
    200222
    201   // sequence of elements
    202   UAPNode* sect = lab->addChild("sector");
    203   sect->addAttribute("name","a_sect");
    204 
    205   abstractElement* elPtr;
    206   for (unsigned k = 0; k < jobList_.size(); k++) {
    207     sector* sector = jobList_[k];
    208     for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
    209       sectionToExecute* section = sector->getSectionsToExecute()[l];
    210       for (unsigned m = 0; m < section->getElements().size(); m++) {
    211         elPtr = section->getElements()[m];
    212         elPtr->InputRep(sect);
    213       }
    214     }
    215   }
     223  // sequence of sectors with elements
     224
     225  for ( unsigned k=0; k < sectors_.size(); k++) {
     226    sector* secteur = sectors_.at(k);
     227    UAPNode* sect = lab->addChild("sector");
     228    sect->addAttribute("name",secteur->getName());
     229    abstractElement* elPtr;
     230    for ( unsigned j=0; j < secteur->getElements().size(); j++) {
     231      elPtr = secteur->getElements().at(j);
     232      elPtr->InputRep(sect);
     233    }
     234  }
     235
     236  if ( currentMachine_ ) currentMachine_->FileAMLOutput(lab);
    216237  cout << "!Create the AML file ---------------------------" << endl;
    217238  AMLReader reader;
     
    220241}
    221242
    222 // bool dataManager::restoreElements(string inputFileName)
    223 // {
    224 //   cout << "***********************************" << endl;
    225 //   cout << " dataManager::restoreElements() fichier :" << inputFileName << endl << endl;
    226 
    227 //   ifstream infile;
    228 //   string name = inputFileName;
    229 //   infile.open(name.c_str(), ios::in);
    230 //   if (!infile) {
    231 //     cerr << " error opening input stream " << name << endl;
    232 //     return false;
    233 //   }
    234 //   else cout << " successful opening input stream : " << name << endl;
    235  
    236 //   //NOTE:: je ne sais pas si les "secteurs" seront conservés, aussi pour ne pas trop changer les fichiers je lis les données aprÚs "globals" dans la boucle
    237  
    238 //   // Clear the BeamLine
    239 //   jobList_.clear();
    240 
    241 //   // FIXME : For test purpose !!!
    242 //   sector* mySect = addNewSector();
    243  
    244 //   nomdElements::typedElement elementType;
    245 //   string elementLabel;
    246 //   abstractElement* nouveau = NULL;
    247 //   while (infile >> elementLabel) {
    248 //     if (elementLabel == string("globals") ) {
    249 //       globParam_.raz();
    250 //       globParam_.FileInput(infile);
    251 //     } else if (elementLabel == string("sectors") ) {
    252 //       // FIXME Francois !!!!!!!
    253 // //      sectorParam_.raz();
    254 // //      sectorParam_.FileInput(infile);
    255 //       // END
    256 //     } else {
    257 //       elementType = nomdElements::getTypeFromLabel(elementLabel);
    258 //       nouveau = mySect->addElementAfter(elementType,nouveau);
    259 //       if ( nouveau == NULL ) {
    260 //      cerr << " dataManager::restoreElements() : restore element " << elementLabel << " failed " << endl;
    261 //      return false;
    262 //       } else {
    263 //      nouveau->FileInput(infile);
    264 //       }
    265 //     }
    266 //   }// while
    267  
    268 // #if BAVARD > 1
    269 // /*  unsigned k;
    270 //   for(k = 0; k < getBeamLineSize(); k++) {
    271 //     abstractElement* ptr = pspa_->getBeamLine_deprecated()->getAbstractElement(k);
    272 //     cout << "recupere " << ptr->getLabel() << endl;
    273 //   }
    274 // */
    275 // #endif
    276 
    277 //   infile.close();
    278 //   return true;
    279 // }
    280243
    281244bool dataManager::restoreAMLElements(string inputFileName)
     
    296259
    297260NodeVec laboratories = uap_root->getSubNodesByName(string("laboratory"));
    298  cout << " dataManager::restoreAMLElements nombre de <laboratory> : " << laboratories.size() << endl;
     261// cout << " dataManager::restoreAMLElements nombre de <laboratory> : " << laboratories.size() << endl;
    299262
    300263 uap_labname = *laboratories.begin();
     
    302265 if ( !uap_labname ) {
    303266   cout << " dataManager::restoreAMLElements : fichier non conforme, on ne trouve pas <laboratory...> " << endl;
    304  } else {
    305    cout << " dataManager::restoreAMLElements : GO !" << endl;
     267   // } else {
     268   //   cout << " dataManager::restoreAMLElements : GO !" << endl;
    306269 }
    307270
     
    310273 
    311274  // Clear the BeamLine
    312   jobList_.clear();
     275  sectors_.clear();
    313276
    314277  // FIXME : For test purpose !!!
    315   sector* mySect = addNewSector();
    316  
     278  //  sector* mySect = addNewSector();
     279  //  if (  currentMachine_ ) delete currentMachine_;
     280  //  currentMachine_ = new expandedMachine();
    317281
    318282   UAPNode* parametresGlobaux = uap_labname->getChildByName(string("global"));
    319283  if ( !parametresGlobaux ) {
    320284    cout << " dataManager::restoreAMLElements GLOBAUX NON TROUVES " << endl;
    321   } else {
    322     cout << " dataManager::restoreAMLElements GENIAL ! " << endl;
     285  // } else {
     286  //   cout << " dataManager::restoreAMLElements GENIAL ! " << endl;
    323287  }
    324288  globParam_.raz();
     
    326290
    327291
     292
    328293  nomdElements::typedElement elementType;
    329294  string elementLabel;
    330   abstractElement* nouveau = NULL;
    331295
    332296
     
    337301    return false;
    338302  }
    339 
    340 
    341   NodeVec& listElem = ( *sectorNode.begin() )->getChildren();
    342   if (  !listElem.size() ) {
    343     cout << " dataManager::restoreAMLElements ERREUR lecture fichier : pas d'elements ? " << endl;
    344     return false;
    345   } else {
    346     cout << " dataManager::restoreAMLElements : liste elements non vide : SUCCES " << endl;
    347   }
    348 
    349   for (NodeVecIter iter = listElem.begin(); iter != listElem.end(); iter++) {
    350 
    351     string nomNoeud = (*iter)->getName();
    352     if ( nomNoeud != string("element") ) {
    353       cout << " le secteur contient un non-element : " << nomNoeud << endl;
    354       continue;
    355     }
    356 
    357     UAPAttribute* att = NULL;
    358     att = (*iter)->getAttribute("name");
    359 
    360     cout << " dataManager::restoreAMLElements trouve element " << att->getValue();
    361 
    362     string nomGenerique;
    363     AMLtools::readAMLParameterAttribut(*iter, "description", "type", nomGenerique);
    364 
    365     // UAPNode*  genericName = (*iter)->getChildByName("description");
    366     // att = genericName->getAttribute("type");
    367 
    368     cout <<  " de type " << nomGenerique << endl;
    369 
    370 
    371     elementType = nomdElements::getTypeFromLabel(nomGenerique);
    372     nouveau = mySect->addElementAfter(elementType,nouveau);
    373 
     303  for (NodeVecIter iterSect = sectorNode.begin(); iterSect != sectorNode.end(); iterSect++) {
     304    UAPAttribute* att = (*iterSect)->getAttribute("name");
     305    if ( !att ) continue;
     306    sectors_.push_back( new sector(this, att->getValue()) );
     307    NodeVec& listElem = (*iterSect)->getChildren();
     308    if (  !listElem.size() ) {
     309      cout << " dataManager::restoreAMLElements WARNING lecture fichier secteur " <<  att->getValue() << "  : pas d'elements ? " << endl;
     310    }
     311    abstractElement* nouveau = NULL;
     312    for (NodeVecIter iterelem = listElem.begin(); iterelem != listElem.end(); iterelem++) {
     313
     314      string nomNoeud = (*iterelem)->getName();
     315      if ( nomNoeud != string("element") ) {
     316        cout << " le secteur contient un non-element : " << nomNoeud << endl;
     317        continue;
     318      }
     319
     320      att = NULL;
     321      att = (*iterelem)->getAttribute("name");
     322
     323
     324      string nomGenerique;
     325      AMLtools::readAMLParameterAttribut(*iterelem, "description", "type", nomGenerique);
     326      elementType = nomdElements::getTypeFromLabel(nomGenerique);
     327      nouveau = sectors_.back()->addElementAfter(elementType,nouveau);
    374328      if ( nouveau == NULL ) {
    375329        cerr << " dataManager::restoreAMLElements() : restore element " << att->getValue() << " failed " << endl;
    376330        return false;
    377331      } else {
    378         nouveau->FileAMLInput(*iter);
     332        nouveau->FileAMLInput(*iterelem);
    379333      }
    380   }
    381 
    382  
     334    } // iterelem
     335  } // itersect
     336
     337
     338  // cout << " dataManager::restoreAMLElements BILAN DES SECTEURS " << endl;
     339  // for ( unsigned m=0; m < sectors_.size(); m++ ) {
     340  //   cout << " secteur " << m+1 << " nom : " << sectors_.at(m)->getName() << endl;
     341  //   for ( unsigned j=0; j<sectors_.at(m)->getElements().size(); j++) {
     342  //     cout << " el. : " << sectors_.at(m)->getElements().at(j)->getLabel() << endl;
     343  //   }
     344  // }
     345
     346  NodeVec machine = uap_root->getSubNodesByName(string("machine"));
     347  if ( !machine.size()  ) {
     348    cout << " dataManager::restoreAMLElements ne trouve pas de machine " << endl;
     349  } else {
     350    if ( machine.size() > 1 ) {
     351      cout << " dataManager::restoreAMLElements PLUSIEURS MACHINES : cas non prevu " << endl;
     352    }
     353    //    cout << " dataManager::restoreAMLElements il y a une machine a lire dans   " << endl;
     354    //    cout << currentMachine_ << endl;
     355    if ( !currentMachine_ ) currentMachine_ = new expandedMachine(this);
     356    currentMachine_->FileAMLInput(machine.at(0));
     357  }
     358 
     359
     360
    383361  return true;
    384362}
     
    397375particleBeam* dataManager::getDiagnosticBeam_deprecated(string elementLabel)
    398376{
     377  if ( !currentMachine_ ) return NULL;
     378
    399379  // FIXME : Devra etre changé par une récupération par "abstractElement" et non pas par label
    400380  unsigned int number = 0;
    401381  abstractElement* elPtr;
    402   for (unsigned k = 0; k < jobList_.size(); k++) {
    403     sector* sector = jobList_[k];
    404     for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
    405       sectionToExecute* section = sector->getSectionsToExecute()[l];
    406       for (unsigned m = 0; m < section->getElements().size(); m++) {
    407         elPtr = section->getElements()[m];
    408         if (elPtr->getLabel() == elementLabel) {
    409           return getDiagnosticBeam(number);
    410         }
    411         number ++;
     382
     383  for (unsigned k = 0; k < currentMachine_->getComputingBlocks().size(); k++) {
     384    computingBlock* block = currentMachine_->getComputingBlocks().at(k);
     385    for (unsigned m = 0; m < block->getNumberOfElements(); m++) {
     386      elPtr = block->getElement(m);
     387      if (elPtr->getLabel() == elementLabel) {
     388        return getDiagnosticBeam(number);
    412389      }
    413     }
    414   }
     390      number ++;
     391    }
     392  }
     393
     394
    415395  return NULL;
    416396}
    417397
    418398
    419 // on ne tient pas compte des elements "snapshot" presents dans la beamLine
    420399void dataManager::donneesRmsEnveloppe(string type,vector<double>& xcor,vector<double>& ycor, string& titre, string& legendx, string& legendy)
    421400{
     
    431410    unsigned i = 0;
    432411    cout << " dataManager::donneesRmsEnveloppe " << endl;
    433     //    for (unsigned k = 0; k < getBeamLineSize(); k++) {
    434     for (unsigned k = 0; k < jobList_.size(); k++) {
    435       sector* sector = jobList_[k];
    436       for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
    437         sectionToExecute* section = sector->getSectionsToExecute()[l];
    438         for (unsigned m = 0; m < section->getElements().size(); m++) {
    439           abstractElement* elPtr = section->getElements()[m];
    440           //     if(elPtr->getNomdElement().getElementType() == snapshot) continue;
    441           //      if(elPtr->getNomdElement().getElementType() == fit) continue;
    442           particleBeam* beamToDraw = getDiagnosticBeam(i);
    443           if ( !beamToDraw->momentRepresentationOk() ) {
    444             beamToDraw->buildMomentRepresentation();
    445           }
     412
     413    if ( !currentMachine_ ) {
     414    cout << " dataManager::donneesRmsEnveloppe PAS DE MACHINE " << endl;
     415    return;
     416    }
     417
     418  for (unsigned k = 0; k < currentMachine_->getComputingBlocks().size(); k++) {
     419    computingBlock* block = currentMachine_->getComputingBlocks().at(k);
     420    for (unsigned m = 0; m < block->getNumberOfElements(); m++) {
     421      abstractElement* elPtr = block->getElement(m);
     422      particleBeam* beamToDraw = getDiagnosticBeam(i);
     423      if ( !beamToDraw->momentRepresentationOk() ) {
     424        beamToDraw->buildMomentRepresentation();
     425      }
    446426         
    447           longueur += elPtr->getLenghtOfElement();
    448           valeur = beamToDraw->getXmaxRms();
    449           cout << " dataManager::donneesRmsEnveloppe index = " << k <<  " longueur = " << longueur << " enveloppe : " << valeur << endl;
    450           xcor.push_back(0.01*longueur);  // on passe en metres
    451           ycor.push_back(valeur);
    452           i++;
    453         }
    454       }
    455     }
     427      longueur += elPtr->getLenghtOfElement();
     428      valeur = beamToDraw->getXmaxRms();
     429      cout << " dataManager::donneesRmsEnveloppe index = " << k <<  " longueur = " << longueur << " enveloppe : " << valeur << endl;
     430      xcor.push_back(0.01*longueur);  // on passe en metres
     431      ycor.push_back(valeur);
     432      i++;     
     433    }
     434  }
     435
     436
     437
     438
     439    // for (unsigned k = 0; k < jobList_.size(); k++) {
     440    //   sector* sector = jobList_[k];
     441    //   for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
     442    //     sectionToExecute* section = sector->getSectionsToExecute()[l];
     443    //     for (unsigned m = 0; m < section->getElements().size(); m++) {
     444    //       abstractElement* elPtr = section->getElements()[m];
     445    //       //     if(elPtr->getNomdElement().getElementType() == snapshot) continue;
     446    //       //      if(elPtr->getNomdElement().getElementType() == fit) continue;
     447    //       particleBeam* beamToDraw = getDiagnosticBeam(i);
     448    //       if ( !beamToDraw->momentRepresentationOk() ) {
     449    //         beamToDraw->buildMomentRepresentation();
     450    //       }
     451         
     452    //       longueur += elPtr->getLenghtOfElement();
     453    //       valeur = beamToDraw->getXmaxRms();
     454    //       cout << " dataManager::donneesRmsEnveloppe index = " << k <<  " longueur = " << longueur << " enveloppe : " << valeur << endl;
     455    //       xcor.push_back(0.01*longueur);  // on passe en metres
     456    //       ycor.push_back(valeur);
     457    //       i++;
     458    //     }
     459    //   }
     460    // }
     461
    456462    legendy.clear();
    457463    legendy = " x (cm) ";
     
    468474 
    469475  sector* sect = new sector(this, std::string("sector ") + result);
    470   jobList_.push_back(sect);
     476  sectors_.push_back(sect);
    471477  return sect;
    472478}
    473479
     480abstractElement* dataManager::getElementInSectorsByLabel(string etiq) {
     481  for ( unsigned k=0; k < sectors_.size(); k++) {
     482    for ( unsigned j=0; j < sectors_.at(k)->getElements().size(); j++) {
     483      if ( etiq == sectors_.at(k)->getElements().at(j)->getLabel() ) return sectors_.at(k)->getElements().at(j);
     484    }
     485  }
     486  return NULL;
     487}
     488
     489
     490  void dataManager::messageEcran(string niveau, string msg) const {
     491    GWt_dialog::iconType icon;
     492    if ( niveau == "ERROR" ) {
     493      icon = GWt_dialog::Error;
     494    } else if  ( niveau == "WARNING" ) {
     495      icon = GWt_dialog::Warning;
     496    } else if  ( niveau == "INFO" ) {
     497      icon = GWt_dialog::Info;
     498    } else {
     499      icon = GWt_dialog::NoIcon;
     500    }
     501    GWt_dialog checkConfigNameDialog(niveau, msg, icon,true,true);
     502    checkConfigNameDialog.exec();
     503  }
  • Interface_Web/trunk/pspaWT/sources/controler/src/elementSoleno.cc

    r488 r493  
    55elementSoleno::elementSoleno() :  abstractElement()
    66{
    7   cout << " passage constructeur elementSoleno " << endl;
    87  setDefaultValues();
    98  setDefaults();
  • Interface_Web/trunk/pspaWT/sources/controler/src/nomDeLogiciel.cc

    r489 r493  
    8181void nomDeLogiciel::setCompatiblesElements()
    8282{
    83   //cout << " nomDeLogiciel::setCompatiblesElements() " << program_ << endl;
    8483  switch (program_)
    8584    {
     
    134133}
    135134
    136 trivaluedBool nomDeLogiciel::doAcceptElement(nomdElements::typedElement typdel)
     135trivaluedBool nomDeLogiciel::doAcceptElement(nomdElements::typedElement typdel) const
    137136{
    138   //xx
    139 
    140   //cout << " nomDeLogiciel::doAcceptElement type : " << typdel << endl;
    141   //cout << " nomDeLogiciel::doAcceptElement nb el/ acc. " << acceptedElements_.size() << endl;
    142137  if (acceptedElements_.size() == 0 ) {
    143138    return TBoolError;
     
    156151  }
    157152 
    158   return TBoolOk;
     153  return TBoolError;
    159154}
    160155
  • Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc

    r487 r493  
    99#include "sector.h"
    1010
    11 #include "sectionToExecute.h"
     11//#include "sectionToExecute.h"
    1212#include "dataManager.h"
    1313#include "elementDrift.h"
     
    100100 
    101101  if (previousElement == NULL) {
    102     if (sectionToExecute_.size() == 0) {
    103       sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL,dataManager_,this));
    104     } else {
    105         sectionToExecute* section = sectionToExecute_.front();
    106       section->insertAtFirst(currentElement);
    107     }
     102    elements_.insert ( elements_.begin() ,currentElement);
     103    // if (sectionToExecute_.size() == 0) {
     104    //   sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL,dataManager_,this));
     105    // } else {
     106    //     sectionToExecute* section = sectionToExecute_.front();
     107    //   section->insertAtFirst(currentElement);
     108    // }
    108109  } else {
    109  
    110     for (unsigned int i=0; i<sectionToExecute_.size(); i++) {
    111       sectionToExecute* section = sectionToExecute_[i];
    112       if (section->insertAfter(previousElement,currentElement)) {
    113         return;
    114       }
    115     }
    116   }
    117 }
    118 
    119 void sector::removeElement(abstractElement* currentElement) {
    120   if (currentElement == NULL) return;
    121  
    122   for (unsigned int i=0; i<sectionToExecute_.size(); i++) {
    123     sectionToExecute* section = sectionToExecute_[i];
    124    
    125     if (section->isInside(currentElement)) {
    126       section->removeElement(currentElement);
    127     }
     110    insertAfter(previousElement,currentElement);
     111    // for (unsigned int i=0; i<sectionToExecute_.size(); i++) {
     112    //   sectionToExecute* section = sectionToExecute_[i];
     113    //   if (section->insertAfter(previousElement,currentElement)) {
     114    //     return;
     115    //   }
     116    // }
    128117  }
    129118}
    130119
    131120
    132 void sector::clearSectionToExecute()
    133 {
    134   unsigned k;
    135   for(k = 0; k < sectionToExecute_.size(); k++)
    136   {
    137     if ( sectionToExecute_[k] != NULL ) clearSectionToExecute(k);
     121bool sector::insertAfter(abstractElement* previousElement,abstractElement* currentElement) {
     122
     123  std::vector<abstractElement*>::iterator it;
     124  for (it = elements_.begin(); it < elements_.end(); it++) {
     125    if (*it == previousElement ) {
     126      elements_.insert (it+1,currentElement);
     127      return true;
     128    }
    138129  }
    139   sectionToExecute_.clear();
     130  return false;
    140131}
    141132
    142 void sector::clearSectionToExecute(int a)
    143 {
    144   cout << " dataManager::clearSectionToExecute : effacement de la section d'index = " << a << endl;
    145   if (a < 0) return;
    146   if (a >= (int)sectionToExecute_.size()) return;
     133bool sector::isInside(abstractElement* previousElement) {
     134  for (unsigned int a=0; a< elements_.size(); a++) {
     135    if (elements_[a] == previousElement ) {
     136      return true;
     137    }
     138  }
     139  return false;
     140}
     141
     142
     143
     144void sector::removeElement(abstractElement* currentElement) {
     145  if (currentElement == NULL) return;
     146  std::vector<abstractElement*>::iterator it;
     147  for (it = elements_.begin(); it < elements_.end(); it++) {
     148    if (*it == currentElement ) {
     149      elements_.erase(it);
     150      return;
     151    }
     152  }
     153  // for (unsigned int i=0; i<sectionToExecute_.size(); i++) {
     154  //   sectionToExecute* section = sectionToExecute_[i];
     155   
     156  //   if (section->isInside(currentElement)) {
     157  //     section->removeElement(currentElement);
     158  //   }
     159  // }
     160}
     161
     162
     163// void sector::clearSectionToExecute()
     164// {
     165//   unsigned k;
     166//   for(k = 0; k < sectionToExecute_.size(); k++)
     167//   {
     168//     if ( sectionToExecute_[k] != NULL ) clearSectionToExecute(k);
     169//   }
     170//   sectionToExecute_.clear();
     171// }
     172
     173// void sector::clearSectionToExecute(int a)
     174// {
     175//   cout << " dataManager::clearSectionToExecute : effacement de la section d'index = " << a << endl;
     176//   if (a < 0) return;
     177//   if (a >= (int)sectionToExecute_.size()) return;
    147178 
    148   // lors de la creation de la section on a fait un 'new' d'un
    149   // softwareXXXX : on fait ici le 'delete'
     179//   // lors de la creation de la section on a fait un 'new' d'un
     180//   // softwareXXXX : on fait ici le 'delete'
    150181 
    151   const abstractSoftware* soft = sectionToExecute_.at(a)->getSoftware();
    152   if ( soft != NULL ) delete soft;
    153   delete sectionToExecute_[a];
    154   sectionToExecute_.erase (sectionToExecute_.begin()+a);
    155 }
     182//   const abstractSoftware* soft = sectionToExecute_.at(a)->getSoftware();
     183//   if ( soft != NULL ) delete soft;
     184//   delete sectionToExecute_[a];
     185//   sectionToExecute_.erase (sectionToExecute_.begin()+a);
     186// }
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc

    r485 r493  
    1212}
    1313
    14 softwareGenerator::softwareGenerator(string inputFileName, sectionToExecute* sect,dataManager* data) : abstractSoftware(inputFileName, sect,data)
     14// softwareGenerator::softwareGenerator(string inputFileName, sectionToExecute* sect,dataManager* data) : abstractSoftware(inputFileName, sect,data)
     15// {
     16//   cout << " softwareUsersprogram::softwareGenerator ENREGISTREMENT " << endl;
     17//   nameOfSoftware_ = new  nomDeLogiciel("generator");
     18//   //  registerElement(nomdElements::RFgun,TBoolOk);
     19// }
     20
     21softwareGenerator::softwareGenerator(string inputFileName, computingBlock* cmpb,dataManager* data) : abstractSoftware(inputFileName, cmpb,data)
    1522{
    1623  cout << " softwareUsersprogram::softwareGenerator ENREGISTREMENT " << endl;
     
    2128bool softwareGenerator::createInputFile(particleBeam* beamBefore, string workingDir)
    2229{
    23   abstractElement* firstElement = getSectionToExecute()->getElements().front();
     30  abstractElement* firstElement = getComputingBlock()->getFirstElement();
    2431 
    2532  if ( firstElement->getNomdElement().getElementType() != nomdElements::RFgun ) {
     
    93100  bool result = true;
    94101
    95   if ( getSectionToExecute()->getElements().size() != 1 ) {
     102  if ( getComputingBlock()->getNumberOfElements() != 1 ) {
    96103    dataManager_->consoleMessage(" softwareGenerator::buildBeamAfterElements : only one element (rfgun) must be calculated " );
    97104    return false;
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareMadx.cc

    r487 r493  
    1313}
    1414
    15 softwareMadx::softwareMadx(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName,sect,data)
     15// softwareMadx::softwareMadx(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName,sect,data)
     16// {
     17//   nameOfSoftware_ = new nomDeLogiciel("madx");
     18// }
     19
     20softwareMadx::softwareMadx(string inputFileName,computingBlock* cmpb, dataManager* data) : abstractSoftware(inputFileName,cmpb,data)
    1621{
    1722  nameOfSoftware_ = new nomDeLogiciel("madx");
     
    3338  }
    3439
    35   sector* sector= getSectionToExecute()->getSector();
    36   cout << " softwareMadx::createInputFile sector " << sector->getName() << endl;
     40  //  sector* sector= getSectionToExecute()->getSector();
     41  //  cout << " softwareMadx::createInputFile sector " << sector->getName() << endl;
    3742  ///////////////////////////////////////////
    3843 
     
    4045  string sbeam;
    4146  abstractElement* elPtr;
    42   elPtr = getSectionToExecute()->getElements().front();
     47  //  elPtr = getSectionToExecute()->getElements().front();
     48  elPtr = getComputingBlock()->getFirstElement();
    4349  nomdElements::typedElement eType = elPtr->getNomdElement().getElementType();
    4450
     
    8591  ostringstream os;
    8692  os << "L: line=(";
    87   unsigned nElts= getSectionToExecute()->getElements().size();
     93  //  unsigned nElts= getSectionToExecute()->getElements().size();
     94  unsigned nElts= getComputingBlock()->getNumberOfElements();
    8895  for(unsigned k = firstIndex; k < nElts; k++)
    8996    {
    90       elPtr = getSectionToExecute()->getElements()[k];
     97      //      elPtr = getSectionToExecute()->getElements()[k];
     98      elPtr = getComputingBlock()->getElement(k);
    9199      cout << " debug:: element [" << k << "] " << elPtr->getNomdElement().getExpandedName() << endl;
    92100      vector<statements> v= elPtr->parametersToSoftware();
     
    103111 
    104112  // relection and repetition ///////////////
    105   os << "all: " << "line=(" << sector->getRepetitionNumber() << "*L);";
     113  //  os << "all: " << "line=(" << sector->getRepetitionNumber() << "*L);";
     114  int bid = 1;
     115os << "all: " << "line=(" << bid << "*L);";
    106116  ///////////////////////////////////////////
    107117 
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc

    r485 r493  
    1313}
    1414
    15 softwareParmela::softwareParmela(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect, data)
     15// softwareParmela::softwareParmela(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect, data)
     16// {
     17//   nameOfSoftware_ = new nomDeLogiciel("parmela");
     18//   cout << " CONSTRUCTEUR softwareParmela() COMPLET " << endl;
     19// }
     20
     21softwareParmela::softwareParmela(string inputFileName,computingBlock* cmpb, dataManager* data) : abstractSoftware(inputFileName, cmpb, data)
    1622{
    1723  nameOfSoftware_ = new nomDeLogiciel("parmela");
    18   cout << " CONSTRUCTEUR softwareParmela() COMPLET " << endl;
    19   // registerElement(nomdElements::RFgun,TBoolOk);
    20   // registerElement(nomdElements::drift,TBoolOk);
    21   // registerElement(nomdElements::cell,TBoolOk);
    22   // registerElement(nomdElements::bend,TBoolOk);
    23   // registerElement(nomdElements::soleno,TBoolOk);
    24   // registerElement(nomdElements::fit,TBoolIgnore);
    25   // registerElement(nomdElements::snapshot,TBoolIgnore);
    26 }
    27 
     24  cout << " CONSTRUCTEUR softwareParmela() COMPLET avec COMPUTING BLOCK = " << cmpb << endl;
     25    cout << " softwareParmela::CONSTRUCTEUR adresse mamager " << dataManager_  << endl;
     26    cout << " softwareParmela::CONSTRUCTEUR adresse GLOBAUX " << dataManager_->getGlobalParameters()  << endl;
     27}
     28
     29void softwareParmela::setRelativeParmelaElementIndices() {
     30    relativeParmelaElementIndices_.clear();
     31
     32  relativeParmelaElementIndices_.resize(getComputingBlock()->getNumberOfElements(), -1);
     33  cout << " setRelativeParmelaElementIndices() taille a priori : " << relativeParmelaElementIndices_.size() << endl;
     34  abstractElement* elPtr = getComputingBlock()->getFirstElement();
     35  bool there_is_rfgun = (elPtr->getNomdElement().getElementType() == nomdElements::RFgun );
     36
     37  //  unsigned offsetNumElem;
     38  // index du premier element de parmela
     39  int id;
     40  // les elements de parmela sont indexes de 1 à max, s'il n'y a pas de rfgun
     41  if ( !there_is_rfgun ) {
     42    id = 1;
     43    // les elements de parmela sont indexes de 0 à max, s'il y a un rfgun
     44  } else {
     45    id = 0;
     46  }
     47
     48  unsigned k;
     49  unsigned curseur = 0;
     50  //  for ( k=numeroDeb_; k <= numeroFin_ ; k++ ) {
     51  for ( k = 0; k < getComputingBlock()->getNumberOfElements(); k ++) {
     52    abstractElement* elem = getComputingBlock()->getElement(k);
     53    cout << " liste PARMELA no absolu " << k << " relatif provisoire " << relativeParmelaElementIndices_.at(curseur) << endl;
     54    // if ( elem->is_accepted_by_software(nameOfSoftware_) == TBoolOk ) {
     55
     56    if ( getNomDeLogiciel()->doAcceptElement(elem->getNomdElement().getElementType()) == TBoolOk  ) {
     57      relativeParmelaElementIndices_.at(curseur) = id;
     58      cout << " mis a " << id << endl;
     59      id++;
     60    }
     61    curseur++;
     62  }
     63}
    2864
    2965
    3066bool softwareParmela::createInputFile(particleBeam* beamBefore, string workingDir)
    3167{
     68
     69  cout << " softwareParmela::createInputFile ENTREE " << endl;
    3270  unsigned int k;
    3371
    34 //  setRelativeParmelaElementIndices();
     72  setRelativeParmelaElementIndices();
    3573  string name = workingDir + inputFileName_;
    3674  ofstream outfile;
     
    4280  }
    4381 
    44   abstractElement* elPtr = getSectionToExecute()->getElements().front();
     82  //  abstractElement* elPtr = getSectionToExecute()->getElements().front();
     83
     84  abstractElement* elPtr = getComputingBlock()->getFirstElement();
    4585  double initalKineticEnergy = 0.0;
     86
    4687  bool there_is_rfgun = (elPtr->getNomdElement().getElementType() == nomdElements::RFgun );
    47  
     88
    4889  if ( !there_is_rfgun ) {
    4990    string nameOfInput = workingDir + "parin.input0";
     
    5596    elPtr->setPhaseStep( dataManager_->getGlobalParameters()->getIntegrationStep() );
    5697    initalKineticEnergy = elPtr->getInitialKineticEnergy();
    57     // les elements de parmela sont indexes de 0 à max, s'il y a un rfgun
    58   }
    59  
     98  }
     99
    60100  outfile << "TITLE" << endl;
    61101  outfile << " titre provisoire " << endl;
    62102  outfile << "RUN /n0=1 /ip=999 /freq=" << dataManager_->getGlobalParameters()->getFrequency() << "  /z0=0.0 /W0=" << initalKineticEnergy << "  /itype=1" << endl;
    63103  outfile << "OUTPUT 0" << endl;
     104
     105  unsigned int premier = 0 ;
    64106  if ( there_is_rfgun ) {
    65107    outfile << elementsData(elPtr->parametersToSoftware());
     108    premier++;
    66109  } else {
    67110    outfile << "INPUT 0 /NP=" << beamBefore->getNbParticles() << endl;
    68111  }
    69  
    70  // retrouver le sector !!
    71   for ( k =1; k < getSectionToExecute()->getElements().size(); k++)
     112
     113  for ( k =premier++; k < getComputingBlock()->getNumberOfElements(); k++)
    72114    {
    73       outfile << elementsData(getSectionToExecute()->getElements()[k]->parametersToSoftware());
    74     }
    75    
     115      outfile << elementsData(getComputingBlock()->getElement(k)->parametersToSoftware());
     116    }
     117 
    76118  outfile << "ZOUT" << endl;
    77119  outfile << "START /wt=0.0 /dwt=" << dataManager_->getGlobalParameters()->getIntegrationStep() << "  /nsteps=" << dataManager_->getGlobalParameters()->getNbSteps() << "  nsc=" << dataManager_->getGlobalParameters()->getScPeriod() << "  /nout=10" << endl;
     
    121163
    122164  unsigned curseur;
    123   for ( unsigned int k=0; k < getSectionToExecute()->getElements().size() ; k++ ) {
    124     abstractElement* elem = getSectionToExecute()->getElements()[k];
     165  for ( unsigned int k=0; k < getComputingBlock()->getNumberOfElements() ; k++ ) {
     166    abstractElement* elem = getComputingBlock()->getElement(k);
    125167      if ( elem == NULL ) {
    126168        dataManager_->consoleMessage(" softwareParmela::buildBeamAfterElements : null pointer on element " );
     
    129171
    130172    curseur = k;
    131     cout << " softwareParmela::buildBeamAfterElements : type element " << getSectionToExecute()->getElements()[curseur]->getNomdElement().getElementType() << endl;
    132     if (!(nameOfSoftware_->doAcceptElement(getSectionToExecute()->getElements()[curseur]->getNomdElement().getElementType()) == TBoolOk)) {
    133 
    134       cout << " softwareParmela::buildBeamAfterElements ELEMENT ETRANGER " << endl;
    135 //      if ( relativeParmelaElementIndices_.at(curseur) < 0 ) {
     173    cout << " softwareParmela::buildBeamAfterElements : type element " << getComputingBlock()->getElement(curseur)->getNomdElement().getElementType() << endl;
     174
     175
     176    //      if (!(nameOfSoftware_->doAcceptElement(getComputingBlock()->getElements()[curseur]->getNomdElement().getElementType()) == TBoolOk)) {
     177
     178    if ( relativeParmelaElementIndices_.at(curseur) < 0 ) {
    136179
    137180        // si l'element doit etre ignore de parmela, on renvoie sur le diag precedent
     
    149192          double freq= dataManager_->getGlobalParameters()->getFrequency();
    150193          unsigned numeroParmel;
    151 //        numeroParmel = (unsigned)relativeParmelaElementIndices_.at(curseur);
    152     numeroParmel = curseur;
    153           cout << " lecture PARMELA el no absolu " << k << " numero relatif " << numeroParmel << " nom " << elem->getNomdElement().getExpandedName() << endl;
     194          numeroParmel = (unsigned)relativeParmelaElementIndices_.at(curseur);
     195          //    numeroParmel = curseur;
     196          cout << " lecture PARMELA el no relativement absolu " << k << " numero relatif " << numeroParmel << " nom " << elem->getNomdElement().getExpandedName() << endl;
    154197        // lecture sortie parmela
    155198        if(!beamFromParmela(workingDir,numeroParmel,freq,centroid,refPart,particles))
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareTest.cc

    r485 r493  
    1414
    1515
    16 softwareTest::softwareTest(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
     16// softwareTest::softwareTest(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
     17// {
     18//   nameOfSoftware_ = new nomDeLogiciel("test");
     19// }
     20
     21softwareTest::softwareTest(string inputFileName,computingBlock* cmpb, dataManager* data) : abstractSoftware(inputFileName, cmpb,data)
    1722{
    1823  nameOfSoftware_ = new nomDeLogiciel("test");
     
    3843  dataManager_->consoleMessage(" softwareTest::buildBeamAfterElements  " );
    3944  bool result = true;
    40   for ( unsigned int k=0; k < getSectionToExecute()->getElements().size() ; k++ ) {
     45  for ( unsigned int k=0; k < getComputingBlock()->getNumberOfElements() ; k++ ) {
    4146      particleBeam* newDiag = dataManager_->updateCurrentDiagnostic(true);
    4247  //      beams.push_back(particleBeam());
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareTransport.cc

    r485 r493  
    1111}
    1212
    13 softwareTransport::softwareTransport(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
     13// softwareTransport::softwareTransport(string inputFileName,sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
     14// {
     15//   nameOfSoftware_ = new nomDeLogiciel("transport");
     16// }
     17
     18softwareTransport::softwareTransport(string inputFileName,computingBlock* cmpb, dataManager* data) : abstractSoftware(inputFileName, cmpb,data)
    1419{
    1520  nameOfSoftware_ = new nomDeLogiciel("transport");
    16   // registerElement(nomdElements::beam,TBoolOk);
    17   // registerElement(nomdElements::drift,TBoolOk);
    18   // registerElement(nomdElements::bend,TBoolOk);
    19   // registerElement(nomdElements::soleno,TBoolOk);
    20   // registerElement(nomdElements::fit,TBoolOk);
    21   // registerElement(nomdElements::snapshot,TBoolIgnore);
    2221}
    2322
     
    2625
    2726
    28   abstractElement* premierEl = getSectionToExecute()->getElements().front();
     27  abstractElement* premierEl = getComputingBlock()->getFirstElement();
    2928
    3029  // ceinture et bretelles
     
    8483
    8584  abstractElement* elPtr;
    86   for (unsigned k = 0; k < getSectionToExecute()->getElements().size(); k++)
     85  for (unsigned k = 0; k < getComputingBlock()->getNumberOfElements(); k++)
    8786    {
    88       elPtr = getSectionToExecute()->getElements()[k];
     87      elPtr = getComputingBlock()->getElement(k);
    8988      cout << "debug:: element [" << k << "] " << elPtr->getNomdElement().getExpandedName() << endl;
    9089      //      outfile << elPtr->transportOutputFlow();
     
    142141  bool result = true;
    143142
    144   for (unsigned k = 0; k < getSectionToExecute()->getElements().size(); k++)
     143  for (unsigned k = 0; k < getComputingBlock()->getNumberOfElements(); k++)
    145144    {
    146       abstractElement* ptr = getSectionToExecute()->getElements()[k];
     145      abstractElement* ptr = getComputingBlock()->getElement(k);
    147146      if ( ptr == NULL ) {
    148147        dataManager_->consoleMessage(" softwareTransport::buildBeamAfterElements : null pointer on element " );
  • Interface_Web/trunk/pspaWT/sources/controler/src/softwareUsersprogram.cc

    r485 r493  
    1010}
    1111
    12 softwareUsersprogram::softwareUsersprogram(string inputFileName, sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
     12// softwareUsersprogram::softwareUsersprogram(string inputFileName, sectionToExecute* sect, dataManager* data) : abstractSoftware(inputFileName, sect,data)
     13// {
     14//   cout << " softwareUsersprogram::softwareUsersprogram ENREGISTREMENT " << endl;
     15//   nameOfSoftware_ = new nomDeLogiciel("usersprogram");
     16//   //  registerElement(nomdElements::snapshot,TBoolOk);
     17// }
     18
     19softwareUsersprogram::softwareUsersprogram(string inputFileName, computingBlock* cmpb, dataManager* data) : abstractSoftware(inputFileName, cmpb,data)
    1320{
    1421  cout << " softwareUsersprogram::softwareUsersprogram ENREGISTREMENT " << endl;
     
    2027{
    2128
    22   abstractElement* element = getSectionToExecute()->getElements().front();
     29  abstractElement* element = getComputingBlock()->getFirstElement();
    2330
    2431  // Dans le cas où l'element n'est pas snapshot
     
    99106  //  for (unsigned k = numeroDeb_; k <= numeroFin_; k++)
    100107 
    101   abstractElement* ptr = getSectionToExecute()->getElements().front();
     108  abstractElement* ptr = getComputingBlock()->getFirstElement();
    102109      if ( ptr == NULL ) {
    103110        dataManager_->consoleMessage("ERROR  softwareUsersprogram::buildBeamAfterElements : null pointer on element " );
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_accelerator.h

    r474 r493  
    2727  virtual ~GWt_accelerator();
    2828  inline WContainerWidget* getAcceleratorDetailledView() {return acceleratorDetailledView_;};
     29  inline WContainerWidget* getAcceleratorComputingView() {return acceleratorComputingView_;};
    2930  inline WLayout* getAcceleratorGlobalViewLayout() {return acceleratorGlobalViewLayout_;};
    3031  inline dataManager* getDataManager() { return dataManager_;};
     
    3435  private :
    3536  WContainerWidget* acceleratorDetailledView_;
     37  WContainerWidget* acceleratorComputingView_;
    3638  void addSector();
    3739  void readConfiguration();
     40  void expandMachine();
    3841  void run();
    3942  void closeGraphicDialog();
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h

    r488 r493  
    1818#include "GWt_dialog.h"
    1919#include "GWt_console.h"
    20 #include "GWt_softwarePanel.h"
     20//#include "GWt_softwarePanel.h"
    2121#include "GWt_globalParameters.h"
    2222#include "GWt_sectorParameters.h"
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sector.h

    r480 r493  
    88#include "GWt_accelerator.h"
    99#include "GWt_ligneFaisceau.h"
     10//#include "GWt_softwarePanel.h"
    1011
    1112using namespace Wt;
     
    2223  /* Return the controler sector element for this UI sector*/
    2324  inline sector* getSectorControler() {return sectorControler_;};
    24   inline GWt_softwarePanel* getExecuteWidget() {
    25     return executeWidget_;
    26   }
     25
     26  //    inline GWt_softwarePanel* getExecuteWidget() {
     27  //      return executeWidget_;
     28  //  }
     29
    2730  /**
    2831   Get the accelerator for this sector
     
    4952  GWt_accelerator* UI_Accelerator_;
    5053  sector* sectorControler_;
    51   GWt_softwarePanel* executeWidget_;
     54  //    GWt_softwarePanel* executeWidget_;
    5255
    5356};
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h

    r480 r493  
    77//
    88
    9 #ifndef GWt_softwarePanel_SEEN
    10 #define GWt_softwarePanel_SEEN
     9#ifndef GWt_softwarePanelBis_SEEN
     10#define GWt_softwarePanelBis_SEEN
    1111
    1212#include <iostream>
     
    2020
    2121class PspaApplication;
    22 class GWt_sector;
     22class GWt_machine;
    2323
    24 class GWt_softwarePanel  : public WContainerWidget
     24class GWt_softwarePanelBis  : public WContainerWidget
    2525{
    2626 public :
    2727 
    28   GWt_softwarePanel(dataManager*, GWt_sector*);
    29   virtual ~GWt_softwarePanel();
     28  GWt_softwarePanelBis(dataManager*, GWt_machine*);
     29  virtual ~GWt_softwarePanelBis();
    3030
    3131  /**
    3232   Read all sectionToExecute from the controler and build a newsoftware panel with it
    3333   */
    34   void displayFromControler();
    35   void updateSections();
     34    void displayFromControler();
     35  //  void updateSections();
    3636   
    3737 private :
    3838 
    39   bool updateSectionSelection();
    40   void addSectionToExecute();
    41   void deleteSectionToExecute(int section);
    42   string getSelection();
    43   void fillComboWithElements(Wt::WComboBox* cBox);
     39  //  bool updateSectionSelection();
     40    void addComputingBlock(computingBlock* cpbl);
     41    //    void deleteComputingBlock(int section);
     42    void deleteComputingBlock(computingBlock* cpbl);
     43  //  string getSelection();
     44    void fillComboWithElements(Wt::WComboBox* cBox);
    4445
    4546  /** Fill a ComboBox with the software list
     
    4748   */
    4849  void fillComboWithSoftwares(Wt::WComboBox* cBox, std::string );
    49   Wt::WContainerWidget* createAddDeletePushButtons(int sectionIndex);
     50  //  Wt::WContainerWidget* createAddDeletePushButtons(int sectionIndex);
     51  Wt::WContainerWidget* createAddDeletePushButtons(computingBlock* cpbl);
    5052
    5153  dataManager* dtmanage_;
    52   WContainerWidget* contenuSections_;
    53   GWt_sector* UIsector_;
     54   WContainerWidget* contenuSections_;
     55  GWt_machine* UImachine_;
    5456};
    5557#endif /* defined(__PSPA__GWt_softwarePanel__) */
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_accelerator.cc

    r474 r493  
    11#include "GWt_accelerator.h"
    22#include "GWt_sector.h"
     3#include "GWt_machine.h"
    34
    45#include <Wt/WLabel>
     
    2425dataManager_(dt)
    2526{
     27  cout << " GWt_accelerator::GWt_accelerator CONSTRUCTION NOUVEL ACCELERATOR " << endl;
    2628  setObjectName("accelerator");
    2729  addStyleClass("acceleratorPanel");
     
    5860  addSectorParameters->setMinimumSize(32,32);
    5961 
     62
     63  // expand machine
     64  WPushButton* expandMachine = new WPushButton("init/expand machine",menu);
     65  // set tooltips
     66  expandMachine->setToolTip("expand the machine");
     67  // Set class for actions elements
     68  expandMachine->setStyleClass("Button WhiteButton expand");
     69  expandMachine->setMaximumSize(128,32);
     70  expandMachine->setMinimumSize(128,32);
     71
     72  // action
     73  expandMachine->clicked().connect(this,&GWt_accelerator::expandMachine);
     74
     75
     76
     77
    6078  // Run
    6179  WPushButton* runParameters = new WPushButton("",menu);
     
    84102
    85103  WContainerWidget* acceleratorGlobalView = new WGroupBox("Global view",acceleratorScrollArea);
    86   acceleratorDetailledView_ = new WGroupBox("Detailled view",acceleratorScrollArea);
    87 
     104  acceleratorDetailledView_ = new WGroupBox("Detailled view of sector",acceleratorScrollArea);
     105  acceleratorComputingView_ = new WGroupBox("Computing view",acceleratorScrollArea);
    88106  acceleratorGlobalViewLayout_= new WHBoxLayout();
    89107  acceleratorGlobalView->setLayout(acceleratorGlobalViewLayout_);
     
    121139  if (sect.size() == 0) {
    122140    // Add the first sector
    123     addSector();
     141       addSector();
    124142  } else {
    125143    for (unsigned long a=0; a< sect.size(); a++) {
     
    127145    }
    128146  }
    129 }
    130 
     147  //  cout << " INTERVENTION GWt_accelerator::readConfiguration  " << endl;
     148  //  if ( dataManager_->getCurrentMachine() )   cout << " GWt_accelerator::readConfiguration nb elem. " <<  dataManager_->getCurrentMachine()->getNumberOfElements() <<   endl;
     149   
     150    new GWt_machine(this, dataManager_->getCurrentMachine());
     151}
     152
     153void GWt_accelerator::expandMachine() {
     154  cout << " coucou depuis GWt_accelerator::expandMachine() " << endl;
     155  if (getDataManager()->expandMachine()) new GWt_machine(this, dataManager_->getCurrentMachine());
     156}
    131157
    132158void GWt_accelerator::run()
    133159{
    134160  cout << "***********************************" << endl;
    135   cout << " GWt_softwarePanel::executer() " << endl<<endl;
     161  cout << " GWt_accelerator::executer() " << endl<<endl;
    136162 
    137163  if (!areDataCoherent()) {
     
    156182}
    157183
     184
     185// recuperer les noms d'elements pour remplir les combos des menus de graphique
    158186void GWt_accelerator::faireDessin()
    159187{
     
    161189  choixHistoDessin_->clear();
    162190 
    163   for (unsigned k = 0; k < getDataManager()->getSectors().size(); k++) {
    164     sector* sector = getDataManager()->getSectors()[k];
    165     for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
    166       sectionToExecute* section = sector->getSectionsToExecute()[l];
    167       for (unsigned m = 0; m < section->getElements().size(); m++) {
    168        
    169         abstractElement* elPtr = section->getElements()[m];
    170         //    if(elPtr->getNomdElement().getElementType() == snapshot) continue;
    171        
     191  if ( getDataManager()->getCurrentMachine() ) {
     192    for (unsigned k = 0; k < getDataManager()->getCurrentMachine()->getComputingBlocks().size(); k++) {
     193      computingBlock* cpblk = getDataManager()->getCurrentMachine()->getComputingBlocks().at(k);
     194      for (unsigned l = 0; l < cpblk->getNumberOfElements(); l++) {
     195        abstractElement* elPtr = cpblk->getElement(k);
    172196        choixElementDessin_->addItem(elPtr->getLabel());
    173197        choixHistoDessin_->addItem(elPtr->getLabel());
     
    175199    }
    176200  }
     201  // for (unsigned k = 0; k < getDataManager()->getSectors().size(); k++) {
     202  //   sector* sector = getDataManager()->getSectors()[k];
     203  //   for (unsigned l = 0; l < sector->getSectionsToExecute().size(); l++) {
     204  //     sectionToExecute* section = sector->getSectionsToExecute()[l];
     205  //     for (unsigned m = 0; m < section->getElements().size(); m++) {
     206       
     207  //       abstractElement* elPtr = section->getElements()[m];
     208  //       //    if(elPtr->getNomdElement().getElementType() == snapshot) continue;
     209       
     210  //       choixElementDessin_->addItem(elPtr->getLabel());
     211  //       choixHistoDessin_->addItem(elPtr->getLabel());
     212  //     }
     213  //   }
     214  // }
     215
    177216}
    178217
     
    675714  // FIXME
    676715  cout << "***********************************" << endl;
    677   cout << "**  To be move in controler  **" << endl;
     716  cout << "**  GWt_accelerator::areDataCoherent()   **" << endl;
    678717  cout << "***********************************" << endl;
    679   return true;
    680 #if BAVARD > 0
    681   cout << "***********************************" << endl;
    682   cout << " GWt_softwarePanel::areDataCoherent() " << endl<<endl;
    683 #endif
    684  
    685   bool caMarche = true;
     718  if ( !dataManager_ ) return false;
     719  return dataManager_->areDataCoherent();
     720    //  return true;
     721 
     722  //  bool caMarche = true;
    686723  /*
    687724   // initialize dataManager
     
    737774   }//a
    738775   */
    739   return caMarche;
    740 }
    741 
     776  //  return caMarche;
     777}
     778
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc

    r483 r493  
    6666 
    6767  buildBeamLineWidget();
    68   getUISector()->getExecuteWidget()->displayFromControler();
     68
     69 
     70  //  getUISector()->getExecuteWidget()->displayFromControler();
    6971
    7072  return UIabstractElement;
     
    112114 
    113115  // FIXME
    114   UI_sector_->getExecuteWidget()->updateSections();
     116  //  UI_sector_->getExecuteWidget()->updateSections();
    115117}
    116118
     
    125127
    126128  GWt_elementLigneFaisceau* elemLigneFaisceau = NULL;
    127   for (unsigned int i =0; i< UI_sector_->getSectorControler()->getSectionsToExecute().size(); i++) {
    128     std::vector <abstractElement*> abstractElem = UI_sector_->getSectorControler()->getSectionsToExecute()[i]->getElements();
     129  //  for (unsigned int i =0; i< UI_sector_->getSectorControler()->getSectionsToExecute().size(); i++) {
     130  //    std::vector <abstractElement*> abstractElem = UI_sector_->getSectorControler()->getSectionsToExecute()[i]->getElements();
     131  std::vector <abstractElement*> abstractElem = UI_sector_->getSectorControler()->getElements();
    129132    for (unsigned int j=0; j< abstractElem.size(); j++) {
    130133
    131       elemLigneFaisceau = new GWt_elementLigneFaisceau(dataManager_,
     134           // elemLigneFaisceau = new GWt_elementLigneFaisceau(dataManager_,
     135           //                                             this,
     136           //                                             abstractElem[j],UI_sector_->getSectorControler()->getSectionsToExecute()[i]->getSoftware()->getColor());
     137
     138
     139           elemLigneFaisceau = new GWt_elementLigneFaisceau(dataManager_,
    132140                                                       this,
    133                                                        abstractElem[j],UI_sector_->getSectorControler()->getSectionsToExecute()[i]->getSoftware()->getColor());
     141                                                       abstractElem[j],"#FFFFFF");
     142
     143
    134144     
    135145      // remove default text
     
    150160     
    151161    }
    152   }
     162    //  }
     163
    153164  // remove last line
    154165  if (elemLigneFaisceau != NULL) {
     
    171182 
    172183  buildBeamLineWidget();
    173   getUISector()->getExecuteWidget()->displayFromControler();
     184  //  getUISector()->getExecuteWidget()->displayFromControler();
    174185/*
    175186  // remove Widget
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sector.cc

    r481 r493  
    116116 
    117117  // add the software panel
    118   executeWidget_ = new GWt_softwarePanel(getAccelerator()->getDataManager(),this);
    119   vContainerLayout->addWidget(executeWidget_);
     118  //    executeWidget_ = new GWt_softwarePanel(getAccelerator()->getDataManager(),this);
     119  //   vContainerLayout->addWidget(executeWidget_);
    120120 
    121121
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r481 r493  
    22//  PSPA
    33//
    4 //  Created by Garnier Laurent on 30/01/13.
    5 //  Copyright (c) 2013 Garnier Laurent. All rights reserved.
     4//  Created by Garnier Laurent on 30/01/13.//  Copyright (c) 2013 Garnier Laurent. All rights reserved.
    65//
    76
     
    1716#include "GWt_dialog.h"
    1817#include "GWt_console.h"
    19 #include "GWt_sector.h"
     18#include "GWt_computingBlock.h"
    2019#include "GWt_globalParameters.h"
    2120#include "GWt_sectionToExecute.h"
    2221#include "GWt_pspaApplication.h"
    23 
    24 #define BAVARD 0
    25 
    26 GWt_softwarePanel::GWt_softwarePanel(dataManager* dataManager,GWt_sector* sect)
     22#include "GWt_machine.h"
     23#define BAVARD 1
     24
     25GWt_softwarePanelBis::GWt_softwarePanelBis(dataManager* dataManager,GWt_machine* mach)
    2726  : WContainerWidget(),
    2827dtmanage_(dataManager),
    29 UIsector_(sect)
     28UImachine_(mach)
    3029{
    3130 
    3231  // le panel
    3332  WPanel *panelLogiciels = new WPanel(this);
    34   panelLogiciels->setTitle(" sections of beam line for executing softwares ");
     33  panelLogiciels->setTitle(" Computing blocks ");
    3534 
    3635  contenuSections_ = new WContainerWidget();
    3736  contenuSections_->addWidget(new WBreak());
    3837  contenuSections_->addWidget(new WBreak());
    39   displayFromControler();
     38  cout << " GWt_softwarePanelBis::GWt_softwarePanelBis DISPLAY SOFTWARE PANEL " << endl;
     39      displayFromControler();
    4040 
    4141  panelLogiciels->setCentralWidget(contenuSections_);
    4242}
    4343
    44 GWt_softwarePanel::~GWt_softwarePanel() {
    45 }
    46 
    47 void GWt_softwarePanel::displayFromControler()
     44GWt_softwarePanelBis::~GWt_softwarePanelBis() {
     45}
     46
     47void GWt_softwarePanelBis::displayFromControler()
    4848{     
    49 #if BAVARD > 0
    50   cout << "***********************************" << endl;
    51   cout << " GWt_softwarePanel::addSectionToExecuteW() " << endl<<endl;
    52 #endif
     49  cout << " GWt_softwarePanelBis::displayFromControler() " << endl<<endl;
    5350
    5451  // Clear all
    5552  contenuSections_->clear();
    56  
    57   // Get all sectionsToExecute from this sector
    58   if (!UIsector_->getSectorControler()) {
     53
     54
     55  // Get all sectionsToExecute from this machine
     56  if (!UImachine_->getMachineControler()) {
     57    cout << " GWt_softwarePanelBis::displayFromControler() PAS DE MACHINE " << endl;
    5958    return;
    60   }
    61  
    62   if (UIsector_->getSectorControler()->getSectionsToExecute().size() == 0) {
     59  } else {
     60    cout << " GWt_softwarePanelBis::displayFromControler() MACHINE TROUVEE " << endl;
     61  }
     62 
     63  if (UImachine_->getMachineControler()->getComputingBlocks().size() == 0) {
    6364    // FIXME : Add a message to tell the user to add first an element
     65    cout << " GWt_softwarePanelBis::displayFromControler() PAS DE BLOCK " << endl;
    6466  } else {
    65 
    66     unsigned int firstSectionToExecuteIndex = 0;
    67     for (unsigned int a=0; a<UIsector_->getSectorControler()->getSectionsToExecute().size(); a++) {
     67    cout << " GWt_softwarePanelBis::displayFromControler() NOMBRE DE BLOCK " << UImachine_->getMachineControler()->getComputingBlocks().size() << endl;
     68
     69    unsigned int firstElemeOfComputingBlockIndex = 0;
     70
     71    for (unsigned int a=0; a<UImachine_->getMachineControler()->getComputingBlocks().size(); a++) {
     72      cout << " GWt_softwarePanelBis::displayFromControler() BLOC No " << a+1 << endl;
    6873      abstractElement* premierElement = NULL;
    6974      abstractElement* dernierElement = NULL;
    70      
    7175      std::string premierElementLabel = "";
    7276      std::string dernierElementLabel = "";
    73       if (premierElement) {
    74         premierElementLabel = premierElement->getLabel();
     77
     78      if ( !UImachine_->getMachineControler()->getComputingBlocks()[a]->isEmpty() ) {
     79        premierElement = UImachine_->getMachineControler()->getComputingBlocks()[a]->getFirstElement();
     80        firstElemeOfComputingBlockIndex = UImachine_->getMachineControler()->getComputingBlocks()[a]->getRankOfFirstElement();
     81        dernierElement = UImachine_->getMachineControler()->getComputingBlocks()[a]->getLastElement();
    7582      }
    76       if (dernierElement) {
    77         dernierElementLabel = dernierElement->getLabel();
    78       }
     83
     84
     85      if (premierElement) premierElementLabel = premierElement->getLabel();
     86      if (dernierElement) dernierElementLabel = dernierElement->getLabel();
     87      cout << " GWt_softwarePanelBis::displayFromControler() dernier element a afficher " << dernierElementLabel << endl;
    7988     
    8089      WComboBox* lineFromCombo = new WComboBox();
     
    8493     
    8594      // set to first
    86       lineFromCombo->setCurrentIndex(firstSectionToExecuteIndex);
     95      lineFromCombo->setCurrentIndex(firstElemeOfComputingBlockIndex);
    8796      // set to last
    88       lineToCombo->setCurrentIndex(firstSectionToExecuteIndex + (unsigned int)UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size() - 1);
    89      
     97      lineToCombo->setCurrentIndex(UImachine_->getMachineControler()->getComputingBlocks()[a]->getRankOfLastElement());
    9098      WComboBox* softCombo = new WComboBox();
    9199     
    92       fillComboWithSoftwares(softCombo,UIsector_->getSectorControler()->getSectionsToExecute()[a]->getSoftware()->getName());
     100      fillComboWithSoftwares(softCombo,UImachine_->getMachineControler()->getComputingBlocks()[a]->getSoftware()->getName());
    93101
    94102      // disable the "to" comboBox
     
    96104
    97105      // disable the first "from" comboBox
    98       if (a==0) {
    99         lineFromCombo->disable();
     106      // if (a==0) {
     107      //   lineFromCombo->disable();
     108      // }
     109
     110      // enable the last "to" comboBox
     111      if (a==UImachine_->getMachineControler()->getComputingBlocks().size()-1) {
     112                lineToCombo->enable();
    100113      }
    101       // disable the last "to" comboBox
    102       if (a==UIsector_->getSectorControler()->getSectionsToExecute().size()-1) {
    103         lineToCombo->disable();
    104       }
    105      
    106       // Add the sectionToExecute Widget
    107       GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(a),UIsector_->getSectorControler()->getSectionsToExecute()[a],UIsector_);
    108      
    109       /*      // FIXME ?
    110        stringstream st;
    111        st << UIsectionsToExecute_deprecated_.size();
    112        
    113        // this is the mean to identify this section!
    114        newSection->setObjectName(st.str());
    115        
    116        // push back on sections vector
    117        UIsectionsToExecute_deprecated_.push_back(newSection);
    118        */
    119       contenuSections_->addWidget(newSection);
    120       //      updateSections();
    121      
    122       firstSectionToExecuteIndex += UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size();
     114     
     115      // // Add computingBlock Widget
     116     
     117      //      GWt_computingBlock* newBlock = new GWt_computingBlock(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(a),UImachine_->getMachineControler()->getComputingBlocks()[a],UImachine_);
     118      computingBlock* blocPtr = UImachine_->getMachineControler()->getComputingBlocks()[a];
     119      GWt_computingBlock* newBlock = new GWt_computingBlock(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(blocPtr),blocPtr,UImachine_);
     120
     121      cout << " GWt_softwarePanelBis::displayFromControler j'ajoute un bloc : " << newBlock << endl;
     122      cout << " GWt_softwarePanelBis::displayFromControler nb widget avant : " << contenuSections_->count() << endl;
     123      contenuSections_->addWidget(newBlock);
     124      cout << " GWt_softwarePanelBis::displayFromControler nb widget apres : " << contenuSections_->count() << endl;
     125     
    123126    }
    124127  }
    125  }
    126 
    127 void GWt_softwarePanel::updateSections()
    128 {
    129 #if BAVARD > 0
    130   cout << "***********************************" << endl;
    131   cout << " GWt_softwarePanel::updateSections() " << endl<<endl;
    132 #endif
    133 
    134   /*
    135   // update all sections in order to manage new/deleted items
    136   for (int a = 0; a < UIsectionsToExecute_deprecated_.size(); a++) {
    137     fillComboWithElements(UIsectionsToExecute_deprecated_[a]->getFirstElement());
    138     fillComboWithElements(UIsectionsToExecute_deprecated_[a]->getLastElement());
    139     UIsectionsToExecute_deprecated_[a]->getFirstElement()->setEnabled (true);
    140     UIsectionsToExecute_deprecated_[a]->getLastElement()->setEnabled (true);
    141   }
    142  
    143   if (UIsectionsToExecute_deprecated_;.size() == 0) {
     128}
     129
     130void GWt_softwarePanelBis::fillComboWithElements(Wt::WComboBox* cBox)
     131{
     132
     133  if (cBox == NULL) return;
     134
     135  if (!UImachine_->getMachineControler()) {
    144136    return;
    145137  }
    146  
    147   // the first element will always be the first element of the beamLine
    148   UIsectionsToExecute_deprecated_[0]->getFirstElement()->setCurrentIndex(0);
    149   UIsectionsToExecute_deprecated_[0]->getFirstElement()->setEnabled (false);
    150 
    151   // the last element will always be the last element of the beamLine
    152   UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_.size()-1]->getLastElement()->setCurrentIndex(UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_;.size()-1]->getLastElement()->count());
    153   UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_.size()-1]->getLastElement()->setEnabled(false);
    154 
    155   // set default values
    156   updateSectionSelection();
    157 */
    158 }
    159 
    160 bool GWt_softwarePanel::updateSectionSelection()
    161 {
    162 #if BAVARD > 0
    163   cout << "***********************************" << endl;
    164   cout << " GWt_softwarePanel::updateSectionSelection() " << endl<<endl;
    165 #endif
    166 
    167   if ( dtmanage_->getJobListSize() == 0 ) return false;
    168  
    169   // traitement de la premiere ligne
    170   // on impose le depart du calcul au premier element
    171   string premier = "";
    172   if (UIsector_->getSectorControler()) {
    173     if (UIsector_->getSectorControler()->getSectionsToExecute().size() > 0) {
    174       if (UIsector_->getSectorControler()->getSectionsToExecute()[0]->getElements().size() > 0) {
    175         premier = UIsector_->getSectorControler()->getSectionsToExecute()[0]->getElements()[0]->getLabel();
    176       }
    177     }
    178   }
    179  
    180   // FIXME :  A réécrire
    181   /*
    182   if (UIsectionsToExecute_deprecated_.size() > 0) {
    183     UIsectionsToExecute_deprecated_[0]->setFirstElementCurrentSelection(premier);
    184   }
    185  
    186   Wt::WString currentString =  UIsectionsToExecute_deprecated_[0]->getLastElementCurrentText();
    187   int current = dtmanage_->getNumeroFromElementLabel(currentString.toUTF8());
    188  
    189   // si la fin est mal definie on prend toute la config par defaut
    190   if ( current <= 0 || current > dtmanage_->getBeamLineSize() )
    191     {
    192       current = dtmanage_->getBeamLineSize();
    193       currentString =  dtmanage_->getLabelFromElementNumero(current);
    194       if (UIsectionsToExecute_deprecated_.size() > 0) {
    195         UIsectionsToExecute_deprecated_[0]->setLastElementCurrentSelection(currentString);
    196         //...
    197       }
    198     }
    199   current++;
    200   currentString = dtmanage_->getLabelFromElementNumero(current);
    201  
    202   // traitement des suivantes (on avance d'un cran dans la liste)
    203   for (int a = 1; a< UIsectionsToExecute_deprecated_;.size(); a++)
    204     {
    205       // debut
    206       if ( current > dtmanage_->getBeamLineSize() )
    207         {
    208           UIsectionsToExecute_deprecated_;[a]->setErrors("This section element could not be after previous session last element");
    209           exec_go_->disable();
    210           return false;
    211         }
    212      
    213       UIsectionsToExecute_deprecated_;[a]->setFirstElementCurrentSelection(currentString);
    214 
    215       // fin
    216       string finString =  UIsectionsToExecute_deprecated_;[a]->getLastElementCurrentText().toUTF8();
    217      
    218       int numeroFin = dtmanage_->getNumeroFromElementLabel( finString);
    219      
    220       if ( numeroFin < current)
    221       {
    222         UIsectionsToExecute_deprecated_;[a]->setErrors("Last section element should be after first section element");
    223         exec_go_->disable();
    224         return false;
    225       }
    226 
    227       if (numeroFin > dtmanage_->getBeamLineSize())
    228       {
    229         UIsectionsToExecute_deprecated_;[a]->setErrors("Last section element number is greater than the beam line size");
    230         exec_go_->disable();
    231         return false;
    232       }
    233      
    234       // preparation de la ligne suivante
    235       current = numeroFin +1;
    236       currentString = dtmanage_->getLabelFromElementNumero(current);
    237     }
    238   //  exec_go_->setDisabled(false);
    239 
    240   if (!areDataCoherent()) {
    241 #if BAVARD > 0
    242     cout << " GWt_softwarePanel::addSectionToExecuteW() DISABLE" << endl;
    243 #endif
    244     exec_go_->disable();
    245   } else {
    246 #if BAVARD > 0
    247     cout << " GWt_softwarePanel::addSectionToExecuteW() ENABLE" << endl;
    248 #endif
    249     exec_go_->enable();
    250   }
    251 */
    252   return true;
    253 }
    254 
    255 
    256 void GWt_softwarePanel::addSectionToExecute() {
    257   // We put the last element of the previous sectionToExecute inside
    258  
    259   // Get the last element from previous section
    260   if (!UIsector_->getSectorControler()) {
    261     return;
    262   }
    263   unsigned long s = UIsector_->getSectorControler()->getSectionsToExecute().size();
    264   if (s > 0) {
    265     abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->getLastElement();
    266     UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL,dtmanage_,UIsector_->getSectorControler()));
    267     UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->removeLastElement();
    268   }
    269 
    270  
    271   displayFromControler();
    272   UIsector_->getBeamLineWidget()->buildBeamLineWidget();
    273 }
    274 
    275 
    276 void GWt_softwarePanel::deleteSectionToExecute(int sectionLabel)
    277 {
    278 #if BAVARD > 0
    279   cout << "***********************************" << endl;
    280   cout << " GWt_softwarePanel::deleteSectionToExecuteW()" << endl<<endl;
    281 #endif
    282 
    283   stringstream st;
    284   st << sectionLabel;
    285   std::string sectionName = st.str();
    286   //FIXME
    287  
    288 /*  if ( dtmanage_->getJobListSize() == 0 ) return;
    289   for (unsigned int sectionIndex = 0; sectionIndex< UIsectionsToExecute_deprecated_.size(); sectionIndex++) {
    290     if (UIsectionsToExecute_deprecated_[sectionIndex]->objectName() == sectionName) {
    291 
    292       // delete from dataManager
    293       UIsector_->getSectorControler()->clearSectionToExecute(sectionIndex);
    294 
    295       // delete from User Interface
    296       contenuSections_->removeWidget(UIsectionsToExecute_deprecated_[sectionIndex]);
    297       delete UIsectionsToExecute_deprecated_[sectionIndex];
    298       UIsectionsToExecute_deprecated_.erase (UIsectionsToExecute_deprecated_.begin()+sectionIndex);
    299     }
    300   } 
    301 */
    302   displayFromControler();
    303 }
    304 
    305 
    306 void GWt_softwarePanel::fillComboWithElements(Wt::WComboBox* cBox)
    307 {
    308 
    309   if (cBox == NULL) return;
    310 
    311   if (!UIsector_->getSectorControler()) {
    312     return;
    313   }
    314   for (unsigned int a=0; a < UIsector_->getSectorControler()->getSectionsToExecute().size(); a++) {
    315     for(unsigned int b=0; b < UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size(); b++) {
    316      
    317       abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements()[b];
     138    for(unsigned int b=0; b < UImachine_->getMachineControler()->getElements().size(); b++) {
     139     
     140      abstractElement* abs = UImachine_->getMachineControler()->getElements()[b];
    318141      if (abs != NULL) {
    319142        cBox->addItem(abs->getLabel());
    320143      }
    321144    }
    322   }
    323 }
    324 
    325 void GWt_softwarePanel::fillComboWithSoftwares(Wt::WComboBox* cBox, std::string selected)
     145}
     146
     147void GWt_softwarePanelBis::fillComboWithSoftwares(Wt::WComboBox* cBox, std::string selected)
    326148{
    327149#if BAVARD > 0
     
    344166}
    345167
    346 Wt::WContainerWidget* GWt_softwarePanel::createAddDeletePushButtons(int sectionNumber)
     168
     169Wt::WContainerWidget* GWt_softwarePanelBis::createAddDeletePushButtons(computingBlock* cpbl)
    347170{
    348171  WContainerWidget* buttonContainer= new WContainerWidget();
     
    352175  // preparation du bouton add
    353176  WPushButton* exec_add = new WPushButton("+");
    354   exec_add->clicked().connect(this, &GWt_softwarePanel::addSectionToExecute);
     177  //  exec_add->clicked().connect(this, &GWt_softwarePanelBis::addComputingBlock);
     178  exec_add->clicked().connect(boost::bind(&GWt_softwarePanelBis::addComputingBlock, this, cpbl));
    355179  exec_add->setStyleClass("roundButton");
    356180  exec_add->setMaximumSize(20,20);
     
    361185  //  warningsContainer_->setStyleClass("warningsContainer");
    362186
    363   exec_delete->clicked().connect(boost::bind(&GWt_softwarePanel::deleteSectionToExecute, this, sectionNumber));
     187  exec_delete->clicked().connect(boost::bind(&GWt_softwarePanelBis::deleteComputingBlock, this, cpbl));
    364188  exec_delete->setStyleClass("roundButton");
    365189  exec_delete->setMaximumSize(20,20);
     
    372196  return buttonContainer;
    373197}
     198
     199void GWt_softwarePanelBis::addComputingBlock(computingBlock* cpbl) {
     200  // We put the last element of the previous sectionToExecute inside
     201 
     202  if (!UImachine_->getMachineControler()) {
     203    return;
     204  }
     205  //  UImachine_->getMachineControler()->openNewLastBlock();
     206    UImachine_->getMachineControler()->openNewBlockAfter(cpbl);
     207  displayFromControler();
     208}
     209
     210
     211// void GWt_softwarePanelBis::deleteComputingBlock(int sectionLabel)
     212// {
     213//   cout << " GWt_softwarePanelBis::deleteComputingBlock()" << endl;
     214
     215//   stringstream st;
     216//   st << sectionLabel;
     217//   std::string sectionName = st.str();
     218//   //FIXME
     219//   vector<computingBlock*>& compBloc = UImachine_->getMachineControler()->getComputingBlocks();
     220//   cout << " GWt_softwarePanelBis::deleteComputingBlock() nb blocs = " << compBloc.size() << endl;
     221//   cout << " GWt_softwarePanelBis::deleteComputingBlock() nb widgets = " << sectionName << endl;
     222//   cout << " GWt_softwarePanelBis::deleteComputingBlock() nom bloc a detruire = " << contenuSections_->count() << endl;
     223
     224//   for ( unsigned k=0; k <  compBloc.size(); k++) {
     225
     226//   }
     227// /*  if ( dtmanage_->getJobListSize() == 0 ) return;
     228//   for (unsigned int sectionIndex = 0; sectionIndex< UIsectionsToExecute_deprecated_.size(); sectionIndex++) {
     229//     if (UIsectionsToExecute_deprecated_[sectionIndex]->objectName() == sectionName) {
     230
     231//       // delete from dataManager
     232//       UIsector_->getSectorControler()->clearSectionToExecute(sectionIndex);
     233
     234//       // delete from User Interface
     235//       contenuSections_->removeWidget(UIsectionsToExecute_deprecated_[sectionIndex]);
     236//       delete UIsectionsToExecute_deprecated_[sectionIndex];
     237//       UIsectionsToExecute_deprecated_.erase (UIsectionsToExecute_deprecated_.begin()+sectionIndex);
     238//     }
     239//   } 
     240// */
     241//   displayFromControler();
     242// }
     243
     244void GWt_softwarePanelBis::deleteComputingBlock(computingBlock* cpbl)
     245{
     246  cout << " GWt_softwarePanelBis::deleteComputingBlock(computingBlock*)" << endl;
     247
     248  UImachine_->getMachineControler()->eraseComputingBlock(cpbl);
     249  displayFromControler();
     250}
  • Interface_Web/trunk/pspaWT/workingArea/philFit.aml

    r488 r493  
    77    <nsc value = "0" />
    88  </global>
    9   <sector name = "a_sect">
     9  <sector name = "sector 1">
    1010    <element name = "rfgun01">
    1111      <description type = "rfgun" />
     
    5555      <length design = "3" />
    5656      <aperture at = "EXIT" shape = "CIRCLE">
    57         <xy_limit design = "1e+61" />
     57        <xy_limit design = "1e+06" />
    5858      </aperture>
    5959      <solenoid>
    6060        <ksol design = "1.0199" />
    61         <vary is_on = "false" />
     61        <vary is_on = "true" />
    6262      </solenoid>
    6363    </element>
     
    8282      </bend>
    8383    </element>
     84  </sector>
     85  <sector name = "sector 2">
    8486    <element name = "drift03">
    8587      <description type = "drift" />
     
    9496    </element>
    9597  </sector>
     98  <machine name = "dummy">
     99    <machineElements>
     100      <melement name = "rfgun01" />
     101      <melement name = "cell01" />
     102      <melement name = "drift01" />
     103      <melement name = "solnd01" />
     104      <melement name = "drift02" />
     105      <melement name = "bend01" />
     106      <melement name = "drift03" />
     107      <melement name = "fit01" />
     108    </machineElements>
     109    <mcomputingBlocks>
     110      <computingBlock>
     111        <software name = "parmela" />
     112        <blocExtension rankOfFirstElement = "0" numberOfelements = "3" />
     113      </computingBlock>
     114      <computingBlock>
     115        <software name = "transport" />
     116        <blocExtension rankOfFirstElement = "3" numberOfelements = "5" />
     117      </computingBlock>
     118    </mcomputingBlocks>
     119  </machine>
    96120</laboratory>
Note: See TracChangeset for help on using the changeset viewer.