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

Last change on this file since 2494 was 2494, checked in by ansari, 22 years ago

Suite debugging gestion lock entre threads ds piapp - A l'air de

marcher sur OSF1 et Linux ... Reza 06/01/2004

File size: 81.9 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"
[2263]11#include "strutilxx.h"
[293]12
13#include "pistdimgapp.h"
14#include "nobjmgr.h"
[326]15#include "servnobjm.h"
[2305]16#include "nomgadapter.h"
[2243]17#include "piyfxdrw.h"
[293]18
19#include "histos.h"
20#include "histos2.h"
21#include "hisprof.h"
22#include "ntuple.h"
23#include "generaldata.h"
[769]24
25#ifdef SANS_EVOLPLANCK
[333]26#include "cvector.h"
[769]27#else
28#include "tvector.h"
29#endif
[293]30
31
32/* --Methode-- */
33PIABaseExecutor::PIABaseExecutor(PIACmd* piac, NamedObjMgr* omg, PIStdImgApp* app)
34{
35mpiac = piac;
36mObjMgr = omg;
37mImgApp = app;
[312]38dynlink = NULL;
[1276]39dynlink2 = NULL;
[293]40RegisterCommands();
41}
42
43PIABaseExecutor::~PIABaseExecutor()
44{
[1276]45 if (dynlink) delete dynlink;
46 if (dynlink2) delete dynlink2;
[293]47}
48
49
[2263]50/* Macro pour tester si flag normalized coordinate est present */
51#define _CkBoolNC_(_jk_) ((tokens.size()>_jk_) && (tokens[_jk_] == "true")) ? true : false;
[293]52
53/* --Methode-- */
[1268]54int PIABaseExecutor::Execute(string& kw, vector<string>& tokens, string& toks)
[293]55{
[333]56Services2NObjMgr* srvo = mObjMgr->GetServiceObj();
[293]57// >>>>> Chargement de modules
[2307]58if (kw == "loadmodule") {
[293]59 if (tokens.size() < 2) { cout << "Usage: loadmodule fnameso modulename" << endl; return(0); }
60 mpiac->LoadModule(tokens[0], tokens[1]);
61 }
62// >>>>>>>>>>> Fenetre graphique , changement d'attributs graphiques
63else if (kw == "zone") {
[384]64 while (tokens.size() < 2) tokens.push_back("1");
[293]65 int nx, ny;
66 nx = ny = 1;
67 nx = atoi(tokens[0].c_str()); ny = atoi(tokens[1].c_str());
[2494]68 if (mImgApp) {
69 mImgApp->LockMutex(); // <ZThread> global event loop synchronisation
70 mImgApp->SetZone(nx, ny);
71 mImgApp->UnlockMutex(true); // <ZThread> global event loop synchronisation
72 }
73}
[293]74else if (kw == "newwin") {
[1451]75 int nx=1, ny=1;
[2243]76 int sx=0, sy=0;
[1451]77 //if(tokens.size() < 2) { cout << "Usage: newwin nx ny" << endl; return(0); }
78 if(tokens.size() > 0) nx = atoi(tokens[0].c_str());
79 if(tokens.size() > 1) ny = atoi(tokens[1].c_str());
[2243]80 if(tokens.size() > 3) {
81 sx = atoi(tokens[2].c_str());
82 sy = atoi(tokens[3].c_str());
83 }
[2494]84 if (mImgApp) {
85 mImgApp->LockMutex(); // <ZThread> global event loop synchronisation
86 mImgApp->CreateGraphWin(nx, ny, sx, sy);
87 mImgApp->UnlockMutex(true); // <ZThread> global event loop synchronisation
88 }
[2243]89}
[2494]90else if (kw == "stacknext") {
91 mImgApp->LockMutex(); // <ZThread> global event loop synchronisation
92 mImgApp->StackWinNext();
93 mImgApp->UnlockMutex(true); // <ZThread> global event loop synchronisation
94}
[553]95else if (kw == "graphicatt") {
96 if (tokens.size() < 1) { cout << "Usage: graphicatt attributes_list (att=def->defaut)" << endl; return(0); }
[1971]97 string opts = tokens[0];
98 if (tokens.size() > 1)
[2089]99 for(unsigned int kt=1; kt<tokens.size(); kt++) { opts += ' '; opts += tokens[kt]; }
[1971]100 if (mImgApp) mImgApp->SetDefaultGraphicAttributes(opts);
[293]101 }
[1971]102else if (kw == "setaxesatt") {
103 if (tokens.size() < 1) { cout << "Usage: setaxesatt attributes_list " << endl; return(0); }
104 string opts = tokens[0];
105 if (tokens.size() > 1)
[2089]106 for(unsigned int kt=1; kt<tokens.size(); kt++) { opts += ' '; opts += tokens[kt]; }
[1971]107 if (mImgApp) mImgApp->SetDefaultAxesAttributes(opts);
[331]108 }
[548]109else if (kw == "setinsetlimits") {
110 if (tokens.size() < 4) { cout << "Usage: setinsetlimits xmin xmax ymin ymax" << endl; return(0); }
111 double xmin = atof(tokens[0].c_str());
112 double xmax = atof(tokens[1].c_str());
113 double ymin = atof(tokens[2].c_str());
114 double ymax = atof(tokens[3].c_str());
115 mImgApp->SetInsetLimits(xmin, xmax, ymin, ymax);
116 }
[2243]117else if (kw == "drpanel") {
118 if (tokens.size() < 4) {
119 cout << "Usage: drpanel xmin xmax ymin ymax [gratt] [name]" << endl;
120 return(0);
121 }
122 double xmin = atof(tokens[0].c_str());
123 double xmax = atof(tokens[1].c_str());
124 double ymin = atof(tokens[2].c_str());
125 double ymax = atof(tokens[3].c_str());
126 char buff[128];
[2265]127 sprintf(buff, "axesnone xylimits=%g,%g,%g,%g ", xmin, xmax, ymin, ymax);
[2243]128 string sop = buff;
129 if (tokens.size() > 4) sop += tokens[4];
130 string name;
[2265]131 if (tokens.size() > 5) name = tokens[5];
[2243]132 PIFuncDrawer* gdr = new PIFuncDrawer(NULL);
133 mImgApp->DispScDrawer(gdr, name, sop);
134}
[349]135else if (kw == "addtext") {
[2263]136 if (tokens.size() < 3) {
137 cout << "Usage: addtext x y txt [colfontatt] [fgnc]" << endl;
138 return(0);
139 }
[349]140 double xp = atof(tokens[0].c_str());
141 double yp = atof(tokens[1].c_str());
[1642]142 string txt = tokens[2];
[1971]143 string sop;
144 if (tokens.size() > 3) sop = tokens[3];
[2263]145 bool fgnc = _CkBoolNC_(4);
146 mImgApp->AddText(txt, xp, yp, sop, fgnc);
[349]147 }
[2263]148else if (kw == "addctext") {
149 if (tokens.size() < 5) {
150 cout << "Usage: addctext x y txt s_up s_dn [colfontatt] [updnfatt] [fgnc] " << endl;
151 return(0);
152 }
153 double xp = atof(tokens[0].c_str());
154 double yp = atof(tokens[1].c_str());
155 string sop;
156 if (tokens.size() > 5) sop = tokens[5];
157 string sopfss;
158 if (tokens.size() > 6) sopfss = tokens[6];
159 bool fgnc = _CkBoolNC_(7);
160 mImgApp->AddCompText(tokens[2], tokens[3], tokens[4], xp, yp, sop, sopfss, fgnc);
161 }
[2243]162else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect") ||
163 (kw == "addarrow") ) {
[2263]164 if (tokens.size() < 4) {
165 cout << "Usage: addline/addrect/addfrect x1 y1 x2 y2 [colatt] [fgnc]" << endl;
166 return(0);
167 }
[1642]168 double xp1 = atof(tokens[0].c_str());
169 double yp1 = atof(tokens[1].c_str());
170 double xp2 = atof(tokens[2].c_str());
171 double yp2 = atof(tokens[3].c_str());
[1971]172 string sop;
173 if (tokens.size() > 4) sop = tokens[4];
[2263]174 bool fgnc = _CkBoolNC_(5);
175 if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, false, fgnc);
176 else if (kw == "addarrow") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, true, fgnc);
[1642]177 else {
178 bool fgfill = (kw == "addrect") ? false : true;
[2263]179 mImgApp->AddRectangle(xp1, yp1, xp2, yp2, sop, fgfill, fgnc);
[1642]180 }
[2243]181}
[1642]182else if ((kw == "addcirc") || (kw == "addfcirc")) {
[2263]183 if (tokens.size() < 3) {
184 cout << "Usage: addcirc/addfcirc xc yc r [colatt] [fgnc]" << endl;
185 return(0);
186 }
[1642]187 double xc = atof(tokens[0].c_str());
188 double yc = atof(tokens[1].c_str());
189 double rad = atof(tokens[2].c_str());
[1971]190 string sop;
191 if (tokens.size() > 3) sop = tokens[3];
[2263]192 bool fgnc = _CkBoolNC_(4);
[1642]193 bool fgfill = (kw == "addcirc") ? false : true;
[2263]194 mImgApp->AddCircle(xc, yc, rad, sop, fgfill, fgnc);
[1642]195 }
[2265]196else if ((kw == "addarca") || (kw == "addfarca")) {
197 if (tokens.size() < 5) {
198 cout << "Usage: addarca/addfarca xc yc r a da [colatt] [fgnc]" << endl;
199 return(0);
200 }
201 double xc = atof(tokens[0].c_str());
202 double yc = atof(tokens[1].c_str());
203 double rad = atof(tokens[2].c_str());
204 double ang = atof(tokens[3].c_str());
205 double dang = atof(tokens[4].c_str());
206 string sop;
207 if (tokens.size() > 5) sop = tokens[5];
208 bool fgnc = _CkBoolNC_(6);
209 bool fgfill = (kw == "addarca") ? false : true;
210 mImgApp->AddArc(xc, yc, rad, ang, dang, sop, fgfill, fgnc);
211 }
[2243]212else if (kw == "addmarker") {
213 if (tokens.size() < 2) {
[2263]214 cout << "Usage: addmarker x y [gratt] [fgnc]" << endl;
[2243]215 return(0);
216 }
217 double xm = atof(tokens[0].c_str());
218 double ym = atof(tokens[1].c_str());
219 string sop;
220 if (tokens.size() > 2) sop = tokens[2];
[2263]221 bool fgnc = _CkBoolNC_(3);
222 mImgApp->AddCircle(xm, ym, -1, sop, false, fgnc);
[2243]223}
224else if ((kw == "addarc") || (kw == "addfarc") ) {
225 if (tokens.size() < 6) {
[2263]226 cout << "Usage: addarc/addfarc x1 y1 x2 y2 x3 y3 [gratt] [fgnc]" << endl;
[2243]227 return(0);
228 }
229 double x1 = atof(tokens[0].c_str());
230 double y1 = atof(tokens[1].c_str());
231 double x2 = atof(tokens[2].c_str());
232 double y2 = atof(tokens[3].c_str());
233 double x3 = atof(tokens[4].c_str());
234 double y3 = atof(tokens[5].c_str());
235 string sop;
236 if (tokens.size() > 6) sop = tokens[6];
[2263]237 bool fgnc = _CkBoolNC_(7);
[2243]238 bool fgfill = (kw == "addarc") ? false : true;
[2263]239 mImgApp->AddArc(x1, y1, x2, y2, x3, y3, sop, fgfill, fgnc);
[2243]240}
[2263]241else if ((kw == "addpoly") || (kw == "addfpoly")) {
242 if (tokens.size() < 1) {
243 cout << "Usage: addpoly/addfpoly 'x1,y1 x2,y2 x3,y3 ...' [gratt] [fgnc]" << endl;
244 return(0);
245 }
246 vector<string> sxy;
247 vector<double> xpol, ypol;
248 double xp, yp;
249 FillVStringFrString(tokens[0], sxy);
250 for(int jkk=0; jkk<sxy.size(); jkk++) {
251 xp = yp = 0;
252 if (sscanf(sxy[jkk].c_str(), "%lg,%lg", &xp, &yp) == 2) {
253 xpol.push_back(xp);
254 ypol.push_back(yp);
255 }
256 }
257 string sop;
258 if (tokens.size() > 1) sop = tokens[1];
259 bool fgnc = _CkBoolNC_(2);
260 bool fgfill = (kw == "addpoly") ? false : true;
261 mImgApp->AddPoly(xpol, ypol, sop, fgfill, fgnc);
262 }
[1642]263
264
[2165]265else if ((kw == "settitle") || (kw == "addtitle")) {
266 if (tokens.size() < 1) { cout << "Usage: settitle/addtitle TopTitle [BotTitle] [fontatt]" << endl; return(0); }
[2154]267 if(tokens.size()<2) tokens.push_back("");
[2165]268 string gropt;
269 if(tokens.size()>2) gropt = tokens[2];
270 mImgApp->SetTitle(tokens[0], tokens[1], gropt);
[2154]271}
[2165]272
273else if ((kw == "setaxelabels") || (kw == "addaxelabels")) {
274 if (tokens.size() < 2) { cout << "Usage: setaxelabels/addaxelabels xLabel yLabel [fontatt]" << endl; return(0); }
275 string gropt;
276 if(tokens.size()>2) gropt = tokens[2];
277 mImgApp->SetAxeLabels(tokens[0], tokens[1], gropt);
278}
[349]279
[293]280// >>>>>>>>>>> Link dynamique de fonctions C++
281else if (kw == "link" ) {
282 if (tokens.size() < 2) { cout << "Usage: link fnameso f1 [f2 f3]" << endl; return(0); }
283 string sph = "";
284 for(int gg=0; gg<5; gg++) tokens.push_back(sph);
285 int rc = LinkUserFuncs(tokens[0], tokens[1], tokens[2], tokens[3]);
286 if (rc == 0) cout << "PIABaseExecutor: Link from " << tokens[0] << " OK " << endl;
287}
[1276]288else if (kw == "linkff2" ) {
289 if (tokens.size() < 2) { cout << "Usage: linkff2 fnameso f1 [f2 f3]" << endl; return(0); }
290 string sph = "";
291 for(int gg=0; gg<5; gg++) tokens.push_back(sph);
292 int rc = LinkUserFuncs2(tokens[0], tokens[1], tokens[2], tokens[3]);
293 if (rc == 0) cout << "PIABaseExecutor: Link2 from " << tokens[0] << " OK " << endl;
294}
[293]295else if (kw == "call" ) {
296 if (tokens.size() < 1) { cout << "Usage: call userf [arg1 arg2 ...]" << endl; return(0); }
[1276]297 UsFmap::iterator it;
298 UsFmap::iterator it1 = usfmap.find(tokens[0]);
299 UsFmap::iterator it2 = usfmap2.find(tokens[0]);
300 if ((it1 == usfmap.end()) && (it2 == usfmap2.end()) ) {
[293]301 cerr << "PIABaseExecutor: No User Function " << tokens[0] << endl;
302 return(0);
303 }
[1276]304 if (it1 == usfmap.end()) it = it2;
305 else it = it1;
[293]306 cout << "PIABaseExecutor: Call " << tokens[0] << "( ... )" << endl;
307// on est oblige de faire un cast etant donne qu'on
308// utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
309 DlUserProcFunction fuf = (DlUserProcFunction)(*it).second;
[2494]310/*DEL----- Plus besoin en multi-thread ? / Reza 06/01/2004
[293]311// On redirige la sortie sur le terminal
312 bool red = mImgApp->HasRedirectedStdOutErr();
313 mImgApp->RedirectStdOutErr(false);
[2494]314 --------DEL */
[1276]315#ifdef SANS_EVOLPLANCK
[293]316 TRY {
317 tokens.erase(tokens.begin());
318 fuf(tokens);
319 } CATCH(merr) {
320 fflush(stdout);
[1276]321 string es = PeidaExc(merr);
322 cerr << "\n PIABaseExecutor: Call UserFunc Exception :" << merr << es;
[293]323 cout << endl;
324 }
[1276]325#else
326 try {
327 tokens.erase(tokens.begin());
328 fuf(tokens);
329 }
330 catch ( PThrowable & exc ) {
331 cerr << "\n PIABaseExecutor: Call / Catched Exception :"
332 << (string)typeid(exc).name() << " Msg= "
333 << exc.Msg() << endl;
334 cout << endl;
335 }
336 catch ( ... ) {
337 cerr << "\n PIABaseExecutor: Call / Catched Exception ... "
338 << endl;
339 cout << endl;
340 }
341#endif
[2494]342/*DEL----- Plus besoin en multi-thread ? / Reza 06/01/2004
[293]343 mImgApp->RedirectStdOutErr(red);
[2494]344 --------DEL */
[293]345}
346
347// >>>>>>>>>>> lecture/ecriture des objets, gestion des objets
348else if (kw == "openfits" ) {
349 if (tokens.size() < 1) { cout << "Usage: openfits file " << endl; return(0); }
[331]350 else { string nomobj = ""; mObjMgr->ReadFits(tokens[0], nomobj); }
[293]351}
352else if (kw == "savefits" ) {
353 if (tokens.size() < 2) { cout << "Usage: savefits nameobj filename " << endl; return(0); }
354 else mObjMgr->SaveFits(tokens[0], tokens[1]);
355}
356else if (kw == "openppf" ) {
357 if (tokens.size() < 1) { cout << "Usage: openppf file " << endl; return(0); }
358 mObjMgr->ReadAll(tokens[0]);
359}
[2132]360else if ((kw == "saveobjs") || (kw == "saveppf")) {
[333]361 if (tokens.size() < 2) { cout << "Usage: saveobjs patt filename " << endl; return(0); }
362 mObjMgr->SaveObjects(tokens[0], tokens[1]);
363}
[293]364else if (kw == "saveall" ) {
365 if (tokens.size() < 1) { cout << "Usage: saveall file " << endl; return(0); }
366 mObjMgr->SaveAll(tokens[0]);
367}
368else if (kw == "print" ) {
369 if (tokens.size() < 1) { cout << "Usage: print nameobj " << endl; return(0); }
370 mObjMgr->PrintObj(tokens[0]);
371}
[333]372else if ( (kw == "rename" ) || (kw == "mv") ) {
[2132]373 if (tokens.size() < 2) { cout << "Usage: rename/mv nameobj namenew" << endl; return(0); }
[293]374 mObjMgr->RenameObj(tokens[0], tokens[1]);
375}
[333]376else if ( (kw == "del" ) || (kw == "rm") ) {
[1655]377 if (tokens.size() < 1) { cout << "Usage: del nameobj [nameobj2 ...]" << endl; return(0); }
378 if (tokens.size()>0)
379 for(uint_4 i=0;i<tokens.size();i++) mObjMgr->DelObj(tokens[i]);
[293]380}
381else if (kw == "delobjs" ) {
382 if (tokens.size() < 1) { cout << "Usage: delobjs nomobjpattern (*,?) " << endl; return(0); }
383 mObjMgr->DelObjects(tokens[0]);
384}
[333]385else if ( (kw == "listobjs") || (kw == "ls") ) {
[331]386 if (tokens.size() < 1) tokens.push_back("*");
387 mObjMgr->ListObjs(tokens[0]);
388}
[333]389// Gestion des repertoires
390else if (kw == "mkdir" ) {
[344]391 if (tokens.size() < 1) { cout << "Usage: mkdir dirname [true]" << endl; return(0); }
392 bool crd = mObjMgr->CreateDir(tokens[0]);
393 if ( crd && (tokens.size() > 1) && (tokens[1] == "true") )
394 mObjMgr->SetKeepOldDirAtt(tokens[0], true);
[333]395 }
396else if (kw == "rmdir" ) {
397 if (tokens.size() < 1) { cout << "Usage: rmdir dirname " << endl; return(0); }
398 mObjMgr->DeleteDir(tokens[0]);
399 }
[2132]400else if (kw == "setdiratt" ) {
401 if (tokens.size() < 2) { cout << "Usage: setdiratt dirname true/false" << endl; return(0); }
402 if (tokens[1] == "true") mObjMgr->SetKeepOldDirAtt(tokens[0], true);
403 else mObjMgr->SetKeepOldDirAtt(tokens[0], false);
404}
[333]405else if (kw == "cd") {
406 if (tokens.size() < 1) tokens.push_back("home");
407 mObjMgr->SetCurrentDir(tokens[0]);
408 }
[345]409else if (kw == "pwd") {
410 string dirn;
411 mObjMgr->GetCurrentDir(dirn);
412 cout << "CurrentDirectory: " << dirn << endl;
413 }
[333]414else if (kw == "listdirs") {
415 if (tokens.size() < 1) tokens.push_back("*");
416 mObjMgr->ListDirs(tokens[0]);
417 }
[293]418
419// >>>>>>>>>>> Creation d'histos 1D-2D
420else if (kw == "newh1d") {
421 if (tokens.size() < 4) { cout << "Usage: newh1d name xmin xmax nbin" << endl; return(0); }
[1091]422 int_4 nbx = 100;
423 r_8 xmin = 0., xmax = 1.;
[293]424 nbx = atoi(tokens[3].c_str());
425 xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
426 Histo* h = new Histo(xmin, xmax, nbx);
427 mObjMgr->AddObj(h, tokens[0]);
428 }
429else if (kw == "newh2d") {
430 if (tokens.size() < 7) {
431 cout << "Usage: newh2d name xmin xmax nbinx ymin ymax nbiny" << endl;
432 return(0);
433 }
[1091]434 int_4 nbx = 50, nby = 50;
435 r_8 xmin = 0., xmax = 1.;
436 r_8 ymin = 0., ymax = 1.;
[293]437 nbx = atoi(tokens[3].c_str());
438 nby = atoi(tokens[6].c_str());
439 xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
440 ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());
441 Histo2D* h = new Histo2D(xmin, xmax, nbx, ymin, ymax, nby);
442 mObjMgr->AddObj(h, tokens[0]);
443 }
[1035]444else if (kw == "newprof" || kw == "newprofe") {
[293]445 if (tokens.size() < 4)
[1035]446 { cout << "Usage: newprof[e] name xmin xmax nbin [ymin ymax]" << endl; return(0); }
[1091]447 int_4 nbx = 100;
448 r_8 xmin = 0., xmax = 1., ymin = 1., ymax = -1.;
[293]449 if(tokens.size() > 5)
450 {ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());}
451 nbx = atoi(tokens[3].c_str());
452 xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
453 HProf* h = new HProf(xmin, xmax, nbx, ymin, ymax);
[1035]454 if(kw == "newprofe") h->SetErrOpt(false);
[293]455 mObjMgr->AddObj(h, tokens[0]);
456 }
[447]457
458// Creation de NTuple
459else if (kw == "newnt") {
460 if(tokens.size() < 2)
461 {cout<<"Usage: newnt name v1 v2 ... vn / newnt name nvar"<<endl; return(0);}
462 vector<string> varname;
463 int nvar = 0;
464 const char *c = tokens[1].c_str();
465 if(isdigit(c[0])) {
466 nvar = atoi(tokens[1].c_str());
467 if(nvar<=0 || nvar>=10000)
468 {cout<<"newnt name nvar : nvar must be an positive integer<10000"<<endl;
469 return(0);}
470 for(int i=0;i<nvar;i++) {
471 char str[16]; sprintf(str,"%d",i);
472 string dum = "v"; dum += str;
473 varname.push_back(dum.c_str());
474 }
475 } else if( islower(c[0]) || isupper(c[0]) ) {
[1548]476 for(int i=1;i<(int)tokens.size();i++) {
[447]477 varname.push_back(tokens[i].c_str());
478 nvar++;
479 }
480 } else {
481 cout<<"newnt name v1 v2 ... vn : name vi must begin by a letter"<<endl
482 <<"newnt name nvar : nvar must be an positive integer"<<endl;
483 return(0);
484 }
485 char **noms = new char*[nvar];
486 for(int i=0;i<nvar;i++) noms[i] = (char *)varname[i].c_str();
487 NTuple* nt = new NTuple(nvar,noms);
488 delete [] noms;
489 mObjMgr->AddObj(nt,tokens[0]);
490 }
491
492// Creation de GeneralFitData
[293]493else if (kw == "newgfd") {
494 if (tokens.size() < 3)
495 { cout << "Usage: newgfd nvar nalloc [errx(0/1)]" << endl; return(0); }
496 int nvar, nalloc, errx=0;
497 if (tokens.size() > 3)
498 { errx = atoi(tokens[3].c_str()); if(errx>0) errx=1; else errx = 0;}
499 nvar = atoi(tokens[1].c_str()); nalloc = atoi(tokens[2].c_str());
500 if(nvar>0 && nalloc>0) {
501 GeneralFitData* gfd = new GeneralFitData(nvar,nalloc,errx);
502 mObjMgr->AddObj(gfd, tokens[0]);
503 }
504 }
505
[333]506// Creation/remplissage de vecteur et de matrice
507else if (kw == "newvec") {
508 if (tokens.size() < 2) {
509 cout << "Usage: newvec name size [f(i) dopt] " << endl; return(0);
510 }
511 int n = atoi(tokens[1].c_str());
512 double xmin, xmax;
513 xmin = 0.; xmax = n;
[357]514 if (tokens.size() < 3) {
515 Vector* v = new Vector(n);
516 mObjMgr->AddObj(v, tokens[0]);
517 }
518 else {
519 if (tokens.size() < 4) tokens.push_back("");
520 mObjMgr->GetServiceObj()->PlotFunc(tokens[2], tokens[0], xmin, xmax, n, tokens[3]);
521 }
[333]522 }
523else if (kw == "newmtx") {
524 if (tokens.size() < 3) {
[1917]525 cout << "Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) dopt] " << endl; return(0);
[333]526 }
527 int nx = atoi(tokens[1].c_str());
528 int ny = atoi(tokens[2].c_str());
529 double xmin, xmax, ymin, ymax;
530 xmin = 0.; xmax = nx;
531 ymin = 0.; ymax = ny;
[357]532 if (tokens.size() < 4) {
533 Matrix* mtx = new Matrix(ny,nx);
534 mObjMgr->AddObj(mtx, tokens[0]);
535 }
536 else {
[1971]537 if (tokens.size() < 5) tokens.push_back("next");
[357]538 mObjMgr->GetServiceObj()->PlotFunc2D(tokens[3], tokens[0], xmin, xmax, ymin, ymax,
539 nx, ny, tokens[4]);
540 }
[333]541 }
[2305]542// ----- Vecteur/NTuple <> Lignes/variables interpreteur
543// Creation de vecteur depuis le contenu de la ligne
544else if (kw == "line2vec") {
545 if (tokens.size() < 2) {
546 cout << "Usage: line2vec vecname v0 v1 v2 ... " << endl; return(0);
547 }
548 int vsz = tokens.size()-1;
549 Vector* v = new Vector(vsz);
550 for(int kkv=0; kkv<vsz; kkv++) (*v)(kkv) = atof(tokens[kkv+1].c_str());
551 mObjMgr->AddObj(v, tokens[0]);
552 }
553// Remplissage de NTuple depuis la ligne
554else if (kw == "line2nt") {
555 if (tokens.size() < 2) {
556 cout << "Usage: line2nt ntname col0 col1 ..." << endl; return(0);
557 }
558 AnyDataObj* obj;
559 obj = mObjMgr->GetObj(tokens[0]);
560 if(obj == NULL) {
561 cerr << "line2nt Error , No such object " << tokens[0] << endl;
562 return(0);
563 }
564 NTuple* nt = dynamic_cast<NTuple *>(obj);
565 if(nt == NULL) {
566 cerr << "line2nt Error " << tokens[0] << " not an NTuple ! " << endl;
567 return(0);
568 }
569 if (nt->NbColumns() < 1) {
570 cerr << "line2nt Error: NbColumns < 1" << endl;
571 return(0);
572 }
573 r_4* xnt = new r_4[ nt->NbColumns() ];
574 int kkx;
575 for(kkx=0; kkx<nt->NbColumns(); kkx++) {
576 if (kkx < tokens.size()-1) xnt[kkx] = atof(tokens[kkx+1].c_str());
577 else xnt[kkx] = 0.;
578 }
579 nt->Fill(xnt);
580 delete[] xnt;
581}
582// Contenu du vecteur vers variable interpreteur
583#define MAXNWORDSO2V 32768
584else if (kw == "vec2var") {
585 if (tokens.size() < 2) {
586 cout << "Usage: vec2var vecname varname [loop_param start:end:step] " << endl; return(0);
587 }
588 AnyDataObj* obj;
589 obj = mObjMgr->GetObj(tokens[0]);
590 if(obj == NULL) {
591 cerr << "vec2var Error , No such object " << tokens[0] << endl;
592 return(0);
593 }
594 Vector* v = dynamic_cast<Vector *>(obj);
595 if(v == NULL) {
596 cerr << "vec2var Error " << tokens[0] << " not a Vector ! " << endl;
597 return(0);
598 }
[2419]599 int_8 kks = 0;
600 int_8 kke = v->NElts();
601 int_8 kkp = 1;
[2305]602 if (tokens.size() > 2) Services2NObjMgr::DecodeLoopParameters(tokens[2], kks, kke, kkp);
603 if (kks < 0) kks = 0;
[2419]604 if (kke > (int_8)v->NElts()) kke = v->NElts();
[2305]605 if (kkp < 1) kkp = 1;
606 int nelt = (kke-kks-1)/kkp;
607 if (nelt > MAXNWORDSO2V) {
608 nelt = MAXNWORDSO2V;
609 cout << "vec2var Warning: Only " << nelt
610 << " elements will be converted to string" << endl;
611 kke = kks+nelt*kkp;
612 }
613 string v2str;
614 char buff[64];
615 for(int kkv=kks; kkv<kke; kkv+=kkp) {
616 sprintf(buff, "%lg ", (*v)(kkv));
617 v2str += buff;
618 }
619
620 mObjMgr->SetVar(tokens[1], v2str);
621}
622// Une ligne du NTuple/NTupleInterface -> variable interpreteur
623else if ((kw == "ntline2var") || (kw == "ntcol2var")) {
624 if (tokens.size() < 3) {
625 cout << "Usage: ntline/col2var objname line_number varname" << endl;
626 return(0);
627 }
628 NObjMgrAdapter* oa = mObjMgr->GetObjAdapter(tokens[0]);
629 if(oa == NULL) {
630 cerr << "ntline/col2var Error , No such object " << tokens[0] << endl;
631 return(0);
632 }
633 bool adel = false;
634 NTupleInterface* nti = oa->GetNTupleInterface(adel);
635 if(nti == NULL) {
636 cerr << "ntline/col2var Error: objet" << tokens[0] << " has no NTupleInterface" << endl;
637 return(0);
638 }
[333]639
[2305]640 if (nti->NbColumns() < 1 || nti->NbLines() < 1) {
641 cerr << "ntline/col2var Error: NbColumns or NbLines < 1" << endl;
642 return(0);
643 }
644 string v2str;
645 char buff[64];
646 if (kw == "ntline2var") {
647 int numline = atoi(tokens[1].c_str());
648 if ( (numline >= nti->NbLines()) || (numline < 0) ) {
649 cerr << "ntline2var Error: numline" << tokens[1] << " out of bounds" << endl;
650 return(0);
651 }
652 r_8* dline = nti->GetLineD(numline);
653 for(int kkv=0; kkv<nti->NbColumns(); kkv++) {
654 sprintf(buff, "%lg ", dline[kkv]);
655 v2str += buff;
656 }
657 }
658 else {
659 int numcol = atoi(tokens[1].c_str());
660 if ( (numcol >= nti->NbColumns()) || (numcol < 0) ) {
661 cerr << "ntcol2var Error: numcol" << tokens[1] << " out of bounds" << endl;
662 return(0);
663 }
[2419]664 int_8 kks = 0;
665 int_8 kke = nti->NbLines();
666 int_8 kkp = 1;
[2305]667 if (tokens.size() > 3) Services2NObjMgr::DecodeLoopParameters(tokens[3], kks, kke, kkp);
668 if (kks < 0) kks = 0;
[2419]669 if (kke > (int_8)nti->NbLines()) kke = nti->NbLines();
[2305]670 if (kkp < 1) kkp = 1;
671 int nelt = (kke-kks-1)/kkp;
672 if (nelt > MAXNWORDSO2V) {
673 nelt = MAXNWORDSO2V;
674 cout << "ntcol2var Warning: Only " << nelt
675 << " lines " << " will be converted to string" << endl;
676 kke = kks+nelt*kkp;
677 }
678 r_8* dline;
679 for(int kkl=kks; kkl<kke; kkl+=kkp) {
680 dline = nti->GetLineD(kkl);
681 sprintf(buff, "%lg ", dline[numcol]);
682 v2str += buff;
683 }
684 }
685 mObjMgr->SetVar(tokens[2], v2str);
686 if (adel) delete nti;
687}
688
689// -------------------------------------------------------
[455]690// Copie d'objets
[2176]691else if ( (kw == "copy") || (kw == "cp") ) {
[455]692 if(tokens.size()<2) {
693 cout<<"Usage: copy name_from name_to"<<endl;return(0);
694 }
[463]695 mObjMgr->CopyObj(tokens[0],tokens[1]);
[455]696}
697
698
[293]699// >>>>>>>>>>> Affichage des objets
[295]700else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") ) {
701 if (tokens.size() < 1) { cout << "Usage: disp/surf/imag nameobj [opt]" << endl; return(0); }
[1971]702 string opt = "next";
[293]703 if (tokens.size() > 1) opt = tokens[1];
704 if (kw == "disp") mObjMgr->DisplayObj(tokens[0], opt);
705 else if (kw == "surf") mObjMgr->DisplaySurf3D(tokens[0], opt);
[295]706 else if (kw == "imag") mObjMgr->DisplayImage(tokens[0], opt);
[293]707 }
708
709else if (kw == "nt2d") {
[486]710 if (tokens.size() < 3) {
711 cout << "Usage: nt2d nameobj varx vary [errx erry wt label opt]" << endl;
712 return(0);
[293]713 }
[486]714 while (tokens.size() < 8) tokens.push_back("");
[333]715 string ph = "";
[486]716 mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], ph, tokens[3], tokens[4], ph,
717 tokens[5], tokens[6], tokens[7], false);
[333]718 }
[293]719else if (kw == "nt3d") {
[486]720 if (tokens.size() < 7) {
721 cout << "Usage: nt3d nameobj varx vary varz [errx erry errz wt label opt]" << endl;
722 return(0);
[293]723 }
[486]724 while (tokens.size() < 10) tokens.push_back("");
725 mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], tokens[3], tokens[4], tokens[5],
726 tokens[6], tokens[7], tokens[8], tokens[9], true);
727 }
[1525]728else if (kw == "vecplot") {
729 if (tokens.size() < 2) {
730 cout << "Usage: vecplot nameVecX nameVecY [opt]" << endl;
[2275]731 return(0);
[1525]732 }
733 while (tokens.size() < 3) tokens.push_back("");
734 mObjMgr->DisplayVector(tokens[0], tokens[1], tokens[2]);
735}
[293]736
[339]737// Obsolete : ne pas virer SVP, cmv 26/7/99
[293]738else if (kw == "gfd2d") {
[339]739 cout<<"----- gfd2d OBSOLETE: utilisez nt2d -----"<<endl;
[293]740 if(tokens.size()<2)
741 {cout<<"Usage: gfd2d nomobj numvarx erreur=(x y xy) opt"<<endl;
742 return(0);}
743 string numvary = "";
744 string err = "";
[1971]745 string opt = "next";
[293]746 if(tokens.size()>2) err = tokens[2];
747 if(tokens.size()>3) opt = tokens[3];
748 mObjMgr->DisplayGFD(tokens[0],tokens[1],numvary,err,opt);
749 }
750else if (kw == "gfd3d") {
[339]751 cout<<"----- gfd3d OBSOLETE: utilisez nt3d -----"<<endl;
[293]752 if(tokens.size()<3)
753 {cout<<"Usage: gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) opt"<<endl;
754 return(0);}
755 string err = "";
[1971]756 string opt = "next";
[293]757 if(tokens.size()>3) err = tokens[3];
758 if(tokens.size()>4) opt = tokens[4];
759 mObjMgr->DisplayGFD(tokens[0],tokens[1],tokens[2],err,opt);
760 }
761
762// >>>>>>>>>>> Trace de fonctions
763else if ( (kw == "func") ) {
[1938]764 if(tokens.size()<3) {cout<<"Usage: func f(x) xmin xmax [npt opt]"<<endl; return(0);}
765 int np = 100;
766 double xmin=0., xmax=1.;
767 string opt = "", nom = "";
768 xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
769 if (tokens.size() > 3) np = atoi(tokens[3].c_str());
[293]770 if (tokens.size() > 4) opt = tokens[4];
[333]771 mObjMgr->GetServiceObj()->PlotFunc(tokens[0], nom, xmin, xmax, np, opt);
[293]772 }
[326]773else if ( (kw == "funcff") ) {
[1938]774 if (tokens.size()<4) {cout<<"Usage: funcff C-filename f(x)-name xmin xmax [npt opt]"<<endl; return(0);}
775 int np = 100;
776 double xmin=0., xmax=1.;
777 string opt = "", nom = "";
778 xmin = atof(tokens[2].c_str()); xmax = atof(tokens[3].c_str());
779 if(tokens.size()>4) np = atoi(tokens[4].c_str());
780 if(tokens.size()>5) opt = tokens[5];
[333]781 mObjMgr->GetServiceObj()->PlotFuncFrCFile(tokens[0], tokens[1], nom, xmin, xmax, np, opt);
[326]782 }
[293]783else if ( (kw == "func2d") ) {
784 if (tokens.size() < 7) {
[357]785 cout << "Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [opt]" << endl;
[293]786 return(0);
787 }
788 int npx, npy;
[333]789 double xmin, xmax;
790 double ymin, ymax;
[293]791 npx = npy = 50;
792 xmin = 0.; xmax = 1.;
793 ymin = 0.; ymax = 1.;
794 npx = atoi(tokens[3].c_str());
795 npy = atoi(tokens[6].c_str());
796 xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
797 ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());
[357]798 string opt = "";
[293]799 if (tokens.size() > 7) opt = tokens[7];
[333]800 string nom = "";
801 mObjMgr->GetServiceObj()->PlotFunc2D(tokens[0], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
[293]802 }
[326]803else if ( (kw == "func2dff") ) {
804 if (tokens.size() < 8) {
[357]805 cout << "Usage: func2d C-filename F(x,y)-name xmax nptx ymin ymax npty [opt]" << endl;
[326]806 return(0);
807 }
808 int npx, npy;
[333]809 double xmin, xmax;
810 double ymin, ymax;
[326]811 npx = npy = 50;
812 xmin = 0.; xmax = 1.;
813 ymin = 0.; ymax = 1.;
814 npx = atoi(tokens[4].c_str());
815 npy = atoi(tokens[7].c_str());
816 xmin = atof(tokens[2].c_str()); xmax = atof(tokens[3].c_str());
817 ymin = atof(tokens[5].c_str()); ymax = atof(tokens[6].c_str());
[357]818 string opt = "";
[326]819 if (tokens.size() > 8) opt = tokens[8];
[333]820 string nom = "";
821 mObjMgr->GetServiceObj()->PlotFunc2DFrCFile(tokens[0], tokens[1], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
[326]822 }
[293]823
824// >>>>>>>>>>> Trace d'expressions de N_Tuple, StarList, etc ...
825else if (kw == "plot2d" ) {
[357]826 if (tokens.size() < 3) {
827 cout << "Usage: plot2d nameobj expx expy [expcut opt loop_par]" << endl;
[293]828 return(0);
829 }
[357]830 string errx = ""; string erry = "";
831 if (tokens.size() < 4) tokens.push_back("1");
832 while (tokens.size() < 6) tokens.push_back("");
833 srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],errx,erry,tokens[3],tokens[4],tokens[5]);
834 }
835
836else if (kw == "plot2de" ) { // Plot2D avec les erreurs
837 if (tokens.size() < 5) {
838 cout << "Usage: plot2de nameobj expx expy experrx experry [expcut opt loop_par]" << endl;
839 return(0);
[293]840 }
[357]841 if (tokens.size() < 6) tokens.push_back("1");
842 while (tokens.size() < 8) tokens.push_back("");
843 srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4],
844 tokens[5],tokens[6],tokens[7]);
[293]845 }
846
[357]847else if (kw == "plot2dw" ) { // Plot2d avec poids
848 if (tokens.size() < 4) {
849 cout << "Usage: plot2dw nomobj expx expy expwt [expcut opt loop_par]" << endl;
[333]850 return(0);
851 }
[357]852 if (tokens.size() < 5) tokens.push_back("1");
853 while (tokens.size() < 7) tokens.push_back("");
854 srvo->DisplayPoints2DW(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]);
[333]855 }
[357]856else if (kw == "plot3d" ) {
857 if (tokens.size() < 4) {
858 cout << "Usage: plot3d nomobj expx expy expz [expcut opt loop_par]" << endl;
[293]859 return(0);
860 }
[357]861 if (tokens.size() < 5) tokens.push_back("1");
862 while (tokens.size() < 7) tokens.push_back("");
863 srvo->DisplayPoints3D(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]);
[293]864 }
865
866else if (kw == "projh1d" ) {
[357]867 if (tokens.size() < 3) {
868 cout << "Usage: projh1d nomh1 nomobj expx [expwt expcut opt loop_par]" << endl;
[293]869 return(0);
870 }
[357]871 if (tokens.size() < 4) tokens.push_back("1.");
872 if (tokens.size() < 5) tokens.push_back("1");
873 while (tokens.size() < 7) tokens.push_back("");
874 srvo->ProjectH1(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] );
[293]875 }
876
[357]877
878// Projection dans histogrammes
[293]879else if (kw == "projh2d" ) {
[357]880 if (tokens.size() < 4) {
881 cout << "Usage: projh2d nomh2 nomobj expx expy [expwt expcut opt loop_par]" << endl;
[293]882 return(0);
883 }
[357]884 if (tokens.size() < 5) tokens.push_back("1.");
885 if (tokens.size() < 6) tokens.push_back("1");
886 while (tokens.size() < 8) tokens.push_back("");
887 srvo->ProjectH2(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
888 tokens[6], tokens[7] );
[293]889 }
890
891else if (kw == "projprof" ) {
[357]892 if (tokens.size() < 4) {
893 cout << "Usage: projprof nomprof nomobj expx expy [expwt expcut opt loop_par]" << endl;
[293]894 return(0);
895 }
[357]896 if (tokens.size() < 5) tokens.push_back("1.");
897 if (tokens.size() < 6) tokens.push_back("1");
898 while (tokens.size() < 8) tokens.push_back("");
899 srvo->ProjectHProf(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
[1091]900 tokens[6], tokens[7] );
[357]901 }
[293]902
[357]903// Projection dans vector/matrix
904else if (kw == "fillvec" ) {
905 if (tokens.size() < 4) {
906 cout << "Usage: fillvec nomvec nomobj expx expv [expcut opt loop_par]" << endl;
907 return(0);
908 }
909 if (tokens.size() < 5) tokens.push_back("1");
910 while (tokens.size() < 7) tokens.push_back("");
911 srvo->FillVect(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] );
[293]912 }
913
[357]914else if (kw == "fillmtx" ) {
915 if (tokens.size() < 5) {
916 cout << "Usage: fillmtx nommtx nomobj expx expy expv [expcut opt loop_par]" << endl;
917 return(0);
918 }
919 if (tokens.size() < 6) tokens.push_back("1");
920 while (tokens.size() < 8) tokens.push_back("");
921 srvo->FillMatx(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
922 tokens[6], tokens[7] );
923 }
924
925// Remplissage NTuple,Vecteurs, ... , boucle de NTuple
[447]926else if (kw == "ntfrascii" ) {
927 if(tokens.size() < 2) {
928 cout<<"Usage: ntfrascii nt_name file_name [def_init_val]"<<endl;
929 return(0);
930 }
931 double def_val = 0.;
932 if(tokens.size()>=3) def_val = atof(tokens[2].c_str());
933 srvo->NtFromASCIIFile(tokens[0],tokens[1],def_val);
934 }
935
[2263]936#ifndef SANS_EVOLPLANCK
937/* Lecture matrice/vecteur depuis fichier ASCII */
938else if ((kw == "mtxfrascii") || (kw == "vecfrascii") ) {
939 if(tokens.size() < 2) {
[2289]940 cout<<"Usage: mtxfrascii/vecfrascii mtx/vec_name file_name [CommLine Separator]"<<endl;
[2263]941 return(0);
942 }
943 TMatrix<r_8> mtx;
944 TVector<r_8> vec;
945 FILE* fip = fopen(tokens[1].c_str(), "r");
946 if (fip == NULL) {
947 cout << "vec/mtxfrascii: can not open file " << tokens[1] << endl;
948 return(0);
949 }
950 fclose(fip);
951 ifstream is(tokens[1].c_str());
952 sa_size_t nr, nc;
[2289]953 char clm = '#';
954 string sep = " \t";
955 if (tokens.size()>2) clm = tokens[2][0];
956 if (tokens.size()>3) sep = tokens[3];
[2263]957 if (kw == "mtxfrascii") {
[2289]958 mtx.ReadASCII(is, nr, nc, clm, sep.c_str());
[2263]959 mObjMgr->AddObj(mtx, tokens[0]);
960 cout << "mtxfrascii: TMatrix<r_8> " << tokens[0] << " read from file "
961 << tokens[1] << endl;
962 }
963 else {
[2289]964 vec.ReadASCII(is, nr, nc, clm, sep.c_str());
[2263]965 mObjMgr->AddObj(vec, tokens[0]);
966 cout << "vecfrascii: TVector<r_8> " << tokens[0] << " read from file "
967 << tokens[1] << endl;
968 }
969}
[2268]970else if (kw == "arrtoascii") {
971 if(tokens.size() < 2) {
972 cout<<"Usage: arrtoascii array_name file_name "<<endl;
973 return(0);
974 }
975
976 AnyDataObj* obj;
977 obj = mObjMgr->GetObj(tokens[0]);
978 if(obj == NULL) {
979 cerr << "arrtoascii Error , No such object " << tokens[0] << endl;
980 return(0);
981 }
982 BaseArray* ba = dynamic_cast<BaseArray *>(obj);
983 if(ba == NULL) {
984 cerr << "arrtoascii Error " << tokens[0] << " not a BaseArray ! " << endl;
985 return(0);
986 }
987 ofstream os(tokens[1].c_str());
988 ba->WriteASCII(os);
989 cout << "arrtoascii: Array " << tokens[0] << " written to file " << tokens[1] << endl;
990}
991
[2263]992#endif
993
[293]994else if (kw == "fillnt" ) {
[357]995 if (tokens.size() < 5) {
996 cout << "Usage: fillnt nameobj expx expy expz expt [expcut ntname loop_par]" << endl;
[293]997 return(0);
998 }
[357]999 while (tokens.size() < 8) tokens.push_back("");
1000 srvo->FillNT(tokens[0],tokens[1],tokens[2], tokens[3], tokens[4], tokens[5], tokens[6], tokens[7] );
[293]1001 }
1002
[333]1003else if (kw == "ntloop" ) {
1004 if (tokens.size() < 3) {
[357]1005 cout << "Usage: ntloop nameobj fname funcname [ntname loop_par ]" << endl;
[333]1006 return(0);
1007 }
[357]1008 while (tokens.size() < 5) tokens.push_back("");
1009 srvo->FillNTFrCFile(tokens[0],tokens[1], tokens[2], tokens[3], tokens[4]);
[333]1010 }
1011
1012else if (kw == "ntexpcfile" ) {
1013 if (tokens.size() < 3) {
1014 cout << "Usage: ntexpcfile nameobj fname funcname" << endl;
1015 return(0);
1016 }
1017 srvo->PrepareNTExpressionCFile(tokens[0],tokens[1], tokens[2]);
1018 }
1019
[357]1020else if (kw == "exptovec" ) {
1021 if (tokens.size() < 3) {
1022 cout << "Usage: exptovec nomvec nameobj expx [expcut opt loop_par]" << endl;
[293]1023 return(0);
1024 }
[357]1025 while (tokens.size() < 6) tokens.push_back("");
1026 srvo->ExpressionToVector(tokens[1],tokens[2],tokens[3],tokens[0],tokens[4],tokens[5]);
[293]1027 }
1028
1029else if (kw == "fillgd1" ) {
1030 if (tokens.size() < 5) {
[357]1031 cout << "Usage: fillgd1 nomgfd nomobj expx expy experry [expcut loop_par] " << endl;
[293]1032 return(0);
1033 }
[357]1034 if (tokens.size() < 6) tokens.push_back("1");
1035 if (tokens.size() < 7) tokens.push_back("");
[293]1036 string expy = "";
[357]1037 srvo->FillGFD(tokens[1],tokens[2], expy, tokens[3], tokens[4], tokens[5], tokens[0]);
[293]1038 }
1039
1040else if (kw == "fillgd2" ) {
1041 if (tokens.size() < 6) {
[357]1042 cout << "Usage: fillgd2 nomgfd nomobj expx expy expz experrz [expcut loop_par]" << endl;
[293]1043 return(0);
1044 }
[357]1045 if (tokens.size() < 7) tokens.push_back("1");
1046 if (tokens.size() < 8) tokens.push_back("");
1047 srvo->FillGFD(tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6], tokens[0], tokens[7]);
[293]1048 }
1049
[1067]1050else if (kw == "gdfrvec" ) {
1051 if(tokens.size()<3) {
1052 cout<<"Usage: gdfrvec namegfd X Y\n"
1053 <<" gdfrvec namegfd X Y"
1054 <<" gdfrvec namegfd X Y ! EY\n"
1055 <<" gdfrvec namegfd X Y Z\n"
1056 <<" gdfrvec namegfd X Y Z EZ"<<endl;
1057 return(0);
1058 }
1059 while(tokens.size()<5) tokens.push_back("!");
1060 srvo->FillGFDfrVec(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4]);
1061 }
[293]1062
[2180]1063// >>>>>>>>>>> Calcul d'expression arithmetique
1064else if ( (kw == "eval") ) {
1065 if(tokens.size()<2)
1066 {cout<<"Usage: eval resultvarname arithmetic expression...."<<endl; return(0);}
1067 string expval = "";
1068 for(unsigned int i=1;i<tokens.size();i++) expval+=tokens[i];
1069 string resultvarname = "";
1070 if(isalpha(tokens[0][0])) resultvarname=tokens[0];
1071 mObjMgr->GetServiceObj()->ExpVal(expval,resultvarname);
1072 }
[293]1073
1074else {
1075 cerr << "PIABaseExecutor::Do() Erreur - Commande " << kw << " inconuue ! " << endl;
1076 return(-1);
1077 }
1078
1079return(0);
1080}
1081
[388]1082// Fonction pour enregistrer le Help des Widgets et Windows de piapp
1083static void RegisterPIGraphicsHelp(PIACmd* piac);
1084
[293]1085/* --Methode-- */
1086void PIABaseExecutor::RegisterCommands()
1087{
[2419]1088string kw, usage, grp;
[2465]1089grp = "External Modules";
1090string gdesc = "Dynamic load (shared object modules) management command group";
1091mpiac->AddHelpGroup(grp, gdesc);
[293]1092kw = "loadmodule";
1093usage = "To load and initialize modules \n Usage: loadmodule fnameso modulename";
1094usage += "\n Related commands: link";
[2465]1095mpiac->RegisterCommand(kw, usage, this, grp);
[293]1096kw = "link";
1097usage = "Dynamic linking of compiled user functions \n Usage: link fnameso f1 [f2 f3]";
1098usage += "\n fnameso: Shared-object file name, f1,f2,f3 : User function names ";
[1276]1099usage += "\n Related commands: call loadmodule linkff2";
[2465]1100mpiac->RegisterCommand(kw, usage, this, grp);
[1276]1101kw = "linkff2";
1102usage = "Dynamic linking of compiled user functions (Set 2)\n Usage: linkff2 fnameso f1 [f2 f3]";
1103usage += "\n fnameso: Shared-object file name, f1,f2,f3 : User function names ";
1104usage += "\n Related commands: call link loadmodule";
[2465]1105mpiac->RegisterCommand(kw, usage, this, grp);
[293]1106kw = "call";
1107usage = "Dynamically linked user function call \n Usage: call userf [arg1 arg2 ...]";
1108usage += "\n User function : f(vector<string>& args)";
1109usage += "\n Related commands: link";
[2465]1110mpiac->RegisterCommand(kw, usage, this, grp);
[293]1111
[2465]1112grp = "Graphics";
1113gdesc = "Basic graphics and object display commands";
1114mpiac->AddHelpGroup(grp, gdesc);
[293]1115kw = "zone";
[384]1116usage = "To Divide the Graphic window \n Usage: zone [nx=1 ny=1]";
[388]1117usage += "\n Related commands: newwin";
[2465]1118mpiac->RegisterCommand(kw, usage, this, grp);
[293]1119kw = "newwin";
[2243]1120usage = "To Create a New Graphic window, with zones \n";
1121usage += " Window size can be specified \n";
1122usage += " Usage: newwin [nx ny [sizeX sizeY]] ";
[388]1123usage += "\n Related commands: zone";
[2465]1124mpiac->RegisterCommand(kw, usage, this, grp);
[293]1125kw = "stacknext";
1126usage = "Displays the next widget on stack window \n Usage: stacknext";
[2465]1127mpiac->RegisterCommand(kw, usage, this, grp);
[293]1128
[553]1129kw = "graphicatt";
1130usage = "To change default graphic options \n Usage: graphicatt att_list \n";
[1971]1131usage += "att_list=def back to default values, Example: gratt 'red circlemarker5'";
[293]1132usage += "\n ------------------ Graphic attribute list ------------------ \n";
[1642]1133usage += ">> Colors: defcol black white grey red blue green yellow \n";
1134usage += " magenta cyan turquoise navyblue orange siennared purple \n";
1135usage += " limegreen gold violet violetred blueviolet darkviolet \n";
[293]1136usage += ">> Lines: defline normalline thinline thickline dashedline thindashedline \n";
1137usage += " thickdashedline dottedline thindottedline thickdottedline \n";
[1569]1138usage += ">> Font Att: deffontatt normalfont boldfont italicfont bolditalicfont \n";
1139usage += " smallfont smallboldfont smallitalicfont smallbolditalicfont \n";
1140usage += " bigfont bigboldfont bigitalicfont bigbolditalicfont \n";
1141usage += " hugefont hugeboldfont hugeitalicfont hugebolditalicfont \n";
1142usage += ">> Font Names: deffont courierfont helveticafont timesfont symbolfont \n";
[2263]1143usage += ">> Marker: dotmarker<T> plusmarker<T> crossmarker<T> circlemarker<T> \n";
[293]1144usage += " fcirclemarker<T> boxmarker<T> fboxmarker<T> trianglemarker<T> \n";
1145usage += " ftrianglemarker<T> starmarker<T> fstarmarker<T> \n";
[2263]1146usage += " with <T> = 1 3 5 7 .. 15 , Example fboxmarker5 , plusmarker9 ... \n";
1147usage += ">> ArrowMarker: basicarrow<T> trianglearrow<T> ftrianglearrow<T> \n";
1148usage += " arrowshapedarrow<T> farrowshapedarrow<T> \n";
1149usage += " with <T> = 5 7 .. 15 , Example trianglearrow7 ... \n";
[1126]1150usage += ">> ColorTables: defcmap grey32 invgrey32 colrj32 colbr32 \n";
1151usage += " grey128 invgrey128 colrj128 colbr128 \n";
[2380]1152usage += " red32cm green32cm blue32cm yellow32cm \n";
1153usage += " orange32cm cyan32cm violet32cm \n";
[1126]1154usage += " midas_pastel midas_heat midas_rainbow3 midas_bluered\n";
1155usage += " midas_bluewhite midas_redwhite \n";
[2380]1156usage += " multicol16 multicol64 \n";
[1504]1157usage += " revcmap : This flag reverses ColorMap indexing \n";
[2358]1158usage += "--- For image displays: \n";
[2118]1159usage += ">> ZoomFactors zoomxN zoomx1 zoomx2 zoomx3 ... \n";
[2358]1160usage += " zoom/N zoom/2 zoom/3 zoom/4 ...\n";
[1971]1161usage += ">> imagecenter=ix,iy -> Position the image in widget \n";
[2121]1162usage += ">> lut=ltyp,min,max -> Sets LUT type and min/max for image display \n";
[2118]1163usage += " (ltyp=lin/log/sqrt/square) \n";
[2358]1164usage += ">> image axes configuration: invx invy exchxy \n";
[2350]1165usage += ">> Axes / Axe labels / LogScale / xylimits / defdrrect \n";
1166usage += " See setaxesatt command \n";
[546]1167usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n";
[1131]1168usage += ">> title/notitle or tit/notit -> Toggle Auto AddTitle flag \n";
[548]1169usage += ">> DisplayWindow: next same win stack inset \n";
[1971]1170usage += " Related commands: setaxesatt setinsetlimits ";
[2465]1171mpiac->RegisterCommand(kw, usage, this, grp);
[293]1172
[1971]1173kw = "setaxesatt";
1174usage = "To set default axes attributes \n Usage: setaxesatt att_list \n";
[2217]1175usage += "Color/Line/Font attributes and axes attributes \n";
[2350]1176usage += ">> Axes: axesnone stdaxes=defaxes=boxaxes boxaxesgrid \n";
1177usage += " fineaxes fineaxesgrid centeredaxes finecenteredaxes \n";
[2118]1178usage += " centeredaxesgrid finecenteredaxesgrid \n";
[2350]1179usage += " grid nogrid labels nolabels \n";
1180usage += " ticks noticks minorticks nominorticks \n";
1181usage += " extticks intticks extintticks \n";
1182usage += " nbticks=X_NTicks,Y_NTicks \n";
1183usage += " tickslen=MajTickLenFrac,MinTickLenFrac \n";
1184usage += ">> Axe labels font size: fixedfontsize/autofontsize=fszf \n";
1185usage += " autofontsize=fsizef: Font size computed automatically \n";
[2121]1186usage += " fixedfontsize: Use font size attribute (BaseDrawer) \n";
[1971]1187usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n";
1188usage += ">> xylimits=xmin,xmax,ymin,ymax -> Forces X-Y limits in 2-D plots \n";
[2296]1189usage += ">> defdrrect=xmin,xmax,ymin,ymax -> Defines drawing rectangle 2-D plots \n";
1190usage += " The rectangle is defined as a fraction of the widget size\n";
[2465]1191mpiac->RegisterCommand(kw, usage, this, grp);
[331]1192
[548]1193kw = "setinsetlimits";
1194usage = "Define the display rectangle for drawers added as insets \n";
1195usage += " over existing graphic objects - limits expressed as fraction \n";
1196usage += " graphic object size (0. .. 1.) Xmax at right, YMax top. ";
1197usage += " Usage: setinsetlimits xmin xmax ymin ymax";
[558]1198usage += "\n Related commands: graphicatt /inset";
[2465]1199mpiac->RegisterCommand(kw, usage, this, grp);
[548]1200
[2243]1201kw = "drpanel";
1202usage = "Creates a new 2D drawing zone for addtext, addline \n";
1203usage += " Usage: drpanel xmin xmax ymin ymax [GrAtt] [Name]";
1204usage += "\n Related commands: addtext addline addrect addcirc ...";
[2465]1205mpiac->RegisterCommand(kw, usage, this, grp);
[2243]1206
[349]1207kw = "addtext";
1208usage = "Adds a text string to the current graphic object";
[2243]1209usage += "\n at the specified position (+ color/font/pos/dir attributes) ";
[1642]1210usage += "\n The Base/AxesDrawer is used to handle added text strings" ;
[2265]1211usage += "\n Alt<E> to remove the added element";
[2263]1212usage += "\n Usage: addtext x y TextString [ColFontPosAtt] [fgnc=false/true]";
[1642]1213usage += "\n (use quotes '' for multi word text strings) ";
[2263]1214usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
[2243]1215usage += "\n Text position/direction attribute: ";
1216usage += "\n horizleft horizcenter horizright";
1217usage += "\n vertbottom vertcenter verttop ";
1218usage += "\n textdirhoriz textdirvertup textdirvertdown ";
[2263]1219usage += "\n Related commands: addctext addline addarrow addrect addfrect";
1220usage += "\n addcirc addfcirc addarc addfrac addpoly addfpoly settitle graphicatt";
[2265]1221mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[349]1222
[2263]1223kw = "addctext";
1224usage = "Adds a composite text string with superscript and subscripts ";
1225usage += "\n at the specified position (+ color/font/pos/dir attributes) ";
1226usage += "\n Usage: addctext x y Text sUp sDown [ColFontPosAtt] [UpDownFontAtt] [fgnc]";
1227usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
1228usage += "\n Related commands: addtext addline addrect ...";
1229usage += "\n (See command addtext and graphicatt for more details)";
[2265]1230mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[2263]1231
[1642]1232kw = "addline";
1233usage = "Adds a line to the current graphic object";
[2243]1234usage += "\n at the specified position (+ graphic attribute)";
[1642]1235usage += "\n The Base/AxesDrawer is used to handle added lines";
[2265]1236usage += "\n Alt<E> to remove the added element";
[2263]1237usage += "\n Usage: addline x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
1238usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
[2243]1239usage += "\n Related commands: addarrow addtext addrect addfrect ";
[2263]1240usage += "\n addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
[2265]1241mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[1642]1242
[2243]1243kw = "addarrow";
1244usage = "Adds an arrow to the current graphic object";
1245usage += "\n at the specified position (+ graphic attribute)";
1246usage += "\n The Base/AxesDrawer is used to handle added lines";
[2265]1247usage += "\n Alt<E> to remove the added element";
[2263]1248usage += "\n Usage: addarrow x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
1249usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
[2243]1250usage += "\n Related commands: addline addtext addrect addfrect ";
[2263]1251usage += "\n addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
[2265]1252mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[2263]1253kw = "addarrow_nc";
[2243]1254
[1642]1255kw = "addrect";
1256usage = "Adds a rectangle to the current graphic object";
[2243]1257usage += "\n between the specified positions (+ graphic attribute)";
[1642]1258usage += "\n The Base/AxesDrawer is used to handle added rectangle";
[2265]1259usage += "\n Alt<E> to remove added element";
[2263]1260usage += "\n Usage: addrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
1261usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
[2243]1262usage += "\n Related commands: addtext addline addarrow addfrect";
[2263]1263usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
[2265]1264mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[1642]1265
1266kw = "addfrect";
1267usage = "Adds a filled rectangle to the current graphic object";
[2243]1268usage += "\n between the specified positions (+ graphic attribute)";
[1642]1269usage += "\n The Base/AxesDrawer is used to handle added rectangle";
[2265]1270usage += "\n Alt<E> to remove added element";
[2263]1271usage += "\n Usage: addfrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
1272usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
[2243]1273usage += "\n Related commands: addtext addline addarrow addrect";
[2263]1274usage += "\n addcirc addfcirc addpoly addfpoly graphicatt";
[2265]1275mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[1642]1276
[2243]1277kw = "addmarker";
1278usage = "Adds a marker to the current graphic object";
1279usage += "\n at the specified position (+ graphic attribute)";
1280usage += "\n The Base/AxesDrawer is used to handle added circles";
[2265]1281usage += "\n Alt<E> to remove added element";
[2263]1282usage += "\n Usage: addmarker xpos ypos [GraphicAtt] [fgnc=false/true]";
1283usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
[2243]1284usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
[2263]1285usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
[2265]1286mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[2243]1287
[1642]1288kw = "addcirc";
1289usage = "Adds a circle to the current graphic object";
[2243]1290usage += "\n with the specified center and radius (+ graphic attribute)";
[1642]1291usage += "\n The Base/AxesDrawer is used to handle added circles";
[2265]1292usage += "\n Alt<E> to remove added element";
[2263]1293usage += "\n Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]";
1294usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
[2243]1295usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
[2263]1296usage += "\n addfcirc addarc addfarc addpoly addfpoly graphicatt";
[2265]1297mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[1642]1298
1299kw = "addfcirc";
1300usage = "Adds a filled circle to the current graphic object";
[2243]1301usage += "\n with the specified center and radius (+ graphic attribute)";
[1642]1302usage += "\n The Base/AxesDrawer is used to handle added circles";
[2265]1303usage += "\n Alt<E> to remove added element";
[2263]1304usage += "\n Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]";
1305usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
[2243]1306usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
[2263]1307usage += "\n addcirc addarc addfarc addpoly addfpoly graphicatt";
[2265]1308mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[1642]1309
[2265]1310kw = "addarca";
1311usage = "Adds an arc to the current graphic object";
1312usage += "\n defined by the circle (center+radius), start angle and angular extension";
1313usage += "\n Angles are specified in degrees";
1314usage += "\n Usage: addarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]";
1315usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
1316usage += "\n Related commands: addtext addline addfarca addarc ...";
1317mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
1318
1319kw = "addfarca";
1320usage = "Adds a filled arc to the current graphic object";
1321usage += "\n defined by the circle (center+radius), start angle and angular extension";
1322usage += "\n Angles are specified in degrees";
1323usage += "\n Usage: addfarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]";
1324usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
1325usage += "\n Related commands: addtext addline addarca addarc ...";
1326mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
1327
[2243]1328kw = "addarc";
1329usage = "Adds an arc to the current graphic object";
1330usage += "\n defined by 3 points (+ graphic attribute)";
1331usage += "\n The Base/AxesDrawer is used to handle added arcs";
[2265]1332usage += "\n Alt<E> to remove the added element";
[2263]1333usage += "\n Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
1334usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
[2243]1335usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
[2265]1336usage += "\n addcirc addfcirc addfarc addarca addpoly addfpoly graphicatt";
1337mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[2243]1338
1339kw = "addfarc";
1340usage = "Adds a filled arc to the current graphic object";
1341usage += "\n defined by 3 points (+ graphic attribute)";
1342usage += "\n The Base/AxesDrawer is used to handle added arcs";
[2265]1343usage += "\n Alt<E> to remove added element";
[2263]1344usage += "\n Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
1345usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
[2243]1346usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
[2263]1347usage += "\n addcirc addfcirc addfarc addpoly addfpoly graphicatt";
[2265]1348mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[2243]1349
[2263]1350kw = "addpoly";
1351usage = "Adds a polyline/polygon to the current graphic object";
1352usage += "\n Usage: addploy 'x1,y1 x2,y2 x3,y3 ...' [GraphicAtt] [fgnc=false/true]";
1353usage += "\n Coordinates specified as pairs x,y in a single word (use simple or double quotes";
1354usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
1355usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
1356usage += "\n addcirc addfcirc addfarc graphicatt";
[2265]1357mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[2263]1358
1359kw = "addfpoly";
1360usage = "Adds a filled polygon to the current graphic object";
1361usage += "\n Usage: addploy 'x1,y1 x2,y2 x3,y3 ...' [GraphicAtt] [fgnc=false/true]";
1362usage += "\n Coordinates specified as pairs x,y in a single word (use simple or double quotes";
1363usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
1364usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
1365usage += "\n addcirc addfcirc addfarc graphicatt";
[2265]1366mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
[2263]1367
[1131]1368kw = "settitle";
[1642]1369usage = "Set the title string (top title / bottom title) for the current graphic object";
1370usage += "\n Usage: settitle TopTitle [BottomTitle] [fontAtt]";
[1131]1371usage += "\n Related commands: addtext graphicatt";
[2465]1372mpiac->RegisterCommand(kw, usage, this, grp);
[1131]1373
[2165]1374kw = "addtitle";
1375usage = "Set the title string (top title / bottom title) \n";
1376usage += " alias for settitle ";
[2465]1377mpiac->RegisterCommand(kw, usage, this, grp);
[2165]1378
1379kw = "setaxelabels";
1380usage = "Set the X and Y axis labels for the current 2D graphic object \n";
1381usage += "\n Usage: setaxelabels xLabel yLabel [ColorFntAtt]";
1382usage += "\n Related commands: settitle addtext graphicatt";
[2465]1383mpiac->RegisterCommand(kw, usage, this, grp);
[2165]1384
1385kw = "addaxelabels";
1386usage = "Set the X and Y axis labels for the current 2D graphic object";
1387usage += " alias for setaxelabels ";
[2465]1388mpiac->RegisterCommand(kw, usage, this, grp);
[2165]1389
[388]1390RegisterPIGraphicsHelp(mpiac);
1391
[293]1392kw = "openfits";
[2263]1393usage = "Loads a FITS file into an appropriate object \n Usage: openfits filename";
[293]1394usage += "\n Related commands: savefits openppf";
[330]1395mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]1396kw = "savefits";
1397usage = "Save an object into a FITS file \n Usage: savefits nameobj filename";
[2132]1398usage += "\n Related commands: openfits saveobjs saveall";
[330]1399mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]1400kw = "openppf";
1401usage = "Reads all objects from a PPF file \n Usage: openppf filename";
1402usage += "\n Related commands: saveall openfits";
[330]1403mpiac->RegisterCommand(kw, usage, this, "FileIO");
[2132]1404kw = "saveppf";
1405usage = "Saves objects with names matching a pattern into a\n";
1406usage += " PPF file (pattern: x?y*) - Alias saveppf\n";
1407usage += "Usage: saveppf nameobjpattern filename";
1408usage += "\n Related commands: saveobjs saveall openppf savefits";
1409mpiac->RegisterCommand(kw, usage, this, "FileIO");
[333]1410kw = "saveobjs";
[2132]1411usage = "Saves objects with names matching a pattern into a\n";
1412usage += " PPF file (pattern: x?y*) - Alias saveppf\n";
[1068]1413usage += "Usage: saveobjs nameobjpattern filename";
[2132]1414usage += "\n Related commands: saveppf saveall openppf savefits";
[333]1415mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]1416kw = "saveall";
1417usage = "Saves all objects into a PPF file \n Usage: saveall filename";
[333]1418usage += "\n Related commands: saveobj openppf savefits";
[330]1419mpiac->RegisterCommand(kw, usage, this, "FileIO");
[449]1420kw = "ntfrascii";
1421usage = "Fills an existing NTuple from ASCII table file";
1422usage += "\n Usage: ntfrascii nt_name file_name [def_init_val]";
1423usage += "\n Related commands: ntloop fillnt ";
1424mpiac->RegisterCommand(kw, usage, this, "FileIO");
[2263]1425#ifndef SANS_EVOLPLANCK
1426kw = "mtxfrascii";
1427usage = "Reads a matrix from an ASCII file (TMatrix<r_8>)";
[2289]1428usage += "\n Usage: mtxfrascii mtx_name file_name [CommChar Separator]";
[2268]1429usage += "\n Related commands: arrtoascii vecfrascii ntfrascii ";
[2263]1430mpiac->RegisterCommand(kw, usage, this, "FileIO");
1431kw = "vecfrascii";
[2268]1432usage = "Reads a vector from an ASCII file (TVector<r_8>)";
[2263]1433usage += "\n Usage: vecfrascii vec_name file_name";
[2289]1434usage += "\n Related commands: arrtoascii mtxfrascii ntfrascii [CommChar Separator]";
[2263]1435mpiac->RegisterCommand(kw, usage, this, "FileIO");
[2268]1436kw = "arrtoascii";
1437usage = "Writes an array (TArray<T>) to an ASCII file ";
1438usage += "\n Usage: arrtoascii array_name file_name";
1439usage += "\n Related commands: mtxfrascii vecfrascii ntfrascii ";
1440mpiac->RegisterCommand(kw, usage, this, "FileIO");
[2263]1441#endif
[293]1442
1443kw = "print";
1444usage = "Prints an object \n Usage: print nameobj";
[330]1445mpiac->RegisterCommand(kw, usage, this, "FileIO");
[293]1446
[333]1447kw = "mkdir";
1448usage = "Create a directory";
[344]1449usage += "\n Usage: mkdir dirname [true]";
1450usage += "\n if second argument==true, the directory's KeepOld attribute is set to true";
[463]1451mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]1452kw = "rmdir";
1453usage = "Removes an empty directory";
1454usage += "\n Usage: remove dirname";
[463]1455mpiac->RegisterCommand(kw, usage, this, "Object Management");
[2132]1456kw = "setdiratt";
1457usage = "Sets directory attributes";
1458usage += "\n Usage: setdiratt dirname KeepOldFlag(=true/false)";
1459usage += "\n KeepOldFlag=true Object with the same name is moved to old";
1460usage += "\n when adding objects";
1461mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]1462kw = "cd";
1463usage = "Change current directory";
1464usage += "\n Usage: cd [dirname]";
[463]1465mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]1466kw = "pwd";
1467usage = "Prints current directory";
1468usage += "\n Usage: pwd";
[463]1469mpiac->RegisterCommand(kw, usage, this, "Object Management");
[333]1470kw = "listdirs";
1471usage = "Prints the list of directories";
1472usage += "\n Usage: listdirs [patt=*] \n patt : * , ? ";
[463]1473mpiac->RegisterCommand(kw, usage, this, "Object Management");
[295]1474kw = "listobjs";
[333]1475usage = "Prints the list of objects (Alias: ls)";
1476 usage += "\n Usage: listobjs [patt=*] \n patt : /*/x?y* ... ";
[463]1477mpiac->RegisterCommand(kw, usage, this, "Object Management");
[293]1478kw = "rename";
[333]1479usage = "Rename an object (Alias: mv) \n Usage: rename nameobj namenew";
[2132]1480usage += "\n Related commands: mv del delobjs";
[463]1481mpiac->RegisterCommand(kw, usage, this, "Object Management");
[2132]1482kw = "mv";
1483usage = "Rename an object (Alias: rename) \n Usage: mv nameobj namenew";
1484usage += "\n Related commands: rename del delobjs";
1485mpiac->RegisterCommand(kw, usage, this, "Object Management");
[463]1486kw = "copy";
[2132]1487usage = "Copy objects (Alias cp) \n";
[463]1488usage +=" Usage: copy name_from name_to";
[2132]1489usage += "\n Related commands: cp new...";
[2176]1490mpiac->RegisterCommand(kw, usage, this, "Object Management");
[2132]1491kw = "cp";
1492usage = "Copy objects (Alias copy) \n";
1493usage +=" Usage: cp name_from name_to";
1494usage += "\n Related commands: copy new...";
[463]1495mpiac->RegisterCommand(kw, usage, this, "Object Management");
[293]1496kw = "del";
[1655]1497usage = "Deletes an object (Alias: rm) \n Usage: del nameobj [nameobj2 ...]";
[2132]1498usage += "\n Related commands: rm delobjs rename";
[463]1499mpiac->RegisterCommand(kw, usage, this, "Object Management");
[2132]1500kw = "rm";
1501usage = "Deletes an object (Alias: del) \n Usage: rm nameobj [nameobj2 ...]";
1502usage += "\n Related commands: del delobjs rename";
1503mpiac->RegisterCommand(kw, usage, this, "Object Management");
[293]1504kw = "delobjs";
1505usage = "Delete a set of objects with names matching a pattern (x?y*)";
1506usage += "\n Usage: delobjs nameobjpattern \n";
1507usage += "\n Related commands: del rename";
[463]1508mpiac->RegisterCommand(kw, usage, this, "Object Management");
[293]1509
1510kw = "newh1d";
1511usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin";
[1035]1512usage += "\n Related commands: newh2d newprof[e] newnt newgfd ";
[333]1513mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]1514kw = "newh2d";
1515usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny";
[1035]1516usage += "\n Related commands: newh1d newprof[e] newnt newgfd ";
[333]1517mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]1518kw = "newprof";
1519usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]";
[1035]1520usage += "\n Errors represent the data spread in the X bin ";
1521usage += "\n Related commands: newh1d newh2d newprofe newnt newgfd ";
[333]1522mpiac->RegisterCommand(kw, usage, this, "Objects");
[1035]1523kw = "newprofe";
1524usage = "Creates a profile histogramm \n Usage: newprofe name xmin xmax nbin [ymin ymax]";
1525usage += "\n Errors represent the error on the data mean in the X bin ";
1526usage += "\n Related commands: newh1d newh2d newprof newnt newgfd ";
1527mpiac->RegisterCommand(kw, usage, this, "Objects");
[447]1528kw = "newnt";
1529usage = "Creates a ntuple \n Usage: newnt name v1 v2 v3 .. vn";
1530usage += "\n newnt name nvar";
[1035]1531usage += "\n Related commands: newh1d newh2d newprof[e] newgfd ";
[447]1532mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]1533kw = "newgfd";
1534usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]";
[1035]1535usage += "\n Related commands: newh1d newh2d newprof[e] newnt ";
[333]1536mpiac->RegisterCommand(kw, usage, this, "Objects");
1537kw = "newvec";
[357]1538usage = "Creates (and optionaly fills) a vector \n Usage: newvec name size [f(i) [dopt] ] ";
[2305]1539usage += "\n Related commands: newmtx line2vec";
[357]1540mpiac->RegisterCommand(kw, usage, this, "Objects");
[333]1541kw = "newmtx";
[357]1542usage = "Creates (and optionaly fills) a matrix \n";
[1917]1543usage +=" Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) [dopt] ] ";
[333]1544usage += "\n Related commands: newvec";
[357]1545mpiac->RegisterCommand(kw, usage, this, "Objects");
[2305]1546kw = "line2vec";
1547usage = "Creates a vector from the line \n";
1548usage += " Usage: line2vec vecname v0 v1 v2 ... \n";
1549usage += " Related commands: newvec line2nt";
1550mpiac->RegisterCommand(kw, usage, this, "Objects");
1551kw = "line2nt";
1552usage = "Fills (append) an NTuple from the line content \n";
1553usage += " Usage: line2nt ntname col0 col1 ... \n";
1554usage += " Related commands: newnt line2vec ntline2var ntcol2var";
1555mpiac->RegisterCommand(kw, usage, this, "Objects");
1556kw = "vec2var";
1557usage = "Vector content to an interpreter variable varname = 'v0 v1 v2 ...' \n";
1558usage += " Usage: line2vec vecname varname [LoopParam start:end[:step] ]\n";
1559usage += " Related commands: line2vec ntline2var";
1560mpiac->RegisterCommand(kw, usage, this, "Objects");
1561kw = "ntline2var";
1562usage = "Object NTupleInterface line to an interpreter variable \n";
1563usage += " Usage: ntline2var objname line_number varname \n";
1564usage += " Related commands: vec2var ntcol2var";
1565mpiac->RegisterCommand(kw, usage, this, "Objects");
1566kw = "ntcol2var";
1567usage = "Object NTupleInterface column to an interpreter variable \n";
1568usage += " Usage: ntline2var objname column_number varname [LoopParam start:end[:step] ] \n";
1569usage += " Related commands: vec2var ntline2var";
1570mpiac->RegisterCommand(kw, usage, this, "Objects");
[293]1571
1572kw = "disp";
1573usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]";
[1525]1574usage += "\n Related commands: surf nt2d nt3d vecplot";
[330]1575mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[295]1576kw = "imag";
1577usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]";
[1525]1578usage += "\n Related commands: disp surf nt2d nt3d vecplot";
[330]1579mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1580kw = "surf";
1581usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]";
[1525]1582usage += "\n Related commands: disp nt2d nt3d vecplot";
[330]1583mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1584kw = "nt2d";
[486]1585usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple ";
1586usage += "\n Usage : nt2d nameobj varx vary [errx erry wt label graphic_attributes]";
[1525]1587usage += "\n Related commands: disp surf nt3d gfd2d vecplot";
[330]1588mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1589kw = "nt3d";
[486]1590usage = "Displays 3D-Points (X-Y-Z) [with error-bars / Weight / Label ] from an NTuple ";
1591usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz wt label graphic_attributes]";
1592usage += "\n Related commands: disp surf nt2d gfd3d ";
[330]1593mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[1525]1594kw = "vecplot";
1595usage = "Displays Points (X-Y) with coordinates defined by two vectors ";
1596usage += "\n Usage : vecplot nameVecX nameVecY [graphic_attributes]";
1597usage += "\n Related commands: disp nt2d ";
1598mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[339]1599
1600// Ceci est maintenant obsolete, on garde pour info.
[293]1601kw = "gfd2d";
1602usage = "Displays Points (X-Y) with error-bars from a GeneralFit Data ";
1603usage += "\n Usage : gfd2d nameobj numvarx erreur=(x y xy) [graphic_attributes]";
[339]1604usage += "\n Related commands: gfd3d nt2d nt3d ";
1605usage += "\n ----- OBSOLETE: utilisez nt2d -----";
[330]1606mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1607kw = "gfd3d";
1608usage = "Displays 3D-Points (X-Y-Z) with error-bars from a GeneralFit Data ";
1609usage += "\n Usage : gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) [graphic_attributes]";
1610usage += "\n Related commands: gfd2d nt2d nt3d ";
[339]1611usage += "\n ----- OBSOLETE: utilisez nt3d -----";
[330]1612mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
[293]1613
1614kw = "func";
1615usage = "Displays a function y=f(x) (Fills a vector with function values)";
[1938]1616usage += "\n Usage: func f(x) xmin xmax [npt graphic_attributes]";
[326]1617usage += "\n Related commands: funcff func2d func2dff ";
[330]1618mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[326]1619kw = "funcff";
1620usage = "Displays a function y=f(x) from a C-file (Fills a vector with function values)";
[1938]1621usage += "\n Usage: funcff C-FileName FunctionName xmin xmax [npt graphic_attributes]";
[326]1622usage += "\n Related commands: func func2d func2dff ";
[330]1623mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[293]1624kw = "func2d";
1625usage = "Displays a function z=f(x,y) (Fills a matrix with function values)";
1626usage += "\n Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [graphic_attributes]";
1627usage += "\n Related commands: func";
[330]1628mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[326]1629kw = "func2dff";
1630usage = "Displays a function z=f(x,y) from a C-file (Fills a matrix with function values)";
1631usage += "\n Usage: func2dff C-FileName FunctionName xmin xmax nptx ymin ymax npty [graphic_attributes]";
1632usage += "\n Related commands: func funcff func2d ";
[330]1633mpiac->RegisterCommand(kw, usage, this, "Func Plot");
[293]1634
[357]1635kw = "ObjectExpressions";
1636usage = "Any mathematical expression (math.h) with object variables can be used";
1637usage += "\n ------ Object Variable names (double) -------- ";
[2419]1638usage += "\n (_nl is the table line number or the sequential index)";
1639usage += "\n- NTuple: ntuple variable names,_nl";
1640usage += "\n- Histo1D/HProf: i,x,val,err,_nl";
1641usage += "\n- Histo2D: i,j,x,y,val,err,_nl";
1642usage += "\n- Vector/Matrix: n,r,c,val,real,imag,mod,phas,_nl";
1643usage += "\n- TArray: n,x,y,z,t,u,val,real,imag,mod,phas,_nl";
1644usage += "\n- Image: i,j,x,y,val(=pix),_nl";
1645usage += "\n- GeneralFitData: x0,ex0 x1,ex1 ... xn,exn y,ey ok ,_nl";
[1548]1646usage += "\n- LocalMap/SphereThetaPhi/SphereHEALPix: ";
[2419]1647usage += "\n- i,k,val,real,imag,mod,phas,teta,phi,_nl";
1648usage += "\n- FITS Binary/ASCII table: fits column names,_nl";
[2128]1649#ifdef SANS_EVOLPLANCK
1650usage += "\n ------ Eros Variable names (double) -------- ";
1651usage += "\n- StarList: x,y,flux,fond,pixmax,flags,";
[2419]1652usage += "\n- xref,yref,fluxref,fondref,pixmaxref,_nl";
[2128]1653#endif
[1548]1654usage += "\n ------ Other parameters -------- ";
[357]1655usage += "\nLoop parameters can be specified as I1[:I2[:DI]] for(int i=I1; i<I2; i+=DI)";
1656usage += "\nThe default Cut() expression in true (=1) for all";
[1548]1657usage += "\n\n Related commands: plot2d plot2de plot2dw plot3d ";
[357]1658usage += "\n projh1d projh2d projprof fillvec fillmtx ";
1659usage += "\n fillnt fillgd1 fillgd2 ntloop exptovec ... ";
[2419]1660grp = "Expr. Plotting";
1661mpiac->RegisterHelp(kw, usage, grp);
[293]1662kw = "plot2d";
1663usage = "Plots (2D) Y=g(Object) vs. X=f(Object) --- Object Variable names (double) :";
[357]1664usage += "\n Usage: plot2d nameobj f_X() g_Y() [f_Cut() graphic_attributes loop_param]";
1665usage += "\n Related commands: plot2de plot2dw plot3d ObjectExpressions ...";
[330]1666mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]1667kw = "plot2de";
1668usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with error bars eX/Y=f_ErrX/Y(Object) ";
1669usage += "\n Usage: plot2de nameobj f_X() g_Y() f_ErrX() f_ErrY() [f_Cut() graphic_attributes loop_param]";
1670usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
1671mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[333]1672kw = "plot2dw";
1673usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with Weight W=h(Object) ";
[357]1674usage += "\n Usage: plot2dw nameobj f_X() g_Y() h_Wt() [Cut() graphic_attributes loop_param]";
1675usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
[333]1676mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1677kw = "plot3d";
1678usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs ";
[357]1679usage += "\n Usage: plot3d nameobj f_X() g_Y() h_Z() [Cut() graphic_attributes loop_param]";
1680usage += "\n Related commands: plot2d plot2dw plot2de plot3d ObjectExpressions ...";
[330]1681mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1682
1683kw = "projh1d";
1684usage = "Projects X=f(Object) with weight WT=h(Object) into a 1D histogram ";
[357]1685usage += "\n Usage: projh1d nameh1d nameobj f_X() [h_WT()=1. Cut() graphic_attributes loop_param]";
[293]1686usage += "\n Histo1D nameh1d is created if necessary ";
[357]1687usage += "\n Related commands: projh2d projprof ObjectExpressions ...";
[330]1688mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1689kw = "projh2d";
1690usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a 2D histogram ";
[357]1691usage += "\n Usage: projh2d nameh2d nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
[293]1692usage += "\n Histo2D nameh2d is created if necessary ";
[357]1693usage += "\n Related commands: projh1d projprof ObjectExpressions ...";
[330]1694mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1695kw = "projprof";
1696usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a profile histogram ";
[709]1697usage += "\n Usage: projprof nameprof nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
[293]1698usage += "\n HProf nameprof is created if necessary ";
[357]1699usage += "\n Related commands: projh1d projh2d ObjectExpressions ...";
[330]1700mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]1701kw = "fillvec";
1702usage = "Fills a Vector V((int)(f_X(Object)+0.5)) = h_V(Object) ";
1703usage += "\n Usage: fillvec namevec nameobj f_X() h_V() [Cut() graphic_attributes loop_param]";
1704usage += "\n Related commands: fillmtx fillnt ObjectExpressions ...";
1705mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1706kw = "fillmtx";
1707usage = "Fills a Matrix M(Line=g_Y(Object)+0.5, Col=f_X(Object)+0.5)) = h_V(Object) ";
1708usage += "\n Usage: fillvec namevec nameobj f_X() g_Y() h_V() [Cut() graphic_attributes loop_param]";
1709usage += "\n Related commands: fillvec fillnt ObjectExpressions ...";
1710mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1711
1712kw = "fillnt";
1713usage = "Creates and Fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
[357]1714usage += "\n Usage: fillnt nameobj f_X() g_Y() h_Z() k_T() [Cut() nameNt loop_param]";
[333]1715usage += "\n Related commands: ntloop plot2d projh1d projh2d projprof ";
[357]1716usage += "\n Related commands: fillvec fillmtx ntloop exptovec fillgd1 fillgd2 ObjectExpressions ...";
[330]1717mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]1718
[333]1719kw = "ntloop";
1720usage = "Loops over an Object NTupleInterface calling a function from a C-file \n";
1721usage += "and optionaly fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
[357]1722usage += "\n Usage: ntloop nameobj CFileName FuncName [NtupleName loop_param]";
1723usage += "\n Related commands: fillvec fillmtx fillnt fillgd1 fillgd2 exptovec ObjectExpressions ...";
[333]1724usage += "\n Related commands: ntexpcfile fillnt";
1725mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[357]1726
[333]1727kw = "ntexpcfile";
1728usage = "Creates a C-File with declarations suitable to be used for ntloop";
1729usage += "\n Usage: ntexpcfile nameobj CFileName FuncName ";
1730usage += "\n Related commands: ntloop";
1731mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
1732
[357]1733kw = "exptovec";
[293]1734usage = "Creates and Fills a Vector with X=f(Object)";
[357]1735usage += "\n Usage: exptovec namevec nameobj f_X() [Cut() graphic_attributes loop_param]";
1736usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
[330]1737mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1738kw = "fillgd1";
1739usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), ErrY=h(...))";
[357]1740usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_ErrY() [Cut() loop_param]";
1741usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
[330]1742mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1743kw = "fillgd2";
1744usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), Z=h(...)) ErrZ=k(...)";
[357]1745usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_Z() k_ErrZ() [Cut() loop_param]";
1746usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
[330]1747mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[1067]1748kw = "gdfrvec";
1749usage = "Fills a GeneralFitData with vectors X,Y,Z,EZ";
1750usage += "\n Usage: gdfrvec namegfd X Y";
1751usage += "\n Usage: gdfrvec namegfd X Y ! EY";
1752usage += "\n Usage: gdfrvec namegfd X Y Z";
1753usage += "\n Usage: gdfrvec namegfd X Y Z EZ";
1754usage += "\n Related commands: fillgd1 fillgd2 ...";
1755mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
[293]1756
[2180]1757
1758kw = "eval";
1759usage = "Compute arithmetic expression\n";
1760usage += "\n Usage: eval resultvarname arithmetic expression....";
1761usage += "\n resultvarname: store result in variable resultvarname";
1762usage += "\n - If first character is not alphabetic, just print result";
1763usage += "\n arithmetic expression:";
1764usage += "\n ex: x + sqrt(y)+z +3.14 (x,y,z are variables)";
1765usage += "\n ex: $x + sqrt($y)+$z +3.14 (x,y,z are variables)";
1766usage += "\n ex: 360 * M_PI / 180.";
1767mpiac->RegisterCommand(kw, usage, this, "Expr. Arithmetic");
1768
[293]1769}
1770
1771/* --Methode-- */
1772int PIABaseExecutor::LinkUserFuncs(string& fnameso, string& func1, string& func2, string& func3)
1773// string& func4, string& func5)
1774{
1775string cmd;
1776
1777if (dynlink) delete dynlink; dynlink = NULL;
1778usfmap.clear();
1779
1780dynlink = new PDynLinkMgr(fnameso, true);
1781if (dynlink == NULL) {
1782 string sn = fnameso;
1783 cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur ouverture SO " << sn << endl;
1784 return(2);
1785 }
1786
1787int nok=0;
1788// on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
1789// DlUserProcFunction f = NULL;
1790DlFunction f = NULL;
1791if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
1792// f = (DlUserProcFunction) dlsym(dlhandle, func1.c_str());
1793f = dynlink->GetFunction(func1);
1794if (f) { nok++; usfmap[func1] = f; }
1795else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func1 << endl;
1796
1797if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
1798// f = (DlUserProcFunction) dlsym(dlhandle, func2.c_str());
1799f = dynlink->GetFunction(func2);
1800if (f) { nok++; usfmap[func2] = f; }
1801else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func2 << endl;
1802
1803if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
1804// f = (DlUserProcFunction) dlsym(dlhandle, func3.c_str());
1805f = dynlink->GetFunction(func3);
1806if (f) { nok++; usfmap[func3] = f; }
1807else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func3 << endl;
1808
1809/* Pb compile g++ 2.7.2
1810if ((func4.length() < 1) || (func4 == "-") || (func4 == ".") ) goto fin;
1811// f = (DlUserProcFunction) dlsym(dlhandle, func4.c_str());
1812f = dynlink->GetFunction(func4);
1813if (f) { nok++; usfmap[func4] = f; }
1814else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func4 << endl;
1815
1816if ((func5.length() < 1) || (func5 == "-") || (func5 == ".") ) goto fin;
1817// f = (DlUserProcFunction) dlsym(dlhandle, func5.c_str());
1818f = dynlink->GetFunction(func5);
1819if (f) { nok++; usfmap[func5] = f; }
1820else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func5 << endl;
1821*/
1822fin:
1823if (nok < 1) { if (dynlink) delete dynlink; dynlink = NULL; return(3); }
1824else return(0);
1825}
1826
[1276]1827/* --Methode-- */
1828int PIABaseExecutor::LinkUserFuncs2(string& fnameso, string& func1, string& func2, string& func3)
1829{
1830string cmd;
1831
1832if (dynlink2) delete dynlink2; dynlink2 = NULL;
1833usfmap2.clear();
1834
1835dynlink2 = new PDynLinkMgr(fnameso, true);
1836if (dynlink2 == NULL) {
1837 string sn = fnameso;
1838 cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur ouverture SO " << sn << endl;
1839 return(2);
1840 }
1841
1842int nok=0;
1843// on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
1844// DlUserProcFunction f = NULL;
1845DlFunction f = NULL;
1846if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
1847f = dynlink2->GetFunction(func1);
1848if (f) { nok++; usfmap2[func1] = f; }
1849else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func1 << endl;
1850
1851if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
1852f = dynlink2->GetFunction(func2);
1853if (f) { nok++; usfmap2[func2] = f; }
1854else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func2 << endl;
1855
1856if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
1857f = dynlink2->GetFunction(func3);
1858if (f) { nok++; usfmap2[func3] = f; }
1859else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func3 << endl;
1860
1861fin:
1862if (nok < 1) { if (dynlink2) delete dynlink2; dynlink2 = NULL; return(3); }
1863else return(0);
1864}
1865
[388]1866/* Nouvelle-Fonction */
1867void RegisterPIGraphicsHelp(PIACmd* piac)
1868{
1869string kw,grp,usage;
1870
1871grp = "Graphics";
1872
1873kw = "PIImage";
1874usage = "Manages the display of a 2-D array (P2DArrayAdapter) as an image \n";
1875usage += "and controls a zoom widget, as well as a global image view widget \n";
1876usage += ">>>> Mouse controls : \n";
1877usage += "o Button-1: Display current coordinates and pixel value\n";
1878usage += " Position the cursor an refresh the zoom widget\n";
1879usage += "o Button-2: Defines an image zone and positions the cursor \n";
1880usage += "o Button-3: Moves the viewed portion of the array inside the window \n";
1881usage += ">>>> Keyboard controls : \n";
1882usage += "o <Alt>R : Refresh display \n";
1883usage += "o <Alt>O : Shows the PIImageTools (image display parameter controls) \n";
1884usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of overlayed graphics (Drawers)) \n";
1885usage += "o <Alt>V : Copy/Paste / Text paste at the current cursor position \n";
1886usage += "o <Alt>C : Copy/Paste / Copies the selected regions content as text in the copy/paste buffer \n";
1887usage += "o <Alt>X : Show/Hide the Cut Window \n";
[2263]1888usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n";
1889usage += "o <Alt>E : Removes the last added graphic element \n";
[2158]1890usage += "o <Alt>+ or <Cntl>+ : Zoom in \n";
1891usage += "o <Alt>- or <Cntl>- : Zoom out \n";
[388]1892usage += "o Cursor keys : Moves the image cursor \n";
1893piac->RegisterHelp(kw, usage, grp);
1894
1895kw = "PIScDrawWdg";
1896usage = "Manages display of 2-D drawers with interactive zoom \n";
1897usage += ">>>> Mouse controls : \n";
1898usage += "o Button-1: Display current coordinates \n";
1899usage += "o Button-2: Defines a rectangle for zoom \n";
1900usage += "o Button-3: Defines a rectangle for Text-Info (<Alt>I) \n";
1901usage += ">>>> Keyboard controls : \n";
1902usage += "o <Alt>R : Refresh display \n";
1903usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n";
1904usage += " Specific controls for 2-D histograms \n";
1905usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
1906usage += " Drawer 0 manages the axes, as well as the added text \n";
1907usage += "o <Alt>V : Copy/Paste / Text paste at the current position \n";
[2263]1908usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n";
1909usage += "o <Alt>E : Removes the last added graphic element \n";
[1134]1910usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n";
[1911]1911usage += "o <Alt>M : Activate/Deactivate a measurement cursor on Button-1\n";
1912usage += "o <Alt>L : Deactivate DX,DY print (see below)\n";
[1883]1913usage += ">>>> Mouse + Keyboard controls : \n";
1914usage += "o Button-1 + <Alt>K : Set (reset) the reference point for DX,DY print \n";
[388]1915piac->RegisterHelp(kw, usage, grp);
1916
1917kw = "PIDraw3DWdg";
1918usage = "Manages display of 3-D objects (drawers) \n";
1919usage += ">>>> Mouse controls : \n";
1920usage += "o Button-2: Rotates the observer (camera) around object \n";
1921usage += "o Shift-Button-2: Rotates object with camera fixed \n";
1922usage += " The object rotation mode can be assigned to Button-2 with <Alt>S \n";
1923usage += "o Button-3: Zoom control (Camera distance And/Or view angle) \n";
1924usage += ">>>> Keyboard controls : \n";
1925usage += "o <Alt>R : Resets the 3-D view and refreshes the display \n";
1926usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
1927usage += "o <Alt>O : = <Alt>G \n";
1928usage += "o <Alt>V : Copy/Paste / Text paste at the current position (Drawer 0)\n";
[2263]1929usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n";
1930usage += "o <Alt>E : Removes the last added graphic element \n";
[388]1931usage += "o <Alt>A : Activate/Deactivate axes drawing \n";
1932usage += "o <Alt>S : Activate/Deactivate object rotation mode on Button-2 \n";
1933piac->RegisterHelp(kw, usage, grp);
1934
1935kw = "Windows";
1936usage = "Objects can be displayed in different windows, or overlayed on the \n";
1937usage += "previous display. The graphics attributes next,win,stack,same control \n";
1938usage += "the display window. \n";
1939usage += "o GraphicWindow : This is the default mode (gr_att=next)\n";
1940usage += " Graphic windows can be divided int zones. Object is displayed \n";
1941usage += " in the next available position, removing a previously displayed \n";
1942usage += " widget if necessary \n";
1943usage += "o Window : An object is displayed in its own window (gr_att= win) \n";
1944usage += "o StackWindow : multpile widgets can be stacked in a StackWindow (gr_att= stack) \n";
1945usage += " A single widget is displayed a any time. Different widgets in a StackWindow \n";
1946usage += " can be displayed using the stacknext command, as well as the StackTools item \n";
1947usage += " in the Tools menu (from Menubar). An automatic cyclic display mode can also \n";
1948usage += " be activated using the StackTools menu (Blink) \n";
[548]1949usage += "o Most objects can be also be displayed overlayed \n";
1950usage += " on the last displayed widget (gr_att= same) \n";
1951usage += "o The overlay can be on a selected rectangle of the \n";
1952usage += " last displayed widget (gr_att= inset) - See setinsetlimits\n";
[553]1953usage += "\n Related commands: newwin zone stacknext graphicatt setinsetlimits";
[388]1954piac->RegisterHelp(kw, usage, grp);
[484]1955
1956kw = "PIConsole";
1957usage = "Text output area and command editing window (console) \n";
1958usage += ">>>> Mouse controls : \n";
1959usage += "o Button-1: Rectangle selection for copy/paste \n";
1960usage += "o Button-2: Paste text in the command editing line \n";
1961usage += "o Button-3: activate display option menu \n";
1962usage += ">>>> Keyboard controls : \n";
1963usage += "o <Alt>O : activate display option menu \n";
1964usage += "o <Alt>V : Paste text in the command editing line \n";
1965usage += "o <Alt>A : Selection of the whole window for copy \n";
1966usage += "o <Alt>L : Command history (List of command history buffer) \n";
1967usage += "o <Ctl>A : Command editing -> Goto the beginning of line \n";
1968usage += "o <Ctl>E : Command editing -> Goto the end of line \n";
1969usage += "o <Ctl>K : Command editing -> Clear to the end of line \n";
1970usage += "o <Ctl>C : Command editing -> Clear the line \n";
1971usage += "o Cursor left,right : Command editing -> Move cursor \n";
1972usage += "o Cursor Up,Down : recall command from history buffer \n";
1973usage += "o Backspace,Del : Command editing \n";
1974usage += "o <Return>,<Enter> : Execute command \n";
1975piac->RegisterHelp(kw, usage, grp);
[388]1976}
Note: See TracBrowser for help on using the repository browser.