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