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

Last change on this file since 1642 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
RevLine 
[293]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"
[326]14#include "servnobjm.h"
[293]15
16#include "histos.h"
17#include "histos2.h"
18#include "hisprof.h"
19#include "ntuple.h"
20#include "generaldata.h"
[769]21
22#ifdef SANS_EVOLPLANCK
[333]23#include "cvector.h"
[769]24#else
25#include "tvector.h"
26#endif
[293]27
28
29/* --Methode-- */
30PIABaseExecutor::PIABaseExecutor(PIACmd* piac, NamedObjMgr* omg, PIStdImgApp* app)
31{
32mpiac = piac;
33mObjMgr = omg;
34mImgApp = app;
[312]35dynlink = NULL;
[1276]36dynlink2 = NULL;
[293]37RegisterCommands();
38}
39
40PIABaseExecutor::~PIABaseExecutor()
41{
[1276]42 if (dynlink) delete dynlink;
43 if (dynlink2) delete dynlink2;
[293]44}
45
46
47
48/* --Methode-- */
[1268]49int PIABaseExecutor::Execute(string& kw, vector<string>& tokens, string& toks)
[293]50{
[333]51Services2NObjMgr* srvo = mObjMgr->GetServiceObj();
[293]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") {
[384]59 while (tokens.size() < 2) tokens.push_back("1");
[293]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") {
[1451]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());
[293]70 mObjMgr->SetGraphicWinZone(nx, ny, true);
71 }
72else if (kw == "stacknext") mImgApp->StackWinNext();
[553]73else if (kw == "graphicatt") {
74 if (tokens.size() < 1) { cout << "Usage: graphicatt attributes_list (att=def->defaut)" << endl; return(0); }
[293]75 mObjMgr->SetGraphicAttributes(tokens[0]);
76 }
[331]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 }
[548]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 }
[558]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 }
[349]99else if (kw == "addtext") {
[1642]100 if (tokens.size() < 3) { cout << "Usage: addtext x y txt [colfontatt]" << endl; return(0); }
[349]101 double xp = atof(tokens[0].c_str());
102 double yp = atof(tokens[1].c_str());
[1642]103 string txt = tokens[2];
104 bool fgsr = false;
105 if (tokens.size() > 3)
106 mObjMgr->GetServiceObj()->DecodeDispOption(tokens[3], fgsr);
[349]107 mImgApp->AddText(txt, xp, yp);
108 if (fgsr) mImgApp->RestoreGraphicAtt();
109 }
[1642]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
[1131]140else if (kw == "settitle") {
[1642]141 if (tokens.size() < 1) { cout << "Usage: settitle TopTitle [BotTitle] [fontatt]" << endl; return(0); }
[1131]142 bool fgsr = true;
[1642]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]);
[1131]148 if (fgsr) mImgApp->RestoreGraphicAtt();
149 }
[349]150
[293]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}
[1276]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}
[293]166else if (kw == "call" ) {
167 if (tokens.size() < 1) { cout << "Usage: call userf [arg1 arg2 ...]" << endl; return(0); }
[1276]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()) ) {
[293]172 cerr << "PIABaseExecutor: No User Function " << tokens[0] << endl;
173 return(0);
174 }
[1276]175 if (it1 == usfmap.end()) it = it2;
176 else it = it1;
[293]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);
[1276]184#ifdef SANS_EVOLPLANCK
[293]185 TRY {
186 tokens.erase(tokens.begin());
187 fuf(tokens);
188 } CATCH(merr) {
189 fflush(stdout);
[1276]190 string es = PeidaExc(merr);
191 cerr << "\n PIABaseExecutor: Call UserFunc Exception :" << merr << es;
[293]192 cout << endl;
193 }
[1276]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
[293]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); }
[331]217 else { string nomobj = ""; mObjMgr->ReadFits(tokens[0], nomobj); }
[293]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}
[333]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}
[293]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}
[333]239else if ( (kw == "rename" ) || (kw == "mv") ) {
[293]240 if (tokens.size() < 2) { cout << "Usage: rename nameobj namenew" << endl; return(0); }
241 mObjMgr->RenameObj(tokens[0], tokens[1]);
242}
[333]243else if ( (kw == "del" ) || (kw == "rm") ) {
[293]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}
[333]251else if ( (kw == "listobjs") || (kw == "ls") ) {
[331]252 if (tokens.size() < 1) tokens.push_back("*");
253 mObjMgr->ListObjs(tokens[0]);
254}
[333]255// Gestion des repertoires
256else if (kw == "mkdir" ) {
[344]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);
[333]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 }
[345]270else if (kw == "pwd") {
271 string dirn;
272 mObjMgr->GetCurrentDir(dirn);
273 cout << "CurrentDirectory: " << dirn << endl;
274 }
[333]275else if (kw == "listdirs") {
276 if (tokens.size() < 1) tokens.push_back("*");
277 mObjMgr->ListDirs(tokens[0]);
278 }
[293]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); }
[1091]283 int_4 nbx = 100;
284 r_8 xmin = 0., xmax = 1.;
[293]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 }
[1091]295 int_4 nbx = 50, nby = 50;
296 r_8 xmin = 0., xmax = 1.;
297 r_8 ymin = 0., ymax = 1.;
[293]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 }
[1035]305else if (kw == "newprof" || kw == "newprofe") {
[293]306 if (tokens.size() < 4)
[1035]307 { cout << "Usage: newprof[e] name xmin xmax nbin [ymin ymax]" << endl; return(0); }
[1091]308 int_4 nbx = 100;
309 r_8 xmin = 0., xmax = 1., ymin = 1., ymax = -1.;
[293]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);
[1035]315 if(kw == "newprofe") h->SetErrOpt(false);
[293]316 mObjMgr->AddObj(h, tokens[0]);
317 }
[447]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]) ) {
[1548]337 for(int i=1;i<(int)tokens.size();i++) {
[447]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
[293]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
[333]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;
[357]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 }
[333]383 }
384else if (kw == "newmtx") {
385 if (tokens.size() < 3) {
[357]386 cout << "Usage: newvec name sizeX(Col) sizeY(Lines) [f(i,j) dopt] " << endl; return(0);
[333]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;
[357]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 }
[333]402 }
403
[455]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 }
[463]409 mObjMgr->CopyObj(tokens[0],tokens[1]);
[455]410}
411
412
[293]413// >>>>>>>>>>> Affichage des objets
[295]414else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") ) {
415 if (tokens.size() < 1) { cout << "Usage: disp/surf/imag nameobj [opt]" << endl; return(0); }
[293]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);
[295]420 else if (kw == "imag") mObjMgr->DisplayImage(tokens[0], opt);
[293]421 }
422
423else if (kw == "nt2d") {
[486]424 if (tokens.size() < 3) {
425 cout << "Usage: nt2d nameobj varx vary [errx erry wt label opt]" << endl;
426 return(0);
[293]427 }
[486]428 while (tokens.size() < 8) tokens.push_back("");
[333]429 string ph = "";
[486]430 mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], ph, tokens[3], tokens[4], ph,
431 tokens[5], tokens[6], tokens[7], false);
[333]432 }
[293]433else if (kw == "nt3d") {
[486]434 if (tokens.size() < 7) {
435 cout << "Usage: nt3d nameobj varx vary varz [errx erry errz wt label opt]" << endl;
436 return(0);
[293]437 }
[486]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 }
[1525]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}
[293]449
[339]450// Obsolete : ne pas virer SVP, cmv 26/7/99
[293]451else if (kw == "gfd2d") {
[339]452 cout<<"----- gfd2d OBSOLETE: utilisez nt2d -----"<<endl;
[293]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") {
[339]464 cout<<"----- gfd3d OBSOLETE: utilisez nt3d -----"<<endl;
[293]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); }
[357]478 string opt = "";
[293]479 if (tokens.size() > 4) opt = tokens[4];
480 int np;
[333]481 double xmin, xmax;
[293]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());
[333]486 string nom = "";
487 mObjMgr->GetServiceObj()->PlotFunc(tokens[0], nom, xmin, xmax, np, opt);
[293]488 }
[326]489else if ( (kw == "funcff") ) {
490 if (tokens.size() < 5) { cout << "Usage: funcff C-filename f(x)-name xmin xmax npt [opt]" << endl; return(0); }
[357]491 string opt = "";
[326]492 if (tokens.size() > 5) opt = tokens[5];
493 int np;
[333]494 double xmin, xmax;
[326]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());
[333]499 string nom = "";
500 mObjMgr->GetServiceObj()->PlotFuncFrCFile(tokens[0], tokens[1], nom, xmin, xmax, np, opt);
[326]501 }
[293]502else if ( (kw == "func2d") ) {
503 if (tokens.size() < 7) {
[357]504 cout << "Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [opt]" << endl;
[293]505 return(0);
506 }
507 int npx, npy;
[333]508 double xmin, xmax;
509 double ymin, ymax;
[293]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());
[357]517 string opt = "";
[293]518 if (tokens.size() > 7) opt = tokens[7];
[333]519 string nom = "";
520 mObjMgr->GetServiceObj()->PlotFunc2D(tokens[0], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
[293]521 }
[326]522else if ( (kw == "func2dff") ) {
523 if (tokens.size() < 8) {
[357]524 cout << "Usage: func2d C-filename F(x,y)-name xmax nptx ymin ymax npty [opt]" << endl;
[326]525 return(0);
526 }
527 int npx, npy;
[333]528 double xmin, xmax;
529 double ymin, ymax;
[326]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());
[357]537 string opt = "";
[326]538 if (tokens.size() > 8) opt = tokens[8];
[333]539 string nom = "";
540 mObjMgr->GetServiceObj()->PlotFunc2DFrCFile(tokens[0], tokens[1], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
[326]541 }
[293]542
543// >>>>>>>>>>> Trace d'expressions de N_Tuple, StarList, etc ...
544else if (kw == "plot2d" ) {
[357]545 if (tokens.size() < 3) {
546 cout << "Usage: plot2d nameobj expx expy [expcut opt loop_par]" << endl;
[293]547 return(0);
548 }
[357]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);
[293]559 }
[357]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]);
[293]564 }
565
[357]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;
[333]569 return(0);
570 }
[357]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]);
[333]574 }
[357]575else if (kw == "plot3d" ) {
576 if (tokens.size() < 4) {
577 cout << "Usage: plot3d nomobj expx expy expz [expcut opt loop_par]" << endl;
[293]578 return(0);
579 }
[357]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]);
[293]583 }
584
585else if (kw == "projh1d" ) {
[357]586 if (tokens.size() < 3) {
587 cout << "Usage: projh1d nomh1 nomobj expx [expwt expcut opt loop_par]" << endl;
[293]588 return(0);
589 }
[357]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] );
[293]594 }
595
[357]596
597// Projection dans histogrammes
[293]598else if (kw == "projh2d" ) {
[357]599 if (tokens.size() < 4) {
600 cout << "Usage: projh2d nomh2 nomobj expx expy [expwt expcut opt loop_par]" << endl;
[293]601 return(0);
602 }
[357]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] );
[293]608 }
609
610else if (kw == "projprof" ) {
[357]611 if (tokens.size() < 4) {
612 cout << "Usage: projprof nomprof nomobj expx expy [expwt expcut opt loop_par]" << endl;
[293]613 return(0);
614 }
[357]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],
[1091]619 tokens[6], tokens[7] );
[357]620 }
[293]621
[357]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] );
[293]631 }
632
[357]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
[447]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
[293]655else if (kw == "fillnt" ) {
[357]656 if (tokens.size() < 5) {
657 cout << "Usage: fillnt nameobj expx expy expz expt [expcut ntname loop_par]" << endl;
[293]658 return(0);
659 }
[357]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] );
[293]662 }
663
[333]664else if (kw == "ntloop" ) {
665 if (tokens.size() < 3) {
[357]666 cout << "Usage: ntloop nameobj fname funcname [ntname loop_par ]" << endl;
[333]667 return(0);
668 }
[357]669 while (tokens.size() < 5) tokens.push_back("");
670 srvo->FillNTFrCFile(tokens[0],tokens[1], tokens[2], tokens[3], tokens[4]);
[333]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
[357]681else if (kw == "exptovec" ) {
682 if (tokens.size() < 3) {
683 cout << "Usage: exptovec nomvec nameobj expx [expcut opt loop_par]" << endl;
[293]684 return(0);
685 }
[357]686 while (tokens.size() < 6) tokens.push_back("");
687 srvo->ExpressionToVector(tokens[1],tokens[2],tokens[3],tokens[0],tokens[4],tokens[5]);
[293]688 }
689
690else if (kw == "fillgd1" ) {
691 if (tokens.size() < 5) {
[357]692 cout << "Usage: fillgd1 nomgfd nomobj expx expy experry [expcut loop_par] " << endl;
[293]693 return(0);
694 }
[357]695 if (tokens.size() < 6) tokens.push_back("1");
696 if (tokens.size() < 7) tokens.push_back("");
[293]697 string expy = "";
[357]698 srvo->FillGFD(tokens[1],tokens[2], expy, tokens[3], tokens[4], tokens[5], tokens[0]);
[293]699 }
700
701else if (kw == "fillgd2" ) {
702 if (tokens.size() < 6) {
[357]703 cout << "Usage: fillgd2 nomgfd nomobj expx expy expz experrz [expcut loop_par]" << endl;
[293]704 return(0);
705 }
[357]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]);
[293]709 }
710
[1067]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 }
[293]723
724
725else {
726 cerr << "PIABaseExecutor::Do() Erreur - Commande " << kw << " inconuue ! " << endl;
727 return(-1);
728 }
729
730return(0);
731}
732
[388]733// Fonction pour enregistrer le Help des Widgets et Windows de piapp
734static void RegisterPIGraphicsHelp(PIACmd* piac);
735
[293]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";
[330]743mpiac->RegisterCommand(kw, usage, this, "External Modules");
[293]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 ";
[1276]747usage += "\n Related commands: call loadmodule linkff2";
[330]748mpiac->RegisterCommand(kw, usage, this, "External Modules");
[1276]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");
[293]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";
[330]758mpiac->RegisterCommand(kw, usage, this, "External Modules");
[293]759
760kw = "zone";
[384]761usage = "To Divide the Graphic window \n Usage: zone [nx=1 ny=1]";
[388]762usage += "\n Related commands: newwin";
[330]763mpiac->RegisterCommand(kw, usage, this, "Graphics");
[293]764kw = "newwin";
765usage = "To Create a New Graphic window, with zones \n Usage: newwin nx ny";
[388]766usage += "\n Related commands: zone";
[330]767mpiac->RegisterCommand(kw, usage, this, "Graphics");
[293]768kw = "stacknext";
769usage = "Displays the next widget on stack window \n Usage: stacknext";
[330]770mpiac->RegisterCommand(kw, usage, this, "Graphics");
[293]771
[553]772kw = "graphicatt";
773usage = "To change default graphic options \n Usage: graphicatt att_list \n";
[293]774usage += "att_list=def back to default values, Example: gratt red,circlemarker5";
775usage += "\n ------------------ Graphic attribute list ------------------ \n";
[1642]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";
[293]779usage += ">> Lines: defline normalline thinline thickline dashedline thindashedline \n";
780usage += " thickdashedline dottedline thindottedline thickdottedline \n";
[1569]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";
[293]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";
[1126]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";
[1504]795usage += " revcmap : This flag reverses ColorMap indexing \n";
[293]796usage += ">> ZoomFactors: defzoom zoomx1 zoomx2 zoomx3 zoomx4 zoomx5 \n";
797usage += " zoom/2 zoom/3 zoom/4 zoom/5 \n";
[558]798usage += ">> Image centering: centerimg -> Position the image in widget \n";
[293]799usage += ">> Axes: stdaxes=defaxes=boxaxes simpleaxes boxaxesgrid \n";
800usage += " fineaxes grid=fineaxesgrid \n";
[506]801usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n";
[331]802usage += ">> XYLimits : xylimits -> Forces X-Y limits in 2-D plots \n";
[546]803usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n";
[1131]804usage += ">> title/notitle or tit/notit -> Toggle Auto AddTitle flag \n";
[548]805usage += ">> DisplayWindow: next same win stack inset \n";
[558]806usage += " Related commands: setxylimits setinsetlimits setimgcenter";
[330]807mpiac->RegisterCommand(kw, usage, this, "Graphics");
[293]808
[331]809kw = "setxylimits";
810usage = "Define 2-D plot limits \n Usage: setxylimits xmin xmax ymin ymax";
[558]811usage += "\n Related commands: graphicatt /xylimits";
[331]812mpiac->RegisterCommand(kw, usage, this, "Graphics");
813
[548]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";
[558]819usage += "\n Related commands: graphicatt /inset";
[548]820mpiac->RegisterCommand(kw, usage, this, "Graphics");
821
[558]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
[349]827kw = "addtext";
828usage = "Adds a text string to the current graphic object";
[1642]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";
[349]836mpiac->RegisterCommand(kw, usage, this, "Graphics");
837
[1642]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
[1131]883kw = "settitle";
[1642]884usage = "Set the title string (top title / bottom title) for the current graphic object";
885usage += "\n Usage: settitle TopTitle [BottomTitle] [fontAtt]";
[1131]886usage += "\n Related commands: addtext graphicatt";
887mpiac->RegisterCommand(kw, usage, this, "Graphics");
888
[388]889RegisterPIGraphicsHelp(mpiac);
890
[293]891kw = "openfits";
892usage = "Loads a FITS file into an Image<T> \n Usage: openfits filename";
893usage += "\n Related commands: savefits openppf";
[330]894mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]895kw = "savefits";
896usage = "Save an object into a FITS file \n Usage: savefits nameobj filename";
897usage += "\n Related commands: openfits saveall";
[330]898mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]899kw = "openppf";
900usage = "Reads all objects from a PPF file \n Usage: openppf filename";
901usage += "\n Related commands: saveall openfits";
[330]902mpiac->RegisterCommand(kw, usage, this, "FileIO");
[333]903kw = "saveobjs";
904usage = "Saves objects with names matching a pattern (x?y*) into a PPF file \n";
[1068]905usage += "Usage: saveobjs nameobjpattern filename";
[333]906usage += "\n Related commands: saveall openppf savefits";
907mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]908kw = "saveall";
909usage = "Saves all objects into a PPF file \n Usage: saveall filename";
[333]910usage += "\n Related commands: saveobj openppf savefits";
[330]911mpiac->RegisterCommand(kw, usage, this, "FileIO");
[449]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");
[293]917
[449]918
[293]919kw = "print";
920usage = "Prints an object \n Usage: print nameobj";
[330]921mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]922
[333]923kw = "mkdir";
924usage = "Create a directory";
[344]925usage += "\n Usage: mkdir dirname [true]";
926usage += "\n if second argument==true, the directory's KeepOld attribute is set to true";
[463]927mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]928kw = "rmdir";
929usage = "Removes an empty directory";
930usage += "\n Usage: remove dirname";
[463]931mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]932kw = "cd";
933usage = "Change current directory";
934usage += "\n Usage: cd [dirname]";
[463]935mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]936kw = "pwd";
937usage = "Prints current directory";
938usage += "\n Usage: pwd";
[463]939mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]940kw = "listdirs";
941usage = "Prints the list of directories";
942usage += "\n Usage: listdirs [patt=*] \n patt : * , ? ";
[463]943mpiac->RegisterCommand(kw, usage, this, "Object Management");
[295]944kw = "listobjs";
[333]945usage = "Prints the list of objects (Alias: ls)";
946 usage += "\n Usage: listobjs [patt=*] \n patt : /*/x?y* ... ";
[463]947mpiac->RegisterCommand(kw, usage, this, "Object Management");
[293]948kw = "rename";
[333]949usage = "Rename an object (Alias: mv) \n Usage: rename nameobj namenew";
[293]950usage += "\n Related commands: del delobjs";
[463]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");
[293]957kw = "del";
[333]958usage = "Deletes an object (Alias: rm) \n Usage: del nameobj";
[293]959usage += "\n Related commands: delobjs rename";
[463]960mpiac->RegisterCommand(kw, usage, this, "Object Management");
[293]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";
[463]965mpiac->RegisterCommand(kw, usage, this, "Object Management");
[293]966
967kw = "newh1d";
968usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin";
[1035]969usage += "\n Related commands: newh2d newprof[e] newnt newgfd ";
[333]970mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]971kw = "newh2d";
972usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny";
[1035]973usage += "\n Related commands: newh1d newprof[e] newnt newgfd ";
[333]974mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]975kw = "newprof";
976usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]";
[1035]977usage += "\n Errors represent the data spread in the X bin ";
978usage += "\n Related commands: newh1d newh2d newprofe newnt newgfd ";
[333]979mpiac->RegisterCommand(kw, usage, this, "Objects");
[1035]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");
[447]985kw = "newnt";
986usage = "Creates a ntuple \n Usage: newnt name v1 v2 v3 .. vn";
987usage += "\n newnt name nvar";
[1035]988usage += "\n Related commands: newh1d newh2d newprof[e] newgfd ";
[447]989mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]990kw = "newgfd";
991usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]";
[1035]992usage += "\n Related commands: newh1d newh2d newprof[e] newnt ";
[333]993mpiac->RegisterCommand(kw, usage, this, "Objects");
994kw = "newvec";
[357]995usage = "Creates (and optionaly fills) a vector \n Usage: newvec name size [f(i) [dopt] ] ";
[333]996usage += "\n Related commands: newmtx";
[357]997mpiac->RegisterCommand(kw, usage, this, "Objects");
[333]998kw = "newmtx";
[357]999usage = "Creates (and optionaly fills) a matrix \n";
1000usage +=" Usage: newvec name sizeX(Col) sizeY(Lines) [f(i,j) [dopt] ] ";
[333]1001usage += "\n Related commands: newvec";
[357]1002mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]1003
1004kw = "disp";
1005usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]";
[1525]1006usage += "\n Related commands: surf nt2d nt3d vecplot";
[330]1007mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[295]1008kw = "imag";
1009usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]";
[1525]1010usage += "\n Related commands: disp surf nt2d nt3d vecplot";
[330]1011mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1012kw = "surf";
1013usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]";
[1525]1014usage += "\n Related commands: disp nt2d nt3d vecplot";
[330]1015mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1016kw = "nt2d";
[486]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]";
[1525]1019usage += "\n Related commands: disp surf nt3d gfd2d vecplot";
[330]1020mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1021kw = "nt3d";
[486]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 ";
[330]1025mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[1525]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");
[339]1031
1032// Ceci est maintenant obsolete, on garde pour info.
[293]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]";
[339]1036usage += "\n Related commands: gfd3d nt2d nt3d ";
1037usage += "\n ----- OBSOLETE: utilisez nt2d -----";
[330]1038mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]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 ";
[339]1043usage += "\n ----- OBSOLETE: utilisez nt3d -----";
[330]1044mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]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]";
[326]1049usage += "\n Related commands: funcff func2d func2dff ";
[330]1050mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[326]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 ";
[330]1055mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[293]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";
[330]1060mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[326]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 ";
[330]1065mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[293]1066
[357]1067kw = "ObjectExpressions";
1068usage = "Any mathematical expression (math.h) with object variables can be used";
1069usage += "\n ------ Object Variable names (double) -------- ";
[1548]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 -------- ";
[357]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";
[1548]1083usage += "\n\n Related commands: plot2d plot2de plot2dw plot3d ";
[357]1084usage += "\n projh1d projh2d projprof fillvec fillmtx ";
1085usage += "\n fillnt fillgd1 fillgd2 ntloop exptovec ... ";
1086mpiac->RegisterCommand(kw, usage, NULL, "Expr. Plotting");
[293]1087kw = "plot2d";
1088usage = "Plots (2D) Y=g(Object) vs. X=f(Object) --- Object Variable names (double) :";
[357]1089usage += "\n Usage: plot2d nameobj f_X() g_Y() [f_Cut() graphic_attributes loop_param]";
1090usage += "\n Related commands: plot2de plot2dw plot3d ObjectExpressions ...";
[330]1091mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]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");
[333]1097kw = "plot2dw";
1098usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with Weight W=h(Object) ";
[357]1099usage += "\n Usage: plot2dw nameobj f_X() g_Y() h_Wt() [Cut() graphic_attributes loop_param]";
1100usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
[333]1101mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1102kw = "plot3d";
1103usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs ";
[357]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 ...";
[330]1106mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1107
1108kw = "projh1d";
1109usage = "Projects X=f(Object) with weight WT=h(Object) into a 1D histogram ";
[357]1110usage += "\n Usage: projh1d nameh1d nameobj f_X() [h_WT()=1. Cut() graphic_attributes loop_param]";
[293]1111usage += "\n Histo1D nameh1d is created if necessary ";
[357]1112usage += "\n Related commands: projh2d projprof ObjectExpressions ...";
[330]1113mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1114kw = "projh2d";
1115usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a 2D histogram ";
[357]1116usage += "\n Usage: projh2d nameh2d nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
[293]1117usage += "\n Histo2D nameh2d is created if necessary ";
[357]1118usage += "\n Related commands: projh1d projprof ObjectExpressions ...";
[330]1119mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1120kw = "projprof";
1121usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a profile histogram ";
[709]1122usage += "\n Usage: projprof nameprof nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
[293]1123usage += "\n HProf nameprof is created if necessary ";
[357]1124usage += "\n Related commands: projh1d projh2d ObjectExpressions ...";
[330]1125mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]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");
[293]1136
1137kw = "fillnt";
1138usage = "Creates and Fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
[357]1139usage += "\n Usage: fillnt nameobj f_X() g_Y() h_Z() k_T() [Cut() nameNt loop_param]";
[333]1140usage += "\n Related commands: ntloop plot2d projh1d projh2d projprof ";
[357]1141usage += "\n Related commands: fillvec fillmtx ntloop exptovec fillgd1 fillgd2 ObjectExpressions ...";
[330]1142mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]1143
[333]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(...))";
[357]1147usage += "\n Usage: ntloop nameobj CFileName FuncName [NtupleName loop_param]";
1148usage += "\n Related commands: fillvec fillmtx fillnt fillgd1 fillgd2 exptovec ObjectExpressions ...";
[333]1149usage += "\n Related commands: ntexpcfile fillnt";
1150mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]1151
[333]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
[357]1158kw = "exptovec";
[293]1159usage = "Creates and Fills a Vector with X=f(Object)";
[357]1160usage += "\n Usage: exptovec namevec nameobj f_X() [Cut() graphic_attributes loop_param]";
1161usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
[330]1162mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1163kw = "fillgd1";
1164usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), ErrY=h(...))";
[357]1165usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_ErrY() [Cut() loop_param]";
1166usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
[330]1167mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1168kw = "fillgd2";
1169usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), Z=h(...)) ErrZ=k(...)";
[357]1170usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_Z() k_ErrZ() [Cut() loop_param]";
1171usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
[330]1172mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[1067]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");
[293]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
[1276]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
[388]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";
[1134]1319usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n";
[388]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";
[548]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";
[553]1358usage += "\n Related commands: newwin zone stacknext graphicatt setinsetlimits";
[388]1359piac->RegisterHelp(kw, usage, grp);
[484]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);
[388]1381}
Note: See TracBrowser for help on using the repository browser.