Changeset 471 in PSPA for Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
- Timestamp:
- Dec 19, 2013, 4:46:02 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
r469 r471 63 63 // FIXME : Add a message to tell the user to add first an element 64 64 } else { 65 66 unsigned long firstSectionToExecuteIndex = 0; 65 67 for (unsigned int a=0; a<UIsector_->getSectorControler()->getSectionsToExecute().size(); a++) { 66 68 abstractElement* premierElement = NULL; … … 82 84 83 85 // set to first 84 lineFromCombo->setCurrentIndex( 0);86 lineFromCombo->setCurrentIndex(firstSectionToExecuteIndex); 85 87 // set to last 86 lineToCombo->setCurrentIndex( lineToCombo->count());88 lineToCombo->setCurrentIndex(firstSectionToExecuteIndex + UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size() - 1); 87 89 88 90 WComboBox* softCombo = new WComboBox(); … … 108 110 GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(a),UIsector_->getSectorControler()->getSectionsToExecute()[a],UIsector_); 109 111 110 // FIXME ?112 /* // FIXME ? 111 113 stringstream st; 112 st << UIsectionsToExecute_ .size();114 st << UIsectionsToExecute_deprecated_.size(); 113 115 114 116 // this is the mean to identify this section! … … 116 118 117 119 // push back on sections vector 118 UIsectionsToExecute_.push_back(newSection); 120 UIsectionsToExecute_deprecated_.push_back(newSection); 121 */ 119 122 contenuSections_->addWidget(newSection); 120 123 // updateSections(); 121 124 122 125 firstSectionToExecuteIndex += UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size(); 123 126 } 124 127 } … … 134 137 /* 135 138 // update all sections in order to manage new/deleted items 136 for (int a = 0; a < UIsectionsToExecute_ .size(); a++) {137 fillComboWithElements(UIsectionsToExecute_ [a]->getFirstElement());138 fillComboWithElements(UIsectionsToExecute_ [a]->getLastElement());139 UIsectionsToExecute_ [a]->getFirstElement()->setEnabled (true);140 UIsectionsToExecute_ [a]->getLastElement()->setEnabled (true);141 } 142 143 if (UIsectionsToExecute_ .size() == 0) {139 for (int a = 0; a < UIsectionsToExecute_deprecated_.size(); a++) { 140 fillComboWithElements(UIsectionsToExecute_deprecated_[a]->getFirstElement()); 141 fillComboWithElements(UIsectionsToExecute_deprecated_[a]->getLastElement()); 142 UIsectionsToExecute_deprecated_[a]->getFirstElement()->setEnabled (true); 143 UIsectionsToExecute_deprecated_[a]->getLastElement()->setEnabled (true); 144 } 145 146 if (UIsectionsToExecute_deprecated_;.size() == 0) { 144 147 return; 145 148 } 146 149 147 150 // the first element will always be the first element of the beamLine 148 UIsectionsToExecute_ [0]->getFirstElement()->setCurrentIndex(0);149 UIsectionsToExecute_ [0]->getFirstElement()->setEnabled (false);151 UIsectionsToExecute_deprecated_[0]->getFirstElement()->setCurrentIndex(0); 152 UIsectionsToExecute_deprecated_[0]->getFirstElement()->setEnabled (false); 150 153 151 154 // the last element will always be the last element of the beamLine 152 UIsectionsToExecute_ [UIsectionsToExecute_.size()-1]->getLastElement()->setCurrentIndex(UIsectionsToExecute_[UIsectionsToExecute_.size()-1]->getLastElement()->count());153 UIsectionsToExecute_ [UIsectionsToExecute_.size()-1]->getLastElement()->setEnabled(false);155 UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_.size()-1]->getLastElement()->setCurrentIndex(UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_;.size()-1]->getLastElement()->count()); 156 UIsectionsToExecute_deprecated_[UIsectionsToExecute_deprecated_.size()-1]->getLastElement()->setEnabled(false); 154 157 155 158 // set default values … … 180 183 // FIXME : A réécrire 181 184 /* 182 if (UIsectionsToExecute_ .size() > 0) {183 UIsectionsToExecute_ [0]->setFirstElementCurrentSelection(premier);184 } 185 186 Wt::WString currentString = UIsectionsToExecute_ [0]->getLastElementCurrentText();185 if (UIsectionsToExecute_deprecated_.size() > 0) { 186 UIsectionsToExecute_deprecated_[0]->setFirstElementCurrentSelection(premier); 187 } 188 189 Wt::WString currentString = UIsectionsToExecute_deprecated_[0]->getLastElementCurrentText(); 187 190 int current = dtmanage_->getNumeroFromElementLabel(currentString.toUTF8()); 188 191 … … 192 195 current = dtmanage_->getBeamLineSize(); 193 196 currentString = dtmanage_->getLabelFromElementNumero(current); 194 if (UIsectionsToExecute_ .size() > 0) {195 UIsectionsToExecute_ [0]->setLastElementCurrentSelection(currentString);197 if (UIsectionsToExecute_deprecated_.size() > 0) { 198 UIsectionsToExecute_deprecated_[0]->setLastElementCurrentSelection(currentString); 196 199 //... 197 200 } … … 201 204 202 205 // traitement des suivantes (on avance d'un cran dans la liste) 203 for (int a = 1; a< UIsectionsToExecute_ .size(); a++)206 for (int a = 1; a< UIsectionsToExecute_deprecated_;.size(); a++) 204 207 { 205 208 // debut 206 209 if ( current > dtmanage_->getBeamLineSize() ) 207 210 { 208 UIsectionsToExecute_ [a]->setErrors("This section element could not be after previous session last element");211 UIsectionsToExecute_deprecated_;[a]->setErrors("This section element could not be after previous session last element"); 209 212 exec_go_->disable(); 210 213 return false; 211 214 } 212 215 213 UIsectionsToExecute_ [a]->setFirstElementCurrentSelection(currentString);216 UIsectionsToExecute_deprecated_;[a]->setFirstElementCurrentSelection(currentString); 214 217 215 218 // fin 216 string finString = UIsectionsToExecute_ [a]->getLastElementCurrentText().toUTF8();219 string finString = UIsectionsToExecute_deprecated_;[a]->getLastElementCurrentText().toUTF8(); 217 220 218 221 int numeroFin = dtmanage_->getNumeroFromElementLabel( finString); … … 220 223 if ( numeroFin < current) 221 224 { 222 UIsectionsToExecute_ [a]->setErrors("Last section element should be after first section element");225 UIsectionsToExecute_deprecated_;[a]->setErrors("Last section element should be after first section element"); 223 226 exec_go_->disable(); 224 227 return false; … … 227 230 if (numeroFin > dtmanage_->getBeamLineSize()) 228 231 { 229 UIsectionsToExecute_ [a]->setErrors("Last section element number is greater than the beam line size");232 UIsectionsToExecute_deprecated_;[a]->setErrors("Last section element number is greater than the beam line size"); 230 233 exec_go_->disable(); 231 234 return false; … … 261 264 return; 262 265 } 263 unsigned ints = UIsector_->getSectorControler()->getSectionsToExecute().size();266 unsigned long s = UIsector_->getSectorControler()->getSectionsToExecute().size(); 264 267 if (s > 0) { 265 268 abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->getLastElement(); 266 269 UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL)); 267 UIsector_->getSectorControler()->getSectionsToExecute()[s ]->removeLastElement();270 UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->removeLastElement(); 268 271 } 269 272 270 273 271 274 displayFromControler(); 275 UIsector_->getBeamLineWidget()->buildBeamLineWidget(); 272 276 } 273 277 … … 283 287 st << sectionLabel; 284 288 std::string sectionName = st.str(); 285 286 if ( dtmanage_->getJobListSize() == 0 ) return; 287 for (unsigned int sectionIndex = 0; sectionIndex< UIsectionsToExecute_.size(); sectionIndex++) { 288 if (UIsectionsToExecute_[sectionIndex]->objectName() == sectionName) { 289 //FIXME 290 291 /* if ( dtmanage_->getJobListSize() == 0 ) return; 292 for (unsigned int sectionIndex = 0; sectionIndex< UIsectionsToExecute_deprecated_.size(); sectionIndex++) { 293 if (UIsectionsToExecute_deprecated_[sectionIndex]->objectName() == sectionName) { 289 294 290 295 // delete from dataManager … … 292 297 293 298 // delete from User Interface 294 contenuSections_->removeWidget(UIsectionsToExecute_ [sectionIndex]);295 delete UIsectionsToExecute_ [sectionIndex];296 UIsectionsToExecute_ .erase (UIsectionsToExecute_.begin()+sectionIndex);299 contenuSections_->removeWidget(UIsectionsToExecute_deprecated_[sectionIndex]); 300 delete UIsectionsToExecute_deprecated_[sectionIndex]; 301 UIsectionsToExecute_deprecated_.erase (UIsectionsToExecute_deprecated_.begin()+sectionIndex); 297 302 } 298 303 } 304 */ 299 305 displayFromControler(); 300 306 }
Note: See TracChangeset
for help on using the changeset viewer.