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