Changeset 474 in PSPA
- Timestamp:
- Jan 2, 2014, 10:15:24 PM (10 years ago)
- Location:
- Interface_Web/trunk/pspaWT/sources
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/controler/include/sectionToExecute.h
r472 r474 5 5 #include "abstractElement.h" 6 6 #include "abstractSoftware.h" 7 #include "sector.h" 7 8 8 9 class sectionToExecute … … 12 13 /** Create a new sectionToExecute and initialize it with the given element and software 13 14 */ 14 sectionToExecute(abstractElement*,abstractSoftware*,dataManager* );15 sectionToExecute(abstractElement*,abstractSoftware*,dataManager*,sector*); 15 16 16 17 /** Deprecated : To be removed ! */ … … 53 54 elements_.insert ( elements_.begin() ,abs); 54 55 }; 56 57 /** Set the first element of this section. 58 If needed, it will change the last element of the previous section 59 */ 60 void setFirstElement(std::string); 55 61 56 62 private : … … 59 65 dataManager* dataManager_; 60 66 std::vector< abstractElement* > elements_; 67 sector* sector_; 61 68 }; 62 69 #endif -
Interface_Web/trunk/pspaWT/sources/controler/include/sector.h
r472 r474 75 75 void addElementAfter(abstractElement*,abstractElement*); 76 76 77 /** 77 /** Add an element after another one. Will put it in the same sectionToExecuteList. If the element after is NULL 78 it will create a new sectionToExecute and put it inside. 79 if the previous element is NULL, it will try to add at the beginning of the first section 80 @return : the new element 81 */ 82 abstractElement* addElementAfter(nomdElements::typedElement, abstractElement* ); 83 84 /** 78 85 set the specific software for the given sectionToExecute number 79 86 */ -
Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
r472 r474 261 261 //NOTE:: je ne sais pas si les "secteurs" seront conservés, aussi pour ne pas trop changer les fichiers je lis les données aprÚs "globals" dans la boucle 262 262 263 pspa_->getBeamLine_deprecated()->clear(); 263 // Clear the BeamLine 264 jobList_.clear(); 265 266 // FIXME : For test purpose !!! 267 sector* mySect = addNewSector(); 268 264 269 nomdElements::typedElement elementType; 265 270 string elementLabel; … … 275 280 } else { 276 281 elementType = nomdElements::getTypeFromLabel(elementLabel); 277 GWt_abstractElement* nouveau = pspa_->getBeamLine_deprecated()->addElement(elementType);282 abstractElement* nouveau = mySect->addElementAfter(elementType,NULL); 278 283 if ( nouveau == NULL ) { 279 284 cerr << " dataManager::restoreElements() : restore element " << elementLabel << " failed " << endl; … … 286 291 287 292 #if BAVARD > 1 288 unsigned k;293 /* unsigned k; 289 294 for(k = 0; k < getBeamLineSize(); k++) { 290 295 abstractElement* ptr = pspa_->getBeamLine_deprecated()->getAbstractElement(k); 291 296 cout << "recupere " << ptr->getLabel() << endl; 292 297 } 298 */ 293 299 #endif 294 300 -
Interface_Web/trunk/pspaWT/sources/controler/src/sectionToExecute.cc
r472 r474 10 10 11 11 12 sectionToExecute::sectionToExecute(abstractElement* f, abstractSoftware* s,dataManager* data ) {12 sectionToExecute::sectionToExecute(abstractElement* f, abstractSoftware* s,dataManager* data,sector* sect) { 13 13 dataManager_ = data; 14 sector_ = sect; 14 15 15 16 elements_.push_back(f); … … 63 64 } 64 65 66 67 void sectionToExecute::setFirstElement(std::string name) { 68 // Possible cases : 69 70 // | section 1 | section 2 | 71 // | a b c d | e f g h | i X j k l | m n o p | Before : X is in the 3rd sectionToExcute 72 // | a b c d e f g h i | X j k l || m n o p | Case 1 : X move in the 2nd 73 // | a b c d | e f g h | i | X j k l m n o p | Case 2 : X move in the 4nd 74 75 // Case 1 : Have to change X and 76 77 std::vector <sectionToExecute*> sectVect = sector_->getSectionsToExecute(); 78 sectionToExecute* previousSection = NULL; 79 80 for (unsigned int a=0; a< sectVect.size(); a++) { 81 if (sectVect[a] == this) { 82 if (a >= 1) { 83 previousSection = sectVect[a-1]; 84 } 85 } 86 } 87 if (previousSection == NULL) { 88 return; 89 } 90 // FIXME : NOt finished !! 02/2014 91 } -
Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc
r472 r474 11 11 #include "sectionToExecute.h" 12 12 #include "dataManager.h" 13 #include "elementDrift.h" 14 #include "elementRfgun.h" 15 #include "elementCell.h" 16 #include "elementSoleno.h" 17 #include "elementBend.h" 18 #include "elementBeam.h" 19 #include "elementFit.h" 20 #include "elementSnapshot.h" 21 #include "elementMultipole.h" 13 22 14 23 sector::sector(dataManager* data, std::string name): … … 27 36 } 28 37 38 abstractElement* sector::addElementAfter(nomdElements::typedElement eType ,abstractElement* previousElement){ 39 40 // create a new abstractElement 41 // FIXME : To be move in an abstractFactory in the controler !! 42 abstractElement* currentElement = NULL; 43 switch ( eType ) { 44 case nomdElements::RFgun : 45 currentElement = new elementRfgun(); 46 break; 47 case nomdElements::drift : 48 currentElement = new elementDrift(); 49 break; 50 case nomdElements::cell : 51 currentElement = new elementCell(); 52 break; 53 case nomdElements::bend : 54 currentElement = new elementBend(); 55 break; 56 case nomdElements::soleno : 57 currentElement = new elementSoleno(); 58 break; 59 case nomdElements::beam : 60 currentElement = new elementBeam(); 61 break; 62 case nomdElements::fit : 63 currentElement = new elementFit(); 64 break; 65 case nomdElements::mpole : 66 currentElement = new elementMultipole(); 67 break; 68 case nomdElements::snapshot : 69 { 70 // FIXME : Snapshot a gérér 71 /* int incr = dataManager_->getPspaApplication()->getExtensionFile(); 72 incr++; 73 dataManager_->getPspaApplication()->setExtensionFile(incr); 74 */ 75 currentElement = new elementSnapshot(); 76 break; 77 } 78 } 79 if (!currentElement) { 80 return NULL; 81 } 82 addElementAfter(currentElement,previousElement); 83 return currentElement; 84 85 } 86 87 29 88 void sector::addElementAfter(abstractElement* currentElement ,abstractElement* previousElement){ 30 89 // if the previous element is NULL, it will try to add at the beginning of the first section … … 32 91 if (previousElement == NULL) { 33 92 if (sectionToExecute_.size() == 0) { 34 sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL,dataManager_ ));93 sectionToExecute_.push_back(new sectionToExecute(currentElement,NULL,dataManager_,this)); 35 94 } else { 36 95 sectionToExecute* section = sectionToExecute_.front(); -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_accelerator.h
r468 r474 35 35 WContainerWidget* acceleratorDetailledView_; 36 36 void addSector(); 37 void readConfiguration(); 37 38 void run(); 38 39 void closeGraphicDialog(); -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h
r469 r474 53 53 GWt_console* console_; 54 54 GWt_abstractElementFactory* abstractElementFactory_; 55 55 WContainerWidget* acceleratorContainerWidget_; 56 56 57 WText* createTitle(const WString&); 57 58 WWidget* createPalette(WContainerWidget* parent); -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h
r469 r474 18 18 19 19 void setSoftware(); 20 20 void changeFirstElement(); 21 21 22 inline Wt::WString getFirstElementCurrentText() { 22 23 return firstElement_->currentText(); -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_accelerator.cc
r469 r474 15 15 #include <string> 16 16 17 //- Ouvrir le premier secteur quand il est chargé 18 //- Ajouter les sectionToExecute 19 //- Fixer le addConsoleMessage() 20 //- remise a jour des éléments si on on change un bout de section 21 17 22 GWt_accelerator::GWt_accelerator(WContainerWidget* parent, dataManager* dt) : 18 23 WContainerWidget(parent), … … 84 89 acceleratorGlobalView->setLayout(acceleratorGlobalViewLayout_); 85 90 86 // Add the first sector87 addSector();91 // read configuration 92 readConfiguration(); 88 93 89 94 // Actions … … 107 112 { 108 113 sector* sect = getDataManager()->addNewSector(); 109 GWt_sector* addedSector = new GWt_sector(this,sect); 110 } 114 new GWt_sector(this,sect); 115 } 116 117 118 void GWt_accelerator::readConfiguration() 119 { 120 std::vector <sector*> sect = dataManager_->getSectors(); 121 if (sect.size() == 0) { 122 // Add the first sector 123 addSector(); 124 } else { 125 for (unsigned long a=0; a< sect.size(); a++) { 126 new GWt_sector(this,sect[a]); 127 } 128 } 129 } 130 111 131 112 132 void GWt_accelerator::run() -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_console.cc
r449 r474 129 129 130 130 // apply filter, will modify outputCurrent 131 // FIXME !!! 132 return; 131 133 searchFilter(); 132 134 /* -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc
r455 r474 120 120 121 121 // create accelerator main widget 122 WContainerWidget* acceleratorContainerWidget= new WContainerWidget();123 gridLayout->addWidget(acceleratorContainerWidget , 2, 1);122 acceleratorContainerWidget_ = new WContainerWidget(); 123 gridLayout->addWidget(acceleratorContainerWidget_, 2, 1); 124 124 125 125 // Let column 2 take the excess space. … … 129 129 130 130 131 new GWt_accelerator(acceleratorContainerWidget ,dtmanage_);132 new WBreak(acceleratorContainerWidget );131 new GWt_accelerator(acceleratorContainerWidget_,dtmanage_); 132 new WBreak(acceleratorContainerWidget_); 133 133 134 134 … … 138 138 beamLine_deprecated_ = NULL; 139 139 /* 140 WScrollArea* scroll = new WScrollArea(acceleratorContainerWidget );140 WScrollArea* scroll = new WScrollArea(acceleratorContainerWidget_); 141 141 scroll->setWidget(createBeamLine__deprecated()); 142 142 scroll->setMinimumSize(300,150); 143 143 */ 144 144 145 new WBreak(acceleratorContainerWidget );145 new WBreak(acceleratorContainerWidget_); 146 146 //----------- 147 147 … … 152 152 globalParam_ = new GWt_globalParameters(dtmanage_); 153 153 sectorParam_ = new GWt_sectorParameters(); 154 WWidget* dboard = createDashBoard(acceleratorContainerWidget );154 WWidget* dboard = createDashBoard(acceleratorContainerWidget_); 155 155 dboard->setMinimumSize(300,100); 156 156 157 new WBreak(acceleratorContainerWidget );157 new WBreak(acceleratorContainerWidget_); 158 158 159 159 //----------- 160 160 161 161 162 new WBreak(acceleratorContainerWidget );163 164 console_ = new GWt_console(acceleratorContainerWidget );162 new WBreak(acceleratorContainerWidget_); 163 164 console_ = new GWt_console(acceleratorContainerWidget_); 165 165 console_->setMinimumSize(300,100); 166 166 … … 317 317 } 318 318 319 globalParam_->renew(); 319 // reload new elements in the GUI 320 // FIXME : Don't do that in the futur ! 321 // In the futur, we should be able to have lot of accelerator at the same time and each with ONE datamanager 322 acceleratorContainerWidget_->clear(); 323 new GWt_accelerator(acceleratorContainerWidget_,dtmanage_); 324 325 globalParam_->renew(); 320 326 //sectorParam_->renew(); 321 327 console_->addConsoleMessage(string("restauration terminee \n")); -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc
r469 r474 91 91 softElement_->setMinimumSize(80,12); 92 92 93 // firstElement_->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);93 firstElement_->activated().connect(this,&GWt_sectionToExecute::changeFirstElement); 94 94 // lastElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections); 95 95 softElement_->activated().connect(this,&GWt_sectionToExecute::setSoftware); … … 148 148 } 149 149 150 151 void GWt_sectionToExecute::changeFirstElement() 152 { 153 section_->setFirstElement(firstElement_->currentText().toUTF8()); 154 UIsector_->getExecuteWidget()->displayFromControler(); 155 } -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
r472 r474 64 64 } else { 65 65 66 unsigned longfirstSectionToExecuteIndex = 0;66 unsigned int firstSectionToExecuteIndex = 0; 67 67 for (unsigned int a=0; a<UIsector_->getSectorControler()->getSectionsToExecute().size(); a++) { 68 68 abstractElement* premierElement = NULL; … … 86 86 lineFromCombo->setCurrentIndex(firstSectionToExecuteIndex); 87 87 // set to last 88 lineToCombo->setCurrentIndex(firstSectionToExecuteIndex + UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size() - 1);88 lineToCombo->setCurrentIndex(firstSectionToExecuteIndex + (unsigned int)UIsector_->getSectorControler()->getSectionsToExecute()[a]->getElements().size() - 1); 89 89 90 90 WComboBox* softCombo = new WComboBox(); 91 sector * sector = UIsector_->getSectorControler();92 91 sectionToExecute* sect = UIsector_->getSectorControler()->getSectionsToExecute()[a]; 93 abstractSoftware* abs = sect->getSoftware();94 92 95 93 fillComboWithSoftwares(softCombo,UIsector_->getSectorControler()->getSectionsToExecute()[a]->getSoftware()->getName()); … … 267 265 if (s > 0) { 268 266 abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->getLastElement(); 269 UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL,dtmanage_ ));267 UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL,dtmanage_,UIsector_->getSectorControler())); 270 268 UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->removeLastElement(); 271 269 }
Note: See TracChangeset
for help on using the changeset viewer.