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