Changeset 347 in PSPA for Interface_Web
- Timestamp:
- Feb 26, 2013, 3:19:15 PM (11 years ago)
- Location:
- Interface_Web/trunk/pspaWT
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/History
r341 r347 5 5 PSPA - Plateforme de simulation en physique des accélérateurs 6 6 ========================================================= 7 8 26 février 2013 Laurent Garnier 9 - pspa.css : Ajout de bordures rondes sur les elements et qq autres trucs 10 - beam2moments : Correction d'un warning qui se pourait être un bug 11 - dataManager : saveConfiguration(string folder, string nameOfCase). 12 Ajout d'un dossiers pour le stockage des fichiers de config 13 - abstractSoftware : Ajout d'une méthode pour retourner la couleur du fond du software. 14 - GWt_elementLigneFaisceau : Coup de rafraihissement visuel 15 - GWt_serverFileSelector : Management des fichiers des sessions utilisateur 16 - PspaApplication : Remise a jour avec l'ajout du dossier en parametre de saveConfiguration() 7 17 8 18 22 février 2013 Guy Le Meur -
Interface_Web/trunk/pspaWT/htdocs/pspa.css
r318 r347 55 55 .beamLineIcon { 56 56 width: 32; 57 background-color: #FFFFFF; 58 box-shadow: 0 1px 3px rgba(34, 25, 25, 0.4); 59 font-size: 11px; 60 padding: 15px 15px 0; 61 position: absolute; 62 border-radius: 5px; 57 63 } 64 65 p.css-vertical-text { 66 color:#333; 67 border:0px solid red; 68 writing-mode:tb-rl; 69 -webkit-transform:rotate(270deg); 70 -moz-transform:rotate(270deg); 71 -o-transform: rotate(270deg); 72 white-space:nowrap; 73 display:block; 74 bottom:0; 75 width:20px; 76 height:20px; 77 font-family: âTrebuchet MSâ, Helvetica, sans-serif; 78 font-size:24px; 79 font-weight:normal; 80 text-shadow: 0px 0px 1px #333; 81 } -
Interface_Web/trunk/pspaWT/sources/controler/include/abstractSoftware.h
r316 r347 37 37 virtual bool buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir) = 0; 38 38 39 /** Color of the background of this sofware 40 Should be a valid Css name as FFEEDD 41 */ 42 virtual string getColor() = 0; 39 43 40 44 }; -
Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h
r344 r347 52 52 trivaluedBool checkElementsForExec(nomDeLogiciel logiciel, unsigned indexDeb, unsigned indexFin, string& diagnostic); 53 53 bool executeAll(); 54 void saveConfiguration(string nameOfCase);55 bool restoreElements(string inputFileName);56 void donneesRmsEnveloppe( string type, unsigned int numeroDeb, unsigned int numeroFin, vector<double>& xcor, vector<double>& ycor);57 54 void donneesRmsEnveloppe(string type,unsigned int lineSize,vector<double>& xcor,vector<double>& ycor); 58 55 59 private : 56 /** 57 Save a configuration file on the server 58 @param folder 59 @param filename 60 */ 61 void saveConfiguration(string folder, string filename); 62 63 bool restoreElements(string inputFileName); 64 65 private : 66 60 67 61 globalParameters globParam_; 62 particleBeam* currentBeam_; 68 void donneesRmsEnveloppe( string type, unsigned int numeroDeb, unsigned int numeroFin, vector<double>& xcor, vector<double>& ycor); 69 /* inline void setWorkingDir(string wd) { */ 70 /* workingDir_ = wd; */ 71 /* } */ 63 72 64 vector<particleBeam> diagnosticBeam_; 65 vector<sectionToExecute*> jobList_; 66 67 void removeFile(string nameOfFile); 68 void clearSectionToExecute(); 73 private: 74 globalParameters globParam_; 75 particleBeam* currentBeam_; 76 77 vector<particleBeam> diagnosticBeam_; 78 79 vector<sectionToExecute*> jobList_; 80 81 void removeFile(string nameOfFile); 82 void clearSectionToExecute(); 69 83 70 84 PspaApplication* pspa_; -
Interface_Web/trunk/pspaWT/sources/controler/include/softwareGenerator.h
r316 r347 33 33 virtual bool buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir); 34 34 35 inline string getColor() { 36 return "#a3c0ed"; 37 } 35 38 }; 36 39 -
Interface_Web/trunk/pspaWT/sources/controler/include/softwareParmela.h
r316 r347 33 33 virtual bool buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir); 34 34 35 inline string getColor() { 36 return "#e09bdf"; 37 } 35 38 36 39 -
Interface_Web/trunk/pspaWT/sources/controler/include/softwareTest.h
r333 r347 31 31 virtual bool buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir); 32 32 33 inline string getColor() { 34 return "#ecc38e"; 35 } 33 36 }; 34 37 #endif -
Interface_Web/trunk/pspaWT/sources/controler/include/softwareTransport.h
r316 r347 24 24 virtual bool buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir); 25 25 26 26 inline string getColor() { 27 return "#c0ea8e"; 28 } 27 29 }; 28 30 #endif -
Interface_Web/trunk/pspaWT/sources/controler/src/beam2Moments.cc
r336 r347 90 90 getline(inp, buf); 91 91 stringstream str(buf); 92 test = str >> bidon >> bidString >> bidon >> ( rij_secondOrderMoments_.at(0) ).at(0) >> bidString; 92 if (!(str >> bidon >> bidString >> bidon >> ( rij_secondOrderMoments_.at(0) ).at(0) >> bidString)) { 93 test = false; 94 } 93 95 cout << " beam2Moments::readFromTransportOutput TEST= " << test << endl; 94 96 } -
Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
r342 r347 9 9 #include "softwareTest.h" 10 10 11 #include <boost/filesystem.hpp> 11 12 #include <stdio.h> 12 13 #include <fstream> … … 213 214 } 214 215 215 void dataManager::saveConfiguration( string nameOfCase) 216 { 217 ofstream outfile; 218 string name = pspa_->getWorkingDir() + nameOfCase + ".save"; 219 outfile.open(name.c_str(), ios::out); 220 if (!outfile) { 221 cerr << " error opening output file for persistency " << name << endl; 216 void dataManager::saveConfiguration(string folder, string nameOfFile) 217 { 218 ofstream outfile; 219 string name = pspa_->getWorkingDir()+ folder + "/" + nameOfFile + ".save"; 220 221 // make dir if not exist 222 boost::filesystem::create_directories(pspa_->getWorkingDir() + folder + "/"); 223 224 outfile.open(name.c_str(), ios::out); 225 if (!outfile) { 226 cerr << " error opening output file for persistency " << name << endl; 222 227 } 223 228 -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementLigneFaisceau.h
r305 r347 37 37 ~GWt_elementLigneFaisceau(); 38 38 void addElement(GWt_abstractElement* elem); 39 void setBGColor(const WColor); 39 40 40 41 inline WText* getElementName() { -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc
r343 r347 84 84 gridLayout->addWidget (dropZoneRight_,0,2); 85 85 86 // add the image if present 87 88 switch ( eType ) { 89 case RFgun : 90 GWt_abstractElement_ = new GWt_rfgun(this); 91 break; 92 case drift : 93 GWt_abstractElement_ = new GWt_drift(this); 94 break; 95 case cell : 96 GWt_abstractElement_ = new GWt_cell(this); 97 break; 98 case bend : 99 GWt_abstractElement_ = new GWt_bend(this); 100 break; 101 case soleno : 102 GWt_abstractElement_ = new GWt_soleno(this); 103 break; 104 case beam : 105 GWt_abstractElement_ = new GWt_beam(this); 106 break; 107 case fit : 108 GWt_abstractElement_ = new GWt_fit(this); 109 break; 110 case snapshot : 111 GWt_abstractElement_ = new GWt_snapshot(this); 112 break; 113 case inconnu : 114 GWt_abstractElement_ = NULL; 115 } 116 117 if (GWt_abstractElement_ != NULL) { 118 gridLayout->addWidget(GWt_abstractElement_,0,1); 119 GWt_abstractElement_->setMaximumSize(32,32); 120 GWt_abstractElement_->setMinimumSize(32,32); 121 } 122 123 // add second line 86 // add first line : initialize arrow and link images 87 dropZoneLeft_ = new GWt_dropZoneLigneFaisceau(pspa_); 88 dropZoneRight_ = new GWt_dropZoneLigneFaisceau(pspa_); 89 90 // change object name in order to manage css : 91 dropZoneLeft_->resize(10,30); 92 dropZoneRight_->resize(10,30); 93 94 gridLayout->addWidget (dropZoneLeft_,0,0); 95 gridLayout->addWidget (dropZoneRight_,0,2); 96 97 // add the image if present 98 99 switch ( eType ) { 100 case RFgun : 101 GWt_abstractElement_ = new GWt_rfgun(this); 102 break; 103 case drift : 104 GWt_abstractElement_ = new GWt_drift(this); 105 break; 106 case cell : 107 GWt_abstractElement_ = new GWt_cell(this); 108 break; 109 case bend : 110 GWt_abstractElement_ = new GWt_bend(this); 111 break; 112 case soleno : 113 GWt_abstractElement_ = new GWt_soleno(this); 114 break; 115 case beam : 116 GWt_abstractElement_ = new GWt_beam(this); 117 break; 118 case fit : 119 GWt_abstractElement_ = new GWt_fit(this); 120 break; 121 case inconnu : 122 GWt_abstractElement_ = NULL; 123 } 124 if (GWt_abstractElement_ != NULL) { 125 gridLayout->addWidget (GWt_abstractElement_,0,1); 126 GWt_abstractElement_->setMaximumSize(80,80); 127 GWt_abstractElement_->setMinimumSize(80,80); 128 } 129 130 // add second line 131 124 132 if (GWt_abstractElement_ == NULL) { 125 133 elementLabel_ = new WText(); … … 141 149 { 142 150 } 151 152 void GWt_elementLigneFaisceau::setBGColor(const WColor c) { 153 decorationStyle().setBackgroundColor (c); 154 } 155 143 156 144 157 void GWt_elementLigneFaisceau::removeDone(GWt_abstractElement* gw) -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc
r343 r347 92 92 boutongraphicalAnalysis->setStyleClass("histoButton"); 93 93 94 boutonSauve->setToolTip ("sauvegarder la config");95 boutonRestaure->setToolTip (" restaurer la config ");96 boutonLoadNew->setToolTip (" upload config");94 boutonSauve->setToolTip ("sauvegarder votre configuration"); 95 boutonRestaure->setToolTip (" restaurer la configuration depuis le serveur"); 96 boutonLoadNew->setToolTip ("charger une configuration"); 97 97 boutongraphicalAnalysis->setToolTip ("analyse graphique"); 98 98 … … 324 324 } 325 325 326 326 327 void PspaApplication::sauver() 327 328 { … … 340 341 } 341 342 343 342 344 void PspaApplication::dialogSaveDone(WDialog::DialogCode code) 343 345 { 344 345 if ( code != Wt::WDialog::Accepted ) { console_->addConsoleMessage(" pas de sauvegarde"); return;}346 else { console_->addConsoleMessage("sauvegarde sur repertoire : " + workingDir_);}347 nameOfCase_ = saveNameEdit_->text().toUTF8();348 cout << " PspaApplication::dialogSaveDone() sur fichier = " << nameOfCase_ << endl;349 delete dialogSave_;350 dialogSave_ = NULL; 351 GWt_globalParameters* bibi = static_cast<GWt_globalParameters*>(globalParam_);352 bibi->updateGlobals();353 // dtmanage_->saveConfiguration(nameOfCase_);354 dtmanage_->saveConfiguration(nameOfCase_);346 if ( code != Wt::WDialog::Accepted ) { 347 return; 348 } 349 nameOfCase_ = saveNameEdit_->text().toUTF8(); 350 delete dialogSave_; 351 dialogSave_ = NULL; 352 353 GWt_globalParameters* bibi = static_cast<GWt_globalParameters*>(globalParam_); 354 bibi->updateGlobals(); 355 // dtmanage_->saveConfiguration(nameOfCase_); 356 dtmanage_->saveConfiguration(sessionId(),nameOfCase_); 355 357 } 356 358 … … 902 904 chart->setLegendStyle(chart->legendFont(), WPen(black), WBrush(WColor(0xFF, 0xFA, 0xE5))); 903 905 } 906 907 -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_serverFileSelector.cc
r337 r347 10 10 #include <Wt/WTreeNode> 11 11 #include <Wt/WIconPair> 12 #include <Wt/WApplication> 13 12 14 #include <boost/algorithm/string.hpp> 13 15 #include <dirent.h> /* readdir(), etc. */ … … 57 59 58 60 buildConfigurationFileTree(treeFileRoot, workingDir_.c_str(), ".save"); 59 61 62 // Add user files 63 Wt::WTreeNode* userTreeFileRoot = new Wt::WTreeNode("MySession", folderIcon); 64 buildConfigurationFileTree(treeFileRoot, (workingDir_+WApplication::instance()->sessionId()).c_str(), ".save"); 65 60 66 treeFileRoot->expand(); 61 67 WContainerWidget *treeContainer = new WContainerWidget(); -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
r343 r347 180 180 { 181 181 exec_go_->setDisabled(false); 182 } 182 183 // All ok, then put colors on beamLine 184 list<GWt_sectionToExecute*>::iterator itr2; 185 for(itr2 = selectedSections_.begin();itr2 != selectedSections_.end(); itr2++) 186 { 187 string debString = (*itr)->debut->text().toUTF8(); 188 string finString = (*itr)->fin->text().toUTF8(); 189 190 191 int debut = dtmanage_->getNumeroFromElementLabel(debString); 192 int fin = dtmanage_->getNumeroFromElementLabel(finString); 193 /** 194 for (int i=debut; i=<fin; i++) { 195 getBeamLine()->getAbstractElement(i)->setBGColor( 196 197 } 198 nomDeLogiciel prog = nomDeLogiciel ( (*itr)->selection->currentIndex() ); 199 dtmanage_->addSectionToExecute(debut,fin,prog); 200 */ 201 } 202 } 203 204 183 205 } 184 206
Note: See TracChangeset
for help on using the changeset viewer.