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