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