Changeset 385 in PSPA


Ignore:
Timestamp:
Mar 12, 2013, 12:37:20 PM (11 years ago)
Author:
garnier
Message:

debut des modifications pour le comboBox : changement de sectionToExecute

Location:
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/controler/include/dataManager.h

    r381 r385  
    3030  particleBeam* getDiagnosticBeam(unsigned index);
    3131   
    32   void addSectionToExecute(int debut, int fin, nomDeLogiciel prog);
     32  void addSectionToExecute(abstractElement* debut,int debutIndex, abstractElement* fin, int finIndex, abstractSoftware* prog);
    3333
    3434    abstractElement* addElement(typedElement elemType);
     
    6464    bool restoreElements(string inputFileName);
    6565   
     66    abstractSoftware* createSoftwareConnexion(nomDeLogiciel logi);
    6667   
    6768
     
    7980    void removeFile(string nameOfFile);
    8081    void clearSectionToExecute();
    81     abstractSoftware* createSoftwareConnexion(nomDeLogiciel logi);
    8282 
    8383  };
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/controler/include/sectionToExecute.h

    r312 r385  
    33
    44#include "nomDeLogiciel.h"
     5#include "abstractElement.h"
     6#include "abstractSoftware.h"
    57
    6 typedef struct 
     8class sectionToExecute
    79{
    8   unsigned firstElement;  // numero premier element
    9   unsigned lastElement;   // numero dernier element
    10   nomDeLogiciel software;
    11 }  sectionToExecute;
     10    public :
     11    sectionToExecute(abstractElement*, abstractElement*, abstractSoftware*);
     12
     13    /** Deprecated : To be removed ! */
     14    sectionToExecute(abstractElement*, int, abstractElement*, int, abstractSoftware*);
     15    ~sectionToExecute() {;}
     16
     17    inline abstractElement* getFirstElement() {
     18        return firstElement;
     19    }
     20   
     21    inline abstractElement* getLastElement() {
     22        return lastElement;
     23    }
     24   
     25    /** Deprecated : To be removed ! */
     26    inline int getFirstElementNumberInBeamLine() {
     27        return firstElementNumberInBeamLine;
     28    }
     29   
     30    /** Deprecated : To be removed ! */
     31    inline int getLastElementNumberInBeamLine()  {
     32        return lastElementNumberInBeamLine;
     33    }
     34    inline abstractSoftware* getSoftware() {
     35        return software;
     36    }
     37   
     38    private :
     39    abstractElement*  firstElement;
     40    abstractElement*  lastElement;
     41
     42    int firstElementNumberInBeamLine;
     43    int lastElementNumberInBeamLine;
     44   
     45    abstractSoftware* software;
     46};
    1247
    1348#endif
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/controler/src/dataManager.cc

    r381 r385  
    6464}
    6565
    66 void dataManager::addSectionToExecute(int debut, int fin, nomDeLogiciel prog)
    67 {
    68     jobList_.push_back(new sectionToExecute);
    69     jobList_.back()->firstElement = debut;
    70     jobList_.back()->lastElement = fin;
    71     jobList_.back()->software  = prog;
     66void dataManager::addSectionToExecute(abstractElement* debut,int debutIndex, abstractElement* fin, int finIndex, abstractSoftware* prog)
     67{
     68    jobList_.push_back(new sectionToExecute(debut, debutIndex, fin, finIndex, prog));
    7269}
    7370
     
    122119  for(unsigned k = 0; k < jobList_.size(); k++)
    123120    {
    124       cout << " dataManager::executeAll je m'apprete a executer : " << (jobList_[k]->software).getString() << endl;
    125      
    126       int debut = jobList_[k]->firstElement;
    127       int fin = jobList_[k]->lastElement;
    128       softw = createSoftwareConnexion(jobList_[k]->software);
     121      cout << " dataManager::executeAll je m'apprete a executer : " << (jobList_[k]->getSoftware()->getName()) << endl;
     122     
     123      int debut = jobList_[k]->getFirstElementNumberInBeamLine();
     124      int fin = jobList_[k]->getLastElementNumberInBeamLine();
     125      softw = jobList_[k]->getSoftware();
    129126     
    130127      if (softw == NULL) {
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_ligneFaisceau.h

    r379 r385  
    5454     */
    5555    abstractElement* getAbstractElement(int i);
     56
     57    /** return the index of the abstract element
     58     @param : label of this abstractElement in the beam line
     59     */
     60    int getAbstractElementIndexFromLabel(std::string str);
     61
    5662    //    void restoreElementCollectionFromDataManager();
    5763    void clickEvent(WContainerWidget*);
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_dialog.cc

    r336 r385  
    2424        hLayout->addWidget(wc);
    2525        widgt->setLayout(hLayout);
     26
     27        setClosable(true);
     28        setModal (modal);
     29        show();
    2630    }
    27    
    28     setClosable(true);
    29     setModal (modal);
    3031}
    3132
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc

    r379 r385  
    203203    }
    204204   
    205     // first if 1
    206     //    i--;
    207205    for (int a=0; a< ligneFaisceauLayout_->count(); a++) {
    208206        if (ligneFaisceauLayout_->itemAt(a)) {
     
    222220
    223221
     222int GWt_LigneFaisceau::getAbstractElementIndexFromLabel(std::string txt){
     223    int index = 0;
     224    if (txt == "") {
     225        return NULL;
     226    }
     227   
     228    for (int a=0; a< ligneFaisceauLayout_->count(); a++) {
     229        if (ligneFaisceauLayout_->itemAt(a)) {
     230           
     231            if (GWt_elementLigneFaisceau* elem = dynamic_cast <GWt_elementLigneFaisceau*> (ligneFaisceauLayout_->itemAt(a)->widget ())) {
     232                if (elem->getGWt_AbstractElement()) {
     233                    if (elem->getGWt_AbstractElement()->getAbstractElement()->getLabel() == txt) {
     234                        return index;
     235                    }
     236                }
     237                index ++;
     238            }
     239        }
     240    }
     241    return NULL;
     242   
     243}
     244
     245
    224246int GWt_LigneFaisceau::getBeamLineSize() {
    225247  int count = 0;
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r371 r385  
    275275      string finString = (*itr)->fin->text().toUTF8();
    276276     
    277       int debut = dtmanage_->getNumeroFromElementLabel(debString);
    278       int fin = dtmanage_->getNumeroFromElementLabel(finString);
     277      int debut = pspa_->getBeamLine()->getAbstractElementIndexFromLabel(debString)+1; // FIXME : Should NOT be +1
     278        int fin = pspa_->getBeamLine()->getAbstractElementIndexFromLabel(finString)+1; // FIXME : Should NOT be +1
     279
    279280      nomDeLogiciel prog = nomDeLogiciel ( (*itr)->selection->currentIndex() );
    280       dtmanage_->addSectionToExecute(debut,fin,prog);
     281      dtmanage_->addSectionToExecute(pspa_->getBeamLine()->getAbstractElement(debut),
     282                                     debut,
     283                                     pspa_->getBeamLine()->getAbstractElement(fin),
     284                                     fin,
     285                                     dtmanage_->createSoftwareConnexion(prog));
    281286       
    282287      // check sections
     
    337342      (*selectedSections_.begin())->fin->setText(dernierText);
    338343    }
    339  
    340   cout << "PspaApplication::updateSelections(): " << premierText << " à  " << dernierText << endl;
    341344}
    342345
Note: See TracChangeset for help on using the changeset viewer.