Changeset 358 in PSPA


Ignore:
Timestamp:
Mar 4, 2013, 5:57:49 PM (11 years ago)
Author:
lemeur
Message:

transfert de la verif depuis check/ok vers execute

Location:
Interface_Web/trunk/pspaWT/sources/userInterface
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h

    r302 r358  
    3939    private :
    4040    void disableSectionExecute();
    41     void checkSectionSelection();
     41    //    void checkSectionSelection();
     42    void updateSectionSelection();
    4243    void deleteSectionToExecuteW();
    4344    string getSelection();
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r351 r358  
    4343   
    4444  // preparation du bouton push_ok
    45   WPushButton* exec_ok = new WPushButton("check/ok");
    46   exec_ok->clicked().connect(this, &GWt_softwarePanel::checkSectionSelection);
     45  WPushButton* exec_ok = new WPushButton("ok");
     46  exec_ok->clicked().connect(this, &GWt_softwarePanel::updateSectionSelection);
    4747 
    4848  // le panel
     
    119119
    120120
    121 void GWt_softwarePanel::checkSectionSelection()
     121// void GWt_softwarePanel::checkSectionSelection()
     122// {
     123//   if ( selectedSections_.empty() ) return;
     124 
     125//   // traitement de la premiere ligne
     126//   // on impose le depart du calcul au premier element
     127//   string premier = dtmanage_->getLabelFromElementNumero(1);
     128//   (*selectedSections_.begin())->debut->setText(premier);
     129 
     130//   string currentString =  (*selectedSections_.begin())->fin->text().toUTF8();
     131//   int current = dtmanage_->getNumeroFromElementLabel(currentString);
     132   
     133//   // si la fin est mal definie on prend toute la config par defaut
     134//   if ( current <= 0 || current > dtmanage_->getBeamLineSize() )
     135//     {
     136//       current = dtmanage_->getBeamLineSize();
     137//       currentString =  dtmanage_->getLabelFromElementNumero(current);
     138//       (*selectedSections_.begin())->fin->setText(currentString);
     139//     }
     140//   current++;
     141//   currentString = dtmanage_->getLabelFromElementNumero(current);
     142 
     143//   // traitement des suivantes (on avance d'un cran dans la liste)
     144//   list<GWt_sectionToExecute*>::iterator itr, itr0;
     145//   itr0 = selectedSections_.begin();
     146//   itr0++;
     147//   for (itr = itr0; itr != selectedSections_.end(); itr++)
     148//     {
     149//       // debut
     150//       if ( current > dtmanage_->getBeamLineSize() )
     151//         {
     152//        GWt_dialog warningDialog("PSPA :: verification des sections", " bad section definition !", GWt_dialog::Error,true,true);
     153//        warningDialog.exec();
     154//        return;
     155//         }
     156     
     157//       (*itr)->debut->setText(currentString);
     158//       // fin
     159//       string finString =  (*itr)->fin->text().toUTF8();
     160     
     161//       int numeroFin = dtmanage_->getNumeroFromElementLabel( finString);
     162     
     163//       if ( numeroFin < current || numeroFin > dtmanage_->getBeamLineSize())
     164//         {
     165//        GWt_dialog warningDialog("PSPA : Checking of sections", " bad section definition !", GWt_dialog::Error, true,true);
     166//        warningDialog.exec();
     167//        return;
     168//         }
     169     
     170//       // preparation de la ligne suivante
     171//       current = numeroFin +1;
     172//       currentString = dtmanage_->getLabelFromElementNumero(current);
     173//     }
     174 
     175//   if (!areDataCoherent()) {
     176//     GWt_dialog warningDialog("PSPA : verification des sections", " donnees incoherentes !", GWt_dialog::Error,true,true);
     177//     warningDialog.exec();
     178//   }
     179//   else
     180//     {
     181//       exec_go_->setDisabled(false);
     182       
     183//         // All ok, then put colors on beamLine
     184//         list<GWt_sectionToExecute*>::iterator itr2;
     185//         for(itr2 = selectedSections_.begin();itr2 != selectedSections_.end(); itr2++)
     186//         {
     187//             string debString = (*itr2)->debut->text().toUTF8();
     188//             string finString = (*itr2)->fin->text().toUTF8();
     189           
     190           
     191//             int debut = dtmanage_->getNumeroFromElementLabel(debString);
     192//             int fin = dtmanage_->getNumeroFromElementLabel(finString);
     193// /**
     194//  for (int i=debut; i=<fin; i++) {
     195//                 getBeamLine()->getAbstractElement(i)->setBGColor(
     196               
     197//             }
     198//             nomDeLogiciel prog = nomDeLogiciel ( (*itr)->selection->currentIndex() );
     199//             dtmanage_->addSectionToExecute(debut,fin,prog);
     200// */
     201//         }
     202//     }
     203   
     204
     205// }
     206
     207void GWt_softwarePanel::updateSectionSelection()
    122208{
    123209  if ( selectedSections_.empty() ) return;
     
    172258      currentString = dtmanage_->getLabelFromElementNumero(current);
    173259    }
    174  
    175   if (!areDataCoherent()) {
    176     GWt_dialog warningDialog("PSPA : verification des sections", " donnees incoherentes !", GWt_dialog::Error,true,true);
    177     warningDialog.exec();
    178   }
    179   else
    180     {
    181       exec_go_->setDisabled(false);
     260  exec_go_->setDisabled(false);
     261
    182262       
    183263        // All ok, then put colors on beamLine
     
    200280*/
    201281        }
    202     }
    203    
    204 
    205282}
    206283
     
    273350void GWt_softwarePanel::executer()
    274351{
     352    if (!areDataCoherent()) {
     353      //    GWt_dialog warningDialog("PSPA : verification des sections", " donnees incoherentes !", GWt_dialog::Error,true,true);
     354      //    warningDialog.exec();
     355    exec_go_->setDisabled(true);
     356    return;
     357    }
     358
    275359  GWt_console* console = NULL;
    276360  if (static_cast<GWt_console*> (wApp->findWidget ("console"))) {
Note: See TracChangeset for help on using the changeset viewer.