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

Last change on this file since 2263 was 2263, checked in by ansari, 23 years ago
  • Ajout commande de trace d'elements graphiques (addpoly addctext ...)
  • Ajout de commandes de lecture ascii matrices/vecteurs
  • Trace de vecteur vx vs vy pour tout type de vecteurs

Reza 14/11/2002

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