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

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

Passage defaut KeepOldDirAtt a false (pour les rep NamedObjMgr) + quelques commande de gestion d'objets + MAJ numver - Reza 26/7/2002

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