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

Last change on this file since 1645 was 1642, checked in by ansari, 24 years ago

1/ Definition d'attributs graphiques texte pour les nouvelles couleurs violettes
2/ Ajout commandes addline addrect addfrect addfcircle ....

Reza 16/8/2001

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