Changeset 367 in PSPA for Interface_Web


Ignore:
Timestamp:
Mar 5, 2013, 9:32:52 PM (11 years ago)
Author:
lemeur
Message:

suppression bouton ok ; retablissement warning elements ignores

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

Legend:

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

    r358 r367  
    3838   
    3939    private :
    40     void disableSectionExecute();
     40    //    void disableSectionExecute();
    4141    //    void checkSectionSelection();
    42     void updateSectionSelection();
     42    bool updateSectionSelection();
    4343    void deleteSectionToExecuteW();
    4444    string getSelection();
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc

    r366 r367  
    281281
    282282  choixHistoDessin_ = new WComboBox();
    283   Wt::WRadioButton *button3= new WRadioButton(" histogram of");
     283  Wt::WRadioButton *button3= new WRadioButton(" histogram after element ");
    284284  group_->addButton(button3,3);
    285285
    286286  glayout->addWidget(button3,3,1);
    287   glayout->addWidget(choixVariableHisto_,3,2);
    288   glayout->addWidget(new WText("after element"),3,3);
    289   glayout->addWidget(choixHistoDessin_,3,4);
     287  glayout->addWidget(choixHistoDessin_,3,2);
     288  //  glayout->addWidget(new WText(" of "),3,3);
     289  glayout->addWidget(choixVariableHisto_,3,3);
    290290  /////////////////////////////////////////////////////////////////////
    291291 
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r359 r367  
    3030  exec_go_ = new WPushButton("execute!");
    3131  //    exec_go_->setMinimumSize(300,300);
    32   exec_go_->setDisabled(true);
     32  //  exec_go_->setDisabled(true);
    3333  exec_go_->clicked().connect(this, &GWt_softwarePanel::executer);
    3434 
     
    4242   
    4343  // preparation du bouton push_ok
    44   WPushButton* exec_ok = new WPushButton("ok");
    45   exec_ok->clicked().connect(this, &GWt_softwarePanel::updateSectionSelection);
     44  //  WPushButton* exec_ok = new WPushButton("ok");
     45  //  exec_ok->clicked().connect(this, &GWt_softwarePanel::updateSectionSelection);
    4646 
    4747  // le panel
     
    5252  contenuSections_->addWidget(exec_add);
    5353  contenuSections_->addWidget(exec_delete);
    54   contenuSections_->addWidget(exec_ok);
     54  //  contenuSections_->addWidget(exec_ok);
    5555  contenuSections_->addWidget(exec_go_);
    5656  contenuSections_->addWidget(new WBreak());
     
    6666void GWt_softwarePanel::addSectionToExecuteW()
    6767{   
    68   disableSectionExecute();
     68  //  disableSectionExecute();
    6969 
    7070  string premierText, dernierText;
     
    9393  selectedSections_.back()->debut->setText(premierText);
    9494  selectedSections_.back()->fin = new WLineEdit();
    95   selectedSections_.back()->fin->changed().connect(this,&GWt_softwarePanel::disableSectionExecute);
     95  //  selectedSections_.back()->fin->changed().connect(this,&GWt_softwarePanel::disableSectionExecute);
    9696  selectedSections_.back()->fin->setText(dernierText);
    9797  selectedSections_.back()->selection = new WComboBox();
     
    112112
    113113
    114 void GWt_softwarePanel::disableSectionExecute()
    115 {
    116   exec_go_->setDisabled(true);
    117 }
     114// void GWt_softwarePanel::disableSectionExecute()
     115// {
     116//   exec_go_->setDisabled(true);
     117// }
    118118
    119119
     
    204204// }
    205205
    206 void GWt_softwarePanel::updateSectionSelection()
    207 {
    208   if ( selectedSections_.empty() ) return;
     206bool GWt_softwarePanel::updateSectionSelection()
     207{
     208  if ( selectedSections_.empty() ) return false;
    209209 
    210210  // traitement de la premiere ligne
     
    237237          GWt_dialog warningDialog("PSPA :: verification des sections", " bad section definition !", GWt_dialog::Error,true,true);
    238238          warningDialog.exec();
    239           return;
     239          return false;
    240240        }
    241241     
     
    250250          GWt_dialog warningDialog("PSPA : Checking of sections", " bad section definition !", GWt_dialog::Error, true,true);
    251251          warningDialog.exec();
    252           return;
     252          return false;
    253253        }
    254254     
     
    257257      currentString = dtmanage_->getLabelFromElementNumero(current);
    258258    }
    259   exec_go_->setDisabled(false);
    260 
     259  //  exec_go_->setDisabled(false);
     260  return true;
    261261}
    262262
     
    265265{
    266266    bool caMarche = true;
     267    trivaluedBool tbResume = TBoolOk;
    267268    dtmanage_->initializeExecution();
    268269    string diagnostic;
     
    283284            if (pspa_->getBeamLine()) {
    284285                if (pspa_->getBeamLine()->getAbstractElement(i)) {
    285                     if (!pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(prog.getString())) {
    286                         diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getLabel()+ "could not be associate with "+ prog.getString()+" ";
     286                  trivaluedBool tb = pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(prog.getString());
     287                    if (tb  == TBoolError ) {
     288                      diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " is not allowed with "+ prog.getString()+"\n ";
    287289                        caMarche = false;
     290                        tbResume = tb;
     291                    } else if ( tb == TBoolIgnore ) {
     292                      diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " will be ignored by  "+ prog.getString()+"\n ";
     293                      if ( tbResume != TBoolError ) tbResume = tb;
    288294                    } else {
    289295                        pspa_->getBeamLine()->update(i);
     
    294300    }
    295301   
    296 //    trivaluedBool essai = dtmanage_->checkExecute(diagnostic);
    297 
    298     if ( caMarche == false ) {
     302    if ( tbResume == TBoolError ) {
    299303        GWt_dialog calculDialog("PSPA check execute : ERROR", diagnostic , GWt_dialog::Error,true,true);
    300304        calculDialog.exec();
     305    } else if (tbResume == TBoolIgnore ) {
     306        GWt_dialog calculDialog("PSPA check execute : WARNING", diagnostic , GWt_dialog::Warning,false,true);
     307        calculDialog.exec();
     308    }
    301309/*
    302310 } else if ( essai == warning )  {
     
    304312        calculDialog.exec();
    305313*/
    306     }
     314   
    307315   
    308316    return caMarche;
     
    312320{
    313321  if ( selectedSections_.empty() ) return;
    314   disableSectionExecute();
     322  //  disableSectionExecute();
    315323  selectedSections_.back()->ligneDeWidget->clear();
    316324  delete selectedSections_.back()->ligneDeWidget;
     
    344352void GWt_softwarePanel::executer()
    345353{
     354
     355  if ( !updateSectionSelection() ) return;
     356
     357
    346358    if (!areDataCoherent()) {
    347359      //    GWt_dialog warningDialog("PSPA : verification des sections", " donnees incoherentes !", GWt_dialog::Error,true,true);
    348360      //    warningDialog.exec();
    349     exec_go_->setDisabled(true);
     361      //    exec_go_->setDisabled(true);
    350362    return;
    351363    }
     
    369381  }
    370382     
    371   exec_go_->setDisabled(true);
     383  //  exec_go_->setDisabled(true);
    372384  calculDialog.hide(); 
    373385  pspa_->faireDessin();
Note: See TracChangeset for help on using the changeset viewer.