Changeset 419 in PSPA


Ignore:
Timestamp:
Jun 21, 2013, 2:32:47 PM (11 years ago)
Author:
lemeur
Message:

ajout de l'include algorithm

Location:
Interface_Web/trunk/pspaWT/sources
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h

    r418 r419  
    3131  particleBeam* getDiagnosticBeam(string elementLabel);
    3232
    33   void addSectionToExecute(abstractElement* debut,int debutIndex, abstractElement* fin, int finIndex, abstractSoftware* prog);
     33  sectionToExecute*  addSectionToExecute(abstractElement* debut,int debutIndex, abstractElement* fin, int finIndex, nomDeLogiciel logiciel);
    3434
    3535  abstractElement* addElement(nomdElements::typedElement elemType);
     
    6565    bool restoreElements(string inputFileName);
    6666   
    67     abstractSoftware* createSoftwareConnexion(nomDeLogiciel logi);
    6867   
    6968    /** return the jobList size
    7069     */
    71     inline int getJobListSize() {
     70    inline int getJobListSize() const {
    7271        return jobList_.size();
    7372    }
     
    8685     return NULL if the index does not exist
    8786     */
    88     inline sectionToExecute* getJobListAt(int a) {
    89         if (a < 0) return NULL;
    90         if (a >= getJobListSize()) return NULL;
    91         return jobList_[a];
    92     }
     87
     88    /* inline sectionToExecute* getJobListAt(int a) { */
     89    /*     if (a < 0) return NULL; */
     90    /*     if (a >= getJobListSize()) return NULL; */
     91    /*     return jobList_[a]; */
     92    /* } */
     93
     94
     95
     96    /* inline const abstractSoftware* getSoftwareOfSection( int index) const { */
     97    /*     if (index < 0) return NULL; */
     98    /*     if (index >= getJobListSize()) return NULL; */
     99    /*  return jobList_[index]->getSoftware(); */
     100    /* } */
    93101   
    94102    /** Clear a specific jobList */
     
    111119    void removeFile(string nameOfFile);
    112120    void clearSectionToExecute();
    113  
     121     abstractSoftware* createSoftwareConnexion(nomDeLogiciel logi);
     122
    114123  };
    115124#endif
  • Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h

    r413 r419  
    2525   
    2626    /** Deprecated : To be removed ! */
    27     inline int getElementNumberInSection() {
     27    inline int getElementNumberInSection() const {
    2828        return firstElementNumberInBeamLine;
    2929    }
    3030   
    3131    /** Deprecated : To be removed ! */
    32     inline int getLastElementNumberInSection()  {
     32    inline int getLastElementNumberInSection()  const {
    3333        return lastElementNumberInBeamLine;
    3434    }
    35     inline abstractSoftware* getSoftware() {
     35    inline abstractSoftware* getSoftware() const {
    3636        return software;
    3737    }
  • Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc

    r418 r419  
    11#include "abstractSoftware.h"
    22#include "dataManager.h"
    3 
     3#include <algorithm>
    44abstractSoftware::abstractSoftware()
    55{
  • Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc

    r418 r419  
    6464}
    6565
    66 void dataManager::addSectionToExecute(abstractElement* debut,int debutIndex, abstractElement* fin, int finIndex, abstractSoftware* prog)
    67 {
    68     jobList_.push_back(new sectionToExecute(debut, debutIndex, fin, finIndex, prog));
     66sectionToExecute*  dataManager::addSectionToExecute(abstractElement* debut,int debutIndex, abstractElement* fin, int finIndex, nomDeLogiciel logiciel)
     67{
     68  abstractSoftware* prog;
     69  string inputFileName;
     70  if(logiciel == nomDeLogiciel::parmela) {
     71    inputFileName = "parmin";
     72    prog = new softwareParmela(inputFileName, &globParam_, this);
     73  } else if (logiciel  == nomDeLogiciel::transport) {
     74    inputFileName = "transport.input";
     75    prog =  new softwareTransport(inputFileName, &globParam_, this);
     76  } else if (logiciel == nomDeLogiciel::generator) {
     77    inputFileName = "generator.in";
     78    prog = new softwareGenerator(inputFileName, &globParam_, this);
     79  } else if (logiciel  == nomDeLogiciel::test) {
     80    prog = new softwareTest(inputFileName, &globParam_, this);
     81  } else {
     82    prog = NULL;
     83  }
     84
     85  //  abstractSoftware* prog = createSoftwareConnexion(logiciel);
     86  jobList_.push_back(new sectionToExecute(debut, debutIndex, fin, finIndex, prog));
     87  //  return prog;
     88  return jobList_.back();
    6989}
    7090
     
    81101
    82102void dataManager::clearSectionToExecute(int a) {
     103  cout << " dataManager::clearSectionToExecute efaacement section d'index : " << a << endl;
    83104  if (a<0) return;
    84105  if (a>= jobList_.size()) return;
     106
     107  // lors de la creation de la section on a fait un 'new' d'un softwareXXXX
     108  // on fait ici le 'delete'
     109
     110  const abstractSoftware* soft = jobList_.at(a)->getSoftware();
     111    if ( soft != NULL ) delete soft;
    85112  jobList_.erase (jobList_.begin()+a);
    86113}
     
    160187      }
    161188     
    162       delete softw;
    163189      if ( success ) {
    164190        currentBeam_ = &diagnosticBeam_.at(indexElementToIndexDiag_.back());
     
    328354    string inputFileName;
    329355    if(logi == nomDeLogiciel::parmela) {
     356      cout << " dataManager::createSoftwareConnexion : logiciel identifie : parmela " << endl;
    330357        inputFileName = "parmin";
    331358        return new softwareParmela(inputFileName, &globParam_, this);
    332359    } else if (logi == nomDeLogiciel::transport) {
     360      cout << " dataManager::createSoftwareConnexion : logiciel identifie : transport " << endl;
    333361        inputFileName = "transport.input";
    334362        return new softwareTransport(inputFileName, &globParam_, this);
    335363    } else if (logi == nomDeLogiciel::generator) {
     364      cout << " dataManager::createSoftwareConnexion : logiciel identifie : generator " << endl;
    336365        inputFileName = "generator.in";
    337366        return new softwareGenerator(inputFileName, &globParam_, this);
    338367    } else if (logi == nomDeLogiciel::test) {
     368      cout << " dataManager::createSoftwareConnexion : logiciel identifie : test " << endl;
    339369        return new softwareTest(inputFileName, &globParam_, this);
    340370    } else {
     371      cout << " dataManager::createSoftwareConnexion : logiciel identifie : null " << endl;
    341372        return NULL;
    342373    }
  • Interface_Web/trunk/pspaWT/sources/controler/src/sectionToExecute.cc

    r401 r419  
    1818    software = s;
    1919}
     20
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r418 r419  
    104104 
    105105 
    106   abstractSoftware* soft = NULL;
    107   dtmanage_->addSectionToExecute(premierElement,premierIndex, dernierElement, dernierIndex, soft);
     106  //  abstractSoftware* soft = NULL;
     107  //  dtmanage_->addSectionToExecute(premierElement,premierIndex, dernierElement, dernierIndex, soft);
     108  dtmanage_->addSectionToExecute(premierElement,premierIndex, dernierElement, dernierIndex, nomDeLogiciel());
    108109
    109110  std::string premierElementLabel = "";
     
    340341   
    341342      nomDeLogiciel prog = nomDeLogiciel ( sections_[a]->getSoftwareCurrentText().toUTF8());
    342       abstractSoftware* softToExec = dtmanage_->createSoftwareConnexion(prog);
    343       dtmanage_->addSectionToExecute(pspa_->getBeamLine()->getAbstractElement(debut),
     343      //      abstractSoftware* softToExec = dtmanage_->createSoftwareConnexion(prog);
     344      sectionToExecute* sectToExec = dtmanage_->addSectionToExecute(pspa_->getBeamLine()->getAbstractElement(debut),
    344345                                     debut,
    345346                                     pspa_->getBeamLine()->getAbstractElement(fin),
    346347                                     fin,
    347                                      softToExec);
    348    
     348                                     prog);
     349
     350      abstractSoftware* softToExec = sectToExec->getSoftware();
    349351      diagnosticErrors = "";
    350352      diagnosticWarnings = "";
Note: See TracChangeset for help on using the changeset viewer.