source: Sophya/trunk/SophyaPI/PIext/basexecut.cc@ 2243

Last change on this file since 2243 was 2243, checked in by ansari, 23 years ago

Ajout commande addarc, addarrow, ... , Reza 3/11/2002

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