| 1 | #include "piacmd.h" | 
|---|
| 2 |  | 
|---|
| 3 | #include <stdio.h> | 
|---|
| 4 | #include <stdlib.h> | 
|---|
| 5 | #include <math.h> | 
|---|
| 6 |  | 
|---|
| 7 | #include "basexecut.h" | 
|---|
| 8 |  | 
|---|
| 9 | #include "pdlmgr.h" | 
|---|
| 10 | #include "ctimer.h" | 
|---|
| 11 |  | 
|---|
| 12 | #include "pistdimgapp.h" | 
|---|
| 13 | #include "nobjmgr.h" | 
|---|
| 14 | #include "servnobjm.h" | 
|---|
| 15 |  | 
|---|
| 16 | #include "histos.h" | 
|---|
| 17 | #include "histos2.h" | 
|---|
| 18 | #include "hisprof.h" | 
|---|
| 19 | #include "ntuple.h" | 
|---|
| 20 | #include "generaldata.h" | 
|---|
| 21 |  | 
|---|
| 22 | #ifdef SANS_EVOLPLANCK | 
|---|
| 23 | #include "cvector.h" | 
|---|
| 24 | #else | 
|---|
| 25 | #include "tvector.h" | 
|---|
| 26 | #endif | 
|---|
| 27 |  | 
|---|
| 28 |  | 
|---|
| 29 | /* --Methode-- */ | 
|---|
| 30 | PIABaseExecutor::PIABaseExecutor(PIACmd* piac, NamedObjMgr* omg, PIStdImgApp* app) | 
|---|
| 31 | { | 
|---|
| 32 | mpiac = piac; | 
|---|
| 33 | mObjMgr = omg; | 
|---|
| 34 | mImgApp = app; | 
|---|
| 35 | dynlink = NULL; | 
|---|
| 36 | dynlink2 = NULL; | 
|---|
| 37 | RegisterCommands(); | 
|---|
| 38 | } | 
|---|
| 39 |  | 
|---|
| 40 | PIABaseExecutor::~PIABaseExecutor() | 
|---|
| 41 | { | 
|---|
| 42 | if (dynlink) delete dynlink; | 
|---|
| 43 | if (dynlink2) delete dynlink2; | 
|---|
| 44 | } | 
|---|
| 45 |  | 
|---|
| 46 |  | 
|---|
| 47 |  | 
|---|
| 48 | /* --Methode-- */ | 
|---|
| 49 | int PIABaseExecutor::Execute(string& kw, vector<string>& tokens, string& toks) | 
|---|
| 50 | { | 
|---|
| 51 | Services2NObjMgr* srvo = mObjMgr->GetServiceObj(); | 
|---|
| 52 | // >>>>> Chargement de modules | 
|---|
| 53 | if (kw == "loadmodule") { | 
|---|
| 54 | if (tokens.size() < 2) { cout << "Usage: loadmodule fnameso modulename" << endl;  return(0); } | 
|---|
| 55 | mpiac->LoadModule(tokens[0], tokens[1]); | 
|---|
| 56 | } | 
|---|
| 57 | // >>>>>>>>>>> Fenetre graphique , changement d'attributs graphiques | 
|---|
| 58 | else if (kw == "zone") { | 
|---|
| 59 | while (tokens.size() < 2) tokens.push_back("1"); | 
|---|
| 60 | int nx, ny; | 
|---|
| 61 | nx = ny = 1; | 
|---|
| 62 | nx = atoi(tokens[0].c_str());    ny = atoi(tokens[1].c_str()); | 
|---|
| 63 | if (mImgApp) mImgApp->SetZone(nx, ny); | 
|---|
| 64 | } | 
|---|
| 65 | else if (kw == "newwin") { | 
|---|
| 66 | int nx=1, ny=1; | 
|---|
| 67 | //if(tokens.size() < 2) { cout << "Usage: newwin nx ny" << endl;  return(0); } | 
|---|
| 68 | if(tokens.size() > 0) nx = atoi(tokens[0].c_str()); | 
|---|
| 69 | if(tokens.size() > 1) ny = atoi(tokens[1].c_str()); | 
|---|
| 70 | if (mImgApp) mImgApp->CreateGraphWin(nx, ny); | 
|---|
| 71 | } | 
|---|
| 72 | else if (kw == "stacknext") mImgApp->StackWinNext(); | 
|---|
| 73 | else if (kw == "graphicatt") { | 
|---|
| 74 | if (tokens.size() < 1) { cout << "Usage: graphicatt attributes_list (att=def->defaut)" << endl;  return(0); } | 
|---|
| 75 | string opts = tokens[0]; | 
|---|
| 76 | if (tokens.size() > 1) | 
|---|
| 77 | for(unsigned int kt=1; kt<tokens.size(); kt++)  { opts += ' '; opts += tokens[kt]; } | 
|---|
| 78 | if (mImgApp) mImgApp->SetDefaultGraphicAttributes(opts); | 
|---|
| 79 | } | 
|---|
| 80 | else if (kw == "setaxesatt") { | 
|---|
| 81 | if (tokens.size() < 1) { cout << "Usage: setaxesatt attributes_list " << endl;  return(0); } | 
|---|
| 82 | string opts = tokens[0]; | 
|---|
| 83 | if (tokens.size() > 1) | 
|---|
| 84 | for(unsigned int kt=1; kt<tokens.size(); kt++)  { opts += ' '; opts += tokens[kt]; } | 
|---|
| 85 | if (mImgApp) mImgApp->SetDefaultAxesAttributes(opts); | 
|---|
| 86 | } | 
|---|
| 87 | else if (kw == "setinsetlimits") { | 
|---|
| 88 | if (tokens.size() < 4) { cout << "Usage: setinsetlimits xmin xmax ymin ymax" << endl;  return(0); } | 
|---|
| 89 | double xmin = atof(tokens[0].c_str()); | 
|---|
| 90 | double xmax = atof(tokens[1].c_str()); | 
|---|
| 91 | double ymin = atof(tokens[2].c_str()); | 
|---|
| 92 | double ymax = atof(tokens[3].c_str()); | 
|---|
| 93 | mImgApp->SetInsetLimits(xmin, xmax, ymin, ymax); | 
|---|
| 94 | } | 
|---|
| 95 | else if (kw == "addtext") { | 
|---|
| 96 | if (tokens.size() < 3) { cout << "Usage: addtext x y txt [colfontatt]" << endl;  return(0); } | 
|---|
| 97 | double xp = atof(tokens[0].c_str()); | 
|---|
| 98 | double yp = atof(tokens[1].c_str()); | 
|---|
| 99 | string txt = tokens[2]; | 
|---|
| 100 | string sop; | 
|---|
| 101 | if (tokens.size() > 3) sop = tokens[3]; | 
|---|
| 102 | mImgApp->AddText(txt, xp, yp, sop); | 
|---|
| 103 | } | 
|---|
| 104 | else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect")) { | 
|---|
| 105 | if (tokens.size() < 4) { cout << "Usage: addline/addrect/addfrect x1 y1 x2 y2 [colatt]" << endl;  return(0); } | 
|---|
| 106 | double xp1 = atof(tokens[0].c_str()); | 
|---|
| 107 | double yp1 = atof(tokens[1].c_str()); | 
|---|
| 108 | double xp2 = atof(tokens[2].c_str()); | 
|---|
| 109 | double yp2 = atof(tokens[3].c_str()); | 
|---|
| 110 | string sop; | 
|---|
| 111 | if (tokens.size() > 4) sop = tokens[4]; | 
|---|
| 112 | if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop); | 
|---|
| 113 | else { | 
|---|
| 114 | bool fgfill = (kw == "addrect") ? false : true; | 
|---|
| 115 | mImgApp->AddRectangle(xp1, yp1, xp2, yp2, sop, fgfill); | 
|---|
| 116 | } | 
|---|
| 117 | } | 
|---|
| 118 | else if ((kw == "addcirc") || (kw == "addfcirc")) { | 
|---|
| 119 | if (tokens.size() < 3) { cout << "Usage: addcirc/addfcirc xc yc r [colatt]" << endl;  return(0); } | 
|---|
| 120 | double xc = atof(tokens[0].c_str()); | 
|---|
| 121 | double yc = atof(tokens[1].c_str()); | 
|---|
| 122 | double rad = atof(tokens[2].c_str()); | 
|---|
| 123 | string sop; | 
|---|
| 124 | if (tokens.size() > 3) sop = tokens[3]; | 
|---|
| 125 | bool fgfill = (kw == "addcirc") ? false : true; | 
|---|
| 126 | mImgApp->AddCircle(xc, yc, rad, sop, fgfill); | 
|---|
| 127 | } | 
|---|
| 128 |  | 
|---|
| 129 |  | 
|---|
| 130 | else if (kw == "settitle") { | 
|---|
| 131 | if (tokens.size() < 1) { cout << "Usage: settitle TopTitle [BotTitle] [fontatt]" << endl;  return(0); } | 
|---|
| 132 | mImgApp->SetTitle(tokens[0], tokens[1]); | 
|---|
| 133 | } | 
|---|
| 134 |  | 
|---|
| 135 | // >>>>>>>>>>> Link dynamique de fonctions C++ | 
|---|
| 136 | else if (kw == "link" ) { | 
|---|
| 137 | if (tokens.size() < 2) { cout << "Usage: link fnameso f1 [f2 f3]" << endl;  return(0); } | 
|---|
| 138 | string sph = ""; | 
|---|
| 139 | for(int gg=0; gg<5; gg++)   tokens.push_back(sph); | 
|---|
| 140 | int rc = LinkUserFuncs(tokens[0], tokens[1], tokens[2], tokens[3]); | 
|---|
| 141 | if (rc == 0)  cout << "PIABaseExecutor: Link from " << tokens[0] << " OK " << endl; | 
|---|
| 142 | } | 
|---|
| 143 | else if (kw == "linkff2" ) { | 
|---|
| 144 | if (tokens.size() < 2) { cout << "Usage: linkff2 fnameso f1 [f2 f3]" << endl;  return(0); } | 
|---|
| 145 | string sph = ""; | 
|---|
| 146 | for(int gg=0; gg<5; gg++)   tokens.push_back(sph); | 
|---|
| 147 | int rc = LinkUserFuncs2(tokens[0], tokens[1], tokens[2], tokens[3]); | 
|---|
| 148 | if (rc == 0)  cout << "PIABaseExecutor: Link2 from " << tokens[0] << " OK " << endl; | 
|---|
| 149 | } | 
|---|
| 150 | else if (kw == "call" ) { | 
|---|
| 151 | if (tokens.size() < 1) { cout << "Usage: call userf [arg1 arg2 ...]" << endl;  return(0); } | 
|---|
| 152 | UsFmap::iterator it; | 
|---|
| 153 | UsFmap::iterator it1 = usfmap.find(tokens[0]); | 
|---|
| 154 | UsFmap::iterator it2 = usfmap2.find(tokens[0]); | 
|---|
| 155 | if ((it1 == usfmap.end()) && (it2 == usfmap2.end()) ) { | 
|---|
| 156 | cerr << "PIABaseExecutor: No User Function " << tokens[0] << endl; | 
|---|
| 157 | return(0); | 
|---|
| 158 | } | 
|---|
| 159 | if (it1 == usfmap.end())  it = it2; | 
|---|
| 160 | else it = it1; | 
|---|
| 161 | cout << "PIABaseExecutor: Call " << tokens[0] << "( ... )" << endl; | 
|---|
| 162 | // on est oblige de faire un cast  etant donne qu'on | 
|---|
| 163 | // utilise donc des DlFunction  (Reza 20/08/98)  voir commentaire ds .h (pb g++) | 
|---|
| 164 | DlUserProcFunction fuf = (DlUserProcFunction)(*it).second; | 
|---|
| 165 | //   On redirige la sortie sur le terminal | 
|---|
| 166 | bool red = mImgApp->HasRedirectedStdOutErr(); | 
|---|
| 167 | mImgApp->RedirectStdOutErr(false); | 
|---|
| 168 | #ifdef SANS_EVOLPLANCK | 
|---|
| 169 | TRY { | 
|---|
| 170 | tokens.erase(tokens.begin()); | 
|---|
| 171 | fuf(tokens); | 
|---|
| 172 | }  CATCH(merr) { | 
|---|
| 173 | fflush(stdout); | 
|---|
| 174 | string es = PeidaExc(merr); | 
|---|
| 175 | cerr << "\n PIABaseExecutor: Call UserFunc  Exception :" << merr << es; | 
|---|
| 176 | cout << endl; | 
|---|
| 177 | } | 
|---|
| 178 | #else | 
|---|
| 179 | try { | 
|---|
| 180 | tokens.erase(tokens.begin()); | 
|---|
| 181 | fuf(tokens); | 
|---|
| 182 | } | 
|---|
| 183 | catch ( PThrowable & exc ) { | 
|---|
| 184 | cerr << "\n PIABaseExecutor: Call / Catched Exception :" | 
|---|
| 185 | << (string)typeid(exc).name() << " Msg= " | 
|---|
| 186 | << exc.Msg() << endl; | 
|---|
| 187 | cout << endl; | 
|---|
| 188 | } | 
|---|
| 189 | catch ( ... ) { | 
|---|
| 190 | cerr << "\n PIABaseExecutor: Call / Catched Exception ... " | 
|---|
| 191 | << endl; | 
|---|
| 192 | cout << endl; | 
|---|
| 193 | } | 
|---|
| 194 | #endif | 
|---|
| 195 | mImgApp->RedirectStdOutErr(red); | 
|---|
| 196 | } | 
|---|
| 197 |  | 
|---|
| 198 | // >>>>>>>>>>> lecture/ecriture des objets, gestion des objets | 
|---|
| 199 | else if (kw == "openfits" ) { | 
|---|
| 200 | if (tokens.size() < 1) { cout << "Usage: openfits file " << endl;  return(0); } | 
|---|
| 201 | else { string nomobj = "";  mObjMgr->ReadFits(tokens[0], nomobj); } | 
|---|
| 202 | } | 
|---|
| 203 | else if (kw == "savefits" ) { | 
|---|
| 204 | if (tokens.size() < 2) { cout << "Usage: savefits nameobj filename " << endl;  return(0); } | 
|---|
| 205 | else mObjMgr->SaveFits(tokens[0], tokens[1]); | 
|---|
| 206 | } | 
|---|
| 207 | else if (kw == "openppf" ) { | 
|---|
| 208 | if (tokens.size() < 1) { cout << "Usage: openppf file " << endl; return(0); } | 
|---|
| 209 | mObjMgr->ReadAll(tokens[0]); | 
|---|
| 210 | } | 
|---|
| 211 | else if (kw == "saveobjs" ) { | 
|---|
| 212 | if (tokens.size() < 2) { cout << "Usage: saveobjs patt filename " << endl; return(0); } | 
|---|
| 213 | mObjMgr->SaveObjects(tokens[0], tokens[1]); | 
|---|
| 214 | } | 
|---|
| 215 | else if (kw == "saveall" ) { | 
|---|
| 216 | if (tokens.size() < 1) { cout << "Usage: saveall file " << endl; return(0); } | 
|---|
| 217 | mObjMgr->SaveAll(tokens[0]); | 
|---|
| 218 | } | 
|---|
| 219 | else if (kw == "print" ) { | 
|---|
| 220 | if (tokens.size() < 1) { cout << "Usage: print nameobj " << endl; return(0); } | 
|---|
| 221 | mObjMgr->PrintObj(tokens[0]); | 
|---|
| 222 | } | 
|---|
| 223 | else if ( (kw == "rename" ) || (kw == "mv") )  { | 
|---|
| 224 | if (tokens.size() < 2) { cout << "Usage: rename nameobj namenew" << endl; return(0); } | 
|---|
| 225 | mObjMgr->RenameObj(tokens[0], tokens[1]); | 
|---|
| 226 | } | 
|---|
| 227 | else if ( (kw == "del" ) || (kw == "rm") ) { | 
|---|
| 228 | if (tokens.size() < 1) { cout << "Usage: del nameobj [nameobj2 ...]" << endl; return(0); } | 
|---|
| 229 | if (tokens.size()>0) | 
|---|
| 230 | for(uint_4 i=0;i<tokens.size();i++)  mObjMgr->DelObj(tokens[i]); | 
|---|
| 231 | } | 
|---|
| 232 | else if (kw == "delobjs" ) { | 
|---|
| 233 | if (tokens.size() < 1) { cout << "Usage: delobjs nomobjpattern (*,?) " << endl; return(0); } | 
|---|
| 234 | mObjMgr->DelObjects(tokens[0]); | 
|---|
| 235 | } | 
|---|
| 236 | else if ( (kw == "listobjs") || (kw == "ls") )    { | 
|---|
| 237 | if  (tokens.size() < 1)  tokens.push_back("*"); | 
|---|
| 238 | mObjMgr->ListObjs(tokens[0]); | 
|---|
| 239 | } | 
|---|
| 240 | // Gestion des repertoires | 
|---|
| 241 | else if (kw == "mkdir" ) { | 
|---|
| 242 | if (tokens.size() < 1) { cout << "Usage: mkdir dirname [true]" << endl; return(0); } | 
|---|
| 243 | bool crd = mObjMgr->CreateDir(tokens[0]); | 
|---|
| 244 | if ( crd && (tokens.size() > 1) && (tokens[1] == "true") ) | 
|---|
| 245 | mObjMgr->SetKeepOldDirAtt(tokens[0], true); | 
|---|
| 246 | } | 
|---|
| 247 | else if (kw == "rmdir" ) { | 
|---|
| 248 | if (tokens.size() < 1) { cout << "Usage: rmdir dirname " << endl; return(0); } | 
|---|
| 249 | mObjMgr->DeleteDir(tokens[0]); | 
|---|
| 250 | } | 
|---|
| 251 | else if (kw == "cd")   { | 
|---|
| 252 | if  (tokens.size() < 1)  tokens.push_back("home"); | 
|---|
| 253 | mObjMgr->SetCurrentDir(tokens[0]); | 
|---|
| 254 | } | 
|---|
| 255 | else if (kw == "pwd") { | 
|---|
| 256 | string dirn; | 
|---|
| 257 | mObjMgr->GetCurrentDir(dirn); | 
|---|
| 258 | cout << "CurrentDirectory: " << dirn << endl; | 
|---|
| 259 | } | 
|---|
| 260 | else if (kw == "listdirs")   { | 
|---|
| 261 | if  (tokens.size() < 1)  tokens.push_back("*"); | 
|---|
| 262 | mObjMgr->ListDirs(tokens[0]); | 
|---|
| 263 | } | 
|---|
| 264 |  | 
|---|
| 265 | // >>>>>>>>>>> Creation d'histos 1D-2D | 
|---|
| 266 | else if (kw == "newh1d") { | 
|---|
| 267 | if (tokens.size() < 4) { cout << "Usage: newh1d name xmin xmax nbin" << endl; return(0); } | 
|---|
| 268 | int_4 nbx = 100; | 
|---|
| 269 | r_8 xmin = 0., xmax = 1.; | 
|---|
| 270 | nbx = atoi(tokens[3].c_str()); | 
|---|
| 271 | xmin = atof(tokens[1].c_str());   xmax = atof(tokens[2].c_str()); | 
|---|
| 272 | Histo* h = new Histo(xmin, xmax, nbx); | 
|---|
| 273 | mObjMgr->AddObj(h, tokens[0]); | 
|---|
| 274 | } | 
|---|
| 275 | else if (kw == "newh2d") { | 
|---|
| 276 | if (tokens.size() < 7) { | 
|---|
| 277 | cout << "Usage: newh2d name xmin xmax nbinx ymin ymax nbiny" << endl; | 
|---|
| 278 | return(0); | 
|---|
| 279 | } | 
|---|
| 280 | int_4 nbx = 50, nby = 50; | 
|---|
| 281 | r_8 xmin = 0., xmax = 1.; | 
|---|
| 282 | r_8 ymin = 0., ymax = 1.; | 
|---|
| 283 | nbx = atoi(tokens[3].c_str()); | 
|---|
| 284 | nby = atoi(tokens[6].c_str()); | 
|---|
| 285 | xmin = atof(tokens[1].c_str());   xmax = atof(tokens[2].c_str()); | 
|---|
| 286 | ymin = atof(tokens[4].c_str());   ymax = atof(tokens[5].c_str()); | 
|---|
| 287 | Histo2D* h = new Histo2D(xmin, xmax, nbx, ymin, ymax, nby); | 
|---|
| 288 | mObjMgr->AddObj(h, tokens[0]); | 
|---|
| 289 | } | 
|---|
| 290 | else if (kw == "newprof" || kw == "newprofe") { | 
|---|
| 291 | if (tokens.size() < 4) | 
|---|
| 292 | { cout << "Usage: newprof[e] name xmin xmax nbin [ymin ymax]" << endl; return(0); } | 
|---|
| 293 | int_4 nbx = 100; | 
|---|
| 294 | r_8 xmin = 0., xmax = 1., ymin = 1., ymax = -1.; | 
|---|
| 295 | if(tokens.size() > 5) | 
|---|
| 296 | {ymin = atof(tokens[4].c_str());   ymax = atof(tokens[5].c_str());} | 
|---|
| 297 | nbx = atoi(tokens[3].c_str()); | 
|---|
| 298 | xmin = atof(tokens[1].c_str());   xmax = atof(tokens[2].c_str()); | 
|---|
| 299 | HProf* h = new HProf(xmin, xmax, nbx, ymin, ymax); | 
|---|
| 300 | if(kw == "newprofe") h->SetErrOpt(false); | 
|---|
| 301 | mObjMgr->AddObj(h, tokens[0]); | 
|---|
| 302 | } | 
|---|
| 303 |  | 
|---|
| 304 | // Creation de NTuple | 
|---|
| 305 | else if (kw == "newnt") { | 
|---|
| 306 | if(tokens.size() < 2) | 
|---|
| 307 | {cout<<"Usage: newnt name v1 v2 ... vn / newnt name nvar"<<endl; return(0);} | 
|---|
| 308 | vector<string> varname; | 
|---|
| 309 | int nvar = 0; | 
|---|
| 310 | const char *c = tokens[1].c_str(); | 
|---|
| 311 | if(isdigit(c[0])) { | 
|---|
| 312 | nvar = atoi(tokens[1].c_str()); | 
|---|
| 313 | if(nvar<=0 || nvar>=10000) | 
|---|
| 314 | {cout<<"newnt name nvar : nvar must be an positive integer<10000"<<endl; | 
|---|
| 315 | return(0);} | 
|---|
| 316 | for(int i=0;i<nvar;i++) { | 
|---|
| 317 | char str[16]; sprintf(str,"%d",i); | 
|---|
| 318 | string dum = "v"; dum += str; | 
|---|
| 319 | varname.push_back(dum.c_str()); | 
|---|
| 320 | } | 
|---|
| 321 | } else if( islower(c[0]) || isupper(c[0]) ) { | 
|---|
| 322 | for(int i=1;i<(int)tokens.size();i++) { | 
|---|
| 323 | varname.push_back(tokens[i].c_str()); | 
|---|
| 324 | nvar++; | 
|---|
| 325 | } | 
|---|
| 326 | } else { | 
|---|
| 327 | cout<<"newnt name v1 v2 ... vn : name vi must begin by a letter"<<endl | 
|---|
| 328 | <<"newnt name nvar : nvar must be an positive integer"<<endl; | 
|---|
| 329 | return(0); | 
|---|
| 330 | } | 
|---|
| 331 | char **noms = new char*[nvar]; | 
|---|
| 332 | for(int i=0;i<nvar;i++) noms[i] = (char *)varname[i].c_str(); | 
|---|
| 333 | NTuple* nt = new NTuple(nvar,noms); | 
|---|
| 334 | delete [] noms; | 
|---|
| 335 | mObjMgr->AddObj(nt,tokens[0]); | 
|---|
| 336 | } | 
|---|
| 337 |  | 
|---|
| 338 | // Creation de GeneralFitData | 
|---|
| 339 | else if (kw == "newgfd") { | 
|---|
| 340 | if (tokens.size() < 3) | 
|---|
| 341 | { cout << "Usage: newgfd nvar nalloc [errx(0/1)]" << endl; return(0); } | 
|---|
| 342 | int nvar, nalloc, errx=0; | 
|---|
| 343 | if (tokens.size() > 3) | 
|---|
| 344 | { errx = atoi(tokens[3].c_str()); if(errx>0) errx=1; else errx = 0;} | 
|---|
| 345 | nvar = atoi(tokens[1].c_str()); nalloc = atoi(tokens[2].c_str()); | 
|---|
| 346 | if(nvar>0 && nalloc>0) { | 
|---|
| 347 | GeneralFitData* gfd = new GeneralFitData(nvar,nalloc,errx); | 
|---|
| 348 | mObjMgr->AddObj(gfd, tokens[0]); | 
|---|
| 349 | } | 
|---|
| 350 | } | 
|---|
| 351 |  | 
|---|
| 352 | // Creation/remplissage de vecteur et de matrice | 
|---|
| 353 | else if (kw == "newvec") { | 
|---|
| 354 | if (tokens.size() < 2) { | 
|---|
| 355 | cout << "Usage: newvec name size [f(i) dopt] " << endl; return(0); | 
|---|
| 356 | } | 
|---|
| 357 | int n = atoi(tokens[1].c_str()); | 
|---|
| 358 | double xmin, xmax; | 
|---|
| 359 | xmin = 0.;  xmax = n; | 
|---|
| 360 | if (tokens.size() < 3)  { | 
|---|
| 361 | Vector* v = new Vector(n); | 
|---|
| 362 | mObjMgr->AddObj(v, tokens[0]); | 
|---|
| 363 | } | 
|---|
| 364 | else { | 
|---|
| 365 | if (tokens.size() < 4)  tokens.push_back(""); | 
|---|
| 366 | mObjMgr->GetServiceObj()->PlotFunc(tokens[2], tokens[0], xmin, xmax, n, tokens[3]); | 
|---|
| 367 | } | 
|---|
| 368 | } | 
|---|
| 369 | else if (kw == "newmtx") { | 
|---|
| 370 | if (tokens.size() < 3) { | 
|---|
| 371 | cout << "Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) dopt] " << endl; return(0); | 
|---|
| 372 | } | 
|---|
| 373 | int nx = atoi(tokens[1].c_str()); | 
|---|
| 374 | int ny = atoi(tokens[2].c_str()); | 
|---|
| 375 | double xmin, xmax, ymin, ymax; | 
|---|
| 376 | xmin = 0.;  xmax = nx; | 
|---|
| 377 | ymin = 0.;  ymax = ny; | 
|---|
| 378 | if (tokens.size() < 4)  { | 
|---|
| 379 | Matrix* mtx = new Matrix(ny,nx); | 
|---|
| 380 | mObjMgr->AddObj(mtx, tokens[0]); | 
|---|
| 381 | } | 
|---|
| 382 | else { | 
|---|
| 383 | if (tokens.size() < 5)  tokens.push_back("next"); | 
|---|
| 384 | mObjMgr->GetServiceObj()->PlotFunc2D(tokens[3], tokens[0], xmin, xmax, ymin, ymax, | 
|---|
| 385 | nx, ny, tokens[4]); | 
|---|
| 386 | } | 
|---|
| 387 | } | 
|---|
| 388 |  | 
|---|
| 389 | // Copie d'objets | 
|---|
| 390 | else if (kw == "copy") { | 
|---|
| 391 | if(tokens.size()<2) { | 
|---|
| 392 | cout<<"Usage: copy name_from  name_to"<<endl;return(0); | 
|---|
| 393 | } | 
|---|
| 394 | mObjMgr->CopyObj(tokens[0],tokens[1]); | 
|---|
| 395 | } | 
|---|
| 396 |  | 
|---|
| 397 |  | 
|---|
| 398 | // >>>>>>>>>>>  Affichage des objets | 
|---|
| 399 | else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") ) { | 
|---|
| 400 | if (tokens.size() < 1) { cout << "Usage: disp/surf/imag nameobj [opt]" << endl; return(0); } | 
|---|
| 401 | string opt = "next"; | 
|---|
| 402 | if (tokens.size() > 1)  opt = tokens[1]; | 
|---|
| 403 | if (kw == "disp") mObjMgr->DisplayObj(tokens[0], opt); | 
|---|
| 404 | else if (kw == "surf")  mObjMgr->DisplaySurf3D(tokens[0], opt); | 
|---|
| 405 | else if (kw == "imag")  mObjMgr->DisplayImage(tokens[0], opt); | 
|---|
| 406 | } | 
|---|
| 407 |  | 
|---|
| 408 | else if (kw == "nt2d") { | 
|---|
| 409 | if (tokens.size() < 3) { | 
|---|
| 410 | cout << "Usage: nt2d nameobj varx vary [errx erry wt label opt]" << endl; | 
|---|
| 411 | return(0); | 
|---|
| 412 | } | 
|---|
| 413 | while (tokens.size() < 8) tokens.push_back(""); | 
|---|
| 414 | string ph = ""; | 
|---|
| 415 | mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], ph, tokens[3], tokens[4], ph, | 
|---|
| 416 | tokens[5], tokens[6], tokens[7], false); | 
|---|
| 417 | } | 
|---|
| 418 | else if (kw == "nt3d") { | 
|---|
| 419 | if (tokens.size() < 7) { | 
|---|
| 420 | cout << "Usage: nt3d nameobj varx vary varz [errx erry errz wt label opt]" << endl; | 
|---|
| 421 | return(0); | 
|---|
| 422 | } | 
|---|
| 423 | while (tokens.size() < 10) tokens.push_back(""); | 
|---|
| 424 | mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], | 
|---|
| 425 | tokens[6], tokens[7], tokens[8], tokens[9], true); | 
|---|
| 426 | } | 
|---|
| 427 | else if (kw == "vecplot") { | 
|---|
| 428 | if (tokens.size() < 2) { | 
|---|
| 429 | cout << "Usage: vecplot nameVecX nameVecY [opt]" << endl; | 
|---|
| 430 | } | 
|---|
| 431 | while (tokens.size() < 3) tokens.push_back(""); | 
|---|
| 432 | mObjMgr->DisplayVector(tokens[0], tokens[1], tokens[2]); | 
|---|
| 433 | } | 
|---|
| 434 |  | 
|---|
| 435 | // Obsolete : ne pas virer SVP, cmv 26/7/99 | 
|---|
| 436 | else if (kw == "gfd2d") { | 
|---|
| 437 | cout<<"----- gfd2d OBSOLETE: utilisez nt2d -----"<<endl; | 
|---|
| 438 | if(tokens.size()<2) | 
|---|
| 439 | {cout<<"Usage: gfd2d nomobj numvarx erreur=(x y xy) opt"<<endl; | 
|---|
| 440 | return(0);} | 
|---|
| 441 | string numvary = ""; | 
|---|
| 442 | string err = ""; | 
|---|
| 443 | string opt = "next"; | 
|---|
| 444 | if(tokens.size()>2) err = tokens[2]; | 
|---|
| 445 | if(tokens.size()>3) opt = tokens[3]; | 
|---|
| 446 | mObjMgr->DisplayGFD(tokens[0],tokens[1],numvary,err,opt); | 
|---|
| 447 | } | 
|---|
| 448 | else if (kw == "gfd3d") { | 
|---|
| 449 | cout<<"----- gfd3d OBSOLETE: utilisez nt3d -----"<<endl; | 
|---|
| 450 | if(tokens.size()<3) | 
|---|
| 451 | {cout<<"Usage: gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) opt"<<endl; | 
|---|
| 452 | return(0);} | 
|---|
| 453 | string err = ""; | 
|---|
| 454 | string opt = "next"; | 
|---|
| 455 | if(tokens.size()>3) err = tokens[3]; | 
|---|
| 456 | if(tokens.size()>4) opt = tokens[4]; | 
|---|
| 457 | mObjMgr->DisplayGFD(tokens[0],tokens[1],tokens[2],err,opt); | 
|---|
| 458 | } | 
|---|
| 459 |  | 
|---|
| 460 | // >>>>>>>>>>>  Trace de fonctions | 
|---|
| 461 | else if ( (kw == "func") ) { | 
|---|
| 462 | if(tokens.size()<3) {cout<<"Usage: func f(x) xmin xmax [npt opt]"<<endl; return(0);} | 
|---|
| 463 | int np = 100; | 
|---|
| 464 | double xmin=0., xmax=1.; | 
|---|
| 465 | string opt = "", nom = ""; | 
|---|
| 466 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str()); | 
|---|
| 467 | if (tokens.size() > 3)  np = atoi(tokens[3].c_str()); | 
|---|
| 468 | if (tokens.size() > 4)  opt = tokens[4]; | 
|---|
| 469 | mObjMgr->GetServiceObj()->PlotFunc(tokens[0], nom, xmin, xmax, np, opt); | 
|---|
| 470 | } | 
|---|
| 471 | else if ( (kw == "funcff") ) { | 
|---|
| 472 | if (tokens.size()<4) {cout<<"Usage: funcff C-filename f(x)-name xmin xmax [npt opt]"<<endl; return(0);} | 
|---|
| 473 | int np = 100; | 
|---|
| 474 | double xmin=0., xmax=1.; | 
|---|
| 475 | string opt = "", nom = ""; | 
|---|
| 476 | xmin = atof(tokens[2].c_str());  xmax = atof(tokens[3].c_str()); | 
|---|
| 477 | if(tokens.size()>4)  np = atoi(tokens[4].c_str()); | 
|---|
| 478 | if(tokens.size()>5)  opt = tokens[5]; | 
|---|
| 479 | mObjMgr->GetServiceObj()->PlotFuncFrCFile(tokens[0], tokens[1], nom, xmin, xmax, np, opt); | 
|---|
| 480 | } | 
|---|
| 481 | else if ( (kw == "func2d") ) { | 
|---|
| 482 | if (tokens.size() < 7) { | 
|---|
| 483 | cout << "Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [opt]" << endl; | 
|---|
| 484 | return(0); | 
|---|
| 485 | } | 
|---|
| 486 | int npx, npy; | 
|---|
| 487 | double xmin, xmax; | 
|---|
| 488 | double ymin, ymax; | 
|---|
| 489 | npx = npy = 50; | 
|---|
| 490 | xmin = 0.;  xmax = 1.; | 
|---|
| 491 | ymin = 0.;  ymax = 1.; | 
|---|
| 492 | npx = atoi(tokens[3].c_str()); | 
|---|
| 493 | npy = atoi(tokens[6].c_str()); | 
|---|
| 494 | xmin = atof(tokens[1].c_str());   xmax = atof(tokens[2].c_str()); | 
|---|
| 495 | ymin = atof(tokens[4].c_str());   ymax = atof(tokens[5].c_str()); | 
|---|
| 496 | string opt = ""; | 
|---|
| 497 | if (tokens.size() > 7)  opt = tokens[7]; | 
|---|
| 498 | string nom = ""; | 
|---|
| 499 | mObjMgr->GetServiceObj()->PlotFunc2D(tokens[0], nom, xmin, xmax, ymin, ymax, npx, npy, opt); | 
|---|
| 500 | } | 
|---|
| 501 | else if ( (kw == "func2dff") ) { | 
|---|
| 502 | if (tokens.size() < 8) { | 
|---|
| 503 | cout << "Usage: func2d C-filename F(x,y)-name xmax nptx ymin ymax npty [opt]" << endl; | 
|---|
| 504 | return(0); | 
|---|
| 505 | } | 
|---|
| 506 | int npx, npy; | 
|---|
| 507 | double xmin, xmax; | 
|---|
| 508 | double ymin, ymax; | 
|---|
| 509 | npx = npy = 50; | 
|---|
| 510 | xmin = 0.;  xmax = 1.; | 
|---|
| 511 | ymin = 0.;  ymax = 1.; | 
|---|
| 512 | npx = atoi(tokens[4].c_str()); | 
|---|
| 513 | npy = atoi(tokens[7].c_str()); | 
|---|
| 514 | xmin = atof(tokens[2].c_str());   xmax = atof(tokens[3].c_str()); | 
|---|
| 515 | ymin = atof(tokens[5].c_str());   ymax = atof(tokens[6].c_str()); | 
|---|
| 516 | string opt = ""; | 
|---|
| 517 | if (tokens.size() > 8)  opt = tokens[8]; | 
|---|
| 518 | string nom = ""; | 
|---|
| 519 | mObjMgr->GetServiceObj()->PlotFunc2DFrCFile(tokens[0], tokens[1], nom, xmin, xmax, ymin, ymax, npx, npy, opt); | 
|---|
| 520 | } | 
|---|
| 521 |  | 
|---|
| 522 | // >>>>>>>>>>>  Trace d'expressions de N_Tuple, StarList, etc ... | 
|---|
| 523 | else if (kw == "plot2d" ) { | 
|---|
| 524 | if (tokens.size() < 3) { | 
|---|
| 525 | cout << "Usage: plot2d nameobj expx expy [expcut opt loop_par]" << endl; | 
|---|
| 526 | return(0); | 
|---|
| 527 | } | 
|---|
| 528 | string errx = ""; string erry = ""; | 
|---|
| 529 | if (tokens.size() < 4) tokens.push_back("1"); | 
|---|
| 530 | while (tokens.size() < 6) tokens.push_back(""); | 
|---|
| 531 | srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],errx,erry,tokens[3],tokens[4],tokens[5]); | 
|---|
| 532 | } | 
|---|
| 533 |  | 
|---|
| 534 | else if (kw == "plot2de" ) {  // Plot2D avec les erreurs | 
|---|
| 535 | if (tokens.size() < 5) { | 
|---|
| 536 | cout << "Usage: plot2de nameobj expx expy experrx experry [expcut opt loop_par]" << endl; | 
|---|
| 537 | return(0); | 
|---|
| 538 | } | 
|---|
| 539 | if (tokens.size() < 6) tokens.push_back("1"); | 
|---|
| 540 | while (tokens.size() < 8) tokens.push_back(""); | 
|---|
| 541 | srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4], | 
|---|
| 542 | tokens[5],tokens[6],tokens[7]); | 
|---|
| 543 | } | 
|---|
| 544 |  | 
|---|
| 545 | else if (kw == "plot2dw" ) {   // Plot2d avec poids | 
|---|
| 546 | if (tokens.size() < 4) { | 
|---|
| 547 | cout << "Usage: plot2dw nomobj expx expy expwt [expcut opt loop_par]" << endl; | 
|---|
| 548 | return(0); | 
|---|
| 549 | } | 
|---|
| 550 | if (tokens.size() < 5) tokens.push_back("1"); | 
|---|
| 551 | while (tokens.size() < 7) tokens.push_back(""); | 
|---|
| 552 | srvo->DisplayPoints2DW(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]); | 
|---|
| 553 | } | 
|---|
| 554 | else if (kw == "plot3d" ) { | 
|---|
| 555 | if (tokens.size() < 4) { | 
|---|
| 556 | cout << "Usage: plot3d nomobj expx expy expz [expcut opt loop_par]" << endl; | 
|---|
| 557 | return(0); | 
|---|
| 558 | } | 
|---|
| 559 | if (tokens.size() < 5) tokens.push_back("1"); | 
|---|
| 560 | while (tokens.size() < 7) tokens.push_back(""); | 
|---|
| 561 | srvo->DisplayPoints3D(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]); | 
|---|
| 562 | } | 
|---|
| 563 |  | 
|---|
| 564 | else if (kw == "projh1d" ) { | 
|---|
| 565 | if (tokens.size() < 3) { | 
|---|
| 566 | cout << "Usage: projh1d nomh1 nomobj expx [expwt expcut opt loop_par]" << endl; | 
|---|
| 567 | return(0); | 
|---|
| 568 | } | 
|---|
| 569 | if (tokens.size() < 4) tokens.push_back("1."); | 
|---|
| 570 | if (tokens.size() < 5) tokens.push_back("1"); | 
|---|
| 571 | while (tokens.size() < 7) tokens.push_back(""); | 
|---|
| 572 | srvo->ProjectH1(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] ); | 
|---|
| 573 | } | 
|---|
| 574 |  | 
|---|
| 575 |  | 
|---|
| 576 | // Projection dans histogrammes | 
|---|
| 577 | else if (kw == "projh2d" ) { | 
|---|
| 578 | if (tokens.size() < 4) { | 
|---|
| 579 | cout << "Usage: projh2d nomh2 nomobj expx expy [expwt expcut opt loop_par]" << endl; | 
|---|
| 580 | return(0); | 
|---|
| 581 | } | 
|---|
| 582 | if (tokens.size() < 5) tokens.push_back("1."); | 
|---|
| 583 | if (tokens.size() < 6) tokens.push_back("1"); | 
|---|
| 584 | while (tokens.size() < 8) tokens.push_back(""); | 
|---|
| 585 | srvo->ProjectH2(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0], | 
|---|
| 586 | tokens[6], tokens[7] ); | 
|---|
| 587 | } | 
|---|
| 588 |  | 
|---|
| 589 | else if (kw == "projprof" ) { | 
|---|
| 590 | if (tokens.size() < 4) { | 
|---|
| 591 | cout << "Usage: projprof nomprof nomobj expx expy [expwt expcut opt loop_par]" << endl; | 
|---|
| 592 | return(0); | 
|---|
| 593 | } | 
|---|
| 594 | if (tokens.size() < 5) tokens.push_back("1."); | 
|---|
| 595 | if (tokens.size() < 6) tokens.push_back("1"); | 
|---|
| 596 | while (tokens.size() < 8) tokens.push_back(""); | 
|---|
| 597 | srvo->ProjectHProf(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0], | 
|---|
| 598 | tokens[6], tokens[7] ); | 
|---|
| 599 | } | 
|---|
| 600 |  | 
|---|
| 601 | // Projection dans vector/matrix | 
|---|
| 602 | else if (kw == "fillvec" ) { | 
|---|
| 603 | if (tokens.size() < 4) { | 
|---|
| 604 | cout << "Usage: fillvec nomvec nomobj expx expv [expcut opt loop_par]" << endl; | 
|---|
| 605 | return(0); | 
|---|
| 606 | } | 
|---|
| 607 | if (tokens.size() < 5) tokens.push_back("1"); | 
|---|
| 608 | while (tokens.size() < 7) tokens.push_back(""); | 
|---|
| 609 | srvo->FillVect(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] ); | 
|---|
| 610 | } | 
|---|
| 611 |  | 
|---|
| 612 | else if (kw == "fillmtx" ) { | 
|---|
| 613 | if (tokens.size() < 5) { | 
|---|
| 614 | cout << "Usage: fillmtx nommtx nomobj expx expy expv [expcut opt loop_par]" << endl; | 
|---|
| 615 | return(0); | 
|---|
| 616 | } | 
|---|
| 617 | if (tokens.size() < 6) tokens.push_back("1"); | 
|---|
| 618 | while (tokens.size() < 8) tokens.push_back(""); | 
|---|
| 619 | srvo->FillMatx(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0], | 
|---|
| 620 | tokens[6], tokens[7] ); | 
|---|
| 621 | } | 
|---|
| 622 |  | 
|---|
| 623 | // Remplissage NTuple,Vecteurs, ... , boucle de NTuple | 
|---|
| 624 | else if (kw == "ntfrascii" ) { | 
|---|
| 625 | if(tokens.size() < 2) { | 
|---|
| 626 | cout<<"Usage: ntfrascii nt_name file_name [def_init_val]"<<endl; | 
|---|
| 627 | return(0); | 
|---|
| 628 | } | 
|---|
| 629 | double def_val = 0.; | 
|---|
| 630 | if(tokens.size()>=3) def_val = atof(tokens[2].c_str()); | 
|---|
| 631 | srvo->NtFromASCIIFile(tokens[0],tokens[1],def_val); | 
|---|
| 632 | } | 
|---|
| 633 |  | 
|---|
| 634 | else if (kw == "fillnt" ) { | 
|---|
| 635 | if (tokens.size() < 5) { | 
|---|
| 636 | cout << "Usage: fillnt nameobj expx expy expz expt [expcut ntname loop_par]" << endl; | 
|---|
| 637 | return(0); | 
|---|
| 638 | } | 
|---|
| 639 | while (tokens.size() < 8) tokens.push_back(""); | 
|---|
| 640 | srvo->FillNT(tokens[0],tokens[1],tokens[2], tokens[3], tokens[4], tokens[5], tokens[6], tokens[7] ); | 
|---|
| 641 | } | 
|---|
| 642 |  | 
|---|
| 643 | else if (kw == "ntloop" ) { | 
|---|
| 644 | if (tokens.size() < 3) { | 
|---|
| 645 | cout << "Usage: ntloop nameobj fname funcname [ntname loop_par ]" << endl; | 
|---|
| 646 | return(0); | 
|---|
| 647 | } | 
|---|
| 648 | while (tokens.size() < 5) tokens.push_back(""); | 
|---|
| 649 | srvo->FillNTFrCFile(tokens[0],tokens[1], tokens[2], tokens[3], tokens[4]); | 
|---|
| 650 | } | 
|---|
| 651 |  | 
|---|
| 652 | else if (kw == "ntexpcfile" ) { | 
|---|
| 653 | if (tokens.size() < 3) { | 
|---|
| 654 | cout << "Usage: ntexpcfile nameobj fname funcname" << endl; | 
|---|
| 655 | return(0); | 
|---|
| 656 | } | 
|---|
| 657 | srvo->PrepareNTExpressionCFile(tokens[0],tokens[1], tokens[2]); | 
|---|
| 658 | } | 
|---|
| 659 |  | 
|---|
| 660 | else if (kw == "exptovec" ) { | 
|---|
| 661 | if (tokens.size() < 3) { | 
|---|
| 662 | cout << "Usage: exptovec nomvec nameobj expx [expcut opt loop_par]" << endl; | 
|---|
| 663 | return(0); | 
|---|
| 664 | } | 
|---|
| 665 | while (tokens.size() < 6) tokens.push_back(""); | 
|---|
| 666 | srvo->ExpressionToVector(tokens[1],tokens[2],tokens[3],tokens[0],tokens[4],tokens[5]); | 
|---|
| 667 | } | 
|---|
| 668 |  | 
|---|
| 669 | else if (kw == "fillgd1" ) { | 
|---|
| 670 | if (tokens.size() < 5) { | 
|---|
| 671 | cout << "Usage: fillgd1 nomgfd nomobj expx expy experry [expcut loop_par] " << endl; | 
|---|
| 672 | return(0); | 
|---|
| 673 | } | 
|---|
| 674 | if (tokens.size() < 6) tokens.push_back("1"); | 
|---|
| 675 | if (tokens.size() < 7) tokens.push_back(""); | 
|---|
| 676 | string expy = ""; | 
|---|
| 677 | srvo->FillGFD(tokens[1],tokens[2], expy, tokens[3], tokens[4], tokens[5], tokens[0]); | 
|---|
| 678 | } | 
|---|
| 679 |  | 
|---|
| 680 | else if (kw == "fillgd2" ) { | 
|---|
| 681 | if (tokens.size() < 6) { | 
|---|
| 682 | cout << "Usage: fillgd2 nomgfd nomobj expx expy expz experrz [expcut loop_par]" << endl; | 
|---|
| 683 | return(0); | 
|---|
| 684 | } | 
|---|
| 685 | if (tokens.size() < 7) tokens.push_back("1"); | 
|---|
| 686 | if (tokens.size() < 8) tokens.push_back(""); | 
|---|
| 687 | srvo->FillGFD(tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6], tokens[0], tokens[7]); | 
|---|
| 688 | } | 
|---|
| 689 |  | 
|---|
| 690 | else if (kw == "gdfrvec" ) { | 
|---|
| 691 | if(tokens.size()<3) { | 
|---|
| 692 | cout<<"Usage: gdfrvec namegfd X Y\n" | 
|---|
| 693 | <<"       gdfrvec namegfd X Y" | 
|---|
| 694 | <<"       gdfrvec namegfd X Y ! EY\n" | 
|---|
| 695 | <<"       gdfrvec namegfd X Y Z\n" | 
|---|
| 696 | <<"       gdfrvec namegfd X Y Z EZ"<<endl; | 
|---|
| 697 | return(0); | 
|---|
| 698 | } | 
|---|
| 699 | while(tokens.size()<5) tokens.push_back("!"); | 
|---|
| 700 | srvo->FillGFDfrVec(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4]); | 
|---|
| 701 | } | 
|---|
| 702 |  | 
|---|
| 703 |  | 
|---|
| 704 | else  { | 
|---|
| 705 | cerr << "PIABaseExecutor::Do() Erreur - Commande " << kw << " inconuue ! " << endl; | 
|---|
| 706 | return(-1); | 
|---|
| 707 | } | 
|---|
| 708 |  | 
|---|
| 709 | return(0); | 
|---|
| 710 | } | 
|---|
| 711 |  | 
|---|
| 712 | // Fonction pour enregistrer le Help des Widgets et Windows de piapp | 
|---|
| 713 | static void RegisterPIGraphicsHelp(PIACmd* piac); | 
|---|
| 714 |  | 
|---|
| 715 | /* --Methode-- */ | 
|---|
| 716 | void PIABaseExecutor::RegisterCommands() | 
|---|
| 717 | { | 
|---|
| 718 | string kw, usage; | 
|---|
| 719 | kw = "loadmodule"; | 
|---|
| 720 | usage = "To load and initialize modules \n  Usage: loadmodule fnameso modulename"; | 
|---|
| 721 | usage += "\n  Related commands: link"; | 
|---|
| 722 | mpiac->RegisterCommand(kw, usage, this, "External Modules"); | 
|---|
| 723 | kw = "link"; | 
|---|
| 724 | usage = "Dynamic linking of compiled user functions \n  Usage: link fnameso f1 [f2 f3]"; | 
|---|
| 725 | usage += "\n  fnameso: Shared-object file name, f1,f2,f3 : User function names "; | 
|---|
| 726 | usage += "\n  Related commands: call loadmodule linkff2"; | 
|---|
| 727 | mpiac->RegisterCommand(kw, usage, this, "External Modules"); | 
|---|
| 728 | kw = "linkff2"; | 
|---|
| 729 | usage = "Dynamic linking of compiled user functions (Set 2)\n  Usage: linkff2 fnameso f1 [f2 f3]"; | 
|---|
| 730 | usage += "\n  fnameso: Shared-object file name, f1,f2,f3 : User function names "; | 
|---|
| 731 | usage += "\n  Related commands: call link loadmodule"; | 
|---|
| 732 | mpiac->RegisterCommand(kw, usage, this, "External Modules"); | 
|---|
| 733 | kw = "call"; | 
|---|
| 734 | usage = "Dynamically linked user function call \n Usage: call userf [arg1 arg2 ...]"; | 
|---|
| 735 | usage += "\n  User function : f(vector<string>& args)"; | 
|---|
| 736 | usage += "\n  Related commands: link"; | 
|---|
| 737 | mpiac->RegisterCommand(kw, usage, this, "External Modules"); | 
|---|
| 738 |  | 
|---|
| 739 | kw = "zone"; | 
|---|
| 740 | usage = "To Divide the Graphic window \n  Usage: zone [nx=1 ny=1]"; | 
|---|
| 741 | usage += "\n  Related commands: newwin"; | 
|---|
| 742 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 743 | kw = "newwin"; | 
|---|
| 744 | usage = "To Create a New Graphic window, with zones \n  Usage: newwin nx ny"; | 
|---|
| 745 | usage += "\n  Related commands: zone"; | 
|---|
| 746 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 747 | kw = "stacknext"; | 
|---|
| 748 | usage = "Displays the next widget on stack window \n  Usage: stacknext"; | 
|---|
| 749 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 750 |  | 
|---|
| 751 | kw = "graphicatt"; | 
|---|
| 752 | usage = "To change default graphic options \n  Usage: graphicatt att_list \n"; | 
|---|
| 753 | usage += "att_list=def back to default values, Example: gratt 'red circlemarker5'"; | 
|---|
| 754 | usage += "\n ------------------ Graphic attribute list ------------------ \n"; | 
|---|
| 755 | usage += ">> Colors: defcol black white grey red blue green yellow \n"; | 
|---|
| 756 | usage += "           magenta cyan turquoise navyblue orange siennared purple \n"; | 
|---|
| 757 | usage += "           limegreen gold violet violetred blueviolet darkviolet \n"; | 
|---|
| 758 | usage += ">> Lines:  defline normalline thinline thickline dashedline thindashedline \n"; | 
|---|
| 759 | usage += "           thickdashedline dottedline thindottedline thickdottedline \n"; | 
|---|
| 760 | usage += ">> Font Att: deffontatt normalfont boldfont italicfont bolditalicfont  \n"; | 
|---|
| 761 | usage += "             smallfont smallboldfont smallitalicfont smallbolditalicfont \n"; | 
|---|
| 762 | usage += "             bigfont bigboldfont bigitalicfont bigbolditalicfont \n"; | 
|---|
| 763 | usage += "             hugefont  hugeboldfont hugeitalicfont hugebolditalicfont \n"; | 
|---|
| 764 | usage += ">> Font Names: deffont courierfont helveticafont timesfont symbolfont  \n"; | 
|---|
| 765 | usage += ">> Marker: dotmarker<T>  plusmarker<T>  crossmarker<T> circlemarker <T> \n"; | 
|---|
| 766 | usage += "           fcirclemarker<T> boxmarker<T> fboxmarker<T> trianglemarker<T> \n"; | 
|---|
| 767 | usage += "           ftrianglemarker<T>  starmarker<T>  fstarmarker<T> \n"; | 
|---|
| 768 | usage += "   with <T> = 1 3 5 7 9 , Example fboxmarker5 , plusmarker9 ... \n"; | 
|---|
| 769 | usage += ">> ColorTables: defcmap  grey32  invgrey32  colrj32  colbr32 \n"; | 
|---|
| 770 | usage += "                grey128  invgrey128  colrj128  colbr128 \n"; | 
|---|
| 771 | usage += "                midas_pastel midas_heat midas_rainbow3 midas_bluered\n"; | 
|---|
| 772 | usage += "                midas_bluewhite midas_redwhite \n"; | 
|---|
| 773 | usage += "                rainbow16 \n"; | 
|---|
| 774 | usage += "   revcmap : This flag reverses ColorMap indexing \n"; | 
|---|
| 775 | usage += ">> ZoomFactors: defzoom zoomx1 zoomx2 zoomx3 zoomx4 zoomx5 \n"; | 
|---|
| 776 | usage += "                               zoom/2 zoom/3 zoom/4 zoom/5 \n"; | 
|---|
| 777 | usage += ">> imagecenter=ix,iy -> Position the image in widget \n"; | 
|---|
| 778 | usage += ">> Axes:  stdaxes=defaxes=boxaxes  simpleaxes boxaxesgrid \n"; | 
|---|
| 779 | usage += "          fineaxes finesimpleaxes  fineaxesgrid=grid \n"; | 
|---|
| 780 | usage += "          simpleaxesgrid finesimpleaxesgrid \n"; | 
|---|
| 781 | usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n"; | 
|---|
| 782 | usage += ">> XYLimits : xylimits  -> Forces X-Y limits in 2-D plots \n"; | 
|---|
| 783 | usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n"; | 
|---|
| 784 | usage += ">> title/notitle or tit/notit -> Toggle Auto AddTitle flag \n"; | 
|---|
| 785 | usage += ">> DisplayWindow: next same win stack inset \n"; | 
|---|
| 786 | usage += "   Related commands: setaxesatt setinsetlimits "; | 
|---|
| 787 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 788 |  | 
|---|
| 789 | kw = "setaxesatt"; | 
|---|
| 790 | usage = "To set default axes attributes \n  Usage: setaxesatt att_list \n"; | 
|---|
| 791 | usage += ">> Axes:  stdaxes=defaxes=boxaxes  simpleaxes boxaxesgrid \n"; | 
|---|
| 792 | usage += "          fineaxes  finesimpleaxes fineaxesgrid=grid \n"; | 
|---|
| 793 | usage += "          simpleaxesgrid finesimpleaxesgrid \n"; | 
|---|
| 794 | usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n"; | 
|---|
| 795 | usage += ">> xylimits=xmin,xmax,ymin,ymax  -> Forces X-Y limits in 2-D plots \n"; | 
|---|
| 796 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 797 |  | 
|---|
| 798 |  | 
|---|
| 799 | kw = "setinsetlimits"; | 
|---|
| 800 | usage = "Define the display rectangle for drawers added as insets \n"; | 
|---|
| 801 | usage += " over existing graphic objects - limits expressed as fraction \n"; | 
|---|
| 802 | usage += " graphic object size (0. .. 1.) Xmax at right, YMax top. "; | 
|---|
| 803 | usage += " Usage: setinsetlimits xmin xmax ymin ymax"; | 
|---|
| 804 | usage += "\n  Related commands: graphicatt /inset"; | 
|---|
| 805 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 806 |  | 
|---|
| 807 | kw = "setimgcenter"; | 
|---|
| 808 | usage = "Define image center postion \n Usage: setimgcenter xc yc"; | 
|---|
| 809 | usage += "\n  Related commands: graphicatt /centerimg"; | 
|---|
| 810 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 811 |  | 
|---|
| 812 | kw = "addtext"; | 
|---|
| 813 | usage = "Adds a text string to the current graphic object"; | 
|---|
| 814 | usage += "\n at the specified position (+ color and font attributes) "; | 
|---|
| 815 | usage += "\n The Base/AxesDrawer is used to handle added text strings" ; | 
|---|
| 816 | usage += "\n Alt<Z> to remove added elements"; | 
|---|
| 817 | usage += "\n Font attribute is common with axes"; | 
|---|
| 818 | usage += "\n  Usage: addtext x y TextString [ColFontAtt]"; | 
|---|
| 819 | usage += "\n  (use quotes '' for multi word text strings) "; | 
|---|
| 820 | usage += "\n  Related commands: addline addrect addfrect addcirc addfcirc settitle graphicatt"; | 
|---|
| 821 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 822 |  | 
|---|
| 823 | kw = "addline"; | 
|---|
| 824 | usage = "Adds a line to the current graphic object"; | 
|---|
| 825 | usage += "\n at the specified position (+ color attribute)"; | 
|---|
| 826 | usage += "\n The Base/AxesDrawer is used to handle added lines"; | 
|---|
| 827 | usage += "\n Alt<Z> to remove added elements"; | 
|---|
| 828 | usage += "\n  Usage: addline x1 y1 x2 y2 [ColAtt]"; | 
|---|
| 829 | usage += "\n  Related commands: addtext addrect addfrect addcirc addfcirc graphicatt"; | 
|---|
| 830 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 831 |  | 
|---|
| 832 | kw = "addrect"; | 
|---|
| 833 | usage = "Adds a rectangle to the current graphic object"; | 
|---|
| 834 | usage += "\n between the specified positions (+ color attribute)"; | 
|---|
| 835 | usage += "\n The Base/AxesDrawer is used to handle added rectangle"; | 
|---|
| 836 | usage += "\n Alt<Z> to remove added elements"; | 
|---|
| 837 | usage += "\n  Usage: addrect x1 y1 x2 y2 [ColAtt]"; | 
|---|
| 838 | usage += "\n  Related commands: addtext addline addfrect addcirc addfcirc graphicatt"; | 
|---|
| 839 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 840 |  | 
|---|
| 841 | kw = "addfrect"; | 
|---|
| 842 | usage = "Adds a filled rectangle to the current graphic object"; | 
|---|
| 843 | usage += "\n between the specified positions (+ color attribute)"; | 
|---|
| 844 | usage += "\n The Base/AxesDrawer is used to handle added rectangle"; | 
|---|
| 845 | usage += "\n Alt<Z> to remove added elements"; | 
|---|
| 846 | usage += "\n  Usage: addfrect x1 y1 x2 y2 [ColAtt]"; | 
|---|
| 847 | usage += "\n  Related commands: addtext addline addrect addcirc addfcirc graphicatt"; | 
|---|
| 848 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 849 |  | 
|---|
| 850 | kw = "addcirc"; | 
|---|
| 851 | usage = "Adds a circle to the current graphic object"; | 
|---|
| 852 | usage += "\n with the specified center and radius (+ color attribute)"; | 
|---|
| 853 | usage += "\n The Base/AxesDrawer is used to handle added circles"; | 
|---|
| 854 | usage += "\n Alt<Z> to remove added elements"; | 
|---|
| 855 | usage += "\n  Usage: addcirc xcenter ycenter radius [ColAtt]"; | 
|---|
| 856 | usage += "\n  Related commands: addtext addline addfrect addfrect addfcirc graphicatt"; | 
|---|
| 857 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 858 |  | 
|---|
| 859 | kw = "addfcirc"; | 
|---|
| 860 | usage = "Adds a filled circle to the current graphic object"; | 
|---|
| 861 | usage += "\n with the specified center and radius (+ color attribute)"; | 
|---|
| 862 | usage += "\n The Base/AxesDrawer is used to handle added circles"; | 
|---|
| 863 | usage += "\n Alt<Z> to remove added elements"; | 
|---|
| 864 | usage += "\n  Usage: addcirc xcenter ycenter radius [ColAtt]"; | 
|---|
| 865 | usage += "\n  Related commands: addtext addline addfrect addfrect addcirc graphicatt"; | 
|---|
| 866 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 867 |  | 
|---|
| 868 | kw = "settitle"; | 
|---|
| 869 | usage = "Set the title string (top title / bottom title) for the current graphic object"; | 
|---|
| 870 | usage += "\n  Usage: settitle TopTitle [BottomTitle] [fontAtt]"; | 
|---|
| 871 | usage += "\n  Related commands: addtext graphicatt"; | 
|---|
| 872 | mpiac->RegisterCommand(kw, usage, this, "Graphics"); | 
|---|
| 873 |  | 
|---|
| 874 | RegisterPIGraphicsHelp(mpiac); | 
|---|
| 875 |  | 
|---|
| 876 | kw = "openfits"; | 
|---|
| 877 | usage = "Loads a FITS file into an Image<T> \n Usage: openfits filename"; | 
|---|
| 878 | usage += "\n  Related commands: savefits openppf"; | 
|---|
| 879 | mpiac->RegisterCommand(kw, usage, this, "FileIO"); | 
|---|
| 880 | kw = "savefits"; | 
|---|
| 881 | usage = "Save an object into a FITS file \n Usage: savefits nameobj filename"; | 
|---|
| 882 | usage += "\n  Related commands: openfits saveall"; | 
|---|
| 883 | mpiac->RegisterCommand(kw, usage, this, "FileIO"); | 
|---|
| 884 | kw = "openppf"; | 
|---|
| 885 | usage = "Reads all objects from a PPF file \n Usage: openppf filename"; | 
|---|
| 886 | usage += "\n  Related commands: saveall openfits"; | 
|---|
| 887 | mpiac->RegisterCommand(kw, usage, this, "FileIO"); | 
|---|
| 888 | kw = "saveobjs"; | 
|---|
| 889 | usage = "Saves objects with names matching a pattern (x?y*) into a PPF file \n"; | 
|---|
| 890 | usage += "Usage: saveobjs nameobjpattern filename"; | 
|---|
| 891 | usage += "\n  Related commands: saveall openppf savefits"; | 
|---|
| 892 | mpiac->RegisterCommand(kw, usage, this, "FileIO"); | 
|---|
| 893 | kw = "saveall"; | 
|---|
| 894 | usage = "Saves all objects into a PPF file \n Usage: saveall filename"; | 
|---|
| 895 | usage += "\n  Related commands: saveobj openppf savefits"; | 
|---|
| 896 | mpiac->RegisterCommand(kw, usage, this, "FileIO"); | 
|---|
| 897 | kw = "ntfrascii"; | 
|---|
| 898 | usage = "Fills an existing NTuple from ASCII table file"; | 
|---|
| 899 | usage += "\n Usage: ntfrascii nt_name file_name [def_init_val]"; | 
|---|
| 900 | usage += "\n  Related commands: ntloop fillnt "; | 
|---|
| 901 | mpiac->RegisterCommand(kw, usage, this, "FileIO"); | 
|---|
| 902 |  | 
|---|
| 903 |  | 
|---|
| 904 | kw = "print"; | 
|---|
| 905 | usage = "Prints an object \n Usage: print nameobj"; | 
|---|
| 906 | mpiac->RegisterCommand(kw, usage, this, "FileIO"); | 
|---|
| 907 |  | 
|---|
| 908 | kw = "mkdir"; | 
|---|
| 909 | usage = "Create a directory"; | 
|---|
| 910 | usage += "\n Usage: mkdir dirname [true]"; | 
|---|
| 911 | usage += "\n if second argument==true, the directory's KeepOld attribute is set to true"; | 
|---|
| 912 | mpiac->RegisterCommand(kw, usage, this, "Object Management"); | 
|---|
| 913 | kw = "rmdir"; | 
|---|
| 914 | usage = "Removes an empty directory"; | 
|---|
| 915 | usage += "\n Usage: remove dirname"; | 
|---|
| 916 | mpiac->RegisterCommand(kw, usage, this, "Object Management"); | 
|---|
| 917 | kw = "cd"; | 
|---|
| 918 | usage = "Change current directory"; | 
|---|
| 919 | usage += "\n Usage: cd [dirname]"; | 
|---|
| 920 | mpiac->RegisterCommand(kw, usage, this, "Object Management"); | 
|---|
| 921 | kw = "pwd"; | 
|---|
| 922 | usage = "Prints current directory"; | 
|---|
| 923 | usage += "\n Usage: pwd"; | 
|---|
| 924 | mpiac->RegisterCommand(kw, usage, this, "Object Management"); | 
|---|
| 925 | kw = "listdirs"; | 
|---|
| 926 | usage = "Prints the list of directories"; | 
|---|
| 927 | usage += "\n Usage: listdirs [patt=*] \n patt : * , ? "; | 
|---|
| 928 | mpiac->RegisterCommand(kw, usage, this, "Object Management"); | 
|---|
| 929 | kw = "listobjs"; | 
|---|
| 930 | usage = "Prints the list of objects (Alias: ls)"; | 
|---|
| 931 | usage += "\n Usage: listobjs [patt=*] \n patt : /*/x?y* ... "; | 
|---|
| 932 | mpiac->RegisterCommand(kw, usage, this, "Object Management"); | 
|---|
| 933 | kw = "rename"; | 
|---|
| 934 | usage = "Rename an object (Alias: mv) \n Usage: rename nameobj namenew"; | 
|---|
| 935 | usage += "\n  Related commands: del delobjs"; | 
|---|
| 936 | mpiac->RegisterCommand(kw, usage, this, "Object Management"); | 
|---|
| 937 | kw = "copy"; | 
|---|
| 938 | usage = "Copy objects \n"; | 
|---|
| 939 | usage +="  Usage: copy name_from name_to"; | 
|---|
| 940 | usage += "\n  Related commands: new..."; | 
|---|
| 941 | mpiac->RegisterCommand(kw, usage, this, "Object Management"); | 
|---|
| 942 | kw = "del"; | 
|---|
| 943 | usage = "Deletes an object (Alias: rm) \n Usage: del nameobj [nameobj2 ...]"; | 
|---|
| 944 | usage += "\n  Related commands: delobjs  rename"; | 
|---|
| 945 | mpiac->RegisterCommand(kw, usage, this, "Object Management"); | 
|---|
| 946 | kw = "delobjs"; | 
|---|
| 947 | usage = "Delete a set of objects with names matching a pattern (x?y*)"; | 
|---|
| 948 | usage += "\n Usage: delobjs nameobjpattern \n"; | 
|---|
| 949 | usage += "\n  Related commands: del rename"; | 
|---|
| 950 | mpiac->RegisterCommand(kw, usage, this, "Object Management"); | 
|---|
| 951 |  | 
|---|
| 952 | kw = "newh1d"; | 
|---|
| 953 | usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin"; | 
|---|
| 954 | usage += "\n  Related commands: newh2d  newprof[e] newnt  newgfd "; | 
|---|
| 955 | mpiac->RegisterCommand(kw, usage, this, "Objects"); | 
|---|
| 956 | kw = "newh2d"; | 
|---|
| 957 | usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny"; | 
|---|
| 958 | usage += "\n  Related commands: newh1d  newprof[e] newnt  newgfd "; | 
|---|
| 959 | mpiac->RegisterCommand(kw, usage, this, "Objects"); | 
|---|
| 960 | kw = "newprof"; | 
|---|
| 961 | usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]"; | 
|---|
| 962 | usage += "\n  Errors represent the data spread in the X bin "; | 
|---|
| 963 | usage += "\n  Related commands: newh1d  newh2d newprofe newnt newgfd "; | 
|---|
| 964 | mpiac->RegisterCommand(kw, usage, this, "Objects"); | 
|---|
| 965 | kw = "newprofe"; | 
|---|
| 966 | usage = "Creates a profile histogramm \n Usage: newprofe name xmin xmax nbin [ymin ymax]"; | 
|---|
| 967 | usage += "\n  Errors represent the error on the data mean in the X bin "; | 
|---|
| 968 | usage += "\n  Related commands: newh1d  newh2d newprof newnt newgfd "; | 
|---|
| 969 | mpiac->RegisterCommand(kw, usage, this, "Objects"); | 
|---|
| 970 | kw = "newnt"; | 
|---|
| 971 | usage = "Creates a ntuple \n Usage: newnt name v1 v2 v3 .. vn"; | 
|---|
| 972 | usage += "\n        newnt name nvar"; | 
|---|
| 973 | usage += "\n  Related commands: newh1d  newh2d newprof[e] newgfd "; | 
|---|
| 974 | mpiac->RegisterCommand(kw, usage, this, "Objects"); | 
|---|
| 975 | kw = "newgfd"; | 
|---|
| 976 | usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]"; | 
|---|
| 977 | usage += "\n  Related commands: newh1d  newh2d  newprof[e] newnt "; | 
|---|
| 978 | mpiac->RegisterCommand(kw, usage, this, "Objects"); | 
|---|
| 979 | kw = "newvec"; | 
|---|
| 980 | usage = "Creates (and optionaly fills) a vector \n Usage: newvec name size [f(i) [dopt] ] "; | 
|---|
| 981 | usage += "\n  Related commands: newmtx"; | 
|---|
| 982 | mpiac->RegisterCommand(kw, usage, this, "Objects"); | 
|---|
| 983 | kw = "newmtx"; | 
|---|
| 984 | usage = "Creates (and optionaly fills) a matrix \n"; | 
|---|
| 985 | usage +="  Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) [dopt] ] "; | 
|---|
| 986 | usage += "\n  Related commands: newvec"; | 
|---|
| 987 | mpiac->RegisterCommand(kw, usage, this, "Objects"); | 
|---|
| 988 |  | 
|---|
| 989 | kw = "disp"; | 
|---|
| 990 | usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]"; | 
|---|
| 991 | usage += "\n  Related commands: surf nt2d nt3d vecplot"; | 
|---|
| 992 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); | 
|---|
| 993 | kw = "imag"; | 
|---|
| 994 | usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]"; | 
|---|
| 995 | usage += "\n  Related commands: disp surf nt2d nt3d vecplot"; | 
|---|
| 996 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); | 
|---|
| 997 | kw = "surf"; | 
|---|
| 998 | usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]"; | 
|---|
| 999 | usage += "\n  Related commands: disp nt2d nt3d vecplot"; | 
|---|
| 1000 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); | 
|---|
| 1001 | kw = "nt2d"; | 
|---|
| 1002 | usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple "; | 
|---|
| 1003 | usage += "\n Usage : nt2d nameobj varx vary [errx erry wt label graphic_attributes]"; | 
|---|
| 1004 | usage += "\n  Related commands: disp  surf  nt3d  gfd2d vecplot"; | 
|---|
| 1005 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); | 
|---|
| 1006 | kw = "nt3d"; | 
|---|
| 1007 | usage = "Displays 3D-Points (X-Y-Z) [with error-bars / Weight / Label ] from an NTuple "; | 
|---|
| 1008 | usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz wt label graphic_attributes]"; | 
|---|
| 1009 | usage += "\n  Related commands: disp  surf  nt2d gfd3d "; | 
|---|
| 1010 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); | 
|---|
| 1011 | kw = "vecplot"; | 
|---|
| 1012 | usage = "Displays Points (X-Y) with coordinates defined by two vectors "; | 
|---|
| 1013 | usage += "\n Usage : vecplot nameVecX nameVecY [graphic_attributes]"; | 
|---|
| 1014 | usage += "\n  Related commands: disp nt2d "; | 
|---|
| 1015 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); | 
|---|
| 1016 |  | 
|---|
| 1017 | // Ceci est maintenant obsolete, on garde pour info. | 
|---|
| 1018 | kw = "gfd2d"; | 
|---|
| 1019 | usage = "Displays Points (X-Y) with error-bars from a GeneralFit Data "; | 
|---|
| 1020 | usage += "\n Usage : gfd2d nameobj numvarx erreur=(x y xy) [graphic_attributes]"; | 
|---|
| 1021 | usage += "\n  Related commands: gfd3d nt2d nt3d "; | 
|---|
| 1022 | usage += "\n  ----- OBSOLETE: utilisez nt2d -----"; | 
|---|
| 1023 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); | 
|---|
| 1024 | kw = "gfd3d"; | 
|---|
| 1025 | usage = "Displays 3D-Points (X-Y-Z) with error-bars from a GeneralFit Data "; | 
|---|
| 1026 | usage += "\n Usage : gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) [graphic_attributes]"; | 
|---|
| 1027 | usage += "\n  Related commands: gfd2d nt2d nt3d "; | 
|---|
| 1028 | usage += "\n  ----- OBSOLETE: utilisez nt3d -----"; | 
|---|
| 1029 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); | 
|---|
| 1030 |  | 
|---|
| 1031 | kw = "func"; | 
|---|
| 1032 | usage = "Displays a function y=f(x) (Fills a vector with function values)"; | 
|---|
| 1033 | usage += "\n Usage: func f(x) xmin xmax [npt graphic_attributes]"; | 
|---|
| 1034 | usage += "\n  Related commands: funcff func2d func2dff "; | 
|---|
| 1035 | mpiac->RegisterCommand(kw, usage, this, "Func Plot"); | 
|---|
| 1036 | kw = "funcff"; | 
|---|
| 1037 | usage = "Displays a function y=f(x) from a C-file (Fills a vector with function values)"; | 
|---|
| 1038 | usage += "\n Usage: funcff C-FileName FunctionName xmin xmax [npt graphic_attributes]"; | 
|---|
| 1039 | usage += "\n  Related commands: func func2d func2dff "; | 
|---|
| 1040 | mpiac->RegisterCommand(kw, usage, this, "Func Plot"); | 
|---|
| 1041 | kw = "func2d"; | 
|---|
| 1042 | usage = "Displays a function z=f(x,y) (Fills a matrix with function values)"; | 
|---|
| 1043 | usage += "\n Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [graphic_attributes]"; | 
|---|
| 1044 | usage += "\n  Related commands: func"; | 
|---|
| 1045 | mpiac->RegisterCommand(kw, usage, this, "Func Plot"); | 
|---|
| 1046 | kw = "func2dff"; | 
|---|
| 1047 | usage = "Displays a function z=f(x,y) from a C-file (Fills a matrix with function values)"; | 
|---|
| 1048 | usage += "\n Usage: func2dff C-FileName FunctionName xmin xmax nptx ymin ymax npty [graphic_attributes]"; | 
|---|
| 1049 | usage += "\n  Related commands: func funcff func2d "; | 
|---|
| 1050 | mpiac->RegisterCommand(kw, usage, this, "Func Plot"); | 
|---|
| 1051 |  | 
|---|
| 1052 | kw = "ObjectExpressions"; | 
|---|
| 1053 | usage = "Any mathematical expression (math.h) with object variables can be used"; | 
|---|
| 1054 | usage += "\n  ------ Object Variable names (double) -------- "; | 
|---|
| 1055 | usage += "\n- NTuple: ntuple variable names"; | 
|---|
| 1056 | usage += "\n- Histo1D/HProf: i,x,val,err"; | 
|---|
| 1057 | usage += "\n- Histo2D: i,j,x,y,val,err"; | 
|---|
| 1058 | usage += "\n- Vector/Matrix: n,r,c,val,real,imag,mod,phas"; | 
|---|
| 1059 | usage += "\n- TArray: n,x,y,z,t,u,val,real,imag,mod,phas"; | 
|---|
| 1060 | usage += "\n- Image: i,j,x,y,val(=pix)"; | 
|---|
| 1061 | usage += "\n- GeneralFitData: x0,ex0 x1,ex1 ...  xn,exn   y,ey   ok"; | 
|---|
| 1062 | usage += "\n- LocalMap/SphereThetaPhi/SphereHEALPix: "; | 
|---|
| 1063 | usage += "\n-         i,k,val,real,imag,mod,phas,teta,phi"; | 
|---|
| 1064 | usage += "\n- FITS Binary/ASCII table: fits column names"; | 
|---|
| 1065 | usage += "\n  ------ Other parameters -------- "; | 
|---|
| 1066 | usage += "\nLoop parameters can be specified as I1[:I2[:DI]] for(int i=I1; i<I2; i+=DI)"; | 
|---|
| 1067 | usage += "\nThe default Cut() expression in true (=1) for all"; | 
|---|
| 1068 | usage += "\n\n  Related commands: plot2d plot2de plot2dw plot3d "; | 
|---|
| 1069 | usage += "\n        projh1d projh2d  projprof fillvec fillmtx "; | 
|---|
| 1070 | usage += "\n        fillnt fillgd1 fillgd2 ntloop exptovec ... "; | 
|---|
| 1071 | mpiac->RegisterCommand(kw, usage, NULL, "Expr. Plotting"); | 
|---|
| 1072 | kw = "plot2d"; | 
|---|
| 1073 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) --- Object Variable names (double) :"; | 
|---|
| 1074 | usage += "\n Usage: plot2d nameobj f_X() g_Y() [f_Cut() graphic_attributes loop_param]"; | 
|---|
| 1075 | usage += "\n  Related commands: plot2de plot2dw plot3d ObjectExpressions ..."; | 
|---|
| 1076 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1077 | kw = "plot2de"; | 
|---|
| 1078 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with error bars eX/Y=f_ErrX/Y(Object) "; | 
|---|
| 1079 | usage += "\n Usage: plot2de nameobj f_X() g_Y() f_ErrX() f_ErrY() [f_Cut() graphic_attributes loop_param]"; | 
|---|
| 1080 | usage += "\n  Related commands: plot2d plot2dw plot3d ObjectExpressions ..."; | 
|---|
| 1081 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1082 | kw = "plot2dw"; | 
|---|
| 1083 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with Weight W=h(Object) "; | 
|---|
| 1084 | usage += "\n Usage: plot2dw nameobj f_X() g_Y() h_Wt() [Cut() graphic_attributes loop_param]"; | 
|---|
| 1085 | usage += "\n  Related commands: plot2d plot2dw plot3d ObjectExpressions ..."; | 
|---|
| 1086 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1087 | kw = "plot3d"; | 
|---|
| 1088 | usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs "; | 
|---|
| 1089 | usage += "\n Usage: plot3d nameobj f_X() g_Y() h_Z() [Cut() graphic_attributes loop_param]"; | 
|---|
| 1090 | usage += "\n  Related commands: plot2d plot2dw plot2de plot3d ObjectExpressions ..."; | 
|---|
| 1091 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1092 |  | 
|---|
| 1093 | kw = "projh1d"; | 
|---|
| 1094 | usage = "Projects X=f(Object) with weight WT=h(Object) into a 1D histogram "; | 
|---|
| 1095 | usage += "\n Usage: projh1d nameh1d nameobj f_X() [h_WT()=1. Cut() graphic_attributes loop_param]"; | 
|---|
| 1096 | usage += "\n   Histo1D nameh1d is created if necessary "; | 
|---|
| 1097 | usage += "\n  Related commands: projh2d projprof ObjectExpressions ..."; | 
|---|
| 1098 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1099 | kw = "projh2d"; | 
|---|
| 1100 | usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a 2D histogram "; | 
|---|
| 1101 | usage += "\n Usage: projh2d nameh2d nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]"; | 
|---|
| 1102 | usage += "\n   Histo2D nameh2d is created if necessary "; | 
|---|
| 1103 | usage += "\n  Related commands: projh1d projprof ObjectExpressions ..."; | 
|---|
| 1104 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1105 | kw = "projprof"; | 
|---|
| 1106 | usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a profile histogram "; | 
|---|
| 1107 | usage += "\n Usage: projprof nameprof nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]"; | 
|---|
| 1108 | usage += "\n   HProf nameprof is created if necessary "; | 
|---|
| 1109 | usage += "\n  Related commands: projh1d projh2d ObjectExpressions ..."; | 
|---|
| 1110 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1111 | kw = "fillvec"; | 
|---|
| 1112 | usage = "Fills a Vector V((int)(f_X(Object)+0.5)) =  h_V(Object) "; | 
|---|
| 1113 | usage += "\n Usage: fillvec namevec nameobj f_X() h_V() [Cut() graphic_attributes loop_param]"; | 
|---|
| 1114 | usage += "\n  Related commands: fillmtx fillnt ObjectExpressions ..."; | 
|---|
| 1115 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1116 | kw = "fillmtx"; | 
|---|
| 1117 | usage = "Fills a Matrix M(Line=g_Y(Object)+0.5, Col=f_X(Object)+0.5)) =  h_V(Object) "; | 
|---|
| 1118 | usage += "\n Usage: fillvec namevec nameobj f_X() g_Y() h_V() [Cut() graphic_attributes loop_param]"; | 
|---|
| 1119 | usage += "\n  Related commands: fillvec fillnt ObjectExpressions ..."; | 
|---|
| 1120 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1121 |  | 
|---|
| 1122 | kw = "fillnt"; | 
|---|
| 1123 | usage = "Creates and Fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))"; | 
|---|
| 1124 | usage += "\n Usage: fillnt nameobj f_X() g_Y() h_Z() k_T() [Cut() nameNt loop_param]"; | 
|---|
| 1125 | usage += "\n  Related commands: ntloop plot2d projh1d projh2d projprof "; | 
|---|
| 1126 | usage += "\n  Related commands: fillvec fillmtx ntloop exptovec fillgd1 fillgd2 ObjectExpressions ..."; | 
|---|
| 1127 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1128 |  | 
|---|
| 1129 | kw = "ntloop"; | 
|---|
| 1130 | usage = "Loops over an Object NTupleInterface calling a function from a C-file \n"; | 
|---|
| 1131 | usage += "and optionaly fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))"; | 
|---|
| 1132 | usage += "\n Usage: ntloop nameobj CFileName FuncName [NtupleName loop_param]"; | 
|---|
| 1133 | usage += "\n  Related commands: fillvec fillmtx fillnt fillgd1 fillgd2 exptovec ObjectExpressions ..."; | 
|---|
| 1134 | usage += "\n  Related commands: ntexpcfile fillnt"; | 
|---|
| 1135 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1136 |  | 
|---|
| 1137 | kw = "ntexpcfile"; | 
|---|
| 1138 | usage = "Creates a C-File with declarations suitable to be used for ntloop"; | 
|---|
| 1139 | usage += "\n Usage: ntexpcfile nameobj CFileName FuncName "; | 
|---|
| 1140 | usage += "\n  Related commands: ntloop"; | 
|---|
| 1141 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1142 |  | 
|---|
| 1143 | kw = "exptovec"; | 
|---|
| 1144 | usage = "Creates and Fills a Vector with X=f(Object)"; | 
|---|
| 1145 | usage += "\n Usage: exptovec namevec nameobj f_X() [Cut() graphic_attributes loop_param]"; | 
|---|
| 1146 | usage += "\n  Related commands: ntloop fillnt ObjectExpressions ..."; | 
|---|
| 1147 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1148 | kw = "fillgd1"; | 
|---|
| 1149 | usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), ErrY=h(...))"; | 
|---|
| 1150 | usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_ErrY() [Cut() loop_param]"; | 
|---|
| 1151 | usage += "\n  Related commands: ntloop fillnt ObjectExpressions ..."; | 
|---|
| 1152 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1153 | kw = "fillgd2"; | 
|---|
| 1154 | usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), Z=h(...)) ErrZ=k(...)"; | 
|---|
| 1155 | usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_Z() k_ErrZ() [Cut() loop_param]"; | 
|---|
| 1156 | usage += "\n  Related commands: ntloop fillnt ObjectExpressions ..."; | 
|---|
| 1157 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1158 | kw = "gdfrvec"; | 
|---|
| 1159 | usage = "Fills a GeneralFitData with vectors X,Y,Z,EZ"; | 
|---|
| 1160 | usage += "\n Usage: gdfrvec namegfd X Y"; | 
|---|
| 1161 | usage += "\n Usage: gdfrvec namegfd X Y ! EY"; | 
|---|
| 1162 | usage += "\n Usage: gdfrvec namegfd X Y Z"; | 
|---|
| 1163 | usage += "\n Usage: gdfrvec namegfd X Y Z EZ"; | 
|---|
| 1164 | usage += "\n  Related commands: fillgd1 fillgd2 ..."; | 
|---|
| 1165 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); | 
|---|
| 1166 |  | 
|---|
| 1167 | } | 
|---|
| 1168 |  | 
|---|
| 1169 | /* --Methode-- */ | 
|---|
| 1170 | int PIABaseExecutor::LinkUserFuncs(string& fnameso, string& func1, string& func2, string& func3) | 
|---|
| 1171 | //                          string& func4, string& func5) | 
|---|
| 1172 | { | 
|---|
| 1173 | string cmd; | 
|---|
| 1174 |  | 
|---|
| 1175 | if (dynlink) delete dynlink;    dynlink = NULL; | 
|---|
| 1176 | usfmap.clear(); | 
|---|
| 1177 |  | 
|---|
| 1178 | dynlink = new PDynLinkMgr(fnameso, true); | 
|---|
| 1179 | if (dynlink == NULL) { | 
|---|
| 1180 | string sn = fnameso; | 
|---|
| 1181 | cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur ouverture SO " << sn << endl; | 
|---|
| 1182 | return(2); | 
|---|
| 1183 | } | 
|---|
| 1184 |  | 
|---|
| 1185 | int nok=0; | 
|---|
| 1186 | // on utilise donc des DlFunction  (Reza 20/08/98)  voir commentaire ds .h (pb g++) | 
|---|
| 1187 | // DlUserProcFunction f = NULL; | 
|---|
| 1188 | DlFunction f = NULL; | 
|---|
| 1189 | if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") )  goto fin; | 
|---|
| 1190 | // f = (DlUserProcFunction)  dlsym(dlhandle, func1.c_str()); | 
|---|
| 1191 | f = dynlink->GetFunction(func1); | 
|---|
| 1192 | if (f) { nok++;  usfmap[func1] = f; } | 
|---|
| 1193 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func1 << endl; | 
|---|
| 1194 |  | 
|---|
| 1195 | if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") )  goto fin; | 
|---|
| 1196 | // f = (DlUserProcFunction)  dlsym(dlhandle, func2.c_str()); | 
|---|
| 1197 | f = dynlink->GetFunction(func2); | 
|---|
| 1198 | if (f) { nok++;  usfmap[func2] = f; } | 
|---|
| 1199 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func2 << endl; | 
|---|
| 1200 |  | 
|---|
| 1201 | if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") )  goto fin; | 
|---|
| 1202 | // f = (DlUserProcFunction)  dlsym(dlhandle, func3.c_str()); | 
|---|
| 1203 | f = dynlink->GetFunction(func3); | 
|---|
| 1204 | if (f) { nok++;  usfmap[func3] = f; } | 
|---|
| 1205 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func3 << endl; | 
|---|
| 1206 |  | 
|---|
| 1207 | /*  Pb compile g++ 2.7.2 | 
|---|
| 1208 | if ((func4.length() < 1) || (func4 == "-") || (func4 == ".") )  goto fin; | 
|---|
| 1209 | // f = (DlUserProcFunction)  dlsym(dlhandle, func4.c_str()); | 
|---|
| 1210 | f = dynlink->GetFunction(func4); | 
|---|
| 1211 | if (f) { nok++;  usfmap[func4] = f; } | 
|---|
| 1212 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func4 << endl; | 
|---|
| 1213 |  | 
|---|
| 1214 | if ((func5.length() < 1) || (func5 == "-") || (func5 == ".") )  goto fin; | 
|---|
| 1215 | // f = (DlUserProcFunction)  dlsym(dlhandle, func5.c_str()); | 
|---|
| 1216 | f = dynlink->GetFunction(func5); | 
|---|
| 1217 | if (f) { nok++;  usfmap[func5] = f; } | 
|---|
| 1218 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func5 << endl; | 
|---|
| 1219 | */ | 
|---|
| 1220 | fin: | 
|---|
| 1221 | if (nok < 1) { if (dynlink) delete dynlink;    dynlink = NULL;  return(3); } | 
|---|
| 1222 | else return(0); | 
|---|
| 1223 | } | 
|---|
| 1224 |  | 
|---|
| 1225 | /* --Methode-- */ | 
|---|
| 1226 | int PIABaseExecutor::LinkUserFuncs2(string& fnameso, string& func1, string& func2, string& func3) | 
|---|
| 1227 | { | 
|---|
| 1228 | string cmd; | 
|---|
| 1229 |  | 
|---|
| 1230 | if (dynlink2) delete dynlink2;    dynlink2 = NULL; | 
|---|
| 1231 | usfmap2.clear(); | 
|---|
| 1232 |  | 
|---|
| 1233 | dynlink2 = new PDynLinkMgr(fnameso, true); | 
|---|
| 1234 | if (dynlink2 == NULL) { | 
|---|
| 1235 | string sn = fnameso; | 
|---|
| 1236 | cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur ouverture SO " << sn << endl; | 
|---|
| 1237 | return(2); | 
|---|
| 1238 | } | 
|---|
| 1239 |  | 
|---|
| 1240 | int nok=0; | 
|---|
| 1241 | // on utilise donc des DlFunction  (Reza 20/08/98)  voir commentaire ds .h (pb g++) | 
|---|
| 1242 | // DlUserProcFunction f = NULL; | 
|---|
| 1243 | DlFunction f = NULL; | 
|---|
| 1244 | if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") )  goto fin; | 
|---|
| 1245 | f = dynlink2->GetFunction(func1); | 
|---|
| 1246 | if (f) { nok++;  usfmap2[func1] = f; } | 
|---|
| 1247 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func1 << endl; | 
|---|
| 1248 |  | 
|---|
| 1249 | if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") )  goto fin; | 
|---|
| 1250 | f = dynlink2->GetFunction(func2); | 
|---|
| 1251 | if (f) { nok++;  usfmap2[func2] = f; } | 
|---|
| 1252 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func2 << endl; | 
|---|
| 1253 |  | 
|---|
| 1254 | if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") )  goto fin; | 
|---|
| 1255 | f = dynlink2->GetFunction(func3); | 
|---|
| 1256 | if (f) { nok++;  usfmap2[func3] = f; } | 
|---|
| 1257 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func3 << endl; | 
|---|
| 1258 |  | 
|---|
| 1259 | fin: | 
|---|
| 1260 | if (nok < 1) { if (dynlink2) delete dynlink2;    dynlink2 = NULL;  return(3); } | 
|---|
| 1261 | else return(0); | 
|---|
| 1262 | } | 
|---|
| 1263 |  | 
|---|
| 1264 | /* Nouvelle-Fonction */ | 
|---|
| 1265 | void RegisterPIGraphicsHelp(PIACmd* piac) | 
|---|
| 1266 | { | 
|---|
| 1267 | string kw,grp,usage; | 
|---|
| 1268 |  | 
|---|
| 1269 | grp = "Graphics"; | 
|---|
| 1270 |  | 
|---|
| 1271 | kw = "PIImage"; | 
|---|
| 1272 | usage = "Manages the display of a 2-D array (P2DArrayAdapter) as an image \n"; | 
|---|
| 1273 | usage += "and controls a zoom widget, as well as a global image view widget \n"; | 
|---|
| 1274 | usage += ">>>> Mouse controls : \n"; | 
|---|
| 1275 | usage += "o Button-1: Display current coordinates and pixel value\n"; | 
|---|
| 1276 | usage += "  Position the cursor an refresh the zoom widget\n"; | 
|---|
| 1277 | usage += "o Button-2: Defines an image zone and positions the cursor \n"; | 
|---|
| 1278 | usage += "o Button-3: Moves the viewed portion of the array inside the window \n"; | 
|---|
| 1279 | usage += ">>>> Keyboard controls : \n"; | 
|---|
| 1280 | usage += "o <Alt>R : Refresh display \n"; | 
|---|
| 1281 | usage += "o <Alt>O : Shows the PIImageTools (image display parameter controls) \n"; | 
|---|
| 1282 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of overlayed graphics (Drawers)) \n"; | 
|---|
| 1283 | usage += "o <Alt>V : Copy/Paste / Text paste at the current cursor position \n"; | 
|---|
| 1284 | usage += "o <Alt>C : Copy/Paste / Copies the selected regions content as text in the copy/paste buffer \n"; | 
|---|
| 1285 | usage += "o <Alt>X : Show/Hide the Cut Window \n"; | 
|---|
| 1286 | usage += "o <Alt>Z : Removes signs overlayed on image (Drawer 0) \n"; | 
|---|
| 1287 | usage += "o Cursor keys : Moves the image cursor \n"; | 
|---|
| 1288 | piac->RegisterHelp(kw, usage, grp); | 
|---|
| 1289 |  | 
|---|
| 1290 | kw = "PIScDrawWdg"; | 
|---|
| 1291 | usage = "Manages display of 2-D drawers with interactive zoom \n"; | 
|---|
| 1292 | usage += ">>>> Mouse controls : \n"; | 
|---|
| 1293 | usage += "o Button-1: Display current coordinates \n"; | 
|---|
| 1294 | usage += "o Button-2: Defines a rectangle for zoom \n"; | 
|---|
| 1295 | usage += "o Button-3: Defines a rectangle for Text-Info (<Alt>I) \n"; | 
|---|
| 1296 | usage += ">>>> Keyboard controls : \n"; | 
|---|
| 1297 | usage += "o <Alt>R : Refresh display \n"; | 
|---|
| 1298 | usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n"; | 
|---|
| 1299 | usage += "           Specific controls for 2-D histograms \n"; | 
|---|
| 1300 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n"; | 
|---|
| 1301 | usage += "           Drawer 0 manages the axes, as well as the added text \n"; | 
|---|
| 1302 | usage += "o <Alt>V : Copy/Paste / Text paste at the current position \n"; | 
|---|
| 1303 | usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n"; | 
|---|
| 1304 | usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n"; | 
|---|
| 1305 | usage += "o <Alt>M : Activate/Deactivate a measurement cursor on Button-1\n"; | 
|---|
| 1306 | usage += "o <Alt>L : Deactivate DX,DY print (see below)\n"; | 
|---|
| 1307 | usage += ">>>> Mouse + Keyboard controls : \n"; | 
|---|
| 1308 | usage += "o Button-1 + <Alt>K : Set (reset) the reference point for DX,DY print \n"; | 
|---|
| 1309 | piac->RegisterHelp(kw, usage, grp); | 
|---|
| 1310 |  | 
|---|
| 1311 | kw = "PIDraw3DWdg"; | 
|---|
| 1312 | usage = "Manages display of 3-D objects (drawers)  \n"; | 
|---|
| 1313 | usage += ">>>> Mouse controls : \n"; | 
|---|
| 1314 | usage += "o Button-2: Rotates the observer (camera) around object \n"; | 
|---|
| 1315 | usage += "o Shift-Button-2: Rotates object with camera fixed \n"; | 
|---|
| 1316 | usage += "  The object rotation mode can be assigned to Button-2 with <Alt>S \n"; | 
|---|
| 1317 | usage += "o Button-3: Zoom control (Camera distance And/Or view angle) \n"; | 
|---|
| 1318 | usage += ">>>> Keyboard controls : \n"; | 
|---|
| 1319 | usage += "o <Alt>R : Resets the 3-D view and refreshes the display \n"; | 
|---|
| 1320 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n"; | 
|---|
| 1321 | usage += "o <Alt>O : = <Alt>G \n"; | 
|---|
| 1322 | usage += "o <Alt>V : Copy/Paste / Text paste at the current position (Drawer 0)\n"; | 
|---|
| 1323 | usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n"; | 
|---|
| 1324 | usage += "o <Alt>A : Activate/Deactivate axes drawing \n"; | 
|---|
| 1325 | usage += "o <Alt>S : Activate/Deactivate object rotation mode on Button-2 \n"; | 
|---|
| 1326 | piac->RegisterHelp(kw, usage, grp); | 
|---|
| 1327 |  | 
|---|
| 1328 | kw = "Windows"; | 
|---|
| 1329 | usage = "Objects can be displayed in different windows, or overlayed on the \n"; | 
|---|
| 1330 | usage += "previous display. The graphics attributes next,win,stack,same control \n"; | 
|---|
| 1331 | usage += "the display window. \n"; | 
|---|
| 1332 | usage += "o GraphicWindow : This is the default mode (gr_att=next)\n"; | 
|---|
| 1333 | usage += "  Graphic windows can be divided int zones. Object is displayed \n"; | 
|---|
| 1334 | usage += "  in the next available position, removing a previously displayed \n"; | 
|---|
| 1335 | usage += "  widget if necessary \n"; | 
|---|
| 1336 | usage += "o Window : An object is displayed in its own window (gr_att= win) \n"; | 
|---|
| 1337 | usage += "o StackWindow : multpile widgets can be stacked in a StackWindow (gr_att= stack) \n"; | 
|---|
| 1338 | usage += "  A single widget is displayed a any time. Different widgets in a StackWindow \n"; | 
|---|
| 1339 | usage += "  can be displayed using the stacknext command, as well as the StackTools item \n"; | 
|---|
| 1340 | usage += "  in the Tools menu (from Menubar). An automatic cyclic display mode can also \n"; | 
|---|
| 1341 | usage += "  be activated using the StackTools menu (Blink) \n"; | 
|---|
| 1342 | usage += "o Most objects can be also be displayed overlayed \n"; | 
|---|
| 1343 | usage += "  on the last displayed widget (gr_att= same) \n"; | 
|---|
| 1344 | usage += "o The overlay can be on a selected rectangle of the \n"; | 
|---|
| 1345 | usage += "  last displayed widget (gr_att= inset) - See setinsetlimits\n"; | 
|---|
| 1346 | usage += "\n  Related commands: newwin zone stacknext graphicatt setinsetlimits"; | 
|---|
| 1347 | piac->RegisterHelp(kw, usage, grp); | 
|---|
| 1348 |  | 
|---|
| 1349 | kw = "PIConsole"; | 
|---|
| 1350 | usage = "Text output area and command editing window (console) \n"; | 
|---|
| 1351 | usage += ">>>> Mouse controls : \n"; | 
|---|
| 1352 | usage += "o Button-1: Rectangle selection for copy/paste \n"; | 
|---|
| 1353 | usage += "o Button-2: Paste text in the command editing line \n"; | 
|---|
| 1354 | usage += "o Button-3: activate display option menu \n"; | 
|---|
| 1355 | usage += ">>>> Keyboard controls : \n"; | 
|---|
| 1356 | usage += "o <Alt>O : activate display option menu   \n"; | 
|---|
| 1357 | usage += "o <Alt>V : Paste text in the command editing line \n"; | 
|---|
| 1358 | usage += "o <Alt>A : Selection of the whole window for copy \n"; | 
|---|
| 1359 | usage += "o <Alt>L : Command history (List of command history buffer) \n"; | 
|---|
| 1360 | usage += "o <Ctl>A : Command editing -> Goto the beginning of line \n"; | 
|---|
| 1361 | usage += "o <Ctl>E : Command editing -> Goto the end of line \n"; | 
|---|
| 1362 | usage += "o <Ctl>K : Command editing -> Clear to the end of line \n"; | 
|---|
| 1363 | usage += "o <Ctl>C : Command editing -> Clear the line \n"; | 
|---|
| 1364 | usage += "o Cursor left,right : Command editing -> Move cursor \n"; | 
|---|
| 1365 | usage += "o Cursor Up,Down : recall command from history buffer \n"; | 
|---|
| 1366 | usage += "o Backspace,Del : Command editing \n"; | 
|---|
| 1367 | usage += "o <Return>,<Enter> : Execute command \n"; | 
|---|
| 1368 | piac->RegisterHelp(kw, usage, grp); | 
|---|
| 1369 | } | 
|---|