Ignore:
Timestamp:
Mar 4, 2013, 6:08:02 PM (11 years ago)
Author:
garnier
Message:

Changement de la couleur des sections selectionnes + plein dautres choses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r358 r359  
    1 //
    21//  GWt_softwarePanel.cpp
    32//  PSPA
     
    260259  exec_go_->setDisabled(false);
    261260
     261}
     262
     263
     264bool GWt_softwarePanel::areDataCoherent()
     265{
     266    bool caMarche = true;
     267    dtmanage_->initializeExecution();
     268    string diagnostic;
     269   
     270    list<GWt_sectionToExecute*>::iterator itr;
     271    for(itr = selectedSections_.begin(); itr != selectedSections_.end(); itr++)
     272    {
     273        string debString = (*itr)->debut->text().toUTF8();
     274        string finString = (*itr)->fin->text().toUTF8();
    262275       
    263         // All ok, then put colors on beamLine
    264         list<GWt_sectionToExecute*>::iterator itr2;
    265         for(itr2 = selectedSections_.begin();itr2 != selectedSections_.end(); itr2++)
    266         {
    267             string debString = (*itr2)->debut->text().toUTF8();
    268             string finString = (*itr2)->fin->text().toUTF8();
    269            
    270            
    271             int debut = dtmanage_->getNumeroFromElementLabel(debString);
    272             int fin = dtmanage_->getNumeroFromElementLabel(finString);
    273 /**
    274  for (int i=debut; i=<fin; i++) {
    275                 getBeamLine()->getAbstractElement(i)->setBGColor(
    276                
     276        int debut = dtmanage_->getNumeroFromElementLabel(debString);
     277        int fin = dtmanage_->getNumeroFromElementLabel(finString);
     278        nomDeLogiciel prog = nomDeLogiciel ( (*itr)->selection->currentIndex() );
     279        dtmanage_->addSectionToExecute(debut,fin,prog);
     280       
     281        // check sections
     282        for (int i=debut-1; i<fin; i++) {
     283            if (pspa_->getBeamLine()) {
     284                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()+" ";
     287                        caMarche = false;
     288                    } else {
     289                        pspa_->getBeamLine()->update(i);
     290                    }
     291                }
    277292            }
    278             nomDeLogiciel prog = nomDeLogiciel ( (*itr)->selection->currentIndex() );
    279             dtmanage_->addSectionToExecute(debut,fin,prog);
     293        }
     294    }
     295   
     296//    trivaluedBool essai = dtmanage_->checkExecute(diagnostic);
     297
     298    if ( caMarche == false ) {
     299        GWt_dialog calculDialog("PSPA check execute : ERROR", diagnostic , GWt_dialog::Error,true,true);
     300        calculDialog.exec();
     301/*
     302 } else if ( essai == warning )  {
     303        GWt_dialog calculDialog("PSPA check execute : warning ", diagnostic , GWt_dialog::Warning, false,true);
     304        calculDialog.exec();
    280305*/
    281         }
    282 }
    283 
    284 
    285 bool GWt_softwarePanel::areDataCoherent()
    286 {
    287   bool caMarche = true;
    288   dtmanage_->initializeExecution();
    289  
    290   list<GWt_sectionToExecute*>::iterator itr;
    291   for(itr = selectedSections_.begin(); itr != selectedSections_.end(); itr++)
    292     {
    293       string debString = (*itr)->debut->text().toUTF8();
    294       string finString = (*itr)->fin->text().toUTF8();
    295        
    296       int debut = dtmanage_->getNumeroFromElementLabel(debString);
    297       int fin = dtmanage_->getNumeroFromElementLabel(finString);
    298       nomDeLogiciel prog = nomDeLogiciel ( (*itr)->selection->currentIndex() );
    299       dtmanage_->addSectionToExecute(debut,fin,prog);
    300     }
    301  
    302   string diagnostic;
    303   trivaluedBool essai = dtmanage_->checkExecute(diagnostic);
    304   if ( essai == error ) {
    305     caMarche = false;
    306     GWt_dialog calculDialog("PSPA check execute : ERROR", diagnostic , GWt_dialog::Error,true,true);
    307     calculDialog.exec();
    308   } else if ( essai == warning )  {
    309     caMarche = true;
    310     GWt_dialog calculDialog("PSPA check execute : warning ", diagnostic , GWt_dialog::Warning, false,true);
    311     calculDialog.exec();
    312   }
    313  
    314   return caMarche;
     306    }
     307   
     308    return caMarche;
    315309}
    316310
Note: See TracChangeset for help on using the changeset viewer.