1 | #include "piacmd.h"
|
---|
2 |
|
---|
3 | #include <stdio.h>
|
---|
4 | #include <stdlib.h>
|
---|
5 | #include <math.h>
|
---|
6 |
|
---|
7 | #include "basexecut.h"
|
---|
8 |
|
---|
9 | #include "pdlmgr.h"
|
---|
10 | #include "ctimer.h"
|
---|
11 |
|
---|
12 | #include "pistdimgapp.h"
|
---|
13 | #include "nobjmgr.h"
|
---|
14 | #include "servnobjm.h"
|
---|
15 |
|
---|
16 | #include "histos.h"
|
---|
17 | #include "histos2.h"
|
---|
18 | #include "hisprof.h"
|
---|
19 | #include "ntuple.h"
|
---|
20 | #include "generaldata.h"
|
---|
21 |
|
---|
22 | #ifdef SANS_EVOLPLANCK
|
---|
23 | #include "cvector.h"
|
---|
24 | #else
|
---|
25 | #include "tvector.h"
|
---|
26 | #endif
|
---|
27 |
|
---|
28 |
|
---|
29 | /* --Methode-- */
|
---|
30 | PIABaseExecutor::PIABaseExecutor(PIACmd* piac, NamedObjMgr* omg, PIStdImgApp* app)
|
---|
31 | {
|
---|
32 | mpiac = piac;
|
---|
33 | mObjMgr = omg;
|
---|
34 | mImgApp = app;
|
---|
35 | dynlink = NULL;
|
---|
36 | dynlink2 = NULL;
|
---|
37 | RegisterCommands();
|
---|
38 | }
|
---|
39 |
|
---|
40 | PIABaseExecutor::~PIABaseExecutor()
|
---|
41 | {
|
---|
42 | if (dynlink) delete dynlink;
|
---|
43 | if (dynlink2) delete dynlink2;
|
---|
44 | }
|
---|
45 |
|
---|
46 |
|
---|
47 |
|
---|
48 | /* --Methode-- */
|
---|
49 | int PIABaseExecutor::Execute(string& kw, vector<string>& tokens, string& toks)
|
---|
50 | {
|
---|
51 | Services2NObjMgr* srvo = mObjMgr->GetServiceObj();
|
---|
52 | // >>>>> Chargement de modules
|
---|
53 | if (kw == "loadmodule") {
|
---|
54 | if (tokens.size() < 2) { cout << "Usage: loadmodule fnameso modulename" << endl; return(0); }
|
---|
55 | mpiac->LoadModule(tokens[0], tokens[1]);
|
---|
56 | }
|
---|
57 | // >>>>>>>>>>> Fenetre graphique , changement d'attributs graphiques
|
---|
58 | else if (kw == "zone") {
|
---|
59 | while (tokens.size() < 2) tokens.push_back("1");
|
---|
60 | int nx, ny;
|
---|
61 | nx = ny = 1;
|
---|
62 | nx = atoi(tokens[0].c_str()); ny = atoi(tokens[1].c_str());
|
---|
63 | mObjMgr->SetGraphicWinZone(nx, ny, false);
|
---|
64 | }
|
---|
65 | else if (kw == "newwin") {
|
---|
66 | int nx=1, ny=1;
|
---|
67 | //if(tokens.size() < 2) { cout << "Usage: newwin nx ny" << endl; return(0); }
|
---|
68 | if(tokens.size() > 0) nx = atoi(tokens[0].c_str());
|
---|
69 | if(tokens.size() > 1) ny = atoi(tokens[1].c_str());
|
---|
70 | mObjMgr->SetGraphicWinZone(nx, ny, true);
|
---|
71 | }
|
---|
72 | else if (kw == "stacknext") mImgApp->StackWinNext();
|
---|
73 | else if (kw == "graphicatt") {
|
---|
74 | if (tokens.size() < 1) { cout << "Usage: graphicatt attributes_list (att=def->defaut)" << endl; return(0); }
|
---|
75 | mObjMgr->SetGraphicAttributes(tokens[0]);
|
---|
76 | }
|
---|
77 | else if (kw == "setxylimits") {
|
---|
78 | if (tokens.size() < 4) { cout << "Usage: setxylimits xmin xmax ymin ymax" << endl; return(0); }
|
---|
79 | double xmin = atof(tokens[0].c_str());
|
---|
80 | double xmax = atof(tokens[1].c_str());
|
---|
81 | double ymin = atof(tokens[2].c_str());
|
---|
82 | double ymax = atof(tokens[3].c_str());
|
---|
83 | mImgApp->SetXYLimits(xmin, xmax, ymin, ymax);
|
---|
84 | }
|
---|
85 | else if (kw == "setinsetlimits") {
|
---|
86 | if (tokens.size() < 4) { cout << "Usage: setinsetlimits xmin xmax ymin ymax" << endl; return(0); }
|
---|
87 | double xmin = atof(tokens[0].c_str());
|
---|
88 | double xmax = atof(tokens[1].c_str());
|
---|
89 | double ymin = atof(tokens[2].c_str());
|
---|
90 | double ymax = atof(tokens[3].c_str());
|
---|
91 | mImgApp->SetInsetLimits(xmin, xmax, ymin, ymax);
|
---|
92 | }
|
---|
93 | else if (kw == "setimgcenter") {
|
---|
94 | if (tokens.size() < 2) { cout << "Usage: setimgcenter xc yc" << endl; return(0); }
|
---|
95 | int xc = atoi(tokens[0].c_str());
|
---|
96 | int yc = atoi(tokens[1].c_str());
|
---|
97 | mImgApp->SetImageCenterPosition(xc, yc);
|
---|
98 | }
|
---|
99 | else if (kw == "addtext") {
|
---|
100 | if (tokens.size() < 3) { cout << "Usage: addtext x y txt [colfontatt]" << endl; return(0); }
|
---|
101 | double xp = atof(tokens[0].c_str());
|
---|
102 | double yp = atof(tokens[1].c_str());
|
---|
103 | string txt = tokens[2];
|
---|
104 | bool fgsr = false;
|
---|
105 | if (tokens.size() > 3)
|
---|
106 | mObjMgr->GetServiceObj()->DecodeDispOption(tokens[3], fgsr);
|
---|
107 | mImgApp->AddText(txt, xp, yp);
|
---|
108 | if (fgsr) mImgApp->RestoreGraphicAtt();
|
---|
109 | }
|
---|
110 | else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect")) {
|
---|
111 | if (tokens.size() < 4) { cout << "Usage: addline/addrect/addfrect x1 y1 x2 y2 [colatt]" << endl; return(0); }
|
---|
112 | double xp1 = atof(tokens[0].c_str());
|
---|
113 | double yp1 = atof(tokens[1].c_str());
|
---|
114 | double xp2 = atof(tokens[2].c_str());
|
---|
115 | double yp2 = atof(tokens[3].c_str());
|
---|
116 | bool fgsr = false;
|
---|
117 | if (tokens.size() > 4)
|
---|
118 | mObjMgr->GetServiceObj()->DecodeDispOption(tokens[4], fgsr);
|
---|
119 | if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2);
|
---|
120 | else {
|
---|
121 | bool fgfill = (kw == "addrect") ? false : true;
|
---|
122 | mImgApp->AddRectangle(xp1, yp1, xp2, yp2, fgfill);
|
---|
123 | }
|
---|
124 | if (fgsr) mImgApp->RestoreGraphicAtt();
|
---|
125 | }
|
---|
126 | else if ((kw == "addcirc") || (kw == "addfcirc")) {
|
---|
127 | if (tokens.size() < 3) { cout << "Usage: addcirc/addfcirc xc yc r [colatt]" << endl; return(0); }
|
---|
128 | double xc = atof(tokens[0].c_str());
|
---|
129 | double yc = atof(tokens[1].c_str());
|
---|
130 | double rad = atof(tokens[2].c_str());
|
---|
131 | bool fgsr = false;
|
---|
132 | if (tokens.size() > 3)
|
---|
133 | mObjMgr->GetServiceObj()->DecodeDispOption(tokens[3], fgsr);
|
---|
134 | bool fgfill = (kw == "addcirc") ? false : true;
|
---|
135 | mImgApp->AddCircle(xc, yc, rad, fgfill);
|
---|
136 | if (fgsr) mImgApp->RestoreGraphicAtt();
|
---|
137 | }
|
---|
138 |
|
---|
139 |
|
---|
140 | else if (kw == "settitle") {
|
---|
141 | if (tokens.size() < 1) { cout << "Usage: settitle TopTitle [BotTitle] [fontatt]" << endl; return(0); }
|
---|
142 | bool fgsr = true;
|
---|
143 | if (tokens.size() > 2)
|
---|
144 | mObjMgr->GetServiceObj()->DecodeDispOption(tokens[2], fgsr);
|
---|
145 | if (tokens.size() < 2)
|
---|
146 | tokens.push_back("");
|
---|
147 | mImgApp->SetTitle(tokens[0], tokens[1]);
|
---|
148 | if (fgsr) mImgApp->RestoreGraphicAtt();
|
---|
149 | }
|
---|
150 |
|
---|
151 | // >>>>>>>>>>> Link dynamique de fonctions C++
|
---|
152 | else if (kw == "link" ) {
|
---|
153 | if (tokens.size() < 2) { cout << "Usage: link fnameso f1 [f2 f3]" << endl; return(0); }
|
---|
154 | string sph = "";
|
---|
155 | for(int gg=0; gg<5; gg++) tokens.push_back(sph);
|
---|
156 | int rc = LinkUserFuncs(tokens[0], tokens[1], tokens[2], tokens[3]);
|
---|
157 | if (rc == 0) cout << "PIABaseExecutor: Link from " << tokens[0] << " OK " << endl;
|
---|
158 | }
|
---|
159 | else if (kw == "linkff2" ) {
|
---|
160 | if (tokens.size() < 2) { cout << "Usage: linkff2 fnameso f1 [f2 f3]" << endl; return(0); }
|
---|
161 | string sph = "";
|
---|
162 | for(int gg=0; gg<5; gg++) tokens.push_back(sph);
|
---|
163 | int rc = LinkUserFuncs2(tokens[0], tokens[1], tokens[2], tokens[3]);
|
---|
164 | if (rc == 0) cout << "PIABaseExecutor: Link2 from " << tokens[0] << " OK " << endl;
|
---|
165 | }
|
---|
166 | else if (kw == "call" ) {
|
---|
167 | if (tokens.size() < 1) { cout << "Usage: call userf [arg1 arg2 ...]" << endl; return(0); }
|
---|
168 | UsFmap::iterator it;
|
---|
169 | UsFmap::iterator it1 = usfmap.find(tokens[0]);
|
---|
170 | UsFmap::iterator it2 = usfmap2.find(tokens[0]);
|
---|
171 | if ((it1 == usfmap.end()) && (it2 == usfmap2.end()) ) {
|
---|
172 | cerr << "PIABaseExecutor: No User Function " << tokens[0] << endl;
|
---|
173 | return(0);
|
---|
174 | }
|
---|
175 | if (it1 == usfmap.end()) it = it2;
|
---|
176 | else it = it1;
|
---|
177 | cout << "PIABaseExecutor: Call " << tokens[0] << "( ... )" << endl;
|
---|
178 | // on est oblige de faire un cast etant donne qu'on
|
---|
179 | // utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
|
---|
180 | DlUserProcFunction fuf = (DlUserProcFunction)(*it).second;
|
---|
181 | // On redirige la sortie sur le terminal
|
---|
182 | bool red = mImgApp->HasRedirectedStdOutErr();
|
---|
183 | mImgApp->RedirectStdOutErr(false);
|
---|
184 | #ifdef SANS_EVOLPLANCK
|
---|
185 | TRY {
|
---|
186 | tokens.erase(tokens.begin());
|
---|
187 | fuf(tokens);
|
---|
188 | } CATCH(merr) {
|
---|
189 | fflush(stdout);
|
---|
190 | string es = PeidaExc(merr);
|
---|
191 | cerr << "\n PIABaseExecutor: Call UserFunc Exception :" << merr << es;
|
---|
192 | cout << endl;
|
---|
193 | }
|
---|
194 | #else
|
---|
195 | try {
|
---|
196 | tokens.erase(tokens.begin());
|
---|
197 | fuf(tokens);
|
---|
198 | }
|
---|
199 | catch ( PThrowable & exc ) {
|
---|
200 | cerr << "\n PIABaseExecutor: Call / Catched Exception :"
|
---|
201 | << (string)typeid(exc).name() << " Msg= "
|
---|
202 | << exc.Msg() << endl;
|
---|
203 | cout << endl;
|
---|
204 | }
|
---|
205 | catch ( ... ) {
|
---|
206 | cerr << "\n PIABaseExecutor: Call / Catched Exception ... "
|
---|
207 | << endl;
|
---|
208 | cout << endl;
|
---|
209 | }
|
---|
210 | #endif
|
---|
211 | mImgApp->RedirectStdOutErr(red);
|
---|
212 | }
|
---|
213 |
|
---|
214 | // >>>>>>>>>>> lecture/ecriture des objets, gestion des objets
|
---|
215 | else if (kw == "openfits" ) {
|
---|
216 | if (tokens.size() < 1) { cout << "Usage: openfits file " << endl; return(0); }
|
---|
217 | else { string nomobj = ""; mObjMgr->ReadFits(tokens[0], nomobj); }
|
---|
218 | }
|
---|
219 | else if (kw == "savefits" ) {
|
---|
220 | if (tokens.size() < 2) { cout << "Usage: savefits nameobj filename " << endl; return(0); }
|
---|
221 | else mObjMgr->SaveFits(tokens[0], tokens[1]);
|
---|
222 | }
|
---|
223 | else if (kw == "openppf" ) {
|
---|
224 | if (tokens.size() < 1) { cout << "Usage: openppf file " << endl; return(0); }
|
---|
225 | mObjMgr->ReadAll(tokens[0]);
|
---|
226 | }
|
---|
227 | else if (kw == "saveobjs" ) {
|
---|
228 | if (tokens.size() < 2) { cout << "Usage: saveobjs patt filename " << endl; return(0); }
|
---|
229 | mObjMgr->SaveObjects(tokens[0], tokens[1]);
|
---|
230 | }
|
---|
231 | else if (kw == "saveall" ) {
|
---|
232 | if (tokens.size() < 1) { cout << "Usage: saveall file " << endl; return(0); }
|
---|
233 | mObjMgr->SaveAll(tokens[0]);
|
---|
234 | }
|
---|
235 | else if (kw == "print" ) {
|
---|
236 | if (tokens.size() < 1) { cout << "Usage: print nameobj " << endl; return(0); }
|
---|
237 | mObjMgr->PrintObj(tokens[0]);
|
---|
238 | }
|
---|
239 | else if ( (kw == "rename" ) || (kw == "mv") ) {
|
---|
240 | if (tokens.size() < 2) { cout << "Usage: rename nameobj namenew" << endl; return(0); }
|
---|
241 | mObjMgr->RenameObj(tokens[0], tokens[1]);
|
---|
242 | }
|
---|
243 | else if ( (kw == "del" ) || (kw == "rm") ) {
|
---|
244 | if (tokens.size() < 1) { cout << "Usage: del nameobj [nameobj2 ...]" << endl; return(0); }
|
---|
245 | if (tokens.size()>0)
|
---|
246 | for(uint_4 i=0;i<tokens.size();i++) mObjMgr->DelObj(tokens[i]);
|
---|
247 | }
|
---|
248 | else if (kw == "delobjs" ) {
|
---|
249 | if (tokens.size() < 1) { cout << "Usage: delobjs nomobjpattern (*,?) " << endl; return(0); }
|
---|
250 | mObjMgr->DelObjects(tokens[0]);
|
---|
251 | }
|
---|
252 | else if ( (kw == "listobjs") || (kw == "ls") ) {
|
---|
253 | if (tokens.size() < 1) tokens.push_back("*");
|
---|
254 | mObjMgr->ListObjs(tokens[0]);
|
---|
255 | }
|
---|
256 | // Gestion des repertoires
|
---|
257 | else if (kw == "mkdir" ) {
|
---|
258 | if (tokens.size() < 1) { cout << "Usage: mkdir dirname [true]" << endl; return(0); }
|
---|
259 | bool crd = mObjMgr->CreateDir(tokens[0]);
|
---|
260 | if ( crd && (tokens.size() > 1) && (tokens[1] == "true") )
|
---|
261 | mObjMgr->SetKeepOldDirAtt(tokens[0], true);
|
---|
262 | }
|
---|
263 | else if (kw == "rmdir" ) {
|
---|
264 | if (tokens.size() < 1) { cout << "Usage: rmdir dirname " << endl; return(0); }
|
---|
265 | mObjMgr->DeleteDir(tokens[0]);
|
---|
266 | }
|
---|
267 | else if (kw == "cd") {
|
---|
268 | if (tokens.size() < 1) tokens.push_back("home");
|
---|
269 | mObjMgr->SetCurrentDir(tokens[0]);
|
---|
270 | }
|
---|
271 | else if (kw == "pwd") {
|
---|
272 | string dirn;
|
---|
273 | mObjMgr->GetCurrentDir(dirn);
|
---|
274 | cout << "CurrentDirectory: " << dirn << endl;
|
---|
275 | }
|
---|
276 | else if (kw == "listdirs") {
|
---|
277 | if (tokens.size() < 1) tokens.push_back("*");
|
---|
278 | mObjMgr->ListDirs(tokens[0]);
|
---|
279 | }
|
---|
280 |
|
---|
281 | // >>>>>>>>>>> Creation d'histos 1D-2D
|
---|
282 | else if (kw == "newh1d") {
|
---|
283 | if (tokens.size() < 4) { cout << "Usage: newh1d name xmin xmax nbin" << endl; return(0); }
|
---|
284 | int_4 nbx = 100;
|
---|
285 | r_8 xmin = 0., xmax = 1.;
|
---|
286 | nbx = atoi(tokens[3].c_str());
|
---|
287 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
288 | Histo* h = new Histo(xmin, xmax, nbx);
|
---|
289 | mObjMgr->AddObj(h, tokens[0]);
|
---|
290 | }
|
---|
291 | else if (kw == "newh2d") {
|
---|
292 | if (tokens.size() < 7) {
|
---|
293 | cout << "Usage: newh2d name xmin xmax nbinx ymin ymax nbiny" << endl;
|
---|
294 | return(0);
|
---|
295 | }
|
---|
296 | int_4 nbx = 50, nby = 50;
|
---|
297 | r_8 xmin = 0., xmax = 1.;
|
---|
298 | r_8 ymin = 0., ymax = 1.;
|
---|
299 | nbx = atoi(tokens[3].c_str());
|
---|
300 | nby = atoi(tokens[6].c_str());
|
---|
301 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
302 | ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());
|
---|
303 | Histo2D* h = new Histo2D(xmin, xmax, nbx, ymin, ymax, nby);
|
---|
304 | mObjMgr->AddObj(h, tokens[0]);
|
---|
305 | }
|
---|
306 | else if (kw == "newprof" || kw == "newprofe") {
|
---|
307 | if (tokens.size() < 4)
|
---|
308 | { cout << "Usage: newprof[e] name xmin xmax nbin [ymin ymax]" << endl; return(0); }
|
---|
309 | int_4 nbx = 100;
|
---|
310 | r_8 xmin = 0., xmax = 1., ymin = 1., ymax = -1.;
|
---|
311 | if(tokens.size() > 5)
|
---|
312 | {ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());}
|
---|
313 | nbx = atoi(tokens[3].c_str());
|
---|
314 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
315 | HProf* h = new HProf(xmin, xmax, nbx, ymin, ymax);
|
---|
316 | if(kw == "newprofe") h->SetErrOpt(false);
|
---|
317 | mObjMgr->AddObj(h, tokens[0]);
|
---|
318 | }
|
---|
319 |
|
---|
320 | // Creation de NTuple
|
---|
321 | else if (kw == "newnt") {
|
---|
322 | if(tokens.size() < 2)
|
---|
323 | {cout<<"Usage: newnt name v1 v2 ... vn / newnt name nvar"<<endl; return(0);}
|
---|
324 | vector<string> varname;
|
---|
325 | int nvar = 0;
|
---|
326 | const char *c = tokens[1].c_str();
|
---|
327 | if(isdigit(c[0])) {
|
---|
328 | nvar = atoi(tokens[1].c_str());
|
---|
329 | if(nvar<=0 || nvar>=10000)
|
---|
330 | {cout<<"newnt name nvar : nvar must be an positive integer<10000"<<endl;
|
---|
331 | return(0);}
|
---|
332 | for(int i=0;i<nvar;i++) {
|
---|
333 | char str[16]; sprintf(str,"%d",i);
|
---|
334 | string dum = "v"; dum += str;
|
---|
335 | varname.push_back(dum.c_str());
|
---|
336 | }
|
---|
337 | } else if( islower(c[0]) || isupper(c[0]) ) {
|
---|
338 | for(int i=1;i<(int)tokens.size();i++) {
|
---|
339 | varname.push_back(tokens[i].c_str());
|
---|
340 | nvar++;
|
---|
341 | }
|
---|
342 | } else {
|
---|
343 | cout<<"newnt name v1 v2 ... vn : name vi must begin by a letter"<<endl
|
---|
344 | <<"newnt name nvar : nvar must be an positive integer"<<endl;
|
---|
345 | return(0);
|
---|
346 | }
|
---|
347 | char **noms = new char*[nvar];
|
---|
348 | for(int i=0;i<nvar;i++) noms[i] = (char *)varname[i].c_str();
|
---|
349 | NTuple* nt = new NTuple(nvar,noms);
|
---|
350 | delete [] noms;
|
---|
351 | mObjMgr->AddObj(nt,tokens[0]);
|
---|
352 | }
|
---|
353 |
|
---|
354 | // Creation de GeneralFitData
|
---|
355 | else if (kw == "newgfd") {
|
---|
356 | if (tokens.size() < 3)
|
---|
357 | { cout << "Usage: newgfd nvar nalloc [errx(0/1)]" << endl; return(0); }
|
---|
358 | int nvar, nalloc, errx=0;
|
---|
359 | if (tokens.size() > 3)
|
---|
360 | { errx = atoi(tokens[3].c_str()); if(errx>0) errx=1; else errx = 0;}
|
---|
361 | nvar = atoi(tokens[1].c_str()); nalloc = atoi(tokens[2].c_str());
|
---|
362 | if(nvar>0 && nalloc>0) {
|
---|
363 | GeneralFitData* gfd = new GeneralFitData(nvar,nalloc,errx);
|
---|
364 | mObjMgr->AddObj(gfd, tokens[0]);
|
---|
365 | }
|
---|
366 | }
|
---|
367 |
|
---|
368 | // Creation/remplissage de vecteur et de matrice
|
---|
369 | else if (kw == "newvec") {
|
---|
370 | if (tokens.size() < 2) {
|
---|
371 | cout << "Usage: newvec name size [f(i) dopt] " << endl; return(0);
|
---|
372 | }
|
---|
373 | int n = atoi(tokens[1].c_str());
|
---|
374 | double xmin, xmax;
|
---|
375 | xmin = 0.; xmax = n;
|
---|
376 | if (tokens.size() < 3) {
|
---|
377 | Vector* v = new Vector(n);
|
---|
378 | mObjMgr->AddObj(v, tokens[0]);
|
---|
379 | }
|
---|
380 | else {
|
---|
381 | if (tokens.size() < 4) tokens.push_back("");
|
---|
382 | mObjMgr->GetServiceObj()->PlotFunc(tokens[2], tokens[0], xmin, xmax, n, tokens[3]);
|
---|
383 | }
|
---|
384 | }
|
---|
385 | else if (kw == "newmtx") {
|
---|
386 | if (tokens.size() < 3) {
|
---|
387 | cout << "Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) dopt] " << endl; return(0);
|
---|
388 | }
|
---|
389 | int nx = atoi(tokens[1].c_str());
|
---|
390 | int ny = atoi(tokens[2].c_str());
|
---|
391 | double xmin, xmax, ymin, ymax;
|
---|
392 | xmin = 0.; xmax = nx;
|
---|
393 | ymin = 0.; ymax = ny;
|
---|
394 | if (tokens.size() < 4) {
|
---|
395 | Matrix* mtx = new Matrix(ny,nx);
|
---|
396 | mObjMgr->AddObj(mtx, tokens[0]);
|
---|
397 | }
|
---|
398 | else {
|
---|
399 | if (tokens.size() < 5) tokens.push_back("n");
|
---|
400 | mObjMgr->GetServiceObj()->PlotFunc2D(tokens[3], tokens[0], xmin, xmax, ymin, ymax,
|
---|
401 | nx, ny, tokens[4]);
|
---|
402 | }
|
---|
403 | }
|
---|
404 |
|
---|
405 | // Copie d'objets
|
---|
406 | else if (kw == "copy") {
|
---|
407 | if(tokens.size()<2) {
|
---|
408 | cout<<"Usage: copy name_from name_to"<<endl;return(0);
|
---|
409 | }
|
---|
410 | mObjMgr->CopyObj(tokens[0],tokens[1]);
|
---|
411 | }
|
---|
412 |
|
---|
413 |
|
---|
414 | // >>>>>>>>>>> Affichage des objets
|
---|
415 | else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") ) {
|
---|
416 | if (tokens.size() < 1) { cout << "Usage: disp/surf/imag nameobj [opt]" << endl; return(0); }
|
---|
417 | string opt = "n";
|
---|
418 | if (tokens.size() > 1) opt = tokens[1];
|
---|
419 | if (kw == "disp") mObjMgr->DisplayObj(tokens[0], opt);
|
---|
420 | else if (kw == "surf") mObjMgr->DisplaySurf3D(tokens[0], opt);
|
---|
421 | else if (kw == "imag") mObjMgr->DisplayImage(tokens[0], opt);
|
---|
422 | }
|
---|
423 |
|
---|
424 | else if (kw == "nt2d") {
|
---|
425 | if (tokens.size() < 3) {
|
---|
426 | cout << "Usage: nt2d nameobj varx vary [errx erry wt label opt]" << endl;
|
---|
427 | return(0);
|
---|
428 | }
|
---|
429 | while (tokens.size() < 8) tokens.push_back("");
|
---|
430 | string ph = "";
|
---|
431 | mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], ph, tokens[3], tokens[4], ph,
|
---|
432 | tokens[5], tokens[6], tokens[7], false);
|
---|
433 | }
|
---|
434 | else if (kw == "nt3d") {
|
---|
435 | if (tokens.size() < 7) {
|
---|
436 | cout << "Usage: nt3d nameobj varx vary varz [errx erry errz wt label opt]" << endl;
|
---|
437 | return(0);
|
---|
438 | }
|
---|
439 | while (tokens.size() < 10) tokens.push_back("");
|
---|
440 | mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], tokens[3], tokens[4], tokens[5],
|
---|
441 | tokens[6], tokens[7], tokens[8], tokens[9], true);
|
---|
442 | }
|
---|
443 | else if (kw == "vecplot") {
|
---|
444 | if (tokens.size() < 2) {
|
---|
445 | cout << "Usage: vecplot nameVecX nameVecY [opt]" << endl;
|
---|
446 | }
|
---|
447 | while (tokens.size() < 3) tokens.push_back("");
|
---|
448 | mObjMgr->DisplayVector(tokens[0], tokens[1], tokens[2]);
|
---|
449 | }
|
---|
450 |
|
---|
451 | // Obsolete : ne pas virer SVP, cmv 26/7/99
|
---|
452 | else if (kw == "gfd2d") {
|
---|
453 | cout<<"----- gfd2d OBSOLETE: utilisez nt2d -----"<<endl;
|
---|
454 | if(tokens.size()<2)
|
---|
455 | {cout<<"Usage: gfd2d nomobj numvarx erreur=(x y xy) opt"<<endl;
|
---|
456 | return(0);}
|
---|
457 | string numvary = "";
|
---|
458 | string err = "";
|
---|
459 | string opt = "n";
|
---|
460 | if(tokens.size()>2) err = tokens[2];
|
---|
461 | if(tokens.size()>3) opt = tokens[3];
|
---|
462 | mObjMgr->DisplayGFD(tokens[0],tokens[1],numvary,err,opt);
|
---|
463 | }
|
---|
464 | else if (kw == "gfd3d") {
|
---|
465 | cout<<"----- gfd3d OBSOLETE: utilisez nt3d -----"<<endl;
|
---|
466 | if(tokens.size()<3)
|
---|
467 | {cout<<"Usage: gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) opt"<<endl;
|
---|
468 | return(0);}
|
---|
469 | string err = "";
|
---|
470 | string opt = "n";
|
---|
471 | if(tokens.size()>3) err = tokens[3];
|
---|
472 | if(tokens.size()>4) opt = tokens[4];
|
---|
473 | mObjMgr->DisplayGFD(tokens[0],tokens[1],tokens[2],err,opt);
|
---|
474 | }
|
---|
475 |
|
---|
476 | // >>>>>>>>>>> Trace de fonctions
|
---|
477 | else if ( (kw == "func") ) {
|
---|
478 | if (tokens.size() < 4) { cout << "Usage: func f(x) xmin xmax npt [opt]" << endl; return(0); }
|
---|
479 | string opt = "";
|
---|
480 | if (tokens.size() > 4) opt = tokens[4];
|
---|
481 | int np;
|
---|
482 | double xmin, xmax;
|
---|
483 | np = 100;
|
---|
484 | xmin = 0.; xmax = 1.;
|
---|
485 | np = atoi(tokens[3].c_str());
|
---|
486 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
487 | string nom = "";
|
---|
488 | mObjMgr->GetServiceObj()->PlotFunc(tokens[0], nom, xmin, xmax, np, opt);
|
---|
489 | }
|
---|
490 | else if ( (kw == "funcff") ) {
|
---|
491 | if (tokens.size() < 5) { cout << "Usage: funcff C-filename f(x)-name xmin xmax npt [opt]" << endl; return(0); }
|
---|
492 | string opt = "";
|
---|
493 | if (tokens.size() > 5) opt = tokens[5];
|
---|
494 | int np;
|
---|
495 | double xmin, xmax;
|
---|
496 | np = 100;
|
---|
497 | xmin = 0.; xmax = 1.;
|
---|
498 | np = atoi(tokens[4].c_str());
|
---|
499 | xmin = atof(tokens[2].c_str()); xmax = atof(tokens[3].c_str());
|
---|
500 | string nom = "";
|
---|
501 | mObjMgr->GetServiceObj()->PlotFuncFrCFile(tokens[0], tokens[1], nom, xmin, xmax, np, opt);
|
---|
502 | }
|
---|
503 | else if ( (kw == "func2d") ) {
|
---|
504 | if (tokens.size() < 7) {
|
---|
505 | cout << "Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [opt]" << endl;
|
---|
506 | return(0);
|
---|
507 | }
|
---|
508 | int npx, npy;
|
---|
509 | double xmin, xmax;
|
---|
510 | double ymin, ymax;
|
---|
511 | npx = npy = 50;
|
---|
512 | xmin = 0.; xmax = 1.;
|
---|
513 | ymin = 0.; ymax = 1.;
|
---|
514 | npx = atoi(tokens[3].c_str());
|
---|
515 | npy = atoi(tokens[6].c_str());
|
---|
516 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
517 | ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());
|
---|
518 | string opt = "";
|
---|
519 | if (tokens.size() > 7) opt = tokens[7];
|
---|
520 | string nom = "";
|
---|
521 | mObjMgr->GetServiceObj()->PlotFunc2D(tokens[0], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
|
---|
522 | }
|
---|
523 | else if ( (kw == "func2dff") ) {
|
---|
524 | if (tokens.size() < 8) {
|
---|
525 | cout << "Usage: func2d C-filename F(x,y)-name xmax nptx ymin ymax npty [opt]" << endl;
|
---|
526 | return(0);
|
---|
527 | }
|
---|
528 | int npx, npy;
|
---|
529 | double xmin, xmax;
|
---|
530 | double ymin, ymax;
|
---|
531 | npx = npy = 50;
|
---|
532 | xmin = 0.; xmax = 1.;
|
---|
533 | ymin = 0.; ymax = 1.;
|
---|
534 | npx = atoi(tokens[4].c_str());
|
---|
535 | npy = atoi(tokens[7].c_str());
|
---|
536 | xmin = atof(tokens[2].c_str()); xmax = atof(tokens[3].c_str());
|
---|
537 | ymin = atof(tokens[5].c_str()); ymax = atof(tokens[6].c_str());
|
---|
538 | string opt = "";
|
---|
539 | if (tokens.size() > 8) opt = tokens[8];
|
---|
540 | string nom = "";
|
---|
541 | mObjMgr->GetServiceObj()->PlotFunc2DFrCFile(tokens[0], tokens[1], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
|
---|
542 | }
|
---|
543 |
|
---|
544 | // >>>>>>>>>>> Trace d'expressions de N_Tuple, StarList, etc ...
|
---|
545 | else if (kw == "plot2d" ) {
|
---|
546 | if (tokens.size() < 3) {
|
---|
547 | cout << "Usage: plot2d nameobj expx expy [expcut opt loop_par]" << endl;
|
---|
548 | return(0);
|
---|
549 | }
|
---|
550 | string errx = ""; string erry = "";
|
---|
551 | if (tokens.size() < 4) tokens.push_back("1");
|
---|
552 | while (tokens.size() < 6) tokens.push_back("");
|
---|
553 | srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],errx,erry,tokens[3],tokens[4],tokens[5]);
|
---|
554 | }
|
---|
555 |
|
---|
556 | else if (kw == "plot2de" ) { // Plot2D avec les erreurs
|
---|
557 | if (tokens.size() < 5) {
|
---|
558 | cout << "Usage: plot2de nameobj expx expy experrx experry [expcut opt loop_par]" << endl;
|
---|
559 | return(0);
|
---|
560 | }
|
---|
561 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
562 | while (tokens.size() < 8) tokens.push_back("");
|
---|
563 | srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4],
|
---|
564 | tokens[5],tokens[6],tokens[7]);
|
---|
565 | }
|
---|
566 |
|
---|
567 | else if (kw == "plot2dw" ) { // Plot2d avec poids
|
---|
568 | if (tokens.size() < 4) {
|
---|
569 | cout << "Usage: plot2dw nomobj expx expy expwt [expcut opt loop_par]" << endl;
|
---|
570 | return(0);
|
---|
571 | }
|
---|
572 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
573 | while (tokens.size() < 7) tokens.push_back("");
|
---|
574 | srvo->DisplayPoints2DW(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]);
|
---|
575 | }
|
---|
576 | else if (kw == "plot3d" ) {
|
---|
577 | if (tokens.size() < 4) {
|
---|
578 | cout << "Usage: plot3d nomobj expx expy expz [expcut opt loop_par]" << endl;
|
---|
579 | return(0);
|
---|
580 | }
|
---|
581 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
582 | while (tokens.size() < 7) tokens.push_back("");
|
---|
583 | srvo->DisplayPoints3D(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]);
|
---|
584 | }
|
---|
585 |
|
---|
586 | else if (kw == "projh1d" ) {
|
---|
587 | if (tokens.size() < 3) {
|
---|
588 | cout << "Usage: projh1d nomh1 nomobj expx [expwt expcut opt loop_par]" << endl;
|
---|
589 | return(0);
|
---|
590 | }
|
---|
591 | if (tokens.size() < 4) tokens.push_back("1.");
|
---|
592 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
593 | while (tokens.size() < 7) tokens.push_back("");
|
---|
594 | srvo->ProjectH1(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] );
|
---|
595 | }
|
---|
596 |
|
---|
597 |
|
---|
598 | // Projection dans histogrammes
|
---|
599 | else if (kw == "projh2d" ) {
|
---|
600 | if (tokens.size() < 4) {
|
---|
601 | cout << "Usage: projh2d nomh2 nomobj expx expy [expwt expcut opt loop_par]" << endl;
|
---|
602 | return(0);
|
---|
603 | }
|
---|
604 | if (tokens.size() < 5) tokens.push_back("1.");
|
---|
605 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
606 | while (tokens.size() < 8) tokens.push_back("");
|
---|
607 | srvo->ProjectH2(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
|
---|
608 | tokens[6], tokens[7] );
|
---|
609 | }
|
---|
610 |
|
---|
611 | else if (kw == "projprof" ) {
|
---|
612 | if (tokens.size() < 4) {
|
---|
613 | cout << "Usage: projprof nomprof nomobj expx expy [expwt expcut opt loop_par]" << endl;
|
---|
614 | return(0);
|
---|
615 | }
|
---|
616 | if (tokens.size() < 5) tokens.push_back("1.");
|
---|
617 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
618 | while (tokens.size() < 8) tokens.push_back("");
|
---|
619 | srvo->ProjectHProf(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
|
---|
620 | tokens[6], tokens[7] );
|
---|
621 | }
|
---|
622 |
|
---|
623 | // Projection dans vector/matrix
|
---|
624 | else if (kw == "fillvec" ) {
|
---|
625 | if (tokens.size() < 4) {
|
---|
626 | cout << "Usage: fillvec nomvec nomobj expx expv [expcut opt loop_par]" << endl;
|
---|
627 | return(0);
|
---|
628 | }
|
---|
629 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
630 | while (tokens.size() < 7) tokens.push_back("");
|
---|
631 | srvo->FillVect(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] );
|
---|
632 | }
|
---|
633 |
|
---|
634 | else if (kw == "fillmtx" ) {
|
---|
635 | if (tokens.size() < 5) {
|
---|
636 | cout << "Usage: fillmtx nommtx nomobj expx expy expv [expcut opt loop_par]" << endl;
|
---|
637 | return(0);
|
---|
638 | }
|
---|
639 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
640 | while (tokens.size() < 8) tokens.push_back("");
|
---|
641 | srvo->FillMatx(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
|
---|
642 | tokens[6], tokens[7] );
|
---|
643 | }
|
---|
644 |
|
---|
645 | // Remplissage NTuple,Vecteurs, ... , boucle de NTuple
|
---|
646 | else if (kw == "ntfrascii" ) {
|
---|
647 | if(tokens.size() < 2) {
|
---|
648 | cout<<"Usage: ntfrascii nt_name file_name [def_init_val]"<<endl;
|
---|
649 | return(0);
|
---|
650 | }
|
---|
651 | double def_val = 0.;
|
---|
652 | if(tokens.size()>=3) def_val = atof(tokens[2].c_str());
|
---|
653 | srvo->NtFromASCIIFile(tokens[0],tokens[1],def_val);
|
---|
654 | }
|
---|
655 |
|
---|
656 | else if (kw == "fillnt" ) {
|
---|
657 | if (tokens.size() < 5) {
|
---|
658 | cout << "Usage: fillnt nameobj expx expy expz expt [expcut ntname loop_par]" << endl;
|
---|
659 | return(0);
|
---|
660 | }
|
---|
661 | while (tokens.size() < 8) tokens.push_back("");
|
---|
662 | srvo->FillNT(tokens[0],tokens[1],tokens[2], tokens[3], tokens[4], tokens[5], tokens[6], tokens[7] );
|
---|
663 | }
|
---|
664 |
|
---|
665 | else if (kw == "ntloop" ) {
|
---|
666 | if (tokens.size() < 3) {
|
---|
667 | cout << "Usage: ntloop nameobj fname funcname [ntname loop_par ]" << endl;
|
---|
668 | return(0);
|
---|
669 | }
|
---|
670 | while (tokens.size() < 5) tokens.push_back("");
|
---|
671 | srvo->FillNTFrCFile(tokens[0],tokens[1], tokens[2], tokens[3], tokens[4]);
|
---|
672 | }
|
---|
673 |
|
---|
674 | else if (kw == "ntexpcfile" ) {
|
---|
675 | if (tokens.size() < 3) {
|
---|
676 | cout << "Usage: ntexpcfile nameobj fname funcname" << endl;
|
---|
677 | return(0);
|
---|
678 | }
|
---|
679 | srvo->PrepareNTExpressionCFile(tokens[0],tokens[1], tokens[2]);
|
---|
680 | }
|
---|
681 |
|
---|
682 | else if (kw == "exptovec" ) {
|
---|
683 | if (tokens.size() < 3) {
|
---|
684 | cout << "Usage: exptovec nomvec nameobj expx [expcut opt loop_par]" << endl;
|
---|
685 | return(0);
|
---|
686 | }
|
---|
687 | while (tokens.size() < 6) tokens.push_back("");
|
---|
688 | srvo->ExpressionToVector(tokens[1],tokens[2],tokens[3],tokens[0],tokens[4],tokens[5]);
|
---|
689 | }
|
---|
690 |
|
---|
691 | else if (kw == "fillgd1" ) {
|
---|
692 | if (tokens.size() < 5) {
|
---|
693 | cout << "Usage: fillgd1 nomgfd nomobj expx expy experry [expcut loop_par] " << endl;
|
---|
694 | return(0);
|
---|
695 | }
|
---|
696 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
697 | if (tokens.size() < 7) tokens.push_back("");
|
---|
698 | string expy = "";
|
---|
699 | srvo->FillGFD(tokens[1],tokens[2], expy, tokens[3], tokens[4], tokens[5], tokens[0]);
|
---|
700 | }
|
---|
701 |
|
---|
702 | else if (kw == "fillgd2" ) {
|
---|
703 | if (tokens.size() < 6) {
|
---|
704 | cout << "Usage: fillgd2 nomgfd nomobj expx expy expz experrz [expcut loop_par]" << endl;
|
---|
705 | return(0);
|
---|
706 | }
|
---|
707 | if (tokens.size() < 7) tokens.push_back("1");
|
---|
708 | if (tokens.size() < 8) tokens.push_back("");
|
---|
709 | srvo->FillGFD(tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6], tokens[0], tokens[7]);
|
---|
710 | }
|
---|
711 |
|
---|
712 | else if (kw == "gdfrvec" ) {
|
---|
713 | if(tokens.size()<3) {
|
---|
714 | cout<<"Usage: gdfrvec namegfd X Y\n"
|
---|
715 | <<" gdfrvec namegfd X Y"
|
---|
716 | <<" gdfrvec namegfd X Y ! EY\n"
|
---|
717 | <<" gdfrvec namegfd X Y Z\n"
|
---|
718 | <<" gdfrvec namegfd X Y Z EZ"<<endl;
|
---|
719 | return(0);
|
---|
720 | }
|
---|
721 | while(tokens.size()<5) tokens.push_back("!");
|
---|
722 | srvo->FillGFDfrVec(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4]);
|
---|
723 | }
|
---|
724 |
|
---|
725 |
|
---|
726 | else {
|
---|
727 | cerr << "PIABaseExecutor::Do() Erreur - Commande " << kw << " inconuue ! " << endl;
|
---|
728 | return(-1);
|
---|
729 | }
|
---|
730 |
|
---|
731 | return(0);
|
---|
732 | }
|
---|
733 |
|
---|
734 | // Fonction pour enregistrer le Help des Widgets et Windows de piapp
|
---|
735 | static void RegisterPIGraphicsHelp(PIACmd* piac);
|
---|
736 |
|
---|
737 | /* --Methode-- */
|
---|
738 | void PIABaseExecutor::RegisterCommands()
|
---|
739 | {
|
---|
740 | string kw, usage;
|
---|
741 | kw = "loadmodule";
|
---|
742 | usage = "To load and initialize modules \n Usage: loadmodule fnameso modulename";
|
---|
743 | usage += "\n Related commands: link";
|
---|
744 | mpiac->RegisterCommand(kw, usage, this, "External Modules");
|
---|
745 | kw = "link";
|
---|
746 | usage = "Dynamic linking of compiled user functions \n Usage: link fnameso f1 [f2 f3]";
|
---|
747 | usage += "\n fnameso: Shared-object file name, f1,f2,f3 : User function names ";
|
---|
748 | usage += "\n Related commands: call loadmodule linkff2";
|
---|
749 | mpiac->RegisterCommand(kw, usage, this, "External Modules");
|
---|
750 | kw = "linkff2";
|
---|
751 | usage = "Dynamic linking of compiled user functions (Set 2)\n Usage: linkff2 fnameso f1 [f2 f3]";
|
---|
752 | usage += "\n fnameso: Shared-object file name, f1,f2,f3 : User function names ";
|
---|
753 | usage += "\n Related commands: call link loadmodule";
|
---|
754 | mpiac->RegisterCommand(kw, usage, this, "External Modules");
|
---|
755 | kw = "call";
|
---|
756 | usage = "Dynamically linked user function call \n Usage: call userf [arg1 arg2 ...]";
|
---|
757 | usage += "\n User function : f(vector<string>& args)";
|
---|
758 | usage += "\n Related commands: link";
|
---|
759 | mpiac->RegisterCommand(kw, usage, this, "External Modules");
|
---|
760 |
|
---|
761 | kw = "zone";
|
---|
762 | usage = "To Divide the Graphic window \n Usage: zone [nx=1 ny=1]";
|
---|
763 | usage += "\n Related commands: newwin";
|
---|
764 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
765 | kw = "newwin";
|
---|
766 | usage = "To Create a New Graphic window, with zones \n Usage: newwin nx ny";
|
---|
767 | usage += "\n Related commands: zone";
|
---|
768 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
769 | kw = "stacknext";
|
---|
770 | usage = "Displays the next widget on stack window \n Usage: stacknext";
|
---|
771 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
772 |
|
---|
773 | kw = "graphicatt";
|
---|
774 | usage = "To change default graphic options \n Usage: graphicatt att_list \n";
|
---|
775 | usage += "att_list=def back to default values, Example: gratt red,circlemarker5";
|
---|
776 | usage += "\n ------------------ Graphic attribute list ------------------ \n";
|
---|
777 | usage += ">> Colors: defcol black white grey red blue green yellow \n";
|
---|
778 | usage += " magenta cyan turquoise navyblue orange siennared purple \n";
|
---|
779 | usage += " limegreen gold violet violetred blueviolet darkviolet \n";
|
---|
780 | usage += ">> Lines: defline normalline thinline thickline dashedline thindashedline \n";
|
---|
781 | usage += " thickdashedline dottedline thindottedline thickdottedline \n";
|
---|
782 | usage += ">> Font Att: deffontatt normalfont boldfont italicfont bolditalicfont \n";
|
---|
783 | usage += " smallfont smallboldfont smallitalicfont smallbolditalicfont \n";
|
---|
784 | usage += " bigfont bigboldfont bigitalicfont bigbolditalicfont \n";
|
---|
785 | usage += " hugefont hugeboldfont hugeitalicfont hugebolditalicfont \n";
|
---|
786 | usage += ">> Font Names: deffont courierfont helveticafont timesfont symbolfont \n";
|
---|
787 | usage += ">> Marker: dotmarker<T> plusmarker<T> crossmarker<T> circlemarker <T> \n";
|
---|
788 | usage += " fcirclemarker<T> boxmarker<T> fboxmarker<T> trianglemarker<T> \n";
|
---|
789 | usage += " ftrianglemarker<T> starmarker<T> fstarmarker<T> \n";
|
---|
790 | usage += " with <T> = 1 3 5 7 9 , Example fboxmarker5 , plusmarker9 ... \n";
|
---|
791 | usage += ">> ColorTables: defcmap grey32 invgrey32 colrj32 colbr32 \n";
|
---|
792 | usage += " grey128 invgrey128 colrj128 colbr128 \n";
|
---|
793 | usage += " midas_pastel midas_heat midas_rainbow3 midas_bluered\n";
|
---|
794 | usage += " midas_bluewhite midas_redwhite \n";
|
---|
795 | usage += " rainbow16 \n";
|
---|
796 | usage += " revcmap : This flag reverses ColorMap indexing \n";
|
---|
797 | usage += ">> ZoomFactors: defzoom zoomx1 zoomx2 zoomx3 zoomx4 zoomx5 \n";
|
---|
798 | usage += " zoom/2 zoom/3 zoom/4 zoom/5 \n";
|
---|
799 | usage += ">> Image centering: centerimg -> Position the image in widget \n";
|
---|
800 | usage += ">> Axes: stdaxes=defaxes=boxaxes simpleaxes boxaxesgrid \n";
|
---|
801 | usage += " fineaxes grid=fineaxesgrid \n";
|
---|
802 | usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n";
|
---|
803 | usage += ">> XYLimits : xylimits -> Forces X-Y limits in 2-D plots \n";
|
---|
804 | usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n";
|
---|
805 | usage += ">> title/notitle or tit/notit -> Toggle Auto AddTitle flag \n";
|
---|
806 | usage += ">> DisplayWindow: next same win stack inset \n";
|
---|
807 | usage += " Related commands: setxylimits setinsetlimits setimgcenter";
|
---|
808 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
809 |
|
---|
810 | kw = "setxylimits";
|
---|
811 | usage = "Define 2-D plot limits \n Usage: setxylimits xmin xmax ymin ymax";
|
---|
812 | usage += "\n Related commands: graphicatt /xylimits";
|
---|
813 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
814 |
|
---|
815 | kw = "setinsetlimits";
|
---|
816 | usage = "Define the display rectangle for drawers added as insets \n";
|
---|
817 | usage += " over existing graphic objects - limits expressed as fraction \n";
|
---|
818 | usage += " graphic object size (0. .. 1.) Xmax at right, YMax top. ";
|
---|
819 | usage += " Usage: setinsetlimits xmin xmax ymin ymax";
|
---|
820 | usage += "\n Related commands: graphicatt /inset";
|
---|
821 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
822 |
|
---|
823 | kw = "setimgcenter";
|
---|
824 | usage = "Define image center postion \n Usage: setimgcenter xc yc";
|
---|
825 | usage += "\n Related commands: graphicatt /centerimg";
|
---|
826 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
827 |
|
---|
828 | kw = "addtext";
|
---|
829 | usage = "Adds a text string to the current graphic object";
|
---|
830 | usage += "\n at the specified position (+ color and font attributes) ";
|
---|
831 | usage += "\n The Base/AxesDrawer is used to handle added text strings" ;
|
---|
832 | usage += "\n Alt<Z> to remove added elements";
|
---|
833 | usage += "\n Font attribute is common with axes";
|
---|
834 | usage += "\n Usage: addtext x y TextString [ColFontAtt]";
|
---|
835 | usage += "\n (use quotes '' for multi word text strings) ";
|
---|
836 | usage += "\n Related commands: addline addrect addfrect addcirc addfcirc settitle graphicatt";
|
---|
837 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
838 |
|
---|
839 | kw = "addline";
|
---|
840 | usage = "Adds a line to the current graphic object";
|
---|
841 | usage += "\n at the specified position (+ color attribute)";
|
---|
842 | usage += "\n The Base/AxesDrawer is used to handle added lines";
|
---|
843 | usage += "\n Alt<Z> to remove added elements";
|
---|
844 | usage += "\n Usage: addline x1 y1 x2 y2 [ColAtt]";
|
---|
845 | usage += "\n Related commands: addtext addrect addfrect addcirc addfcirc graphicatt";
|
---|
846 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
847 |
|
---|
848 | kw = "addrect";
|
---|
849 | usage = "Adds a rectangle to the current graphic object";
|
---|
850 | usage += "\n between the specified positions (+ color attribute)";
|
---|
851 | usage += "\n The Base/AxesDrawer is used to handle added rectangle";
|
---|
852 | usage += "\n Alt<Z> to remove added elements";
|
---|
853 | usage += "\n Usage: addrect x1 y1 x2 y2 [ColAtt]";
|
---|
854 | usage += "\n Related commands: addtext addline addfrect addcirc addfcirc graphicatt";
|
---|
855 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
856 |
|
---|
857 | kw = "addfrect";
|
---|
858 | usage = "Adds a filled rectangle to the current graphic object";
|
---|
859 | usage += "\n between the specified positions (+ color attribute)";
|
---|
860 | usage += "\n The Base/AxesDrawer is used to handle added rectangle";
|
---|
861 | usage += "\n Alt<Z> to remove added elements";
|
---|
862 | usage += "\n Usage: addfrect x1 y1 x2 y2 [ColAtt]";
|
---|
863 | usage += "\n Related commands: addtext addline addrect addcirc addfcirc graphicatt";
|
---|
864 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
865 |
|
---|
866 | kw = "addcirc";
|
---|
867 | usage = "Adds a circle to the current graphic object";
|
---|
868 | usage += "\n with the specified center and radius (+ color attribute)";
|
---|
869 | usage += "\n The Base/AxesDrawer is used to handle added circles";
|
---|
870 | usage += "\n Alt<Z> to remove added elements";
|
---|
871 | usage += "\n Usage: addcirc xcenter ycenter radius [ColAtt]";
|
---|
872 | usage += "\n Related commands: addtext addline addfrect addfrect addfcirc graphicatt";
|
---|
873 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
874 |
|
---|
875 | kw = "addfcirc";
|
---|
876 | usage = "Adds a filled circle to the current graphic object";
|
---|
877 | usage += "\n with the specified center and radius (+ color attribute)";
|
---|
878 | usage += "\n The Base/AxesDrawer is used to handle added circles";
|
---|
879 | usage += "\n Alt<Z> to remove added elements";
|
---|
880 | usage += "\n Usage: addcirc xcenter ycenter radius [ColAtt]";
|
---|
881 | usage += "\n Related commands: addtext addline addfrect addfrect addcirc graphicatt";
|
---|
882 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
883 |
|
---|
884 | kw = "settitle";
|
---|
885 | usage = "Set the title string (top title / bottom title) for the current graphic object";
|
---|
886 | usage += "\n Usage: settitle TopTitle [BottomTitle] [fontAtt]";
|
---|
887 | usage += "\n Related commands: addtext graphicatt";
|
---|
888 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
|
---|
889 |
|
---|
890 | RegisterPIGraphicsHelp(mpiac);
|
---|
891 |
|
---|
892 | kw = "openfits";
|
---|
893 | usage = "Loads a FITS file into an Image<T> \n Usage: openfits filename";
|
---|
894 | usage += "\n Related commands: savefits openppf";
|
---|
895 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
896 | kw = "savefits";
|
---|
897 | usage = "Save an object into a FITS file \n Usage: savefits nameobj filename";
|
---|
898 | usage += "\n Related commands: openfits saveall";
|
---|
899 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
900 | kw = "openppf";
|
---|
901 | usage = "Reads all objects from a PPF file \n Usage: openppf filename";
|
---|
902 | usage += "\n Related commands: saveall openfits";
|
---|
903 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
904 | kw = "saveobjs";
|
---|
905 | usage = "Saves objects with names matching a pattern (x?y*) into a PPF file \n";
|
---|
906 | usage += "Usage: saveobjs nameobjpattern filename";
|
---|
907 | usage += "\n Related commands: saveall openppf savefits";
|
---|
908 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
909 | kw = "saveall";
|
---|
910 | usage = "Saves all objects into a PPF file \n Usage: saveall filename";
|
---|
911 | usage += "\n Related commands: saveobj openppf savefits";
|
---|
912 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
913 | kw = "ntfrascii";
|
---|
914 | usage = "Fills an existing NTuple from ASCII table file";
|
---|
915 | usage += "\n Usage: ntfrascii nt_name file_name [def_init_val]";
|
---|
916 | usage += "\n Related commands: ntloop fillnt ";
|
---|
917 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
918 |
|
---|
919 |
|
---|
920 | kw = "print";
|
---|
921 | usage = "Prints an object \n Usage: print nameobj";
|
---|
922 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
923 |
|
---|
924 | kw = "mkdir";
|
---|
925 | usage = "Create a directory";
|
---|
926 | usage += "\n Usage: mkdir dirname [true]";
|
---|
927 | usage += "\n if second argument==true, the directory's KeepOld attribute is set to true";
|
---|
928 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
929 | kw = "rmdir";
|
---|
930 | usage = "Removes an empty directory";
|
---|
931 | usage += "\n Usage: remove dirname";
|
---|
932 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
933 | kw = "cd";
|
---|
934 | usage = "Change current directory";
|
---|
935 | usage += "\n Usage: cd [dirname]";
|
---|
936 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
937 | kw = "pwd";
|
---|
938 | usage = "Prints current directory";
|
---|
939 | usage += "\n Usage: pwd";
|
---|
940 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
941 | kw = "listdirs";
|
---|
942 | usage = "Prints the list of directories";
|
---|
943 | usage += "\n Usage: listdirs [patt=*] \n patt : * , ? ";
|
---|
944 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
945 | kw = "listobjs";
|
---|
946 | usage = "Prints the list of objects (Alias: ls)";
|
---|
947 | usage += "\n Usage: listobjs [patt=*] \n patt : /*/x?y* ... ";
|
---|
948 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
949 | kw = "rename";
|
---|
950 | usage = "Rename an object (Alias: mv) \n Usage: rename nameobj namenew";
|
---|
951 | usage += "\n Related commands: del delobjs";
|
---|
952 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
953 | kw = "copy";
|
---|
954 | usage = "Copy objects \n";
|
---|
955 | usage +=" Usage: copy name_from name_to";
|
---|
956 | usage += "\n Related commands: new...";
|
---|
957 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
958 | kw = "del";
|
---|
959 | usage = "Deletes an object (Alias: rm) \n Usage: del nameobj [nameobj2 ...]";
|
---|
960 | usage += "\n Related commands: delobjs rename";
|
---|
961 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
962 | kw = "delobjs";
|
---|
963 | usage = "Delete a set of objects with names matching a pattern (x?y*)";
|
---|
964 | usage += "\n Usage: delobjs nameobjpattern \n";
|
---|
965 | usage += "\n Related commands: del rename";
|
---|
966 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
967 |
|
---|
968 | kw = "newh1d";
|
---|
969 | usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin";
|
---|
970 | usage += "\n Related commands: newh2d newprof[e] newnt newgfd ";
|
---|
971 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
972 | kw = "newh2d";
|
---|
973 | usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny";
|
---|
974 | usage += "\n Related commands: newh1d newprof[e] newnt newgfd ";
|
---|
975 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
976 | kw = "newprof";
|
---|
977 | usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]";
|
---|
978 | usage += "\n Errors represent the data spread in the X bin ";
|
---|
979 | usage += "\n Related commands: newh1d newh2d newprofe newnt newgfd ";
|
---|
980 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
981 | kw = "newprofe";
|
---|
982 | usage = "Creates a profile histogramm \n Usage: newprofe name xmin xmax nbin [ymin ymax]";
|
---|
983 | usage += "\n Errors represent the error on the data mean in the X bin ";
|
---|
984 | usage += "\n Related commands: newh1d newh2d newprof newnt newgfd ";
|
---|
985 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
986 | kw = "newnt";
|
---|
987 | usage = "Creates a ntuple \n Usage: newnt name v1 v2 v3 .. vn";
|
---|
988 | usage += "\n newnt name nvar";
|
---|
989 | usage += "\n Related commands: newh1d newh2d newprof[e] newgfd ";
|
---|
990 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
991 | kw = "newgfd";
|
---|
992 | usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]";
|
---|
993 | usage += "\n Related commands: newh1d newh2d newprof[e] newnt ";
|
---|
994 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
995 | kw = "newvec";
|
---|
996 | usage = "Creates (and optionaly fills) a vector \n Usage: newvec name size [f(i) [dopt] ] ";
|
---|
997 | usage += "\n Related commands: newmtx";
|
---|
998 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
999 | kw = "newmtx";
|
---|
1000 | usage = "Creates (and optionaly fills) a matrix \n";
|
---|
1001 | usage +=" Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) [dopt] ] ";
|
---|
1002 | usage += "\n Related commands: newvec";
|
---|
1003 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
1004 |
|
---|
1005 | kw = "disp";
|
---|
1006 | usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]";
|
---|
1007 | usage += "\n Related commands: surf nt2d nt3d vecplot";
|
---|
1008 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
1009 | kw = "imag";
|
---|
1010 | usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]";
|
---|
1011 | usage += "\n Related commands: disp surf nt2d nt3d vecplot";
|
---|
1012 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
1013 | kw = "surf";
|
---|
1014 | usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]";
|
---|
1015 | usage += "\n Related commands: disp nt2d nt3d vecplot";
|
---|
1016 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
1017 | kw = "nt2d";
|
---|
1018 | usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple ";
|
---|
1019 | usage += "\n Usage : nt2d nameobj varx vary [errx erry wt label graphic_attributes]";
|
---|
1020 | usage += "\n Related commands: disp surf nt3d gfd2d vecplot";
|
---|
1021 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
1022 | kw = "nt3d";
|
---|
1023 | usage = "Displays 3D-Points (X-Y-Z) [with error-bars / Weight / Label ] from an NTuple ";
|
---|
1024 | usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz wt label graphic_attributes]";
|
---|
1025 | usage += "\n Related commands: disp surf nt2d gfd3d ";
|
---|
1026 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
1027 | kw = "vecplot";
|
---|
1028 | usage = "Displays Points (X-Y) with coordinates defined by two vectors ";
|
---|
1029 | usage += "\n Usage : vecplot nameVecX nameVecY [graphic_attributes]";
|
---|
1030 | usage += "\n Related commands: disp nt2d ";
|
---|
1031 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
1032 |
|
---|
1033 | // Ceci est maintenant obsolete, on garde pour info.
|
---|
1034 | kw = "gfd2d";
|
---|
1035 | usage = "Displays Points (X-Y) with error-bars from a GeneralFit Data ";
|
---|
1036 | usage += "\n Usage : gfd2d nameobj numvarx erreur=(x y xy) [graphic_attributes]";
|
---|
1037 | usage += "\n Related commands: gfd3d nt2d nt3d ";
|
---|
1038 | usage += "\n ----- OBSOLETE: utilisez nt2d -----";
|
---|
1039 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
1040 | kw = "gfd3d";
|
---|
1041 | usage = "Displays 3D-Points (X-Y-Z) with error-bars from a GeneralFit Data ";
|
---|
1042 | usage += "\n Usage : gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) [graphic_attributes]";
|
---|
1043 | usage += "\n Related commands: gfd2d nt2d nt3d ";
|
---|
1044 | usage += "\n ----- OBSOLETE: utilisez nt3d -----";
|
---|
1045 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
1046 |
|
---|
1047 | kw = "func";
|
---|
1048 | usage = "Displays a function y=f(x) (Fills a vector with function values)";
|
---|
1049 | usage += "\n Usage: func f(x) xmin xmax npt [graphic_attributes]";
|
---|
1050 | usage += "\n Related commands: funcff func2d func2dff ";
|
---|
1051 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
1052 | kw = "funcff";
|
---|
1053 | usage = "Displays a function y=f(x) from a C-file (Fills a vector with function values)";
|
---|
1054 | usage += "\n Usage: funcff C-FileName FunctionName xmin xmax npt [graphic_attributes]";
|
---|
1055 | usage += "\n Related commands: func func2d func2dff ";
|
---|
1056 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
1057 | kw = "func2d";
|
---|
1058 | usage = "Displays a function z=f(x,y) (Fills a matrix with function values)";
|
---|
1059 | usage += "\n Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [graphic_attributes]";
|
---|
1060 | usage += "\n Related commands: func";
|
---|
1061 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
1062 | kw = "func2dff";
|
---|
1063 | usage = "Displays a function z=f(x,y) from a C-file (Fills a matrix with function values)";
|
---|
1064 | usage += "\n Usage: func2dff C-FileName FunctionName xmin xmax nptx ymin ymax npty [graphic_attributes]";
|
---|
1065 | usage += "\n Related commands: func funcff func2d ";
|
---|
1066 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
1067 |
|
---|
1068 | kw = "ObjectExpressions";
|
---|
1069 | usage = "Any mathematical expression (math.h) with object variables can be used";
|
---|
1070 | usage += "\n ------ Object Variable names (double) -------- ";
|
---|
1071 | usage += "\n- NTuple: ntuple variable names";
|
---|
1072 | usage += "\n- Histo1D/HProf: i,x,val,err";
|
---|
1073 | usage += "\n- Histo2D: i,j,x,y,val,err";
|
---|
1074 | usage += "\n- Vector/Matrix: n,r,c,val,real,imag,mod,phas";
|
---|
1075 | usage += "\n- TArray: n,x,y,z,t,u,val,real,imag,mod,phas";
|
---|
1076 | usage += "\n- Image: i,j,x,y,val(=pix)";
|
---|
1077 | usage += "\n- GeneralFitData: x0,ex0 x1,ex1 ... xn,exn y,ey ok";
|
---|
1078 | usage += "\n- LocalMap/SphereThetaPhi/SphereHEALPix: ";
|
---|
1079 | usage += "\n- i,k,val,real,imag,mod,phas,teta,phi";
|
---|
1080 | usage += "\n- FITS Binary/ASCII table: fits column names";
|
---|
1081 | usage += "\n ------ Other parameters -------- ";
|
---|
1082 | usage += "\nLoop parameters can be specified as I1[:I2[:DI]] for(int i=I1; i<I2; i+=DI)";
|
---|
1083 | usage += "\nThe default Cut() expression in true (=1) for all";
|
---|
1084 | usage += "\n\n Related commands: plot2d plot2de plot2dw plot3d ";
|
---|
1085 | usage += "\n projh1d projh2d projprof fillvec fillmtx ";
|
---|
1086 | usage += "\n fillnt fillgd1 fillgd2 ntloop exptovec ... ";
|
---|
1087 | mpiac->RegisterCommand(kw, usage, NULL, "Expr. Plotting");
|
---|
1088 | kw = "plot2d";
|
---|
1089 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) --- Object Variable names (double) :";
|
---|
1090 | usage += "\n Usage: plot2d nameobj f_X() g_Y() [f_Cut() graphic_attributes loop_param]";
|
---|
1091 | usage += "\n Related commands: plot2de plot2dw plot3d ObjectExpressions ...";
|
---|
1092 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1093 | kw = "plot2de";
|
---|
1094 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with error bars eX/Y=f_ErrX/Y(Object) ";
|
---|
1095 | usage += "\n Usage: plot2de nameobj f_X() g_Y() f_ErrX() f_ErrY() [f_Cut() graphic_attributes loop_param]";
|
---|
1096 | usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
|
---|
1097 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1098 | kw = "plot2dw";
|
---|
1099 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with Weight W=h(Object) ";
|
---|
1100 | usage += "\n Usage: plot2dw nameobj f_X() g_Y() h_Wt() [Cut() graphic_attributes loop_param]";
|
---|
1101 | usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
|
---|
1102 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1103 | kw = "plot3d";
|
---|
1104 | usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs ";
|
---|
1105 | usage += "\n Usage: plot3d nameobj f_X() g_Y() h_Z() [Cut() graphic_attributes loop_param]";
|
---|
1106 | usage += "\n Related commands: plot2d plot2dw plot2de plot3d ObjectExpressions ...";
|
---|
1107 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1108 |
|
---|
1109 | kw = "projh1d";
|
---|
1110 | usage = "Projects X=f(Object) with weight WT=h(Object) into a 1D histogram ";
|
---|
1111 | usage += "\n Usage: projh1d nameh1d nameobj f_X() [h_WT()=1. Cut() graphic_attributes loop_param]";
|
---|
1112 | usage += "\n Histo1D nameh1d is created if necessary ";
|
---|
1113 | usage += "\n Related commands: projh2d projprof ObjectExpressions ...";
|
---|
1114 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1115 | kw = "projh2d";
|
---|
1116 | usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a 2D histogram ";
|
---|
1117 | usage += "\n Usage: projh2d nameh2d nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
|
---|
1118 | usage += "\n Histo2D nameh2d is created if necessary ";
|
---|
1119 | usage += "\n Related commands: projh1d projprof ObjectExpressions ...";
|
---|
1120 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1121 | kw = "projprof";
|
---|
1122 | usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a profile histogram ";
|
---|
1123 | usage += "\n Usage: projprof nameprof nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
|
---|
1124 | usage += "\n HProf nameprof is created if necessary ";
|
---|
1125 | usage += "\n Related commands: projh1d projh2d ObjectExpressions ...";
|
---|
1126 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1127 | kw = "fillvec";
|
---|
1128 | usage = "Fills a Vector V((int)(f_X(Object)+0.5)) = h_V(Object) ";
|
---|
1129 | usage += "\n Usage: fillvec namevec nameobj f_X() h_V() [Cut() graphic_attributes loop_param]";
|
---|
1130 | usage += "\n Related commands: fillmtx fillnt ObjectExpressions ...";
|
---|
1131 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1132 | kw = "fillmtx";
|
---|
1133 | usage = "Fills a Matrix M(Line=g_Y(Object)+0.5, Col=f_X(Object)+0.5)) = h_V(Object) ";
|
---|
1134 | usage += "\n Usage: fillvec namevec nameobj f_X() g_Y() h_V() [Cut() graphic_attributes loop_param]";
|
---|
1135 | usage += "\n Related commands: fillvec fillnt ObjectExpressions ...";
|
---|
1136 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1137 |
|
---|
1138 | kw = "fillnt";
|
---|
1139 | usage = "Creates and Fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
|
---|
1140 | usage += "\n Usage: fillnt nameobj f_X() g_Y() h_Z() k_T() [Cut() nameNt loop_param]";
|
---|
1141 | usage += "\n Related commands: ntloop plot2d projh1d projh2d projprof ";
|
---|
1142 | usage += "\n Related commands: fillvec fillmtx ntloop exptovec fillgd1 fillgd2 ObjectExpressions ...";
|
---|
1143 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1144 |
|
---|
1145 | kw = "ntloop";
|
---|
1146 | usage = "Loops over an Object NTupleInterface calling a function from a C-file \n";
|
---|
1147 | usage += "and optionaly fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
|
---|
1148 | usage += "\n Usage: ntloop nameobj CFileName FuncName [NtupleName loop_param]";
|
---|
1149 | usage += "\n Related commands: fillvec fillmtx fillnt fillgd1 fillgd2 exptovec ObjectExpressions ...";
|
---|
1150 | usage += "\n Related commands: ntexpcfile fillnt";
|
---|
1151 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1152 |
|
---|
1153 | kw = "ntexpcfile";
|
---|
1154 | usage = "Creates a C-File with declarations suitable to be used for ntloop";
|
---|
1155 | usage += "\n Usage: ntexpcfile nameobj CFileName FuncName ";
|
---|
1156 | usage += "\n Related commands: ntloop";
|
---|
1157 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1158 |
|
---|
1159 | kw = "exptovec";
|
---|
1160 | usage = "Creates and Fills a Vector with X=f(Object)";
|
---|
1161 | usage += "\n Usage: exptovec namevec nameobj f_X() [Cut() graphic_attributes loop_param]";
|
---|
1162 | usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
|
---|
1163 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1164 | kw = "fillgd1";
|
---|
1165 | usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), ErrY=h(...))";
|
---|
1166 | usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_ErrY() [Cut() loop_param]";
|
---|
1167 | usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
|
---|
1168 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1169 | kw = "fillgd2";
|
---|
1170 | usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), Z=h(...)) ErrZ=k(...)";
|
---|
1171 | usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_Z() k_ErrZ() [Cut() loop_param]";
|
---|
1172 | usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
|
---|
1173 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1174 | kw = "gdfrvec";
|
---|
1175 | usage = "Fills a GeneralFitData with vectors X,Y,Z,EZ";
|
---|
1176 | usage += "\n Usage: gdfrvec namegfd X Y";
|
---|
1177 | usage += "\n Usage: gdfrvec namegfd X Y ! EY";
|
---|
1178 | usage += "\n Usage: gdfrvec namegfd X Y Z";
|
---|
1179 | usage += "\n Usage: gdfrvec namegfd X Y Z EZ";
|
---|
1180 | usage += "\n Related commands: fillgd1 fillgd2 ...";
|
---|
1181 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
1182 |
|
---|
1183 | }
|
---|
1184 |
|
---|
1185 | /* --Methode-- */
|
---|
1186 | int PIABaseExecutor::LinkUserFuncs(string& fnameso, string& func1, string& func2, string& func3)
|
---|
1187 | // string& func4, string& func5)
|
---|
1188 | {
|
---|
1189 | string cmd;
|
---|
1190 |
|
---|
1191 | if (dynlink) delete dynlink; dynlink = NULL;
|
---|
1192 | usfmap.clear();
|
---|
1193 |
|
---|
1194 | dynlink = new PDynLinkMgr(fnameso, true);
|
---|
1195 | if (dynlink == NULL) {
|
---|
1196 | string sn = fnameso;
|
---|
1197 | cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur ouverture SO " << sn << endl;
|
---|
1198 | return(2);
|
---|
1199 | }
|
---|
1200 |
|
---|
1201 | int nok=0;
|
---|
1202 | // on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
|
---|
1203 | // DlUserProcFunction f = NULL;
|
---|
1204 | DlFunction f = NULL;
|
---|
1205 | if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
|
---|
1206 | // f = (DlUserProcFunction) dlsym(dlhandle, func1.c_str());
|
---|
1207 | f = dynlink->GetFunction(func1);
|
---|
1208 | if (f) { nok++; usfmap[func1] = f; }
|
---|
1209 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func1 << endl;
|
---|
1210 |
|
---|
1211 | if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
|
---|
1212 | // f = (DlUserProcFunction) dlsym(dlhandle, func2.c_str());
|
---|
1213 | f = dynlink->GetFunction(func2);
|
---|
1214 | if (f) { nok++; usfmap[func2] = f; }
|
---|
1215 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func2 << endl;
|
---|
1216 |
|
---|
1217 | if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
|
---|
1218 | // f = (DlUserProcFunction) dlsym(dlhandle, func3.c_str());
|
---|
1219 | f = dynlink->GetFunction(func3);
|
---|
1220 | if (f) { nok++; usfmap[func3] = f; }
|
---|
1221 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func3 << endl;
|
---|
1222 |
|
---|
1223 | /* Pb compile g++ 2.7.2
|
---|
1224 | if ((func4.length() < 1) || (func4 == "-") || (func4 == ".") ) goto fin;
|
---|
1225 | // f = (DlUserProcFunction) dlsym(dlhandle, func4.c_str());
|
---|
1226 | f = dynlink->GetFunction(func4);
|
---|
1227 | if (f) { nok++; usfmap[func4] = f; }
|
---|
1228 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func4 << endl;
|
---|
1229 |
|
---|
1230 | if ((func5.length() < 1) || (func5 == "-") || (func5 == ".") ) goto fin;
|
---|
1231 | // f = (DlUserProcFunction) dlsym(dlhandle, func5.c_str());
|
---|
1232 | f = dynlink->GetFunction(func5);
|
---|
1233 | if (f) { nok++; usfmap[func5] = f; }
|
---|
1234 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func5 << endl;
|
---|
1235 | */
|
---|
1236 | fin:
|
---|
1237 | if (nok < 1) { if (dynlink) delete dynlink; dynlink = NULL; return(3); }
|
---|
1238 | else return(0);
|
---|
1239 | }
|
---|
1240 |
|
---|
1241 | /* --Methode-- */
|
---|
1242 | int PIABaseExecutor::LinkUserFuncs2(string& fnameso, string& func1, string& func2, string& func3)
|
---|
1243 | {
|
---|
1244 | string cmd;
|
---|
1245 |
|
---|
1246 | if (dynlink2) delete dynlink2; dynlink2 = NULL;
|
---|
1247 | usfmap2.clear();
|
---|
1248 |
|
---|
1249 | dynlink2 = new PDynLinkMgr(fnameso, true);
|
---|
1250 | if (dynlink2 == NULL) {
|
---|
1251 | string sn = fnameso;
|
---|
1252 | cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur ouverture SO " << sn << endl;
|
---|
1253 | return(2);
|
---|
1254 | }
|
---|
1255 |
|
---|
1256 | int nok=0;
|
---|
1257 | // on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
|
---|
1258 | // DlUserProcFunction f = NULL;
|
---|
1259 | DlFunction f = NULL;
|
---|
1260 | if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
|
---|
1261 | f = dynlink2->GetFunction(func1);
|
---|
1262 | if (f) { nok++; usfmap2[func1] = f; }
|
---|
1263 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func1 << endl;
|
---|
1264 |
|
---|
1265 | if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
|
---|
1266 | f = dynlink2->GetFunction(func2);
|
---|
1267 | if (f) { nok++; usfmap2[func2] = f; }
|
---|
1268 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func2 << endl;
|
---|
1269 |
|
---|
1270 | if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
|
---|
1271 | f = dynlink2->GetFunction(func3);
|
---|
1272 | if (f) { nok++; usfmap2[func3] = f; }
|
---|
1273 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func3 << endl;
|
---|
1274 |
|
---|
1275 | fin:
|
---|
1276 | if (nok < 1) { if (dynlink2) delete dynlink2; dynlink2 = NULL; return(3); }
|
---|
1277 | else return(0);
|
---|
1278 | }
|
---|
1279 |
|
---|
1280 | /* Nouvelle-Fonction */
|
---|
1281 | void RegisterPIGraphicsHelp(PIACmd* piac)
|
---|
1282 | {
|
---|
1283 | string kw,grp,usage;
|
---|
1284 |
|
---|
1285 | grp = "Graphics";
|
---|
1286 |
|
---|
1287 | kw = "PIImage";
|
---|
1288 | usage = "Manages the display of a 2-D array (P2DArrayAdapter) as an image \n";
|
---|
1289 | usage += "and controls a zoom widget, as well as a global image view widget \n";
|
---|
1290 | usage += ">>>> Mouse controls : \n";
|
---|
1291 | usage += "o Button-1: Display current coordinates and pixel value\n";
|
---|
1292 | usage += " Position the cursor an refresh the zoom widget\n";
|
---|
1293 | usage += "o Button-2: Defines an image zone and positions the cursor \n";
|
---|
1294 | usage += "o Button-3: Moves the viewed portion of the array inside the window \n";
|
---|
1295 | usage += ">>>> Keyboard controls : \n";
|
---|
1296 | usage += "o <Alt>R : Refresh display \n";
|
---|
1297 | usage += "o <Alt>O : Shows the PIImageTools (image display parameter controls) \n";
|
---|
1298 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of overlayed graphics (Drawers)) \n";
|
---|
1299 | usage += "o <Alt>V : Copy/Paste / Text paste at the current cursor position \n";
|
---|
1300 | usage += "o <Alt>C : Copy/Paste / Copies the selected regions content as text in the copy/paste buffer \n";
|
---|
1301 | usage += "o <Alt>X : Show/Hide the Cut Window \n";
|
---|
1302 | usage += "o <Alt>Z : Removes signs overlayed on image (Drawer 0) \n";
|
---|
1303 | usage += "o Cursor keys : Moves the image cursor \n";
|
---|
1304 | piac->RegisterHelp(kw, usage, grp);
|
---|
1305 |
|
---|
1306 | kw = "PIScDrawWdg";
|
---|
1307 | usage = "Manages display of 2-D drawers with interactive zoom \n";
|
---|
1308 | usage += ">>>> Mouse controls : \n";
|
---|
1309 | usage += "o Button-1: Display current coordinates \n";
|
---|
1310 | usage += "o Button-2: Defines a rectangle for zoom \n";
|
---|
1311 | usage += "o Button-3: Defines a rectangle for Text-Info (<Alt>I) \n";
|
---|
1312 | usage += ">>>> Keyboard controls : \n";
|
---|
1313 | usage += "o <Alt>R : Refresh display \n";
|
---|
1314 | usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n";
|
---|
1315 | usage += " Specific controls for 2-D histograms \n";
|
---|
1316 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
|
---|
1317 | usage += " Drawer 0 manages the axes, as well as the added text \n";
|
---|
1318 | usage += "o <Alt>V : Copy/Paste / Text paste at the current position \n";
|
---|
1319 | usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n";
|
---|
1320 | usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n";
|
---|
1321 | usage += "o <Alt>M : Activate/Deactivate a measurement cursor on Button-1\n";
|
---|
1322 | usage += "o <Alt>L : Deactivate DX,DY print (see below)\n";
|
---|
1323 | usage += ">>>> Mouse + Keyboard controls : \n";
|
---|
1324 | usage += "o Button-1 + <Alt>K : Set (reset) the reference point for DX,DY print \n";
|
---|
1325 | piac->RegisterHelp(kw, usage, grp);
|
---|
1326 |
|
---|
1327 | kw = "PIDraw3DWdg";
|
---|
1328 | usage = "Manages display of 3-D objects (drawers) \n";
|
---|
1329 | usage += ">>>> Mouse controls : \n";
|
---|
1330 | usage += "o Button-2: Rotates the observer (camera) around object \n";
|
---|
1331 | usage += "o Shift-Button-2: Rotates object with camera fixed \n";
|
---|
1332 | usage += " The object rotation mode can be assigned to Button-2 with <Alt>S \n";
|
---|
1333 | usage += "o Button-3: Zoom control (Camera distance And/Or view angle) \n";
|
---|
1334 | usage += ">>>> Keyboard controls : \n";
|
---|
1335 | usage += "o <Alt>R : Resets the 3-D view and refreshes the display \n";
|
---|
1336 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
|
---|
1337 | usage += "o <Alt>O : = <Alt>G \n";
|
---|
1338 | usage += "o <Alt>V : Copy/Paste / Text paste at the current position (Drawer 0)\n";
|
---|
1339 | usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n";
|
---|
1340 | usage += "o <Alt>A : Activate/Deactivate axes drawing \n";
|
---|
1341 | usage += "o <Alt>S : Activate/Deactivate object rotation mode on Button-2 \n";
|
---|
1342 | piac->RegisterHelp(kw, usage, grp);
|
---|
1343 |
|
---|
1344 | kw = "Windows";
|
---|
1345 | usage = "Objects can be displayed in different windows, or overlayed on the \n";
|
---|
1346 | usage += "previous display. The graphics attributes next,win,stack,same control \n";
|
---|
1347 | usage += "the display window. \n";
|
---|
1348 | usage += "o GraphicWindow : This is the default mode (gr_att=next)\n";
|
---|
1349 | usage += " Graphic windows can be divided int zones. Object is displayed \n";
|
---|
1350 | usage += " in the next available position, removing a previously displayed \n";
|
---|
1351 | usage += " widget if necessary \n";
|
---|
1352 | usage += "o Window : An object is displayed in its own window (gr_att= win) \n";
|
---|
1353 | usage += "o StackWindow : multpile widgets can be stacked in a StackWindow (gr_att= stack) \n";
|
---|
1354 | usage += " A single widget is displayed a any time. Different widgets in a StackWindow \n";
|
---|
1355 | usage += " can be displayed using the stacknext command, as well as the StackTools item \n";
|
---|
1356 | usage += " in the Tools menu (from Menubar). An automatic cyclic display mode can also \n";
|
---|
1357 | usage += " be activated using the StackTools menu (Blink) \n";
|
---|
1358 | usage += "o Most objects can be also be displayed overlayed \n";
|
---|
1359 | usage += " on the last displayed widget (gr_att= same) \n";
|
---|
1360 | usage += "o The overlay can be on a selected rectangle of the \n";
|
---|
1361 | usage += " last displayed widget (gr_att= inset) - See setinsetlimits\n";
|
---|
1362 | usage += "\n Related commands: newwin zone stacknext graphicatt setinsetlimits";
|
---|
1363 | piac->RegisterHelp(kw, usage, grp);
|
---|
1364 |
|
---|
1365 | kw = "PIConsole";
|
---|
1366 | usage = "Text output area and command editing window (console) \n";
|
---|
1367 | usage += ">>>> Mouse controls : \n";
|
---|
1368 | usage += "o Button-1: Rectangle selection for copy/paste \n";
|
---|
1369 | usage += "o Button-2: Paste text in the command editing line \n";
|
---|
1370 | usage += "o Button-3: activate display option menu \n";
|
---|
1371 | usage += ">>>> Keyboard controls : \n";
|
---|
1372 | usage += "o <Alt>O : activate display option menu \n";
|
---|
1373 | usage += "o <Alt>V : Paste text in the command editing line \n";
|
---|
1374 | usage += "o <Alt>A : Selection of the whole window for copy \n";
|
---|
1375 | usage += "o <Alt>L : Command history (List of command history buffer) \n";
|
---|
1376 | usage += "o <Ctl>A : Command editing -> Goto the beginning of line \n";
|
---|
1377 | usage += "o <Ctl>E : Command editing -> Goto the end of line \n";
|
---|
1378 | usage += "o <Ctl>K : Command editing -> Clear to the end of line \n";
|
---|
1379 | usage += "o <Ctl>C : Command editing -> Clear the line \n";
|
---|
1380 | usage += "o Cursor left,right : Command editing -> Move cursor \n";
|
---|
1381 | usage += "o Cursor Up,Down : recall command from history buffer \n";
|
---|
1382 | usage += "o Backspace,Del : Command editing \n";
|
---|
1383 | usage += "o <Return>,<Enter> : Execute command \n";
|
---|
1384 | piac->RegisterHelp(kw, usage, grp);
|
---|
1385 | }
|
---|