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

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

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

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