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