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