Changeset 449 in PSPA
- Timestamp:
- Dec 12, 2013, 12:14:25 PM (10 years ago)
- Location:
- Interface_Web/trunk/pspaWT
- Files:
-
- 2 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/History
r443 r449 5 5 PSPA - Plateforme de simulation en physique des accélérateurs 6 6 ========================================================= 7 8 12 Décembre 2013 : Laurent Garnier 9 Modifications en vue de changer l'interface utilisateur : 10 - GWt_softwarePanel : Changement du container parent 11 - GWt_sector : Nouvelle classe pour gérer les secteur au niveau UI 12 - GWt_accelerator : Nouvelle classe pour gérer les accelerateurs au niveau UI 13 - PspaApplication : Nouveau layout (suppression de la grille de fond) 14 - GWt_LigneFaisceau, GWt_elementLigneFaisceau, GWt_console 15 - Changements mineurs 16 - GWt_dropZoneLigneFaisceau : Changement de comportement du drop 17 - dataManager : Ajout de méthode pour ajouter un secteur addNewSector() et du 18 vecteur de sector associé. 19 - sector : Changement des noms setReflectedFrom en setDuplicatedFrom 20 21 Ajout de la classe Section et quelques modifications dans le pspa.css 22 7 23 11 Décembre 2013 : Laurent Garnier 8 - Ajout de la classe Section et quelques modi ications dans le pspa.css24 - Ajout de la classe Section et quelques modifications dans le pspa.css 9 25 10 26 21 juin 2013 : Guy Le Meur -
Interface_Web/trunk/pspaWT/cmt/requirements
r443 r449 65 65 ../sources/userInterface/src/GWt_draggableImage.cc \ 66 66 ../sources/userInterface/src/GWt_serverFileSelector.cc \ 67 ../sources/userInterface/src/GWt_sector.cc \ 68 ../sources/userInterface/src/GWt_accelerator.cc \ 67 69 ../sources/userInterface/src/GWt_sectionToExecute.cc 68 70 -
Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h
r431 r449 13 13 #include "parmelaParticle.h" 14 14 #include "nomDeLogiciel.h" 15 #include "sector.h" 15 16 16 17 #include "sectorParameters.h" //xx … … 41 42 abstractElement* addElement(nomdElements::typedElement elemType); 42 43 void removeElement(string); 44 45 /** Add a new sector 46 */ 47 sector* addNewSector(); 48 49 /** return all sectors 50 */ 51 inline std::vector <sector*> getSectors() {return sectors_;}; 43 52 44 53 /** … … 102 111 vector<unsigned> indexElementToIndexDiag_; 103 112 vector<sectionToExecute*> jobList_; 104 113 vector <sector*> sectors_; 105 114 void removeFile(string nameOfFile); 106 115 void clearSectionToExecute(); -
Interface_Web/trunk/pspaWT/sources/controler/include/sector.h
r443 r449 9 9 public : 10 10 11 sector( );11 sector(std::string name = "sector default name"); 12 12 virtual ~sector(); 13 13 /** … … 21 21 22 22 /** 23 Set the original sector from where this sector is reflected 23 Set the original sector from where this sector is reflected/duplicated 24 24 */ 25 inline void set ReflectedFrom(sector* s) { reflectedFrom_ = s;};25 inline void setDuplicatedFrom(sector* s) { duplicatedFrom_ = s;}; 26 26 /** 27 Get the original sector from where this sector is reflected . return NULL if not27 Get the original sector from where this sector is reflected/duplicated. Return NULL if not 28 28 */ 29 inline sector* get ReflectedFrom() { return reflectedFrom_;};29 inline sector* getDuplicatedFrom() { return duplicatedFrom_;}; 30 30 31 31 … … 78 78 std::string name_; 79 79 bool reflected_; 80 sector* reflectedFrom_;80 sector* duplicatedFrom_; 81 81 unsigned int repetitionNumber_; 82 82 }; -
Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
r442 r449 441 441 } 442 442 } 443 444 sector* dataManager::addNewSector() { 445 std::stringstream str; 446 str << getSectors().size()+1; 447 std::string result; 448 str >> result; 449 450 sector* sect = new sector(std::string("sector ") + result); 451 sectors_.push_back(sect); 452 return sect; 453 } 454 -
Interface_Web/trunk/pspaWT/sources/controler/src/sector.cc
r444 r449 9 9 #include "sector.h" 10 10 11 sector::sector( ):11 sector::sector(std::string name): 12 12 reflected_(false), 13 reflectedFrom_(NULL), 14 repetitionNumber_(1) 13 duplicatedFrom_(NULL), 14 repetitionNumber_(1), 15 name_(name) 15 16 { 16 17 -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_console.h
r437 r449 15 15 16 16 public: 17 GWt_console( );17 GWt_console(WContainerWidget* parent); 18 18 virtual ~GWt_console(); 19 19 void addConsoleMessage(WString msg); -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_dropZoneLigneFaisceau.h
r437 r449 3 3 4 4 #include "GWt_pspaApplication.h" 5 #include "GWt_LigneFaisceau.h" 5 6 6 7 #include <Wt/WContainerWidget> … … 13 14 public : 14 15 15 GWt_dropZoneLigneFaisceau(PspaApplication* pspa_ );16 GWt_dropZoneLigneFaisceau(PspaApplication* pspa_,GWt_LigneFaisceau* parent); 16 17 ~GWt_dropZoneLigneFaisceau(); 17 18 inline GWt_LigneFaisceau* getParent() {return parent_;}; 19 18 20 private: 19 21 void initialise( PspaApplication* pspa); … … 24 26 void mouseIsDragged(const WMouseEvent &e ); 25 27 void dropEvent(WDropEvent evt); 28 29 GWt_LigneFaisceau* parent_; 26 30 }; 27 31 #endif -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementLigneFaisceau.h
r437 r449 31 31 */ 32 32 33 GWt_elementLigneFaisceau(PspaApplication* );34 GWt_elementLigneFaisceau(nomdElements::typedElement,PspaApplication* );33 GWt_elementLigneFaisceau(PspaApplication*,GWt_LigneFaisceau*); 34 GWt_elementLigneFaisceau(nomdElements::typedElement,PspaApplication*,GWt_LigneFaisceau*); 35 35 36 36 ~GWt_elementLigneFaisceau(); … … 67 67 void removeDone(GWt_abstractElement*); 68 68 std::string getElementNumberInBeamLine(nomdElements el); 69 void initialize_ligneFaisceau(nomdElements::typedElement eType );69 void initialize_ligneFaisceau(nomdElements::typedElement eType,GWt_LigneFaisceau* ligne); 70 70 void mouseWentOut(); 71 71 void mouseWentOver(); -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_ligneFaisceau.h
r437 r449 26 26 class GWt_LigneFaisceau : public WContainerWidget 27 27 { 28 WHBoxLayout* ligneFaisceauLayout_;29 28 PspaApplication* pspa_; 30 29 … … 86 85 void manageLineFaisceauLayout(); 87 86 GWt_dropZoneLigneFaisceau* allDropZone_; 88 87 WHBoxLayout* ligneFaisceauLayout_; 89 88 }; 90 89 -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h
r437 r449 72 72 73 73 WText* createTitle(const WString&); 74 WWidget* createPalette( );74 WWidget* createPalette(WContainerWidget* parent); 75 75 WWidget* createBeamLine(); 76 76 WWidget* createExecuteWidget(); 77 77 WContainerWidget* createDrawingWidget(); 78 78 79 WWidget* createDashBoard( );79 WWidget* createDashBoard(WContainerWidget*); 80 80 void messageBox1(); 81 81 void messageBox2(); -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h
r437 r449 25 25 public : 26 26 27 GWt_softwarePanel(dataManager*, PspaApplication* );27 GWt_softwarePanel(dataManager*, PspaApplication*,WContainerWidget*); 28 28 virtual ~GWt_softwarePanel(); 29 29 -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_console.cc
r427 r449 13 13 14 14 15 GWt_console::GWt_console( ) : WContainerWidget()15 GWt_console::GWt_console(WContainerWidget* parent) : WContainerWidget(parent) 16 16 { 17 17 setObjectName("console"); -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_dropZoneLigneFaisceau.cc
r437 r449 10 10 #include "nomdElements.h" 11 11 12 GWt_dropZoneLigneFaisceau::GWt_dropZoneLigneFaisceau( PspaApplication* pspa) 13 : WContainerWidget() 12 GWt_dropZoneLigneFaisceau::GWt_dropZoneLigneFaisceau( PspaApplication* pspa,GWt_LigneFaisceau* parent) 13 : WContainerWidget(), 14 parent_(parent) 14 15 { 15 16 initialise(pspa); … … 62 63 void GWt_dropZoneLigneFaisceau::dropEvent(WDropEvent evt) 63 64 { 64 // get LigneFaiseau widget and add new elementLigneFaiseau65 GWt_LigneFaisceau* ligneFaisceau = NULL;66 if ( static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"))) {67 ligneFaisceau = static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"));68 } else {69 return;70 }71 72 65 // get the type of element 73 66 nomdElements e(evt.mimeType()); 74 67 nomdElements::typedElement eType = e.getElementType(); 75 ligneFaisceau->addElement(eType, this);68 getParent()->addElement(eType, this); 76 69 } 77 70 -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc
r437 r449 19 19 #define PSPA_DEBUG 1 20 20 21 GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(PspaApplication* pspa )21 GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(PspaApplication* pspa,GWt_LigneFaisceau* ligne) 22 22 : WContainerWidget(), 23 23 firstTimeInsertMessage_(NULL), … … 28 28 pspa_(pspa) 29 29 { 30 initialize_ligneFaisceau(nomdElements::inconnu );31 } 32 33 34 GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(nomdElements::typedElement type,PspaApplication* pspa )30 initialize_ligneFaisceau(nomdElements::inconnu,ligne); 31 } 32 33 34 GWt_elementLigneFaisceau::GWt_elementLigneFaisceau(nomdElements::typedElement type,PspaApplication* pspa,GWt_LigneFaisceau* ligne) 35 35 : WContainerWidget(), 36 36 firstTimeInsertMessage_(NULL), … … 43 43 // set the css name 44 44 setObjectName("elementLigneFaisceau"); 45 initialize_ligneFaisceau(type );46 } 47 48 void GWt_elementLigneFaisceau::initialize_ligneFaisceau(nomdElements::typedElement eType )45 initialize_ligneFaisceau(type,ligne); 46 } 47 48 void GWt_elementLigneFaisceau::initialize_ligneFaisceau(nomdElements::typedElement eType,GWt_LigneFaisceau* ligne) 49 49 { 50 50 cout << " new GWt_elementLigneFaisceau : "<< nomdElements::getLabelFromType(eType) << endl; … … 62 62 63 63 // add first line : initialize arrow and link images 64 dropZoneLeft_ = new GWt_dropZoneLigneFaisceau(pspa_ );65 dropZoneRight_ = new GWt_dropZoneLigneFaisceau(pspa_ );64 dropZoneLeft_ = new GWt_dropZoneLigneFaisceau(pspa_,ligne); 65 dropZoneRight_ = new GWt_dropZoneLigneFaisceau(pspa_,ligne); 66 66 67 67 // change object name in order to manage css : … … 73 73 74 74 // add first line : initialize arrow and link images 75 dropZoneLeft_ = new GWt_dropZoneLigneFaisceau(pspa_ );76 dropZoneRight_ = new GWt_dropZoneLigneFaisceau(pspa_ );75 dropZoneLeft_ = new GWt_dropZoneLigneFaisceau(pspa_,ligne); 76 dropZoneRight_ = new GWt_dropZoneLigneFaisceau(pspa_,ligne); 77 77 78 78 // change object name in order to manage css : -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc
r437 r449 16 16 { 17 17 18 cout<<"GWt_LigneFaisceau::GWt_LigneFaisceau() %d"<< this << "<---------------"<< endl;19 20 18 ligneFaisceauLayout_ = new WHBoxLayout(); 21 // decorationStyle().setBackgroundColor (WColor(245,245,245));22 19 ligneFaisceauLayout_->setContentsMargins(0,0,0,0); 23 20 ligneFaisceauLayout_->setSpacing(0); … … 37 34 // add the first drop zone 38 35 decorationStyle().setBorder (WBorder (WBorder::Dotted)); 39 allDropZone_ = new GWt_dropZoneLigneFaisceau(pspa_ );36 allDropZone_ = new GWt_dropZoneLigneFaisceau(pspa_,this); 40 37 WVBoxLayout* fit = new WVBoxLayout(); 41 38 allDropZone_->setLayout(fit); … … 77 74 ligneFaisceauLayout_->clear(); 78 75 // add first element 79 GWt_elementLigneFaisceau* elemLigneFaisceau = new GWt_elementLigneFaisceau(eType,pspa_ );76 GWt_elementLigneFaisceau* elemLigneFaisceau = new GWt_elementLigneFaisceau(eType,pspa_,this); 80 77 ligneFaisceauLayout_->addWidget(elemLigneFaisceau,1); 81 78 GWtAbstractElem = elemLigneFaisceau->getGWt_AbstractElement(); … … 101 98 102 99 // ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaiseau(ptr),0); 103 GWt_elementLigneFaisceau* elemLigneFaisceau = new GWt_elementLigneFaisceau(eType, pspa_ );100 GWt_elementLigneFaisceau* elemLigneFaisceau = new GWt_elementLigneFaisceau(eType, pspa_,this); 104 101 if (index != -1) { 105 102 ligneFaisceauLayout_->insertWidget(index,elemLigneFaisceau,1); -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc
r437 r449 6 6 #include "GWt_abstractElementFactory.h" 7 7 #include "GWt_serverFileSelector.h" 8 #include "GWt_accelerator.h" 8 9 #include "particleBeam.h" 9 10 #include "bareParticle.h" … … 27 28 #include <Wt/WRadioButton> 28 29 #include <Wt/WMessageBox> 30 #include <Wt/WScrollArea> 31 #include <Wt/WLabel> 29 32 30 33 #define HAS_IMAGEMAGIC 1 … … 66 69 67 70 // include the styleSheetcd 68 WContainerWidget * widroot = root();71 WContainerWidget *mainContainerWidget = root(); 69 72 useStyleSheet("htdocs/pspa.css"); 70 73 dtmanage_ = new dataManager(this); 71 74 72 75 // The main layout is a 4x3 grid layout. 73 WGridLayout *mainGridLayout = new WGridLayout();74 76 WHBoxLayout *toolbarLayout = new WHBoxLayout(); 75 77 … … 116 118 toolbarLayout->addWidget(new WText("") , 1,Wt::AlignMiddle); 117 119 120 WGridLayout* gridLayout = new WGridLayout(mainContainerWidget); 121 118 122 WContainerWidget * toolbarLayoutContainer = new WContainerWidget(); 119 123 toolbarLayoutContainer->setLayout(toolbarLayout); 120 124 toolbarLayoutContainer->decorationStyle().setBackgroundImage ("/htdocs/fond_toolbar.png"); 121 122 mainGridLayout->addWidget(toolbarLayoutContainer, 1, 0, 1, 3); 123 mainGridLayout->addWidget(createPalette(), 2, 0, 4, 1); 124 125 WScrollArea* scroll = new WScrollArea(); 125 // menu menu on the top 126 gridLayout->addWidget(toolbarLayoutContainer, 1,0,1,2); 127 // palette on the left 128 gridLayout->addWidget(createPalette(mainContainerWidget), 2, 0); 129 130 // create accelerator main widget 131 WContainerWidget* acceleratorContainerWidget = new WContainerWidget(); 132 gridLayout->addWidget(acceleratorContainerWidget, 2, 1); 133 134 // Let column 2 take the excess space. 135 gridLayout->setColumnStretch(1,1); 136 // Let row 1 take the excess space. 137 gridLayout->setRowStretch(2,1); 138 139 140 GWt_accelerator* accel = new GWt_accelerator(acceleratorContainerWidget,this); 141 new WBreak(acceleratorContainerWidget); 142 143 WScrollArea* scroll = new WScrollArea(acceleratorContainerWidget); 126 144 scroll->setWidget(createBeamLine()); 127 145 scroll->setMinimumSize(300,150); 128 mainGridLayout->addWidget(scroll, 2, 1, 1, 2); 129 146 147 new WBreak(acceleratorContainerWidget); 130 148 //----------- 131 149 … … 136 154 globalParam_ = new GWt_globalParameters(dtmanage_); 137 155 sectorParam_ = new GWt_sectorParameters(dtmanage_); 138 WWidget* dboard = createDashBoard( );156 WWidget* dboard = createDashBoard(acceleratorContainerWidget); 139 157 dboard->setMinimumSize(300,100); 140 mainGridLayout->addWidget(dboard,3,1); 158 159 new WBreak(acceleratorContainerWidget); 160 141 161 //----------- 142 162 … … 146 166 graphicsDialog_->hide(); 147 167 148 executeWidget_ = new GWt_softwarePanel(dtmanage_,this );168 executeWidget_ = new GWt_softwarePanel(dtmanage_,this,acceleratorContainerWidget); 149 169 executeWidget_->setMinimumSize(400,100); 150 mainGridLayout->addWidget(executeWidget_,4,1); 151 152 console_ = new GWt_console(); 170 171 new WBreak(acceleratorContainerWidget); 172 173 console_ = new GWt_console(acceleratorContainerWidget); 153 174 console_->setMinimumSize(300,100); 154 mainGridLayout->addWidget(console_,3,2,2,1); 155 156 // Let row 2 and column 1 take the excess space. 157 mainGridLayout->setRowStretch(4,1); 158 mainGridLayout->setColumnStretch(2,1); 159 160 widroot->setLayout(mainGridLayout); 175 176 161 177 // set auto scrollbar if needed 162 widroot->setOverflow(WContainerWidget::OverflowAuto);163 } 164 165 WWidget* PspaApplication::createDashBoard( )178 mainContainerWidget->setOverflow(WContainerWidget::OverflowAuto); 179 } 180 181 WWidget* PspaApplication::createDashBoard(WContainerWidget* parent) 166 182 { 167 183 WContainerWidget *wt= new WContainerWidget(); … … 185 201 cnt->addWidget(wt); 186 202 187 WContainerWidget *result = new WContainerWidget( );203 WContainerWidget *result = new WContainerWidget(parent); 188 204 WPanel *panel = new WPanel(result); 189 205 panel->setTitle("dashboard"); … … 207 223 } 208 224 209 WWidget* PspaApplication::createPalette( )210 { 211 WContainerWidget* palette = new WContainerWidget( );225 WWidget* PspaApplication::createPalette(WContainerWidget* parent) 226 { 227 WContainerWidget* palette = new WContainerWidget(parent); 212 228 vector <GWt_abstractElement*> elems = abstractElementFactory_->getAllElements(); 213 229 for (unsigned a = 0; a < elems.size(); a++) { -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
r442 r449 23 23 #define BAVARD 0 24 24 25 GWt_softwarePanel::GWt_softwarePanel(dataManager* dataManager,PspaApplication* pspa )26 : WContainerWidget( )25 GWt_softwarePanel::GWt_softwarePanel(dataManager* dataManager,PspaApplication* pspa,WContainerWidget* parent) 26 : WContainerWidget(parent) 27 27 { 28 28 dtmanage_ = dataManager;
Note: See TracChangeset
for help on using the changeset viewer.