Changeset 427 in PSPA for Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
- Timestamp:
- Oct 25, 2013, 3:51:05 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
r419 r427 19 19 #include "GWt_globalParameters.h" 20 20 #include "GWt_sectionToExecute.h" 21 21 #include "GWt_pspaApplication.h" 22 22 23 23 GWt_softwarePanel::GWt_softwarePanel(dataManager* dataManager,PspaApplication* pspa) … … 29 29 // bouton execute 30 30 exec_go_ = new WPushButton("execute!"); 31 // exec_go_->setMinimumSize(300,300);32 // exec_go_->setDisabled(true);33 31 exec_go_->clicked().connect(this, &GWt_softwarePanel::executer); 34 35 36 // preparation du bouton push_ok 37 // WPushButton* exec_ok = new WPushButton("ok"); 38 // exec_ok->clicked().connect(this, &GWt_softwarePanel::updateSectionSelection); 39 32 40 33 // le panel 41 34 WPanel *panelLogiciels = new WPanel(this); … … 43 36 44 37 contenuSections_ = new WContainerWidget(); 45 // contenuSections_->addWidget(exec_ok);46 38 contenuSections_->addWidget(exec_go_); 47 39 contenuSections_->addWidget(new WBreak()); … … 56 48 57 49 void GWt_softwarePanel::addSectionToExecuteW() 58 { 59 50 { 60 51 abstractElement* premierElement; 61 52 abstractElement* dernierElement; … … 63 54 int premierIndex = 0; 64 55 int dernierIndex = 0; 65 66 56 57 // if there is no section 67 58 if(sections_.size() == 0) { 68 69 70 71 // if this is not the first :72 // - first element will be the last of the previous section73 // (or the same if it is the last of the beam line)74 // - lastElement will be the last of the beam line75 // - software will be the first of the list76 59 premierElement = pspa_->getBeamLine()->getAbstractElement(0); 60 premierIndex = 0; 61 62 // if this is not the first : 63 // - first element will be the last of the previous section 64 // (or the same if it is the last of the beam line) 65 // - lastElement will be the last of the beam line 66 // - software will be the first of the list 67 77 68 } else { 78 69 dernierElement = pspa_->getBeamLine()->getAbstractElement(pspa_->getBeamLine()->getBeamLineSize()-1); 79 70 dernierIndex = pspa_->getBeamLine()->getBeamLineSize()-1; 80 71 81 72 premierElement = dernierElement; 82 73 premierIndex = dernierIndex; 83 84 /* int indexOfLastElementOfLastSection = dtmanage_->getJobListAt(dtmanage_->getJobListSize()-1)->getLastElementNumberInSection();85 86 87 // if there are still elements at the end88 if (pspa_->getBeamLine()->getAbstractElement(indexOfLastElementOfLastSection+1) != NULL ) {89 premierIndex = indexOfLastElementOfLastSection+1;90 premierElement = pspa_->getBeamLine()->getAbstractElement(indexOfLastElementOfLastSection+1);91 92 // if this is the last element93 } else {94 premierIndex = indexOfLastElementOfLastSection;95 premierElement = pspa_->getBeamLine()->getAbstractElement(indexOfLastElementOfLastSection);96 97 }98 */99 74 } 100 75 … … 102 77 dernierIndex = pspa_->getBeamLine()->getBeamLineSize()-1; 103 78 // cout << "PspaApplication::addSectionToExecute() : " << premierText << " ââ " << dernierText << endl; 104 105 79 106 80 // abstractSoftware* soft = NULL; … … 140 114 // push back on sections vector 141 115 sections_.push_back(newSection); 142 143 116 contenuSections_->addWidget(newSection); 144 145 117 updateSections(); 146 118 } 147 148 149 // void GWt_softwarePanel::disableSectionExecute()150 // {151 // exec_go_->setDisabled(true);152 // }153 154 155 // void GWt_softwarePanel::checkSectionSelection()156 // {157 // if ( selectedSections_.empty() ) return;158 159 // // traitement de la premiere ligne160 // // on impose le depart du calcul au premier element161 // string premier = dtmanage_->getLabelFromElementNumero(1);162 // (*selectedSections_.begin())->debut->setText(premier);163 164 // string currentString = (*selectedSections_.begin())->fin->text().toUTF8();165 // int current = dtmanage_->getNumeroFromElementLabel(currentString);166 167 // // si la fin est mal definie on prend toute la config par defaut168 // if ( current <= 0 || current > dtmanage_->getBeamLineSize() )169 // {170 // current = dtmanage_->getBeamLineSize();171 // currentString = dtmanage_->getLabelFromElementNumero(current);172 // (*selectedSections_.begin())->fin->setText(currentString);173 // }174 // current++;175 // currentString = dtmanage_->getLabelFromElementNumero(current);176 177 // // traitement des suivantes (on avance d'un cran dans la liste)178 // list<GWt_sectionToExecute*>::iterator itr, itr0;179 // itr0 = selectedSections_.begin();180 // itr0++;181 // for (itr = itr0; itr != selectedSections_.end(); itr++)182 // {183 // // debut184 // if ( current > dtmanage_->getBeamLineSize() )185 // {186 // GWt_dialog warningDialog("PSPA :: verification des sections", " bad section definition !", GWt_dialog::Error,true,true);187 // warningDialog.exec();188 // return;189 // }190 191 // (*itr)->debut->setText(currentString);192 // // fin193 // string finString = (*itr)->fin->text().toUTF8();194 195 // int numeroFin = dtmanage_->getNumeroFromElementLabel( finString);196 197 // if ( numeroFin < current || numeroFin > dtmanage_->getBeamLineSize())198 // {199 // GWt_dialog warningDialog("PSPA : Checking of sections", " bad section definition !", GWt_dialog::Error, true,true);200 // warningDialog.exec();201 // return;202 // }203 204 // // preparation de la ligne suivante205 // current = numeroFin +1;206 // currentString = dtmanage_->getLabelFromElementNumero(current);207 // }208 209 // if (!areDataCoherent()) {210 // GWt_dialog warningDialog("PSPA : verification des sections", " donnees incoherentes !", GWt_dialog::Error,true,true);211 // warningDialog.exec();212 // }213 // else214 // {215 // exec_go_->setDisabled(false);216 217 // // All ok, then put colors on beamLine218 // list<GWt_sectionToExecute*>::iterator itr2;219 // for(itr2 = selectedSections_.begin();itr2 != selectedSections_.end(); itr2++)220 // {221 // string debString = (*itr2)->debut->text().toUTF8();222 // string finString = (*itr2)->fin->text().toUTF8();223 224 225 // int debut = dtmanage_->getNumeroFromElementLabel(debString);226 // int fin = dtmanage_->getNumeroFromElementLabel(finString);227 // /**228 // for (int i=debut; i=<fin; i++) {229 // getBeamLine()->getAbstractElement(i)->setBGColor(230 231 // }232 // nomDeLogiciel prog = nomDeLogiciel ( (*itr)->selection->currentIndex() );233 // dtmanage_->addSectionToExecute(debut,fin,prog);234 // */235 // }236 // }237 238 239 // }240 119 241 120 bool GWt_softwarePanel::updateSectionSelection() … … 435 314 } 436 315 437 438 439 /*440 string GWt_softwarePanel::getSelection()441 {442 list<GWt_sectionToExecute*>::iterator itr = selectedSections_.begin();443 string str = (*itr)->fin->text().toUTF8();444 return str;445 }446 */447 448 316 void GWt_softwarePanel::executer() 449 317 { 450 318 451 319 if (!areDataCoherent()) { 452 // GWt_dialog warningDialog("PSPA : verification des sections", " donnees incoherentes !", GWt_dialog::Error,true,true);453 // warningDialog.exec();454 // exec_go_->setDisabled(true);455 320 return; 456 } 457 458 // GWt_console* console = NULL; 459 // if (static_cast<GWt_console*> (wApp->findWidget ("console"))) { 460 // console = static_cast<GWt_console*> (wApp->findWidget ("console")); 461 // console->addConsoleMessage(string("on va peut etre y arriver")); 462 // } 321 } 463 322 464 323 static_cast<GWt_globalParameters*>(pspa_->getGlobalParam())->updateGlobals();
Note: See TracChangeset
for help on using the changeset viewer.