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