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

Last change on this file since 2128 was 2128, checked in by cmv, 23 years ago

ObjectExpressions for Eros StarList cmv 23/7/2002

File size: 57.8 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";
778usage += ">> 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 += ">> Axe labels font size: fixedfontsize/autofontsize \n";
784usage += " autofontsize: Font size computed automatically \n";
785usage += " fixedfontsize: Use font size attribute (BaseDrawer) \n";
786usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n";
787usage += ">> xylimits=xmin,xmax,ymin,ymax -> Forces X-Y limits in 2-D plots \n";
788usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n";
789usage += ">> title/notitle or tit/notit -> Toggle Auto AddTitle flag \n";
790usage += ">> DisplayWindow: next same win stack inset \n";
791usage += " Related commands: setaxesatt setinsetlimits ";
792mpiac->RegisterCommand(kw, usage, this, "Graphics");
793
794kw = "setaxesatt";
795usage = "To set default axes attributes \n Usage: setaxesatt att_list \n";
796usage += "Color/Line/Font attributes and axes attributes";
797usage += ">> Axes: stdaxes=defaxes=boxaxes boxaxesgrid centeredaxes\n";
798usage += " fineaxes finecenteredaxes fineaxesgrid=grid \n";
799usage += " centeredaxesgrid finecenteredaxesgrid \n";
800usage += ">> Axe labels font size: fixedfontsize/autofontsize \n";
801usage += " autofontsize: Font size computed automatically \n";
802usage += " fixedfontsize: Use font size attribute (BaseDrawer) \n";
803usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n";
804usage += ">> xylimits=xmin,xmax,ymin,ymax -> Forces X-Y limits in 2-D plots \n";
805mpiac->RegisterCommand(kw, usage, this, "Graphics");
806
807kw = "setinsetlimits";
808usage = "Define the display rectangle for drawers added as insets \n";
809usage += " over existing graphic objects - limits expressed as fraction \n";
810usage += " graphic object size (0. .. 1.) Xmax at right, YMax top. ";
811usage += " Usage: setinsetlimits xmin xmax ymin ymax";
812usage += "\n Related commands: graphicatt /inset";
813mpiac->RegisterCommand(kw, usage, this, "Graphics");
814
815kw = "addtext";
816usage = "Adds a text string to the current graphic object";
817usage += "\n at the specified position (+ color and font attributes) ";
818usage += "\n The Base/AxesDrawer is used to handle added text strings" ;
819usage += "\n Alt<Z> to remove added elements";
820usage += "\n Font attribute is common with axes";
821usage += "\n Usage: addtext x y TextString [ColFontAtt]";
822usage += "\n (use quotes '' for multi word text strings) ";
823usage += "\n Related commands: addline addrect addfrect addcirc addfcirc settitle graphicatt";
824mpiac->RegisterCommand(kw, usage, this, "Graphics");
825
826kw = "addline";
827usage = "Adds a line to the current graphic object";
828usage += "\n at the specified position (+ color attribute)";
829usage += "\n The Base/AxesDrawer is used to handle added lines";
830usage += "\n Alt<Z> to remove added elements";
831usage += "\n Usage: addline x1 y1 x2 y2 [ColAtt]";
832usage += "\n Related commands: addtext addrect addfrect addcirc addfcirc graphicatt";
833mpiac->RegisterCommand(kw, usage, this, "Graphics");
834
835kw = "addrect";
836usage = "Adds a rectangle to the current graphic object";
837usage += "\n between the specified positions (+ color attribute)";
838usage += "\n The Base/AxesDrawer is used to handle added rectangle";
839usage += "\n Alt<Z> to remove added elements";
840usage += "\n Usage: addrect x1 y1 x2 y2 [ColAtt]";
841usage += "\n Related commands: addtext addline addfrect addcirc addfcirc graphicatt";
842mpiac->RegisterCommand(kw, usage, this, "Graphics");
843
844kw = "addfrect";
845usage = "Adds a filled rectangle to the current graphic object";
846usage += "\n between the specified positions (+ color attribute)";
847usage += "\n The Base/AxesDrawer is used to handle added rectangle";
848usage += "\n Alt<Z> to remove added elements";
849usage += "\n Usage: addfrect x1 y1 x2 y2 [ColAtt]";
850usage += "\n Related commands: addtext addline addrect addcirc addfcirc graphicatt";
851mpiac->RegisterCommand(kw, usage, this, "Graphics");
852
853kw = "addcirc";
854usage = "Adds a circle to the current graphic object";
855usage += "\n with the specified center and radius (+ color attribute)";
856usage += "\n The Base/AxesDrawer is used to handle added circles";
857usage += "\n Alt<Z> to remove added elements";
858usage += "\n Usage: addcirc xcenter ycenter radius [ColAtt]";
859usage += "\n Related commands: addtext addline addfrect addfrect addfcirc graphicatt";
860mpiac->RegisterCommand(kw, usage, this, "Graphics");
861
862kw = "addfcirc";
863usage = "Adds a filled circle to the current graphic object";
864usage += "\n with the specified center and radius (+ color attribute)";
865usage += "\n The Base/AxesDrawer is used to handle added circles";
866usage += "\n Alt<Z> to remove added elements";
867usage += "\n Usage: addcirc xcenter ycenter radius [ColAtt]";
868usage += "\n Related commands: addtext addline addfrect addfrect addcirc graphicatt";
869mpiac->RegisterCommand(kw, usage, this, "Graphics");
870
871kw = "settitle";
872usage = "Set the title string (top title / bottom title) for the current graphic object";
873usage += "\n Usage: settitle TopTitle [BottomTitle] [fontAtt]";
874usage += "\n Related commands: addtext graphicatt";
875mpiac->RegisterCommand(kw, usage, this, "Graphics");
876
877RegisterPIGraphicsHelp(mpiac);
878
879kw = "openfits";
880usage = "Loads a FITS file into an Image<T> \n Usage: openfits filename";
881usage += "\n Related commands: savefits openppf";
882mpiac->RegisterCommand(kw, usage, this, "FileIO");
883kw = "savefits";
884usage = "Save an object into a FITS file \n Usage: savefits nameobj filename";
885usage += "\n Related commands: openfits saveall";
886mpiac->RegisterCommand(kw, usage, this, "FileIO");
887kw = "openppf";
888usage = "Reads all objects from a PPF file \n Usage: openppf filename";
889usage += "\n Related commands: saveall openfits";
890mpiac->RegisterCommand(kw, usage, this, "FileIO");
891kw = "saveobjs";
892usage = "Saves objects with names matching a pattern (x?y*) into a PPF file \n";
893usage += "Usage: saveobjs nameobjpattern filename";
894usage += "\n Related commands: saveall openppf savefits";
895mpiac->RegisterCommand(kw, usage, this, "FileIO");
896kw = "saveall";
897usage = "Saves all objects into a PPF file \n Usage: saveall filename";
898usage += "\n Related commands: saveobj openppf savefits";
899mpiac->RegisterCommand(kw, usage, this, "FileIO");
900kw = "ntfrascii";
901usage = "Fills an existing NTuple from ASCII table file";
902usage += "\n Usage: ntfrascii nt_name file_name [def_init_val]";
903usage += "\n Related commands: ntloop fillnt ";
904mpiac->RegisterCommand(kw, usage, this, "FileIO");
905
906
907kw = "print";
908usage = "Prints an object \n Usage: print nameobj";
909mpiac->RegisterCommand(kw, usage, this, "FileIO");
910
911kw = "mkdir";
912usage = "Create a directory";
913usage += "\n Usage: mkdir dirname [true]";
914usage += "\n if second argument==true, the directory's KeepOld attribute is set to true";
915mpiac->RegisterCommand(kw, usage, this, "Object Management");
916kw = "rmdir";
917usage = "Removes an empty directory";
918usage += "\n Usage: remove dirname";
919mpiac->RegisterCommand(kw, usage, this, "Object Management");
920kw = "cd";
921usage = "Change current directory";
922usage += "\n Usage: cd [dirname]";
923mpiac->RegisterCommand(kw, usage, this, "Object Management");
924kw = "pwd";
925usage = "Prints current directory";
926usage += "\n Usage: pwd";
927mpiac->RegisterCommand(kw, usage, this, "Object Management");
928kw = "listdirs";
929usage = "Prints the list of directories";
930usage += "\n Usage: listdirs [patt=*] \n patt : * , ? ";
931mpiac->RegisterCommand(kw, usage, this, "Object Management");
932kw = "listobjs";
933usage = "Prints the list of objects (Alias: ls)";
934 usage += "\n Usage: listobjs [patt=*] \n patt : /*/x?y* ... ";
935mpiac->RegisterCommand(kw, usage, this, "Object Management");
936kw = "rename";
937usage = "Rename an object (Alias: mv) \n Usage: rename nameobj namenew";
938usage += "\n Related commands: del delobjs";
939mpiac->RegisterCommand(kw, usage, this, "Object Management");
940kw = "copy";
941usage = "Copy objects \n";
942usage +=" Usage: copy name_from name_to";
943usage += "\n Related commands: new...";
944mpiac->RegisterCommand(kw, usage, this, "Object Management");
945kw = "del";
946usage = "Deletes an object (Alias: rm) \n Usage: del nameobj [nameobj2 ...]";
947usage += "\n Related commands: delobjs rename";
948mpiac->RegisterCommand(kw, usage, this, "Object Management");
949kw = "delobjs";
950usage = "Delete a set of objects with names matching a pattern (x?y*)";
951usage += "\n Usage: delobjs nameobjpattern \n";
952usage += "\n Related commands: del rename";
953mpiac->RegisterCommand(kw, usage, this, "Object Management");
954
955kw = "newh1d";
956usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin";
957usage += "\n Related commands: newh2d newprof[e] newnt newgfd ";
958mpiac->RegisterCommand(kw, usage, this, "Objects");
959kw = "newh2d";
960usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny";
961usage += "\n Related commands: newh1d newprof[e] newnt newgfd ";
962mpiac->RegisterCommand(kw, usage, this, "Objects");
963kw = "newprof";
964usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]";
965usage += "\n Errors represent the data spread in the X bin ";
966usage += "\n Related commands: newh1d newh2d newprofe newnt newgfd ";
967mpiac->RegisterCommand(kw, usage, this, "Objects");
968kw = "newprofe";
969usage = "Creates a profile histogramm \n Usage: newprofe name xmin xmax nbin [ymin ymax]";
970usage += "\n Errors represent the error on the data mean in the X bin ";
971usage += "\n Related commands: newh1d newh2d newprof newnt newgfd ";
972mpiac->RegisterCommand(kw, usage, this, "Objects");
973kw = "newnt";
974usage = "Creates a ntuple \n Usage: newnt name v1 v2 v3 .. vn";
975usage += "\n newnt name nvar";
976usage += "\n Related commands: newh1d newh2d newprof[e] newgfd ";
977mpiac->RegisterCommand(kw, usage, this, "Objects");
978kw = "newgfd";
979usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]";
980usage += "\n Related commands: newh1d newh2d newprof[e] newnt ";
981mpiac->RegisterCommand(kw, usage, this, "Objects");
982kw = "newvec";
983usage = "Creates (and optionaly fills) a vector \n Usage: newvec name size [f(i) [dopt] ] ";
984usage += "\n Related commands: newmtx";
985mpiac->RegisterCommand(kw, usage, this, "Objects");
986kw = "newmtx";
987usage = "Creates (and optionaly fills) a matrix \n";
988usage +=" Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) [dopt] ] ";
989usage += "\n Related commands: newvec";
990mpiac->RegisterCommand(kw, usage, this, "Objects");
991
992kw = "disp";
993usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]";
994usage += "\n Related commands: surf nt2d nt3d vecplot";
995mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
996kw = "imag";
997usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]";
998usage += "\n Related commands: disp surf nt2d nt3d vecplot";
999mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
1000kw = "surf";
1001usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]";
1002usage += "\n Related commands: disp nt2d nt3d vecplot";
1003mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
1004kw = "nt2d";
1005usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple ";
1006usage += "\n Usage : nt2d nameobj varx vary [errx erry wt label graphic_attributes]";
1007usage += "\n Related commands: disp surf nt3d gfd2d vecplot";
1008mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
1009kw = "nt3d";
1010usage = "Displays 3D-Points (X-Y-Z) [with error-bars / Weight / Label ] from an NTuple ";
1011usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz wt label graphic_attributes]";
1012usage += "\n Related commands: disp surf nt2d gfd3d ";
1013mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
1014kw = "vecplot";
1015usage = "Displays Points (X-Y) with coordinates defined by two vectors ";
1016usage += "\n Usage : vecplot nameVecX nameVecY [graphic_attributes]";
1017usage += "\n Related commands: disp nt2d ";
1018mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
1019
1020// Ceci est maintenant obsolete, on garde pour info.
1021kw = "gfd2d";
1022usage = "Displays Points (X-Y) with error-bars from a GeneralFit Data ";
1023usage += "\n Usage : gfd2d nameobj numvarx erreur=(x y xy) [graphic_attributes]";
1024usage += "\n Related commands: gfd3d nt2d nt3d ";
1025usage += "\n ----- OBSOLETE: utilisez nt2d -----";
1026mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
1027kw = "gfd3d";
1028usage = "Displays 3D-Points (X-Y-Z) with error-bars from a GeneralFit Data ";
1029usage += "\n Usage : gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) [graphic_attributes]";
1030usage += "\n Related commands: gfd2d nt2d nt3d ";
1031usage += "\n ----- OBSOLETE: utilisez nt3d -----";
1032mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
1033
1034kw = "func";
1035usage = "Displays a function y=f(x) (Fills a vector with function values)";
1036usage += "\n Usage: func f(x) xmin xmax [npt graphic_attributes]";
1037usage += "\n Related commands: funcff func2d func2dff ";
1038mpiac->RegisterCommand(kw, usage, this, "Func Plot");
1039kw = "funcff";
1040usage = "Displays a function y=f(x) from a C-file (Fills a vector with function values)";
1041usage += "\n Usage: funcff C-FileName FunctionName xmin xmax [npt graphic_attributes]";
1042usage += "\n Related commands: func func2d func2dff ";
1043mpiac->RegisterCommand(kw, usage, this, "Func Plot");
1044kw = "func2d";
1045usage = "Displays a function z=f(x,y) (Fills a matrix with function values)";
1046usage += "\n Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [graphic_attributes]";
1047usage += "\n Related commands: func";
1048mpiac->RegisterCommand(kw, usage, this, "Func Plot");
1049kw = "func2dff";
1050usage = "Displays a function z=f(x,y) from a C-file (Fills a matrix with function values)";
1051usage += "\n Usage: func2dff C-FileName FunctionName xmin xmax nptx ymin ymax npty [graphic_attributes]";
1052usage += "\n Related commands: func funcff func2d ";
1053mpiac->RegisterCommand(kw, usage, this, "Func Plot");
1054
1055kw = "ObjectExpressions";
1056usage = "Any mathematical expression (math.h) with object variables can be used";
1057usage += "\n ------ Object Variable names (double) -------- ";
1058usage += "\n- NTuple: ntuple variable names";
1059usage += "\n- Histo1D/HProf: i,x,val,err";
1060usage += "\n- Histo2D: i,j,x,y,val,err";
1061usage += "\n- Vector/Matrix: n,r,c,val,real,imag,mod,phas";
1062usage += "\n- TArray: n,x,y,z,t,u,val,real,imag,mod,phas";
1063usage += "\n- Image: i,j,x,y,val(=pix)";
1064usage += "\n- GeneralFitData: x0,ex0 x1,ex1 ... xn,exn y,ey ok";
1065usage += "\n- LocalMap/SphereThetaPhi/SphereHEALPix: ";
1066usage += "\n- i,k,val,real,imag,mod,phas,teta,phi";
1067usage += "\n- FITS Binary/ASCII table: fits column names";
1068#ifdef SANS_EVOLPLANCK
1069usage += "\n ------ Eros Variable names (double) -------- ";
1070usage += "\n- StarList: x,y,flux,fond,pixmax,flags,";
1071usage += "\n- xref,yref,fluxref,fondref,pixmaxref";
1072#endif
1073usage += "\n ------ Other parameters -------- ";
1074usage += "\nLoop parameters can be specified as I1[:I2[:DI]] for(int i=I1; i<I2; i+=DI)";
1075usage += "\nThe default Cut() expression in true (=1) for all";
1076usage += "\n\n Related commands: plot2d plot2de plot2dw plot3d ";
1077usage += "\n projh1d projh2d projprof fillvec fillmtx ";
1078usage += "\n fillnt fillgd1 fillgd2 ntloop exptovec ... ";
1079mpiac->RegisterCommand(kw, usage, NULL, "Expr. Plotting");
1080kw = "plot2d";
1081usage = "Plots (2D) Y=g(Object) vs. X=f(Object) --- Object Variable names (double) :";
1082usage += "\n Usage: plot2d nameobj f_X() g_Y() [f_Cut() graphic_attributes loop_param]";
1083usage += "\n Related commands: plot2de plot2dw plot3d ObjectExpressions ...";
1084mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1085kw = "plot2de";
1086usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with error bars eX/Y=f_ErrX/Y(Object) ";
1087usage += "\n Usage: plot2de nameobj f_X() g_Y() f_ErrX() f_ErrY() [f_Cut() graphic_attributes loop_param]";
1088usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
1089mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1090kw = "plot2dw";
1091usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with Weight W=h(Object) ";
1092usage += "\n Usage: plot2dw nameobj f_X() g_Y() h_Wt() [Cut() graphic_attributes loop_param]";
1093usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
1094mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1095kw = "plot3d";
1096usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs ";
1097usage += "\n Usage: plot3d nameobj f_X() g_Y() h_Z() [Cut() graphic_attributes loop_param]";
1098usage += "\n Related commands: plot2d plot2dw plot2de plot3d ObjectExpressions ...";
1099mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1100
1101kw = "projh1d";
1102usage = "Projects X=f(Object) with weight WT=h(Object) into a 1D histogram ";
1103usage += "\n Usage: projh1d nameh1d nameobj f_X() [h_WT()=1. Cut() graphic_attributes loop_param]";
1104usage += "\n Histo1D nameh1d is created if necessary ";
1105usage += "\n Related commands: projh2d projprof ObjectExpressions ...";
1106mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1107kw = "projh2d";
1108usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a 2D histogram ";
1109usage += "\n Usage: projh2d nameh2d nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
1110usage += "\n Histo2D nameh2d is created if necessary ";
1111usage += "\n Related commands: projh1d projprof ObjectExpressions ...";
1112mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1113kw = "projprof";
1114usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a profile histogram ";
1115usage += "\n Usage: projprof nameprof nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
1116usage += "\n HProf nameprof is created if necessary ";
1117usage += "\n Related commands: projh1d projh2d ObjectExpressions ...";
1118mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1119kw = "fillvec";
1120usage = "Fills a Vector V((int)(f_X(Object)+0.5)) = h_V(Object) ";
1121usage += "\n Usage: fillvec namevec nameobj f_X() h_V() [Cut() graphic_attributes loop_param]";
1122usage += "\n Related commands: fillmtx fillnt ObjectExpressions ...";
1123mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1124kw = "fillmtx";
1125usage = "Fills a Matrix M(Line=g_Y(Object)+0.5, Col=f_X(Object)+0.5)) = h_V(Object) ";
1126usage += "\n Usage: fillvec namevec nameobj f_X() g_Y() h_V() [Cut() graphic_attributes loop_param]";
1127usage += "\n Related commands: fillvec fillnt ObjectExpressions ...";
1128mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1129
1130kw = "fillnt";
1131usage = "Creates and Fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
1132usage += "\n Usage: fillnt nameobj f_X() g_Y() h_Z() k_T() [Cut() nameNt loop_param]";
1133usage += "\n Related commands: ntloop plot2d projh1d projh2d projprof ";
1134usage += "\n Related commands: fillvec fillmtx ntloop exptovec fillgd1 fillgd2 ObjectExpressions ...";
1135mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1136
1137kw = "ntloop";
1138usage = "Loops over an Object NTupleInterface calling a function from a C-file \n";
1139usage += "and optionaly fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
1140usage += "\n Usage: ntloop nameobj CFileName FuncName [NtupleName loop_param]";
1141usage += "\n Related commands: fillvec fillmtx fillnt fillgd1 fillgd2 exptovec ObjectExpressions ...";
1142usage += "\n Related commands: ntexpcfile fillnt";
1143mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1144
1145kw = "ntexpcfile";
1146usage = "Creates a C-File with declarations suitable to be used for ntloop";
1147usage += "\n Usage: ntexpcfile nameobj CFileName FuncName ";
1148usage += "\n Related commands: ntloop";
1149mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1150
1151kw = "exptovec";
1152usage = "Creates and Fills a Vector with X=f(Object)";
1153usage += "\n Usage: exptovec namevec nameobj f_X() [Cut() graphic_attributes loop_param]";
1154usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
1155mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1156kw = "fillgd1";
1157usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), ErrY=h(...))";
1158usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_ErrY() [Cut() loop_param]";
1159usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
1160mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1161kw = "fillgd2";
1162usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), Z=h(...)) ErrZ=k(...)";
1163usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_Z() k_ErrZ() [Cut() loop_param]";
1164usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
1165mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1166kw = "gdfrvec";
1167usage = "Fills a GeneralFitData with vectors X,Y,Z,EZ";
1168usage += "\n Usage: gdfrvec namegfd X Y";
1169usage += "\n Usage: gdfrvec namegfd X Y ! EY";
1170usage += "\n Usage: gdfrvec namegfd X Y Z";
1171usage += "\n Usage: gdfrvec namegfd X Y Z EZ";
1172usage += "\n Related commands: fillgd1 fillgd2 ...";
1173mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1174
1175}
1176
1177/* --Methode-- */
1178int PIABaseExecutor::LinkUserFuncs(string& fnameso, string& func1, string& func2, string& func3)
1179// string& func4, string& func5)
1180{
1181string cmd;
1182
1183if (dynlink) delete dynlink; dynlink = NULL;
1184usfmap.clear();
1185
1186dynlink = new PDynLinkMgr(fnameso, true);
1187if (dynlink == NULL) {
1188 string sn = fnameso;
1189 cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur ouverture SO " << sn << endl;
1190 return(2);
1191 }
1192
1193int nok=0;
1194// on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
1195// DlUserProcFunction f = NULL;
1196DlFunction f = NULL;
1197if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
1198// f = (DlUserProcFunction) dlsym(dlhandle, func1.c_str());
1199f = dynlink->GetFunction(func1);
1200if (f) { nok++; usfmap[func1] = f; }
1201else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func1 << endl;
1202
1203if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
1204// f = (DlUserProcFunction) dlsym(dlhandle, func2.c_str());
1205f = dynlink->GetFunction(func2);
1206if (f) { nok++; usfmap[func2] = f; }
1207else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func2 << endl;
1208
1209if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
1210// f = (DlUserProcFunction) dlsym(dlhandle, func3.c_str());
1211f = dynlink->GetFunction(func3);
1212if (f) { nok++; usfmap[func3] = f; }
1213else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func3 << endl;
1214
1215/* Pb compile g++ 2.7.2
1216if ((func4.length() < 1) || (func4 == "-") || (func4 == ".") ) goto fin;
1217// f = (DlUserProcFunction) dlsym(dlhandle, func4.c_str());
1218f = dynlink->GetFunction(func4);
1219if (f) { nok++; usfmap[func4] = f; }
1220else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func4 << endl;
1221
1222if ((func5.length() < 1) || (func5 == "-") || (func5 == ".") ) goto fin;
1223// f = (DlUserProcFunction) dlsym(dlhandle, func5.c_str());
1224f = dynlink->GetFunction(func5);
1225if (f) { nok++; usfmap[func5] = f; }
1226else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func5 << endl;
1227*/
1228fin:
1229if (nok < 1) { if (dynlink) delete dynlink; dynlink = NULL; return(3); }
1230else return(0);
1231}
1232
1233/* --Methode-- */
1234int PIABaseExecutor::LinkUserFuncs2(string& fnameso, string& func1, string& func2, string& func3)
1235{
1236string cmd;
1237
1238if (dynlink2) delete dynlink2; dynlink2 = NULL;
1239usfmap2.clear();
1240
1241dynlink2 = new PDynLinkMgr(fnameso, true);
1242if (dynlink2 == NULL) {
1243 string sn = fnameso;
1244 cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur ouverture SO " << sn << endl;
1245 return(2);
1246 }
1247
1248int nok=0;
1249// on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
1250// DlUserProcFunction f = NULL;
1251DlFunction f = NULL;
1252if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
1253f = dynlink2->GetFunction(func1);
1254if (f) { nok++; usfmap2[func1] = f; }
1255else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func1 << endl;
1256
1257if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
1258f = dynlink2->GetFunction(func2);
1259if (f) { nok++; usfmap2[func2] = f; }
1260else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func2 << endl;
1261
1262if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
1263f = dynlink2->GetFunction(func3);
1264if (f) { nok++; usfmap2[func3] = f; }
1265else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func3 << endl;
1266
1267fin:
1268if (nok < 1) { if (dynlink2) delete dynlink2; dynlink2 = NULL; return(3); }
1269else return(0);
1270}
1271
1272/* Nouvelle-Fonction */
1273void RegisterPIGraphicsHelp(PIACmd* piac)
1274{
1275string kw,grp,usage;
1276
1277grp = "Graphics";
1278
1279kw = "PIImage";
1280usage = "Manages the display of a 2-D array (P2DArrayAdapter) as an image \n";
1281usage += "and controls a zoom widget, as well as a global image view widget \n";
1282usage += ">>>> Mouse controls : \n";
1283usage += "o Button-1: Display current coordinates and pixel value\n";
1284usage += " Position the cursor an refresh the zoom widget\n";
1285usage += "o Button-2: Defines an image zone and positions the cursor \n";
1286usage += "o Button-3: Moves the viewed portion of the array inside the window \n";
1287usage += ">>>> Keyboard controls : \n";
1288usage += "o <Alt>R : Refresh display \n";
1289usage += "o <Alt>O : Shows the PIImageTools (image display parameter controls) \n";
1290usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of overlayed graphics (Drawers)) \n";
1291usage += "o <Alt>V : Copy/Paste / Text paste at the current cursor position \n";
1292usage += "o <Alt>C : Copy/Paste / Copies the selected regions content as text in the copy/paste buffer \n";
1293usage += "o <Alt>X : Show/Hide the Cut Window \n";
1294usage += "o <Alt>Z : Removes signs overlayed on image (Drawer 0) \n";
1295usage += "o Cursor keys : Moves the image cursor \n";
1296piac->RegisterHelp(kw, usage, grp);
1297
1298kw = "PIScDrawWdg";
1299usage = "Manages display of 2-D drawers with interactive zoom \n";
1300usage += ">>>> Mouse controls : \n";
1301usage += "o Button-1: Display current coordinates \n";
1302usage += "o Button-2: Defines a rectangle for zoom \n";
1303usage += "o Button-3: Defines a rectangle for Text-Info (<Alt>I) \n";
1304usage += ">>>> Keyboard controls : \n";
1305usage += "o <Alt>R : Refresh display \n";
1306usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n";
1307usage += " Specific controls for 2-D histograms \n";
1308usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
1309usage += " Drawer 0 manages the axes, as well as the added text \n";
1310usage += "o <Alt>V : Copy/Paste / Text paste at the current position \n";
1311usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n";
1312usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n";
1313usage += "o <Alt>M : Activate/Deactivate a measurement cursor on Button-1\n";
1314usage += "o <Alt>L : Deactivate DX,DY print (see below)\n";
1315usage += ">>>> Mouse + Keyboard controls : \n";
1316usage += "o Button-1 + <Alt>K : Set (reset) the reference point for DX,DY print \n";
1317piac->RegisterHelp(kw, usage, grp);
1318
1319kw = "PIDraw3DWdg";
1320usage = "Manages display of 3-D objects (drawers) \n";
1321usage += ">>>> Mouse controls : \n";
1322usage += "o Button-2: Rotates the observer (camera) around object \n";
1323usage += "o Shift-Button-2: Rotates object with camera fixed \n";
1324usage += " The object rotation mode can be assigned to Button-2 with <Alt>S \n";
1325usage += "o Button-3: Zoom control (Camera distance And/Or view angle) \n";
1326usage += ">>>> Keyboard controls : \n";
1327usage += "o <Alt>R : Resets the 3-D view and refreshes the display \n";
1328usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
1329usage += "o <Alt>O : = <Alt>G \n";
1330usage += "o <Alt>V : Copy/Paste / Text paste at the current position (Drawer 0)\n";
1331usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n";
1332usage += "o <Alt>A : Activate/Deactivate axes drawing \n";
1333usage += "o <Alt>S : Activate/Deactivate object rotation mode on Button-2 \n";
1334piac->RegisterHelp(kw, usage, grp);
1335
1336kw = "Windows";
1337usage = "Objects can be displayed in different windows, or overlayed on the \n";
1338usage += "previous display. The graphics attributes next,win,stack,same control \n";
1339usage += "the display window. \n";
1340usage += "o GraphicWindow : This is the default mode (gr_att=next)\n";
1341usage += " Graphic windows can be divided int zones. Object is displayed \n";
1342usage += " in the next available position, removing a previously displayed \n";
1343usage += " widget if necessary \n";
1344usage += "o Window : An object is displayed in its own window (gr_att= win) \n";
1345usage += "o StackWindow : multpile widgets can be stacked in a StackWindow (gr_att= stack) \n";
1346usage += " A single widget is displayed a any time. Different widgets in a StackWindow \n";
1347usage += " can be displayed using the stacknext command, as well as the StackTools item \n";
1348usage += " in the Tools menu (from Menubar). An automatic cyclic display mode can also \n";
1349usage += " be activated using the StackTools menu (Blink) \n";
1350usage += "o Most objects can be also be displayed overlayed \n";
1351usage += " on the last displayed widget (gr_att= same) \n";
1352usage += "o The overlay can be on a selected rectangle of the \n";
1353usage += " last displayed widget (gr_att= inset) - See setinsetlimits\n";
1354usage += "\n Related commands: newwin zone stacknext graphicatt setinsetlimits";
1355piac->RegisterHelp(kw, usage, grp);
1356
1357kw = "PIConsole";
1358usage = "Text output area and command editing window (console) \n";
1359usage += ">>>> Mouse controls : \n";
1360usage += "o Button-1: Rectangle selection for copy/paste \n";
1361usage += "o Button-2: Paste text in the command editing line \n";
1362usage += "o Button-3: activate display option menu \n";
1363usage += ">>>> Keyboard controls : \n";
1364usage += "o <Alt>O : activate display option menu \n";
1365usage += "o <Alt>V : Paste text in the command editing line \n";
1366usage += "o <Alt>A : Selection of the whole window for copy \n";
1367usage += "o <Alt>L : Command history (List of command history buffer) \n";
1368usage += "o <Ctl>A : Command editing -> Goto the beginning of line \n";
1369usage += "o <Ctl>E : Command editing -> Goto the end of line \n";
1370usage += "o <Ctl>K : Command editing -> Clear to the end of line \n";
1371usage += "o <Ctl>C : Command editing -> Clear the line \n";
1372usage += "o Cursor left,right : Command editing -> Move cursor \n";
1373usage += "o Cursor Up,Down : recall command from history buffer \n";
1374usage += "o Backspace,Del : Command editing \n";
1375usage += "o <Return>,<Enter> : Execute command \n";
1376piac->RegisterHelp(kw, usage, grp);
1377}
Note: See TracBrowser for help on using the repository browser.