Changeset 3132 in Sophya for trunk/SophyaPI/PIext/pihisto.cc
- Timestamp:
- Jan 12, 2007, 2:26:57 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pihisto.cc
r3125 r3132 9 9 #include <typeinfo> 10 10 11 //RZDEL #include "sopnamsp.h"12 11 #include "pihisto.h" 12 13 //------ Implementation classe P1DHistoWrapper 14 P1DHistoWrapper::P1DHistoWrapper() 15 : mScale(1.) , mOff(0.) 16 { 17 } 18 19 P1DHistoWrapper::~P1DHistoWrapper() 20 { 21 } 22 23 int P1DHistoWrapper::GetStatInfoAsText(vector<string> & /* text */ ) 24 { 25 return 0; 26 } 27 28 int P1DHistoWrapper::DecodeOptionString(vector<string> & opt, bool rmdecopt) 29 { 30 if(opt.size() < 1) return(0); 31 32 vector<string> udopt; // On gardera ici les options non decodees 33 unsigned int k = 0; 34 int ndec = opt.size(); 35 for( k=0; k<opt.size(); k++ ) { 36 string & opts = opt[k]; 37 if(opts.substr(0,7) == "hs1") { 38 mScale = 1.; mOff = 0.; 39 } 40 else if(opts.substr(0,7) == "hscale=") { 41 mScale = atof(opts.substr(7).c_str()); 42 } 43 else if(opt[k].substr(0,8) == "hoffset=") { 44 mOff = atof(opts.substr(8).c_str()); 45 } 46 else { 47 ndec--; 48 // S'il faut supprimer les options decodees 49 if (rmdecopt) udopt.push_back(opts); 50 } 51 } 52 // S'il faut supprimer les options decodees, on remplace l'argument opt 53 // par le vecteur des options non decodees. 54 if (rmdecopt) opt = udopt; 55 return(ndec); 56 } 57 13 58 14 59 //++ … … 212 257 } 213 258 } 259 214 260 // S'il faut supprimer les options decodees, on remplace l'argument opt 215 261 // par le vecteur des options non decodees. 216 262 if (rmdecopt) opt = udopt; 217 return(ndec+ndec1); 263 264 // Decodage des options par le histo-wrapper 265 int ndec2 = 0; 266 if ( ( optsz1-ndec1-ndec > 0) && (mHisto) ) { 267 ndec2 = mHisto->DecodeOptionString(opt, rmdecopt); 268 } 269 return(ndec+ndec1+ndec2); 218 270 } 219 271 … … 246 298 info += " statposoff=OffsetX,OffsetY : Position offset for Stats drawing \n"; 247 299 info += " as a fraction of total size \n"; 300 info += " ---- HistoWrapper options : \n" ; 301 info += " hscale=value : multiplicative factor (in Y) \n" ; 302 info += " hoffset=value : additive coefficient (in Y) \n" ; 303 info += " hs1 : set hscale=1 hoffset=0 (default) \n" ; 248 304 // On recupere ensuite la chaine info de la classe de base 249 305 PIDrawer::GetOptionsHelpInfo(info);
Note:
See TracChangeset
for help on using the changeset viewer.