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

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

commemtaire auto/fixedfontsize rz+cmv 19/7/02

File size: 57.6 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());
[1971]63 if (mImgApp) mImgApp->SetZone(nx, ny);
[293]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());
[1971]70 if (mImgApp) mImgApp->CreateGraphWin(nx, ny);
[293]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); }
[1971]75 string opts = tokens[0];
76 if (tokens.size() > 1)
[2089]77 for(unsigned int kt=1; kt<tokens.size(); kt++) { opts += ' '; opts += tokens[kt]; }
[1971]78 if (mImgApp) mImgApp->SetDefaultGraphicAttributes(opts);
[293]79 }
[1971]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)
[2089]84 for(unsigned int kt=1; kt<tokens.size(); kt++) { opts += ' '; opts += tokens[kt]; }
[1971]85 if (mImgApp) mImgApp->SetDefaultAxesAttributes(opts);
[331]86 }
[548]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 }
[349]95else if (kw == "addtext") {
[1642]96 if (tokens.size() < 3) { cout << "Usage: addtext x y txt [colfontatt]" << endl; return(0); }
[349]97 double xp = atof(tokens[0].c_str());
98 double yp = atof(tokens[1].c_str());
[1642]99 string txt = tokens[2];
[1971]100 string sop;
101 if (tokens.size() > 3) sop = tokens[3];
102 mImgApp->AddText(txt, xp, yp, sop);
[349]103 }
[1642]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());
[1971]110 string sop;
111 if (tokens.size() > 4) sop = tokens[4];
112 if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop);
[1642]113 else {
114 bool fgfill = (kw == "addrect") ? false : true;
[1971]115 mImgApp->AddRectangle(xp1, yp1, xp2, yp2, sop, fgfill);
[1642]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());
[1971]123 string sop;
124 if (tokens.size() > 3) sop = tokens[3];
[1642]125 bool fgfill = (kw == "addcirc") ? false : true;
[1971]126 mImgApp->AddCircle(xc, yc, rad, sop, fgfill);
[1642]127 }
128
129
[1131]130else if (kw == "settitle") {
[1642]131 if (tokens.size() < 1) { cout << "Usage: settitle TopTitle [BotTitle] [fontatt]" << endl; return(0); }
132 mImgApp->SetTitle(tokens[0], tokens[1]);
[1131]133 }
[349]134
[293]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}
[1276]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}
[293]150else if (kw == "call" ) {
151 if (tokens.size() < 1) { cout << "Usage: call userf [arg1 arg2 ...]" << endl; return(0); }
[1276]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()) ) {
[293]156 cerr << "PIABaseExecutor: No User Function " << tokens[0] << endl;
157 return(0);
158 }
[1276]159 if (it1 == usfmap.end()) it = it2;
160 else it = it1;
[293]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);
[1276]168#ifdef SANS_EVOLPLANCK
[293]169 TRY {
170 tokens.erase(tokens.begin());
171 fuf(tokens);
172 } CATCH(merr) {
173 fflush(stdout);
[1276]174 string es = PeidaExc(merr);
175 cerr << "\n PIABaseExecutor: Call UserFunc Exception :" << merr << es;
[293]176 cout << endl;
177 }
[1276]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
[293]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); }
[331]201 else { string nomobj = ""; mObjMgr->ReadFits(tokens[0], nomobj); }
[293]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}
[333]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}
[293]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}
[333]223else if ( (kw == "rename" ) || (kw == "mv") ) {
[293]224 if (tokens.size() < 2) { cout << "Usage: rename nameobj namenew" << endl; return(0); }
225 mObjMgr->RenameObj(tokens[0], tokens[1]);
226}
[333]227else if ( (kw == "del" ) || (kw == "rm") ) {
[1655]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]);
[293]231}
232else if (kw == "delobjs" ) {
233 if (tokens.size() < 1) { cout << "Usage: delobjs nomobjpattern (*,?) " << endl; return(0); }
234 mObjMgr->DelObjects(tokens[0]);
235}
[333]236else if ( (kw == "listobjs") || (kw == "ls") ) {
[331]237 if (tokens.size() < 1) tokens.push_back("*");
238 mObjMgr->ListObjs(tokens[0]);
239}
[333]240// Gestion des repertoires
241else if (kw == "mkdir" ) {
[344]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);
[333]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 }
[345]255else if (kw == "pwd") {
256 string dirn;
257 mObjMgr->GetCurrentDir(dirn);
258 cout << "CurrentDirectory: " << dirn << endl;
259 }
[333]260else if (kw == "listdirs") {
261 if (tokens.size() < 1) tokens.push_back("*");
262 mObjMgr->ListDirs(tokens[0]);
263 }
[293]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); }
[1091]268 int_4 nbx = 100;
269 r_8 xmin = 0., xmax = 1.;
[293]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 }
[1091]280 int_4 nbx = 50, nby = 50;
281 r_8 xmin = 0., xmax = 1.;
282 r_8 ymin = 0., ymax = 1.;
[293]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 }
[1035]290else if (kw == "newprof" || kw == "newprofe") {
[293]291 if (tokens.size() < 4)
[1035]292 { cout << "Usage: newprof[e] name xmin xmax nbin [ymin ymax]" << endl; return(0); }
[1091]293 int_4 nbx = 100;
294 r_8 xmin = 0., xmax = 1., ymin = 1., ymax = -1.;
[293]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);
[1035]300 if(kw == "newprofe") h->SetErrOpt(false);
[293]301 mObjMgr->AddObj(h, tokens[0]);
302 }
[447]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]) ) {
[1548]322 for(int i=1;i<(int)tokens.size();i++) {
[447]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
[293]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
[333]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;
[357]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 }
[333]368 }
369else if (kw == "newmtx") {
370 if (tokens.size() < 3) {
[1917]371 cout << "Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) dopt] " << endl; return(0);
[333]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;
[357]378 if (tokens.size() < 4) {
379 Matrix* mtx = new Matrix(ny,nx);
380 mObjMgr->AddObj(mtx, tokens[0]);
381 }
382 else {
[1971]383 if (tokens.size() < 5) tokens.push_back("next");
[357]384 mObjMgr->GetServiceObj()->PlotFunc2D(tokens[3], tokens[0], xmin, xmax, ymin, ymax,
385 nx, ny, tokens[4]);
386 }
[333]387 }
388
[455]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 }
[463]394 mObjMgr->CopyObj(tokens[0],tokens[1]);
[455]395}
396
397
[293]398// >>>>>>>>>>> Affichage des objets
[295]399else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") ) {
400 if (tokens.size() < 1) { cout << "Usage: disp/surf/imag nameobj [opt]" << endl; return(0); }
[1971]401 string opt = "next";
[293]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);
[295]405 else if (kw == "imag") mObjMgr->DisplayImage(tokens[0], opt);
[293]406 }
407
408else if (kw == "nt2d") {
[486]409 if (tokens.size() < 3) {
410 cout << "Usage: nt2d nameobj varx vary [errx erry wt label opt]" << endl;
411 return(0);
[293]412 }
[486]413 while (tokens.size() < 8) tokens.push_back("");
[333]414 string ph = "";
[486]415 mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], ph, tokens[3], tokens[4], ph,
416 tokens[5], tokens[6], tokens[7], false);
[333]417 }
[293]418else if (kw == "nt3d") {
[486]419 if (tokens.size() < 7) {
420 cout << "Usage: nt3d nameobj varx vary varz [errx erry errz wt label opt]" << endl;
421 return(0);
[293]422 }
[486]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 }
[1525]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}
[293]434
[339]435// Obsolete : ne pas virer SVP, cmv 26/7/99
[293]436else if (kw == "gfd2d") {
[339]437 cout<<"----- gfd2d OBSOLETE: utilisez nt2d -----"<<endl;
[293]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 = "";
[1971]443 string opt = "next";
[293]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") {
[339]449 cout<<"----- gfd3d OBSOLETE: utilisez nt3d -----"<<endl;
[293]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 = "";
[1971]454 string opt = "next";
[293]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") ) {
[1938]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());
[293]468 if (tokens.size() > 4) opt = tokens[4];
[333]469 mObjMgr->GetServiceObj()->PlotFunc(tokens[0], nom, xmin, xmax, np, opt);
[293]470 }
[326]471else if ( (kw == "funcff") ) {
[1938]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];
[333]479 mObjMgr->GetServiceObj()->PlotFuncFrCFile(tokens[0], tokens[1], nom, xmin, xmax, np, opt);
[326]480 }
[293]481else if ( (kw == "func2d") ) {
482 if (tokens.size() < 7) {
[357]483 cout << "Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [opt]" << endl;
[293]484 return(0);
485 }
486 int npx, npy;
[333]487 double xmin, xmax;
488 double ymin, ymax;
[293]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());
[357]496 string opt = "";
[293]497 if (tokens.size() > 7) opt = tokens[7];
[333]498 string nom = "";
499 mObjMgr->GetServiceObj()->PlotFunc2D(tokens[0], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
[293]500 }
[326]501else if ( (kw == "func2dff") ) {
502 if (tokens.size() < 8) {
[357]503 cout << "Usage: func2d C-filename F(x,y)-name xmax nptx ymin ymax npty [opt]" << endl;
[326]504 return(0);
505 }
506 int npx, npy;
[333]507 double xmin, xmax;
508 double ymin, ymax;
[326]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());
[357]516 string opt = "";
[326]517 if (tokens.size() > 8) opt = tokens[8];
[333]518 string nom = "";
519 mObjMgr->GetServiceObj()->PlotFunc2DFrCFile(tokens[0], tokens[1], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
[326]520 }
[293]521
522// >>>>>>>>>>> Trace d'expressions de N_Tuple, StarList, etc ...
523else if (kw == "plot2d" ) {
[357]524 if (tokens.size() < 3) {
525 cout << "Usage: plot2d nameobj expx expy [expcut opt loop_par]" << endl;
[293]526 return(0);
527 }
[357]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);
[293]538 }
[357]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]);
[293]543 }
544
[357]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;
[333]548 return(0);
549 }
[357]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]);
[333]553 }
[357]554else if (kw == "plot3d" ) {
555 if (tokens.size() < 4) {
556 cout << "Usage: plot3d nomobj expx expy expz [expcut opt loop_par]" << endl;
[293]557 return(0);
558 }
[357]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]);
[293]562 }
563
564else if (kw == "projh1d" ) {
[357]565 if (tokens.size() < 3) {
566 cout << "Usage: projh1d nomh1 nomobj expx [expwt expcut opt loop_par]" << endl;
[293]567 return(0);
568 }
[357]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] );
[293]573 }
574
[357]575
576// Projection dans histogrammes
[293]577else if (kw == "projh2d" ) {
[357]578 if (tokens.size() < 4) {
579 cout << "Usage: projh2d nomh2 nomobj expx expy [expwt expcut opt loop_par]" << endl;
[293]580 return(0);
581 }
[357]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] );
[293]587 }
588
589else if (kw == "projprof" ) {
[357]590 if (tokens.size() < 4) {
591 cout << "Usage: projprof nomprof nomobj expx expy [expwt expcut opt loop_par]" << endl;
[293]592 return(0);
593 }
[357]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],
[1091]598 tokens[6], tokens[7] );
[357]599 }
[293]600
[357]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] );
[293]610 }
611
[357]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
[447]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
[293]634else if (kw == "fillnt" ) {
[357]635 if (tokens.size() < 5) {
636 cout << "Usage: fillnt nameobj expx expy expz expt [expcut ntname loop_par]" << endl;
[293]637 return(0);
638 }
[357]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] );
[293]641 }
642
[333]643else if (kw == "ntloop" ) {
644 if (tokens.size() < 3) {
[357]645 cout << "Usage: ntloop nameobj fname funcname [ntname loop_par ]" << endl;
[333]646 return(0);
647 }
[357]648 while (tokens.size() < 5) tokens.push_back("");
649 srvo->FillNTFrCFile(tokens[0],tokens[1], tokens[2], tokens[3], tokens[4]);
[333]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
[357]660else if (kw == "exptovec" ) {
661 if (tokens.size() < 3) {
662 cout << "Usage: exptovec nomvec nameobj expx [expcut opt loop_par]" << endl;
[293]663 return(0);
664 }
[357]665 while (tokens.size() < 6) tokens.push_back("");
666 srvo->ExpressionToVector(tokens[1],tokens[2],tokens[3],tokens[0],tokens[4],tokens[5]);
[293]667 }
668
669else if (kw == "fillgd1" ) {
670 if (tokens.size() < 5) {
[357]671 cout << "Usage: fillgd1 nomgfd nomobj expx expy experry [expcut loop_par] " << endl;
[293]672 return(0);
673 }
[357]674 if (tokens.size() < 6) tokens.push_back("1");
675 if (tokens.size() < 7) tokens.push_back("");
[293]676 string expy = "";
[357]677 srvo->FillGFD(tokens[1],tokens[2], expy, tokens[3], tokens[4], tokens[5], tokens[0]);
[293]678 }
679
680else if (kw == "fillgd2" ) {
681 if (tokens.size() < 6) {
[357]682 cout << "Usage: fillgd2 nomgfd nomobj expx expy expz experrz [expcut loop_par]" << endl;
[293]683 return(0);
684 }
[357]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]);
[293]688 }
689
[1067]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 }
[293]702
703
704else {
705 cerr << "PIABaseExecutor::Do() Erreur - Commande " << kw << " inconuue ! " << endl;
706 return(-1);
707 }
708
709return(0);
710}
711
[388]712// Fonction pour enregistrer le Help des Widgets et Windows de piapp
713static void RegisterPIGraphicsHelp(PIACmd* piac);
714
[293]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";
[330]722mpiac->RegisterCommand(kw, usage, this, "External Modules");
[293]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 ";
[1276]726usage += "\n Related commands: call loadmodule linkff2";
[330]727mpiac->RegisterCommand(kw, usage, this, "External Modules");
[1276]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");
[293]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";
[330]737mpiac->RegisterCommand(kw, usage, this, "External Modules");
[293]738
739kw = "zone";
[384]740usage = "To Divide the Graphic window \n Usage: zone [nx=1 ny=1]";
[388]741usage += "\n Related commands: newwin";
[330]742mpiac->RegisterCommand(kw, usage, this, "Graphics");
[293]743kw = "newwin";
744usage = "To Create a New Graphic window, with zones \n Usage: newwin nx ny";
[388]745usage += "\n Related commands: zone";
[330]746mpiac->RegisterCommand(kw, usage, this, "Graphics");
[293]747kw = "stacknext";
748usage = "Displays the next widget on stack window \n Usage: stacknext";
[330]749mpiac->RegisterCommand(kw, usage, this, "Graphics");
[293]750
[553]751kw = "graphicatt";
752usage = "To change default graphic options \n Usage: graphicatt att_list \n";
[1971]753usage += "att_list=def back to default values, Example: gratt 'red circlemarker5'";
[293]754usage += "\n ------------------ Graphic attribute list ------------------ \n";
[1642]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";
[293]758usage += ">> Lines: defline normalline thinline thickline dashedline thindashedline \n";
759usage += " thickdashedline dottedline thindottedline thickdottedline \n";
[1569]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";
[293]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";
[1126]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";
[1504]774usage += " revcmap : This flag reverses ColorMap indexing \n";
[2118]775usage += ">> ZoomFactors zoomxN zoomx1 zoomx2 zoomx3 ... \n";
776usage += " (image display) zoom/N zoom/2 zoom/3 zoom/4 ...\n";
[1971]777usage += ">> imagecenter=ix,iy -> Position the image in widget \n";
[2121]778usage += ">> lut=ltyp,min,max -> Sets LUT type and min/max for image display \n";
[2118]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";
[2121]783usage += ">> Axe labels font size: fixedfontsize/autofontsize \n";
784usage += " autofontsize: Font size computed automatically \n";
785usage += " fixedfontsize: Use font size attribute (BaseDrawer) \n";
[506]786usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n";
[2118]787usage += ">> xylimits=xmin,xmax,ymin,ymax -> Forces X-Y limits in 2-D plots \n";
[546]788usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n";
[1131]789usage += ">> title/notitle or tit/notit -> Toggle Auto AddTitle flag \n";
[548]790usage += ">> DisplayWindow: next same win stack inset \n";
[1971]791usage += " Related commands: setaxesatt setinsetlimits ";
[330]792mpiac->RegisterCommand(kw, usage, this, "Graphics");
[293]793
[1971]794kw = "setaxesatt";
795usage = "To set default axes attributes \n Usage: setaxesatt att_list \n";
[2118]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";
[2121]800usage += ">> Axe labels font size: fixedfontsize/autofontsize \n";
801usage += " autofontsize: Font size computed automatically \n";
802usage += " fixedfontsize: Use font size attribute (BaseDrawer) \n";
[1971]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";
[331]805mpiac->RegisterCommand(kw, usage, this, "Graphics");
806
[548]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";
[558]812usage += "\n Related commands: graphicatt /inset";
[548]813mpiac->RegisterCommand(kw, usage, this, "Graphics");
814
[349]815kw = "addtext";
816usage = "Adds a text string to the current graphic object";
[1642]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";
[349]824mpiac->RegisterCommand(kw, usage, this, "Graphics");
825
[1642]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
[1131]871kw = "settitle";
[1642]872usage = "Set the title string (top title / bottom title) for the current graphic object";
873usage += "\n Usage: settitle TopTitle [BottomTitle] [fontAtt]";
[1131]874usage += "\n Related commands: addtext graphicatt";
875mpiac->RegisterCommand(kw, usage, this, "Graphics");
876
[388]877RegisterPIGraphicsHelp(mpiac);
878
[293]879kw = "openfits";
880usage = "Loads a FITS file into an Image<T> \n Usage: openfits filename";
881usage += "\n Related commands: savefits openppf";
[330]882mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]883kw = "savefits";
884usage = "Save an object into a FITS file \n Usage: savefits nameobj filename";
885usage += "\n Related commands: openfits saveall";
[330]886mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]887kw = "openppf";
888usage = "Reads all objects from a PPF file \n Usage: openppf filename";
889usage += "\n Related commands: saveall openfits";
[330]890mpiac->RegisterCommand(kw, usage, this, "FileIO");
[333]891kw = "saveobjs";
892usage = "Saves objects with names matching a pattern (x?y*) into a PPF file \n";
[1068]893usage += "Usage: saveobjs nameobjpattern filename";
[333]894usage += "\n Related commands: saveall openppf savefits";
895mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]896kw = "saveall";
897usage = "Saves all objects into a PPF file \n Usage: saveall filename";
[333]898usage += "\n Related commands: saveobj openppf savefits";
[330]899mpiac->RegisterCommand(kw, usage, this, "FileIO");
[449]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");
[293]905
[449]906
[293]907kw = "print";
908usage = "Prints an object \n Usage: print nameobj";
[330]909mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]910
[333]911kw = "mkdir";
912usage = "Create a directory";
[344]913usage += "\n Usage: mkdir dirname [true]";
914usage += "\n if second argument==true, the directory's KeepOld attribute is set to true";
[463]915mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]916kw = "rmdir";
917usage = "Removes an empty directory";
918usage += "\n Usage: remove dirname";
[463]919mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]920kw = "cd";
921usage = "Change current directory";
922usage += "\n Usage: cd [dirname]";
[463]923mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]924kw = "pwd";
925usage = "Prints current directory";
926usage += "\n Usage: pwd";
[463]927mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]928kw = "listdirs";
929usage = "Prints the list of directories";
930usage += "\n Usage: listdirs [patt=*] \n patt : * , ? ";
[463]931mpiac->RegisterCommand(kw, usage, this, "Object Management");
[295]932kw = "listobjs";
[333]933usage = "Prints the list of objects (Alias: ls)";
934 usage += "\n Usage: listobjs [patt=*] \n patt : /*/x?y* ... ";
[463]935mpiac->RegisterCommand(kw, usage, this, "Object Management");
[293]936kw = "rename";
[333]937usage = "Rename an object (Alias: mv) \n Usage: rename nameobj namenew";
[293]938usage += "\n Related commands: del delobjs";
[463]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");
[293]945kw = "del";
[1655]946usage = "Deletes an object (Alias: rm) \n Usage: del nameobj [nameobj2 ...]";
[293]947usage += "\n Related commands: delobjs rename";
[463]948mpiac->RegisterCommand(kw, usage, this, "Object Management");
[293]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";
[463]953mpiac->RegisterCommand(kw, usage, this, "Object Management");
[293]954
955kw = "newh1d";
956usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin";
[1035]957usage += "\n Related commands: newh2d newprof[e] newnt newgfd ";
[333]958mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]959kw = "newh2d";
960usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny";
[1035]961usage += "\n Related commands: newh1d newprof[e] newnt newgfd ";
[333]962mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]963kw = "newprof";
964usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]";
[1035]965usage += "\n Errors represent the data spread in the X bin ";
966usage += "\n Related commands: newh1d newh2d newprofe newnt newgfd ";
[333]967mpiac->RegisterCommand(kw, usage, this, "Objects");
[1035]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");
[447]973kw = "newnt";
974usage = "Creates a ntuple \n Usage: newnt name v1 v2 v3 .. vn";
975usage += "\n newnt name nvar";
[1035]976usage += "\n Related commands: newh1d newh2d newprof[e] newgfd ";
[447]977mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]978kw = "newgfd";
979usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]";
[1035]980usage += "\n Related commands: newh1d newh2d newprof[e] newnt ";
[333]981mpiac->RegisterCommand(kw, usage, this, "Objects");
982kw = "newvec";
[357]983usage = "Creates (and optionaly fills) a vector \n Usage: newvec name size [f(i) [dopt] ] ";
[333]984usage += "\n Related commands: newmtx";
[357]985mpiac->RegisterCommand(kw, usage, this, "Objects");
[333]986kw = "newmtx";
[357]987usage = "Creates (and optionaly fills) a matrix \n";
[1917]988usage +=" Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) [dopt] ] ";
[333]989usage += "\n Related commands: newvec";
[357]990mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]991
992kw = "disp";
993usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]";
[1525]994usage += "\n Related commands: surf nt2d nt3d vecplot";
[330]995mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[295]996kw = "imag";
997usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]";
[1525]998usage += "\n Related commands: disp surf nt2d nt3d vecplot";
[330]999mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1000kw = "surf";
1001usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]";
[1525]1002usage += "\n Related commands: disp nt2d nt3d vecplot";
[330]1003mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1004kw = "nt2d";
[486]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]";
[1525]1007usage += "\n Related commands: disp surf nt3d gfd2d vecplot";
[330]1008mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1009kw = "nt3d";
[486]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 ";
[330]1013mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[1525]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");
[339]1019
1020// Ceci est maintenant obsolete, on garde pour info.
[293]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]";
[339]1024usage += "\n Related commands: gfd3d nt2d nt3d ";
1025usage += "\n ----- OBSOLETE: utilisez nt2d -----";
[330]1026mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]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 ";
[339]1031usage += "\n ----- OBSOLETE: utilisez nt3d -----";
[330]1032mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1033
1034kw = "func";
1035usage = "Displays a function y=f(x) (Fills a vector with function values)";
[1938]1036usage += "\n Usage: func f(x) xmin xmax [npt graphic_attributes]";
[326]1037usage += "\n Related commands: funcff func2d func2dff ";
[330]1038mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[326]1039kw = "funcff";
1040usage = "Displays a function y=f(x) from a C-file (Fills a vector with function values)";
[1938]1041usage += "\n Usage: funcff C-FileName FunctionName xmin xmax [npt graphic_attributes]";
[326]1042usage += "\n Related commands: func func2d func2dff ";
[330]1043mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[293]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";
[330]1048mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[326]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 ";
[330]1053mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[293]1054
[357]1055kw = "ObjectExpressions";
1056usage = "Any mathematical expression (math.h) with object variables can be used";
1057usage += "\n ------ Object Variable names (double) -------- ";
[1548]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";
1068usage += "\n ------ Other parameters -------- ";
[357]1069usage += "\nLoop parameters can be specified as I1[:I2[:DI]] for(int i=I1; i<I2; i+=DI)";
1070usage += "\nThe default Cut() expression in true (=1) for all";
[1548]1071usage += "\n\n Related commands: plot2d plot2de plot2dw plot3d ";
[357]1072usage += "\n projh1d projh2d projprof fillvec fillmtx ";
1073usage += "\n fillnt fillgd1 fillgd2 ntloop exptovec ... ";
1074mpiac->RegisterCommand(kw, usage, NULL, "Expr. Plotting");
[293]1075kw = "plot2d";
1076usage = "Plots (2D) Y=g(Object) vs. X=f(Object) --- Object Variable names (double) :";
[357]1077usage += "\n Usage: plot2d nameobj f_X() g_Y() [f_Cut() graphic_attributes loop_param]";
1078usage += "\n Related commands: plot2de plot2dw plot3d ObjectExpressions ...";
[330]1079mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]1080kw = "plot2de";
1081usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with error bars eX/Y=f_ErrX/Y(Object) ";
1082usage += "\n Usage: plot2de nameobj f_X() g_Y() f_ErrX() f_ErrY() [f_Cut() graphic_attributes loop_param]";
1083usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
1084mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[333]1085kw = "plot2dw";
1086usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with Weight W=h(Object) ";
[357]1087usage += "\n Usage: plot2dw nameobj f_X() g_Y() h_Wt() [Cut() graphic_attributes loop_param]";
1088usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
[333]1089mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1090kw = "plot3d";
1091usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs ";
[357]1092usage += "\n Usage: plot3d nameobj f_X() g_Y() h_Z() [Cut() graphic_attributes loop_param]";
1093usage += "\n Related commands: plot2d plot2dw plot2de plot3d ObjectExpressions ...";
[330]1094mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1095
1096kw = "projh1d";
1097usage = "Projects X=f(Object) with weight WT=h(Object) into a 1D histogram ";
[357]1098usage += "\n Usage: projh1d nameh1d nameobj f_X() [h_WT()=1. Cut() graphic_attributes loop_param]";
[293]1099usage += "\n Histo1D nameh1d is created if necessary ";
[357]1100usage += "\n Related commands: projh2d projprof ObjectExpressions ...";
[330]1101mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1102kw = "projh2d";
1103usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a 2D histogram ";
[357]1104usage += "\n Usage: projh2d nameh2d nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
[293]1105usage += "\n Histo2D nameh2d is created if necessary ";
[357]1106usage += "\n Related commands: projh1d projprof ObjectExpressions ...";
[330]1107mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1108kw = "projprof";
1109usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a profile histogram ";
[709]1110usage += "\n Usage: projprof nameprof nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
[293]1111usage += "\n HProf nameprof is created if necessary ";
[357]1112usage += "\n Related commands: projh1d projh2d ObjectExpressions ...";
[330]1113mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]1114kw = "fillvec";
1115usage = "Fills a Vector V((int)(f_X(Object)+0.5)) = h_V(Object) ";
1116usage += "\n Usage: fillvec namevec nameobj f_X() h_V() [Cut() graphic_attributes loop_param]";
1117usage += "\n Related commands: fillmtx fillnt ObjectExpressions ...";
1118mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1119kw = "fillmtx";
1120usage = "Fills a Matrix M(Line=g_Y(Object)+0.5, Col=f_X(Object)+0.5)) = h_V(Object) ";
1121usage += "\n Usage: fillvec namevec nameobj f_X() g_Y() h_V() [Cut() graphic_attributes loop_param]";
1122usage += "\n Related commands: fillvec fillnt ObjectExpressions ...";
1123mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1124
1125kw = "fillnt";
1126usage = "Creates and Fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
[357]1127usage += "\n Usage: fillnt nameobj f_X() g_Y() h_Z() k_T() [Cut() nameNt loop_param]";
[333]1128usage += "\n Related commands: ntloop plot2d projh1d projh2d projprof ";
[357]1129usage += "\n Related commands: fillvec fillmtx ntloop exptovec fillgd1 fillgd2 ObjectExpressions ...";
[330]1130mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]1131
[333]1132kw = "ntloop";
1133usage = "Loops over an Object NTupleInterface calling a function from a C-file \n";
1134usage += "and optionaly fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
[357]1135usage += "\n Usage: ntloop nameobj CFileName FuncName [NtupleName loop_param]";
1136usage += "\n Related commands: fillvec fillmtx fillnt fillgd1 fillgd2 exptovec ObjectExpressions ...";
[333]1137usage += "\n Related commands: ntexpcfile fillnt";
1138mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]1139
[333]1140kw = "ntexpcfile";
1141usage = "Creates a C-File with declarations suitable to be used for ntloop";
1142usage += "\n Usage: ntexpcfile nameobj CFileName FuncName ";
1143usage += "\n Related commands: ntloop";
1144mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1145
[357]1146kw = "exptovec";
[293]1147usage = "Creates and Fills a Vector with X=f(Object)";
[357]1148usage += "\n Usage: exptovec namevec nameobj f_X() [Cut() graphic_attributes loop_param]";
1149usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
[330]1150mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1151kw = "fillgd1";
1152usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), ErrY=h(...))";
[357]1153usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_ErrY() [Cut() loop_param]";
1154usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
[330]1155mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1156kw = "fillgd2";
1157usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), Z=h(...)) ErrZ=k(...)";
[357]1158usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_Z() k_ErrZ() [Cut() loop_param]";
1159usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
[330]1160mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[1067]1161kw = "gdfrvec";
1162usage = "Fills a GeneralFitData with vectors X,Y,Z,EZ";
1163usage += "\n Usage: gdfrvec namegfd X Y";
1164usage += "\n Usage: gdfrvec namegfd X Y ! EY";
1165usage += "\n Usage: gdfrvec namegfd X Y Z";
1166usage += "\n Usage: gdfrvec namegfd X Y Z EZ";
1167usage += "\n Related commands: fillgd1 fillgd2 ...";
1168mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1169
1170}
1171
1172/* --Methode-- */
1173int PIABaseExecutor::LinkUserFuncs(string& fnameso, string& func1, string& func2, string& func3)
1174// string& func4, string& func5)
1175{
1176string cmd;
1177
1178if (dynlink) delete dynlink; dynlink = NULL;
1179usfmap.clear();
1180
1181dynlink = new PDynLinkMgr(fnameso, true);
1182if (dynlink == NULL) {
1183 string sn = fnameso;
1184 cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur ouverture SO " << sn << endl;
1185 return(2);
1186 }
1187
1188int nok=0;
1189// on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
1190// DlUserProcFunction f = NULL;
1191DlFunction f = NULL;
1192if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
1193// f = (DlUserProcFunction) dlsym(dlhandle, func1.c_str());
1194f = dynlink->GetFunction(func1);
1195if (f) { nok++; usfmap[func1] = f; }
1196else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func1 << endl;
1197
1198if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
1199// f = (DlUserProcFunction) dlsym(dlhandle, func2.c_str());
1200f = dynlink->GetFunction(func2);
1201if (f) { nok++; usfmap[func2] = f; }
1202else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func2 << endl;
1203
1204if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
1205// f = (DlUserProcFunction) dlsym(dlhandle, func3.c_str());
1206f = dynlink->GetFunction(func3);
1207if (f) { nok++; usfmap[func3] = f; }
1208else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func3 << endl;
1209
1210/* Pb compile g++ 2.7.2
1211if ((func4.length() < 1) || (func4 == "-") || (func4 == ".") ) goto fin;
1212// f = (DlUserProcFunction) dlsym(dlhandle, func4.c_str());
1213f = dynlink->GetFunction(func4);
1214if (f) { nok++; usfmap[func4] = f; }
1215else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func4 << endl;
1216
1217if ((func5.length() < 1) || (func5 == "-") || (func5 == ".") ) goto fin;
1218// f = (DlUserProcFunction) dlsym(dlhandle, func5.c_str());
1219f = dynlink->GetFunction(func5);
1220if (f) { nok++; usfmap[func5] = f; }
1221else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func5 << endl;
1222*/
1223fin:
1224if (nok < 1) { if (dynlink) delete dynlink; dynlink = NULL; return(3); }
1225else return(0);
1226}
1227
[1276]1228/* --Methode-- */
1229int PIABaseExecutor::LinkUserFuncs2(string& fnameso, string& func1, string& func2, string& func3)
1230{
1231string cmd;
1232
1233if (dynlink2) delete dynlink2; dynlink2 = NULL;
1234usfmap2.clear();
1235
1236dynlink2 = new PDynLinkMgr(fnameso, true);
1237if (dynlink2 == NULL) {
1238 string sn = fnameso;
1239 cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur ouverture SO " << sn << endl;
1240 return(2);
1241 }
1242
1243int nok=0;
1244// on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
1245// DlUserProcFunction f = NULL;
1246DlFunction f = NULL;
1247if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
1248f = dynlink2->GetFunction(func1);
1249if (f) { nok++; usfmap2[func1] = f; }
1250else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func1 << endl;
1251
1252if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
1253f = dynlink2->GetFunction(func2);
1254if (f) { nok++; usfmap2[func2] = f; }
1255else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func2 << endl;
1256
1257if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
1258f = dynlink2->GetFunction(func3);
1259if (f) { nok++; usfmap2[func3] = f; }
1260else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func3 << endl;
1261
1262fin:
1263if (nok < 1) { if (dynlink2) delete dynlink2; dynlink2 = NULL; return(3); }
1264else return(0);
1265}
1266
[388]1267/* Nouvelle-Fonction */
1268void RegisterPIGraphicsHelp(PIACmd* piac)
1269{
1270string kw,grp,usage;
1271
1272grp = "Graphics";
1273
1274kw = "PIImage";
1275usage = "Manages the display of a 2-D array (P2DArrayAdapter) as an image \n";
1276usage += "and controls a zoom widget, as well as a global image view widget \n";
1277usage += ">>>> Mouse controls : \n";
1278usage += "o Button-1: Display current coordinates and pixel value\n";
1279usage += " Position the cursor an refresh the zoom widget\n";
1280usage += "o Button-2: Defines an image zone and positions the cursor \n";
1281usage += "o Button-3: Moves the viewed portion of the array inside the window \n";
1282usage += ">>>> Keyboard controls : \n";
1283usage += "o <Alt>R : Refresh display \n";
1284usage += "o <Alt>O : Shows the PIImageTools (image display parameter controls) \n";
1285usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of overlayed graphics (Drawers)) \n";
1286usage += "o <Alt>V : Copy/Paste / Text paste at the current cursor position \n";
1287usage += "o <Alt>C : Copy/Paste / Copies the selected regions content as text in the copy/paste buffer \n";
1288usage += "o <Alt>X : Show/Hide the Cut Window \n";
1289usage += "o <Alt>Z : Removes signs overlayed on image (Drawer 0) \n";
1290usage += "o Cursor keys : Moves the image cursor \n";
1291piac->RegisterHelp(kw, usage, grp);
1292
1293kw = "PIScDrawWdg";
1294usage = "Manages display of 2-D drawers with interactive zoom \n";
1295usage += ">>>> Mouse controls : \n";
1296usage += "o Button-1: Display current coordinates \n";
1297usage += "o Button-2: Defines a rectangle for zoom \n";
1298usage += "o Button-3: Defines a rectangle for Text-Info (<Alt>I) \n";
1299usage += ">>>> Keyboard controls : \n";
1300usage += "o <Alt>R : Refresh display \n";
1301usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n";
1302usage += " Specific controls for 2-D histograms \n";
1303usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
1304usage += " Drawer 0 manages the axes, as well as the added text \n";
1305usage += "o <Alt>V : Copy/Paste / Text paste at the current position \n";
1306usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n";
[1134]1307usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n";
[1911]1308usage += "o <Alt>M : Activate/Deactivate a measurement cursor on Button-1\n";
1309usage += "o <Alt>L : Deactivate DX,DY print (see below)\n";
[1883]1310usage += ">>>> Mouse + Keyboard controls : \n";
1311usage += "o Button-1 + <Alt>K : Set (reset) the reference point for DX,DY print \n";
[388]1312piac->RegisterHelp(kw, usage, grp);
1313
1314kw = "PIDraw3DWdg";
1315usage = "Manages display of 3-D objects (drawers) \n";
1316usage += ">>>> Mouse controls : \n";
1317usage += "o Button-2: Rotates the observer (camera) around object \n";
1318usage += "o Shift-Button-2: Rotates object with camera fixed \n";
1319usage += " The object rotation mode can be assigned to Button-2 with <Alt>S \n";
1320usage += "o Button-3: Zoom control (Camera distance And/Or view angle) \n";
1321usage += ">>>> Keyboard controls : \n";
1322usage += "o <Alt>R : Resets the 3-D view and refreshes the display \n";
1323usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
1324usage += "o <Alt>O : = <Alt>G \n";
1325usage += "o <Alt>V : Copy/Paste / Text paste at the current position (Drawer 0)\n";
1326usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n";
1327usage += "o <Alt>A : Activate/Deactivate axes drawing \n";
1328usage += "o <Alt>S : Activate/Deactivate object rotation mode on Button-2 \n";
1329piac->RegisterHelp(kw, usage, grp);
1330
1331kw = "Windows";
1332usage = "Objects can be displayed in different windows, or overlayed on the \n";
1333usage += "previous display. The graphics attributes next,win,stack,same control \n";
1334usage += "the display window. \n";
1335usage += "o GraphicWindow : This is the default mode (gr_att=next)\n";
1336usage += " Graphic windows can be divided int zones. Object is displayed \n";
1337usage += " in the next available position, removing a previously displayed \n";
1338usage += " widget if necessary \n";
1339usage += "o Window : An object is displayed in its own window (gr_att= win) \n";
1340usage += "o StackWindow : multpile widgets can be stacked in a StackWindow (gr_att= stack) \n";
1341usage += " A single widget is displayed a any time. Different widgets in a StackWindow \n";
1342usage += " can be displayed using the stacknext command, as well as the StackTools item \n";
1343usage += " in the Tools menu (from Menubar). An automatic cyclic display mode can also \n";
1344usage += " be activated using the StackTools menu (Blink) \n";
[548]1345usage += "o Most objects can be also be displayed overlayed \n";
1346usage += " on the last displayed widget (gr_att= same) \n";
1347usage += "o The overlay can be on a selected rectangle of the \n";
1348usage += " last displayed widget (gr_att= inset) - See setinsetlimits\n";
[553]1349usage += "\n Related commands: newwin zone stacknext graphicatt setinsetlimits";
[388]1350piac->RegisterHelp(kw, usage, grp);
[484]1351
1352kw = "PIConsole";
1353usage = "Text output area and command editing window (console) \n";
1354usage += ">>>> Mouse controls : \n";
1355usage += "o Button-1: Rectangle selection for copy/paste \n";
1356usage += "o Button-2: Paste text in the command editing line \n";
1357usage += "o Button-3: activate display option menu \n";
1358usage += ">>>> Keyboard controls : \n";
1359usage += "o <Alt>O : activate display option menu \n";
1360usage += "o <Alt>V : Paste text in the command editing line \n";
1361usage += "o <Alt>A : Selection of the whole window for copy \n";
1362usage += "o <Alt>L : Command history (List of command history buffer) \n";
1363usage += "o <Ctl>A : Command editing -> Goto the beginning of line \n";
1364usage += "o <Ctl>E : Command editing -> Goto the end of line \n";
1365usage += "o <Ctl>K : Command editing -> Clear to the end of line \n";
1366usage += "o <Ctl>C : Command editing -> Clear the line \n";
1367usage += "o Cursor left,right : Command editing -> Move cursor \n";
1368usage += "o Cursor Up,Down : recall command from history buffer \n";
1369usage += "o Backspace,Del : Command editing \n";
1370usage += "o <Return>,<Enter> : Execute command \n";
1371piac->RegisterHelp(kw, usage, grp);
[388]1372}
Note: See TracBrowser for help on using the repository browser.