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

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

Correction bug ds affichage d'image, amelioration du texte d'aide en ligne des commandes - MAJ numero de version - Reza 18/7/2002

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