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