Changeset 317 in PSPA
- Timestamp:
- Feb 12, 2013, 2:15:38 PM (12 years ago)
- Location:
- Interface_Web/tags/v0.3
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/tags/v0.3/htdocs/pspa.css
r283 r317 4 4 5 5 body { 6 background : url("fond.jpg") repeat fixed left top / 100% auto #FFFFFF;6 background-image: url("fond.jpg"); 7 7 } 8 8 -
Interface_Web/tags/v0.3/sources/userInterface/include/GWt_abstractElement.h
r310 r317 20 20 #include <Wt/WContainerWidget> 21 21 22 #include <boost/variant.hpp> 23 22 24 using namespace Wt; 23 25 using namespace std; 26 using namespace boost; 24 27 25 28 class GWt_elementLigneFaisceau; 29 30 // defined to ensure that the boost::variant could return something even when there is nothing 31 class NullType {}; 26 32 27 33 class GWt_abstractElement : public WContainerWidget … … 71 77 WImage* image_; 72 78 GWt_elementLigneFaisceau* elementLigneFaiseauContainer_; 79 80 81 // Nom, type de parametre 82 std::map<std::string, variant<int, string, bool, float, NullType> > parameterMapValue; 83 std::map<std::string, std::string > parameterMapDescription; 84 85 inline void registerParam(string name, variant<int, string, bool, float, NullType> value, string desc) { 86 parameterMapValue[name] = value; 87 parameterMapDescription[name] = desc; 88 } 89 90 variant<int, string, bool, float, NullType> getParamValue(string elem); 91 string getParamDescription(string elem); 92 73 93 }; 74 94 #endif -
Interface_Web/tags/v0.3/sources/userInterface/src/GWt_abstractElement.cc
r311 r317 2 2 #include <iostream> 3 3 #include <string> 4 #include <boost/variant.hpp> 5 #include <boost/variant/get.hpp> 4 6 5 7 #include "GWt_abstractElement.h" … … 24 26 #include <Wt/WMessageBox> 25 27 28 26 29 GWt_abstractElement::GWt_abstractElement(abstractElement* elem) 27 30 : WContainerWidget() … … 146 149 } 147 150 } 151 152 153 154 variant<int, string, bool, float, NullType> GWt_abstractElement::getParamValue(string elem) { 155 156 if (parameterMapValue.find(elem) == parameterMapValue.end() ) 157 { 158 return new NullType(); 159 } 160 161 std::map<std::string, variant<int, string, bool, float, NullType> >::iterator it; 162 it = parameterMapValue.find(elem); 163 164 variant <int, string, bool, float, NullType> value = it->second; 165 166 try { 167 int pi = boost::get<int>(value); 168 printf("%s Type is int\n",elem.c_str()); 169 return pi; 170 } 171 catch (boost::bad_get v) { 172 try { 173 string si = boost::get<string>(value); 174 printf("%s Type is string\n",elem.c_str()); 175 return si; 176 } 177 catch (boost::bad_get v) { 178 try { 179 bool bi = boost::get<bool>(value); 180 printf("%s Type is bool\n",elem.c_str()); 181 return bi; 182 } 183 catch (boost::bad_get v) { 184 printf("%s Type is NULL\n",elem.c_str()); 185 return new NullType(); 186 } 187 } 188 } 189 printf("%s Type is NULL NULL\n",elem.c_str()); 190 return new NullType(); 191 } 192 193 194 string GWt_abstractElement::getParamDescription(string elem) { 195 196 if (parameterMapDescription.find(elem) == parameterMapDescription.end() ) 197 { 198 printf("%s Descr is NULL NULL\n",elem.c_str()); 199 return ""; 200 } else { 201 printf("%s Descr is %s\n",elem.c_str(),parameterMapDescription.find(elem)->second.c_str()); 202 return parameterMapDescription.find(elem)->second; 203 } 204 } -
Interface_Web/tags/v0.3/sources/userInterface/src/GWt_beam.cc
r310 r317 19 19 void GWt_beam::initilializeDialog() { 20 20 string* param = beginDialog(); 21 21 22 registerParam("int____",2000, " 1/2 horizontal beam extend rms (cm) : "); 23 getParamValue("int____"); 24 getParamDescription("int____"); 25 registerParam("bool____",true, " 1/2 horizontal beam extend rms (cm) : "); 26 getParamValue("bool____"); 27 getParamDescription("bool____"); 28 29 string t = "ttttt"; 30 registerParam("str____",t, " 1/2 horizontal beam extend rms (cm) : "); 31 getParamValue("str____"); 32 getParamDescription("str____"); 33 22 34 new WText(" 1/2 horizontal beam extend rms (cm) : ",dialog_->contents()); 23 35 xEdit_ = new WLineEdit(param->c_str(), dialog_->contents()); -
Interface_Web/tags/v0.3/sources/userInterface/src/GWt_pspaApplication.cc
r312 r317 274 274 dessin->addWidget(caroule); 275 275 dessin->addWidget(new WBreak()); 276 276 277 277 278 278 279 … … 280 281 ///////////////////////////////////////////////////////////////////// 281 282 dessin->addWidget(new WText(" histogramme : ")); 282 WPushButton* okHisto = new WPushButton("histogramme ");283 WPushButton* okHisto = new WPushButton("histogramme------"); 283 284 dessin->addWidget(okHisto); 285 284 286 okHisto->clicked().connect(this,&PspaApplication::dessinerHistogramme); 285 287 ///////////////////////////////////////////////////////////////////// … … 359 361 GWt_globalParameters* bibi = static_cast<GWt_globalParameters*>(globalParam_); 360 362 bibi->renew(); 361 362 GWt_LigneFaisceau* bobo = static_cast<GWt_LigneFaisceau*>(beamLine_); 363 // bobo->restoreElementCollectionFromDataManager(); 364 363 365 364 console_->addConsoleMessage(string("...terminee")); 366 365 }
Note: See TracChangeset
for help on using the changeset viewer.