Changeset 480 in PSPA


Ignore:
Timestamp:
Jan 8, 2014, 5:19:17 PM (10 years ago)
Author:
garnier
Message:

BugFix d un memory leak quand on changeait les debut de section. Amelioration lors des changement de debut de sections

Location:
Interface_Web/trunk/pspaWT
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/History

    r479 r480  
    55     PSPA - Plateforme de simulation en physique des accélérateurs
    66     =========================================================
     7
     808 Janvier 2014 : Laurent Garnier
     9- sectionToExecute : Ameliorations dans le changement du début des sections
     10- dataManager : Ajout d'une protection dans executeAll()
     11- GWt_sectionToExecute : BUGFIX: Memory leak résolu ici. Lors du changement d'une section, on demandait au secteur qui contient à le section de toute redessiner(y compris la section courante qui était supprimée), cela revenait à couper la branche sur laquelle ont était assis. Désormais, on passe par un signal.
     12- GWt_sector : Changement de privé à public de displayWidgetBeamLine()
    713
    81407 Janvier 2014 : Laurent Garnier
  • Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h

    r476 r480  
    5151  bool insertAfter(abstractElement*,abstractElement*);
    5252
    53   inline bool insertAtFirst(abstractElement* abs) {
     53  inline void insertAtFirst(abstractElement* abs) {
    5454    elements_.insert ( elements_.begin() ,abs);
    5555  };
    5656
     57  inline void removeFirstElement() {
     58    elements_.erase(elements_.begin());
     59  };
     60 
     61  inline void insertAtLast(abstractElement* abs) {
     62    elements_.push_back(abs);
     63  };
     64 
    5765  /** Set the first element of this section.
    5866   If needed, it will change the last element of the previous section
  • Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc

    r479 r480  
    135135    }
    136136   
    137     if ( success ) {
     137    if ( success  && (diagnosticBeam_.size() > 0)) {
    138138      sector->setParticleBeam(&diagnosticBeam_.at(indexElementToIndexDiag_.back()));
    139139      cout << " execute termine avec succes " << endl;
  • Interface_Web/trunk/pspaWT/sources/controler/src/sectionToExecute.cc

    r476 r480  
    119119      std::vector< abstractElement* > elemsVect = sectVect[a]->getElements();
    120120      long stop = 0;
     121      long start = elemsVect.size();
    121122      if (a == newBeginSectionNumber) {
    122123        stop = indexOfNewBeginSectionNumber;
    123124      }
    124       for (long elemIndex = elemsVect.size(); elemIndex > stop; elemIndex--) {
     125      for (long elemIndex = start; elemIndex > stop; elemIndex--) {
    125126        insertAtFirst(elemsVect.back());
    126127        elemsVect.pop_back();
     
    132133   
    133134    // Moved in the same section :
    134   } else if ( newBeginSectionNumber == sectionNumber ) {
     135  } else if (( newBeginSectionNumber == sectionNumber ) && (sectionNumber > 0)){
     136    for (long elemIndex = 0; elemIndex < indexOfNewBeginSectionNumber; elemIndex++) {
     137      sectVect[sectionNumber-1]->insertAtLast(elements_.front());
     138      removeFirstElement();
     139    }
    135140   
    136141   
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h

    r476 r480  
    55#include <Wt/WComboBox>
    66#include <Wt/WText>
     7#include <Wt/WSignal>
    78
    89class GWt_softwarePanel;
     
    5051    }
    5152
     53    Wt::Signal<void> redraw_;
     54
    5255    private :
    5356   
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sector.h

    r469 r480  
    3939  };
    4040 
     41  /**
     42   Display the content of this sector. Create a widget for the beamline and the softwares
     43   */
     44  void displayWidgetBeamLine();
     45
    4146  private :
    4247  GWt_ligneFaisceau* UI_beamLine_;
    4348  void setIcon(WLayout*);
    44   void displayWidgetBeamLine();
    4549  GWt_accelerator* UI_Accelerator_;
    4650  sector* sectorControler_;
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h

    r471 r480  
    2929  virtual ~GWt_softwarePanel();
    3030
     31  /**
     32   Read all sectionToExecute from the controler and build a newsoftware panel with it
     33   */
    3134  void displayFromControler();
    3235  void updateSections();
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc

    r476 r480  
    9494//  lastElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
    9595  softElement_->activated().connect(this,&GWt_sectionToExecute::setSoftware);
     96  this->redraw_.connect(UIsector_,&GWt_sector::displayWidgetBeamLine);
    9697 
    9798  manageWarningsAndErrors();
     
    155156
    156157  section_->setFirstElement(firstElement_->currentIndex());
    157   UIsector_->getExecuteWidget()->displayFromControler();
    158   UIsector_->getBeamLineWidget()->buildBeamLineWidget();
     158  redraw_.emit();
    159159}
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sector.cc

    r455 r480  
    1515{
    1616  setIcon(UI_Accelerator_->getAcceleratorGlobalViewLayout());
     17  displayWidgetBeamLine();
    1718}
    1819
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r474 r480  
    108108      GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(a),UIsector_->getSectorControler()->getSectionsToExecute()[a],UIsector_);
    109109     
    110 /*      // FIXME ?
    111       stringstream st;
    112       st << UIsectionsToExecute_deprecated_.size();
    113      
    114       // this is the mean to identify this section!
    115       newSection->setObjectName(st.str());
    116      
    117       // push back on sections vector
    118       UIsectionsToExecute_deprecated_.push_back(newSection);
    119 */
     110      /*      // FIXME ?
     111       stringstream st;
     112       st << UIsectionsToExecute_deprecated_.size();
     113       
     114       // this is the mean to identify this section!
     115       newSection->setObjectName(st.str());
     116       
     117       // push back on sections vector
     118       UIsectionsToExecute_deprecated_.push_back(newSection);
     119       */
    120120      contenuSections_->addWidget(newSection);
    121 //      updateSections();
    122 
     121      //      updateSections();
     122     
    123123      firstSectionToExecuteIndex += UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size();
    124124    }
Note: See TracChangeset for help on using the changeset viewer.