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

Last change on this file since 2765 was 2755, checked in by ansari, 20 years ago

1/ Correction bug trace des lignes ds PINTuple
2/ Ajout methode IsThreadable() (declaration conformite thread separe pour certaines commandes) ds baseexecut.h .cc (plot2d plot3d ...) , ds pawexecut.cc (n/plot ...) et ds cxxexecutor.h .cc (c++exec c++execfrf ...)
3/ Ajout de ZMutex (et ZSync) pour la gestion des commandes threadable - ds les
executeurs et ds servnobjm.h .cc
4/ bug d'execution en thread identifie et corrige ds nobjmgr.h .cc (ajout des
methodes GetObj_P() GetObjAdapter_P() et ReadObj_P()
5/ Ajout de l'appel a ZSync::NOp() pour eviter les warnings 'unused variable zs ...'

Reza 23 Mai 2005

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