Changeset 468 in PSPA


Ignore:
Timestamp:
Dec 18, 2013, 6:00:14 PM (10 years ago)
Author:
garnier
Message:

Amélioration et intégration du softwarePanel en cours. A terminer

Location:
Interface_Web/trunk/pspaWT
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/History

    r467 r468  
    77
    8818 Décembre 2013 : Laurent Garnier
    9 - requierements : Améliorer afin de mieux prendre en compte la gestion/création de tags sur le serveur.
     9- sectionToExecute :
     10  o Ajoute des méthodes getLastElement() et removeLastElement()
     11- GWt_softwarePanel : Début de la réintégration de ce panel dans l'interface
     12- GWt_accelerator :
     13  o  Ajout de la méthode areDataCoherent (déplacé de GWt_sofwtarePanel)
     14  o Impléméntation de run() (déplacé de la classe GWt_sofwtarePanel)
     15
     1618 Décembre 2013 : Laurent Garnier
     17- requirements : Améliorer afin de mieux prendre en compte la gestion/création de tags sur le serveur.
    1018  Précédement les libraries n'étaient pas accrochées comme il le fallait dans le requierement.
    1119
  • Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h

    r455 r468  
    3535  inline std::vector< abstractElement* > getElements() {return elements_;};
    3636 
     37  /**
     38   Get the last element of this section
     39   */
     40  inline abstractElement*  getLastElement() {return elements_.back();};
     41 
     42  /**
     43   Remove the last element of this section
     44   */
     45  inline void removeLastElement() {return elements_.pop_back();};
     46
    3747  bool insertAfter(abstractElement*,abstractElement*);
    3848
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_accelerator.h

    r455 r468  
    4545  void dessinerHistogramme();
    4646  void chartPlot2vec(WContainerWidget* toto,vector<double>& xcor,vector<double>& ycor,Wt::Chart::SeriesType seriesType,Wt::Chart::FillRangeType fillRange,Wt::Chart::AxisValue value,bool isGridLinesEnables,string title,string legendx,string legendy,int width,int height,bool makeIcon = false);
    47  
     47  bool areDataCoherent();
    4848
    4949
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h

    r455 r468  
    2929  virtual ~GWt_softwarePanel();
    3030
    31   void addSectionToExecuteW();
     31  void displayFromControler();
    3232  void updateSections();
    3333   
     
    3535 
    3636  bool updateSectionSelection();
    37   void deleteSectionToExecuteW(int section);
     37  void addSectionToExecute();
     38  void deleteSectionToExecute(int section);
    3839  string getSelection();
    39   void executer();
    40   bool areDataCoherent();
    4140  void fillComboWithElements(Wt::WComboBox* cBox);
    4241  void fillComboWithSoftwares(Wt::WComboBox* cBox);
     
    4443
    4544  dataManager* dtmanage_;
    46   WPushButton *exec_go_;
    4745  WContainerWidget* contenuSections_;
    4846  GWt_sector* UIsector_;
    4947
    50   std::vector <GWt_sectionToExecute*> sections_;
     48  std::vector <GWt_sectionToExecute*> UIsectionsToExecute_;
    5149};
    5250#endif /* defined(__PSPA__GWt_softwarePanel__) */
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_accelerator.cc

    r455 r468  
    112112void GWt_accelerator::run()
    113113{
     114  cout << "***********************************" << endl;
     115  cout << " GWt_softwarePanel::executer() " << endl<<endl;
     116 
     117  if (!areDataCoherent()) {
     118    return;
     119  }
     120 
     121  //static_cast<GWt_globalParameters*>(pspa_->getGlobalParam())->updateGlobals();
     122 
     123  GWt_dialog calculDialog("Calcul en cours", "Veuillez patienter...", GWt_dialog::Wait, true,false);
     124  calculDialog.show();
     125 
     126  wApp->processEvents();
     127 
     128  if (!getDataManager()->executeAll()) {
     129    GWt_dialog warningDialog("PSPA : Echec", " echec lors de l'exécution !", GWt_dialog::Error, true,true);
     130    warningDialog.exec();
     131  }
     132 
     133  //  exec_go_->setDisabled(true);
     134  calculDialog.hide();
     135  faireDessin();
    114136}
    115137
     
    629651
    630652
    631 
    632 
     653bool GWt_accelerator::areDataCoherent()
     654{
     655  // FIXME
     656  cout << "***********************************" << endl;
     657  cout << "**  To be move in controler  **" << endl;
     658  cout << "***********************************" << endl;
     659  return true;
     660#if BAVARD > 0
     661  cout << "***********************************" << endl;
     662  cout << " GWt_softwarePanel::areDataCoherent() " << endl<<endl;
     663#endif
     664 
     665  bool caMarche = true;
     666  /*
     667   // initialize dataManager
     668   dtmanage_->initializeExecution();
     669   
     670   // intialize User Interface
     671   if (pspa_->getBeamLine()) {
     672   pspa_->getBeamLine()->initializeSoftwares();
     673   }
     674   
     675   string diagnosticErrors;
     676   string diagnosticWarnings;
     677   for (int a = 0; a < sections_.size(); a++)
     678   {
     679   string debString= sections_[a]->getFirstElementCurrentText().toUTF8();
     680   string finString= sections_[a]->getLastElementCurrentText().toUTF8();
     681   int debut = pspa_->getBeamLine()->getAbstractElementNumeroFromLabel(debString);
     682   int fin = pspa_->getBeamLine()->getAbstractElementNumeroFromLabel(finString);
     683   
     684   string currentSoft= sections_[a]->getSoftwareCurrentText().toUTF8();
     685   nomDeLogiciel prog = nomDeLogiciel(currentSoft);
     686   sectionToExecute* sectToExec = dtmanage_->addSectionToExecute(pspa_->getBeamLine()->getAbstractElement(debut),debut,pspa_->getBeamLine()->getAbstractElement(fin),fin,prog);
     687   
     688   abstractSoftware* softToExec = sectToExec->getSoftware();
     689   diagnosticErrors = "";
     690   diagnosticWarnings = "";
     691   for(int i = debut-1; i < fin; i++) // check sections
     692   {
     693   if (!pspa_->getBeamLine()) continue;
     694   abstractElement* elPtr= pspa_->getBeamLine()->getAbstractElement(i);
     695   if (!elPtr) continue;
     696   
     697   trivaluedBool tb = softToExec->doAcceptElement(elPtr->getNomdElement().getElementType());
     698   cout << " GWt_softwarePanel::areDataCoherent() el " << elPtr->getLabel() << " tb= " << tb << endl;
     699   if (tb  == TBoolOk ) {
     700   elPtr->setSoftware(softToExec);
     701   } else {
     702   elPtr->setSoftware(NULL);
     703   if (tb == TBoolIgnore) {
     704   if(prog.getString() != "unknownSoftware") diagnosticWarnings += elPtr->getLabel() + " will be ignored by  "+ prog.getString() + "<br /> ";
     705   } else {
     706   // j'insiste pour remettre le nom generique de l'element refuse (glm / 30/03/2013)
     707   diagnosticErrors += elPtr->getNomdElement().getExpandedName() + " is not allowed with " + prog.getString() + "<br /> ";
     708   caMarche = false;
     709   }
     710   }
     711   pspa_->getBeamLine()->update(i);
     712   } //i
     713   
     714   // set errors and warnings
     715   sections_[a]->setErrors(diagnosticErrors);
     716   sections_[a]->setWarnings(diagnosticWarnings);
     717   }//a
     718   */
     719  return caMarche;
     720}
     721
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc

    r455 r468  
    113113 
    114114  buildBeamLineWidget();
     115  getUISector()->getExecuteWidget()->displayFromControler();
     116
    115117  return UIabstractElement;
    116118
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r455 r468  
    3030{
    3131 
    32   // bouton execute
    33   exec_go_ = new WPushButton("execute!");
    34   exec_go_->clicked().connect(this, &GWt_softwarePanel::executer);
    35 
    3632  // le panel
    3733  WPanel *panelLogiciels = new WPanel(this);
     
    3935 
    4036  contenuSections_ = new WContainerWidget();
    41   contenuSections_->addWidget(exec_go_);
    4237  contenuSections_->addWidget(new WBreak());
    4338  contenuSections_->addWidget(new WBreak());
    44   addSectionToExecuteW();
     39  displayFromControler();
    4540 
    4641  panelLogiciels->setCentralWidget(contenuSections_);
     
    5045}
    5146
    52 void GWt_softwarePanel::addSectionToExecuteW()
     47void GWt_softwarePanel::displayFromControler()
    5348{     
    54   cout << "***********************************" << endl;
    55   cout << "*  A réécrire  *" << endl;
    56   cout << "***********************************" << endl;
     49#if BAVARD > 0
     50  cout << "***********************************" << endl;
     51  cout << " GWt_softwarePanel::addSectionToExecuteW() " << endl<<endl;
     52#endif
     53
     54  // Clear all
     55  contenuSections_->clear();
     56 
     57  // Get all sectionsToExecute from this sector
     58  if (!UIsector_->getSectorControler()) {
     59    return;
     60  }
     61 
     62  if (UIsector_->getSectorControler()->getSectionsToExecute().size() == 0) {
     63    // FIXME : Add a message to tell the user to add first an element
     64  } else {
     65    for (unsigned int a=0; a<UIsector_->getSectorControler()->getSectionsToExecute().size(); a++) {
     66      abstractElement* premierElement = NULL;
     67      abstractElement* dernierElement = NULL;
     68     
     69      int premierIndex = 0;
     70      int dernierIndex = 0;
     71     
     72      std::string premierElementLabel = "";
     73      std::string dernierElementLabel = "";
     74      if (premierElement) {
     75        premierElementLabel = premierElement->getLabel();
     76      }
     77      if (dernierElement) {
     78        dernierElementLabel = dernierElement->getLabel();
     79      }
     80     
     81      WComboBox* lineFromCombo = new WComboBox();
     82      WComboBox* lineToCombo = new WComboBox();
     83      fillComboWithElements(lineFromCombo);
     84      fillComboWithElements(lineToCombo);
     85     
     86      // set selection
     87      lineFromCombo->setCurrentIndex(premierIndex);
     88      lineToCombo->setCurrentIndex(dernierIndex);
     89     
     90      WComboBox* softCombo = new WComboBox();
     91      fillComboWithSoftwares(softCombo);
     92     
     93      // Add the sectionToExecute Widget
     94      GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(UIsectionsToExecute_.size()),this,UIsector_);
     95     
     96      stringstream st;
     97      st << UIsectionsToExecute_.size();
     98     
     99      // this is the mean to identify this section!
     100      newSection->setObjectName(st.str());
     101     
     102      // push back on sections vector
     103      UIsectionsToExecute_.push_back(newSection);
     104      contenuSections_->addWidget(newSection);
     105      updateSections();
     106
     107     
     108    }
     109  }
     110 }
     111
     112void GWt_softwarePanel::updateSections()
     113{
     114#if BAVARD > 0
     115  cout << "***********************************" << endl;
     116  cout << " GWt_softwarePanel::updateSections() " << endl<<endl;
     117#endif
    57118  return;
    58 #if BAVARD > 0
    59   cout << "***********************************" << endl;
    60   cout << " GWt_softwarePanel::addSectionToExecuteW() " << endl<<endl;
    61 #endif
    62 
    63   abstractElement* premierElement = NULL;
    64   abstractElement* dernierElement = NULL;
    65 
    66   int premierIndex = 0;
    67   int dernierIndex = 0;
    68  
    69   cout << "sections_.size() = " << sections_.size() << endl;
    70 /*
    71   // if there is no section
    72   if(sections_.size() == 0) {
    73     premierElement = pspa_->getBeamLine()->getAbstractElement(0);
    74     premierIndex = 0;
    75    
    76     // if this is not the first :
    77     // - first element will be the last of the previous section
    78     // (or the same if it is the last of the beam line)
    79     // - lastElement will be the last of the beam line
    80     // - software will be the first of the list
    81    
    82   } else {
    83     dernierElement = pspa_->getBeamLine()->getAbstractElement(pspa_->getBeamLine()->getBeamLineSize()-1);
    84     dernierIndex = pspa_->getBeamLine()->getBeamLineSize()-1;
    85    
    86     premierElement = dernierElement;
    87     premierIndex = dernierIndex;
    88   }
    89  
    90   dernierElement = pspa_->getBeamLine()->getAbstractElement(pspa_->getBeamLine()->getBeamLineSize()-1);
    91   dernierIndex = pspa_->getBeamLine()->getBeamLineSize()-1;
    92  
    93   dtmanage_->addSectionToExecute(premierElement,premierIndex,dernierElement,dernierIndex,nomDeLogiciel());
    94 */
    95   std::string premierElementLabel = "";
    96   std::string dernierElementLabel = "";
    97   if (premierElement) {
    98     premierElementLabel = premierElement->getLabel();
    99   }
    100   if (dernierElement) {
    101     dernierElementLabel = dernierElement->getLabel();
    102   }
    103 
    104   WComboBox* lineFromCombo = new WComboBox();
    105   WComboBox* lineToCombo = new WComboBox();
    106   fillComboWithElements(lineFromCombo);
    107   fillComboWithElements(lineToCombo);
    108 
    109   // set selection
    110   lineFromCombo->setCurrentIndex(premierIndex);
    111   lineToCombo->setCurrentIndex(dernierIndex);
    112 
    113   WComboBox* softCombo = new WComboBox();
    114   fillComboWithSoftwares(softCombo);
    115 
    116   GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(sections_.size()),this,UIsector_);
    117 
    118   stringstream st;
    119   st << sections_.size();
    120 
    121   // this is the mean to identify this section!
    122   newSection->setObjectName(st.str());
    123 
    124   // push back on sections vector
    125   sections_.push_back(newSection);
    126   contenuSections_->addWidget(newSection);
    127   updateSections();
    128 }
    129 
    130 void GWt_softwarePanel::updateSections()
    131 {
    132 #if BAVARD > 0
    133   cout << "***********************************" << endl;
    134   cout << " GWt_softwarePanel::updateSections() " << endl<<endl;
    135 #endif
    136 
     119 
    137120  // update all sections in order to manage new/deleted items
    138   for (int a = 0; a < sections_.size(); a++) {
    139     fillComboWithElements(sections_[a]->getFirstElement());
    140     fillComboWithElements(sections_[a]->getLastElement());
    141     sections_[a]->getFirstElement()->setEnabled (true);
    142     sections_[a]->getLastElement()->setEnabled (true);
    143   }
    144  
    145   if (sections_.size() == 0) {
     121  for (int a = 0; a < UIsectionsToExecute_.size(); a++) {
     122    fillComboWithElements(UIsectionsToExecute_[a]->getFirstElement());
     123    fillComboWithElements(UIsectionsToExecute_[a]->getLastElement());
     124    UIsectionsToExecute_[a]->getFirstElement()->setEnabled (true);
     125    UIsectionsToExecute_[a]->getLastElement()->setEnabled (true);
     126  }
     127 
     128  if (UIsectionsToExecute_.size() == 0) {
    146129    return;
    147130  }
    148131 
    149132  // the first element will always be the first element of the beamLine
    150   sections_[0]->getFirstElement()->setCurrentIndex(0);
    151   sections_[0]->getFirstElement()->setEnabled (false);
     133  UIsectionsToExecute_[0]->getFirstElement()->setCurrentIndex(0);
     134  UIsectionsToExecute_[0]->getFirstElement()->setEnabled (false);
    152135
    153136  // the last element will always be the last element of the beamLine
    154   sections_[sections_.size()-1]->getLastElement()->setCurrentIndex(sections_[sections_.size()-1]->getLastElement()->count());
    155   sections_[sections_.size()-1]->getLastElement()->setEnabled(false);
     137  UIsectionsToExecute_[UIsectionsToExecute_.size()-1]->getLastElement()->setCurrentIndex(UIsectionsToExecute_[UIsectionsToExecute_.size()-1]->getLastElement()->count());
     138  UIsectionsToExecute_[UIsectionsToExecute_.size()-1]->getLastElement()->setEnabled(false);
    156139
    157140  // set default values
     
    181164  // FIXME :  A réécrire
    182165  /*
    183   if (sections_.size() > 0) {
    184     sections_[0]->setFirstElementCurrentSelection(premier);
    185   }
    186  
    187   Wt::WString currentString =  sections_[0]->getLastElementCurrentText();
     166  if (UIsectionsToExecute_.size() > 0) {
     167    UIsectionsToExecute_[0]->setFirstElementCurrentSelection(premier);
     168  }
     169 
     170  Wt::WString currentString =  UIsectionsToExecute_[0]->getLastElementCurrentText();
    188171  int current = dtmanage_->getNumeroFromElementLabel(currentString.toUTF8());
    189172 
     
    193176      current = dtmanage_->getBeamLineSize();
    194177      currentString =  dtmanage_->getLabelFromElementNumero(current);
    195       if (sections_.size() > 0) {
    196         sections_[0]->setLastElementCurrentSelection(currentString);
     178      if (UIsectionsToExecute_.size() > 0) {
     179        UIsectionsToExecute_[0]->setLastElementCurrentSelection(currentString);
    197180        //...
    198181      }
     
    202185 
    203186  // traitement des suivantes (on avance d'un cran dans la liste)
    204   for (int a = 1; a< sections_.size(); a++)
     187  for (int a = 1; a< UIsectionsToExecute_.size(); a++)
    205188    {
    206189      // debut
    207190      if ( current > dtmanage_->getBeamLineSize() )
    208191        {
    209           sections_[a]->setErrors("This section element could not be after previous session last element");
     192          UIsectionsToExecute_[a]->setErrors("This section element could not be after previous session last element");
    210193          exec_go_->disable();
    211194          return false;
    212195        }
    213196     
    214       sections_[a]->setFirstElementCurrentSelection(currentString);
     197      UIsectionsToExecute_[a]->setFirstElementCurrentSelection(currentString);
    215198
    216199      // fin
    217       string finString =  sections_[a]->getLastElementCurrentText().toUTF8();
     200      string finString =  UIsectionsToExecute_[a]->getLastElementCurrentText().toUTF8();
    218201     
    219202      int numeroFin = dtmanage_->getNumeroFromElementLabel( finString);
     
    221204      if ( numeroFin < current)
    222205      {
    223         sections_[a]->setErrors("Last section element should be after first section element");
     206        UIsectionsToExecute_[a]->setErrors("Last section element should be after first section element");
    224207        exec_go_->disable();
    225208        return false;
     
    228211      if (numeroFin > dtmanage_->getBeamLineSize())
    229212      {
    230         sections_[a]->setErrors("Last section element number is greater than the beam line size");
     213        UIsectionsToExecute_[a]->setErrors("Last section element number is greater than the beam line size");
    231214        exec_go_->disable();
    232215        return false;
     
    254237}
    255238
    256 bool GWt_softwarePanel::areDataCoherent()
    257 {
    258 // FIXME
    259   cout << "***********************************" << endl;
    260   cout << "**  To be move in controler  **" << endl;
    261   cout << "***********************************" << endl;
    262   return true;
    263 #if BAVARD > 0
    264   cout << "***********************************" << endl;
    265   cout << " GWt_softwarePanel::areDataCoherent() " << endl<<endl;
    266 #endif
    267 
    268   bool caMarche = true;
    269 /*
    270   // initialize dataManager
    271   dtmanage_->initializeExecution();
    272  
    273   // intialize User Interface
    274   if (pspa_->getBeamLine()) {
    275     pspa_->getBeamLine()->initializeSoftwares();
    276   }
    277        
    278   string diagnosticErrors;
    279   string diagnosticWarnings;
    280   for (int a = 0; a < sections_.size(); a++)
    281     {
    282       string debString= sections_[a]->getFirstElementCurrentText().toUTF8();
    283       string finString= sections_[a]->getLastElementCurrentText().toUTF8();
    284       int debut = pspa_->getBeamLine()->getAbstractElementNumeroFromLabel(debString);
    285       int fin = pspa_->getBeamLine()->getAbstractElementNumeroFromLabel(finString);
    286 
    287       string currentSoft= sections_[a]->getSoftwareCurrentText().toUTF8();
    288       nomDeLogiciel prog = nomDeLogiciel(currentSoft);
    289       sectionToExecute* sectToExec = dtmanage_->addSectionToExecute(pspa_->getBeamLine()->getAbstractElement(debut),debut,pspa_->getBeamLine()->getAbstractElement(fin),fin,prog);
    290 
    291       abstractSoftware* softToExec = sectToExec->getSoftware();
    292       diagnosticErrors = "";
    293       diagnosticWarnings = "";
    294       for(int i = debut-1; i < fin; i++) // check sections
    295         {
    296           if (!pspa_->getBeamLine()) continue;
    297           abstractElement* elPtr= pspa_->getBeamLine()->getAbstractElement(i);   
    298           if (!elPtr) continue;
    299 
    300           trivaluedBool tb = softToExec->doAcceptElement(elPtr->getNomdElement().getElementType());
    301           cout << " GWt_softwarePanel::areDataCoherent() el " << elPtr->getLabel() << " tb= " << tb << endl;
    302           if (tb  == TBoolOk ) {
    303             elPtr->setSoftware(softToExec);
    304           } else {
    305             elPtr->setSoftware(NULL);
    306             if (tb == TBoolIgnore) {
    307               if(prog.getString() != "unknownSoftware") diagnosticWarnings += elPtr->getLabel() + " will be ignored by  "+ prog.getString() + "<br /> ";           
    308             } else {
    309               // j'insiste pour remettre le nom generique de l'element refuse (glm / 30/03/2013)
    310               diagnosticErrors += elPtr->getNomdElement().getExpandedName() + " is not allowed with " + prog.getString() + "<br /> ";
    311               caMarche = false;
    312             }
    313           }
    314           pspa_->getBeamLine()->update(i);
    315         } //i
    316      
    317       // set errors and warnings
    318       sections_[a]->setErrors(diagnosticErrors);
    319       sections_[a]->setWarnings(diagnosticWarnings);
    320     }//a
    321     */
    322   return caMarche;
    323 }
    324 
    325 void GWt_softwarePanel::deleteSectionToExecuteW(int sectionLabel)
     239
     240void GWt_softwarePanel::addSectionToExecute() {
     241  // We put the last element of the previous sectionToExecute inside
     242 
     243  // Get the last element from previous section
     244  if (!UIsector_->getSectorControler()) {
     245    return;
     246  }
     247  unsigned int s = UIsector_->getSectorControler()->getSectionsToExecute().size();
     248  if (s > 0) {
     249    abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->getLastElement();
     250    UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs));
     251    UIsector_->getSectorControler()->getSectionsToExecute()[s]->removeLastElement();
     252  }
     253
     254 
     255  displayFromControler();
     256}
     257
     258
     259void GWt_softwarePanel::deleteSectionToExecute(int sectionLabel)
    326260{
    327261#if BAVARD > 0
     
    335269 
    336270  if ( dtmanage_->getJobListSize() == 0 ) return;
    337   for (unsigned int sectionIndex = 0; sectionIndex< sections_.size(); sectionIndex++) {
    338     if (sections_[sectionIndex]->objectName() == sectionName) {
     271  for (unsigned int sectionIndex = 0; sectionIndex< UIsectionsToExecute_.size(); sectionIndex++) {
     272    if (UIsectionsToExecute_[sectionIndex]->objectName() == sectionName) {
    339273
    340274      // delete from dataManager
     
    342276
    343277      // delete from User Interface
    344       contenuSections_->removeWidget(sections_[sectionIndex]);
    345       delete sections_[sectionIndex];
    346       sections_.erase (sections_.begin()+sectionIndex);
     278      contenuSections_->removeWidget(UIsectionsToExecute_[sectionIndex]);
     279      delete UIsectionsToExecute_[sectionIndex];
     280      UIsectionsToExecute_.erase (UIsectionsToExecute_.begin()+sectionIndex);
    347281    }
    348282  } 
    349 }
    350 
    351 void GWt_softwarePanel::executer()
    352 {
    353   cout << "***********************************" << endl;
    354   cout << " GWt_softwarePanel::executer() " << endl<<endl;
    355 
    356   if (!areDataCoherent()) {
    357     return;
    358   } 
    359  
    360   //static_cast<GWt_globalParameters*>(pspa_->getGlobalParam())->updateGlobals();
    361  
    362   GWt_dialog calculDialog("Calcul en cours", "Veuillez patienter...", GWt_dialog::Wait, true,false);
    363   calculDialog.show();
    364    
    365   wApp->processEvents();
    366  
    367   if (!dtmanage_->executeAll()) {
    368     GWt_dialog warningDialog("PSPA : Echec", " echec lors de l'exécution !", GWt_dialog::Error, true,true);
    369     warningDialog.exec();
    370   }
    371      
    372   //  exec_go_->setDisabled(true);
    373   calculDialog.hide(); 
    374   UIsector_->getAccelerator()->faireDessin();
    375 }
     283  displayFromControler();
     284}
     285
    376286
    377287void GWt_softwarePanel::fillComboWithElements(Wt::WComboBox* cBox)
    378288{
    379   // FIXME
    380   cout << "***********************************" << endl;
    381   cout << "**  To be move in controler  **" << endl;
    382   cout << "***********************************" << endl;
    383   return;
    384 
    385 /*  if (cBox == NULL) return;
     289
     290  if (cBox == NULL) return;
    386291
    387292  // get the last item selected
     
    389294  cBox->clear();
    390295
    391   for(int a = 0; a < pspa_->getBeamLine()->getBeamLineSize(); a++) {
    392     abstractElement* abs = pspa_->getBeamLine()->getAbstractElement(a);
    393     if (abs != NULL) {
    394       cBox->addItem(abs->getLabel());
     296  if (!UIsector_->getSectorControler()) {
     297    return;
     298  }
     299  for (unsigned int a=0; a < UIsector_->getSectorControler()->getSectionsToExecute().size(); a++) {
     300    for(unsigned int b=0; b < UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size(); b++) {
     301     
     302      abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements()[b];
     303      if (abs != NULL) {
     304        cBox->addItem(abs->getLabel());
     305      }
    395306    }
    396307  }
     
    402313  }
    403314  cBox->refresh();
    404 */
    405315}
    406316
     
    432342  // preparation du bouton add
    433343  WPushButton* exec_add = new WPushButton("+");
    434   exec_add->clicked().connect(this, &GWt_softwarePanel::addSectionToExecuteW);
     344  exec_add->clicked().connect(this, &GWt_softwarePanel::addSectionToExecute);
    435345  exec_add->setStyleClass("roundButton");
    436346  exec_add->setMaximumSize(20,20);
     
    441351  //  warningsContainer_->setStyleClass("warningsContainer");
    442352
    443   exec_delete->clicked().connect(boost::bind(&GWt_softwarePanel::deleteSectionToExecuteW, this, sectionNumber));
     353  exec_delete->clicked().connect(boost::bind(&GWt_softwarePanel::deleteSectionToExecute, this, sectionNumber));
    444354  exec_delete->setStyleClass("roundButton");
    445355  exec_delete->setMaximumSize(20,20);
Note: See TracChangeset for help on using the changeset viewer.