[2615] | 1 | #include "sopnamsp.h"
|
---|
[293] | 2 | #include "piacmd.h"
|
---|
| 3 |
|
---|
| 4 | #include <stdio.h>
|
---|
| 5 | #include <stdlib.h>
|
---|
| 6 | #include <math.h>
|
---|
| 7 |
|
---|
| 8 | #include "basexecut.h"
|
---|
| 9 |
|
---|
| 10 | #include "pdlmgr.h"
|
---|
| 11 | #include "ctimer.h"
|
---|
[2263] | 12 | #include "strutilxx.h"
|
---|
[293] | 13 |
|
---|
| 14 | #include "pistdimgapp.h"
|
---|
| 15 | #include "nobjmgr.h"
|
---|
[326] | 16 | #include "servnobjm.h"
|
---|
[2305] | 17 | #include "nomgadapter.h"
|
---|
[2243] | 18 | #include "piyfxdrw.h"
|
---|
[2536] | 19 | #include "pibargraph.h"
|
---|
[2545] | 20 | #include "pitxtdrw.h"
|
---|
[293] | 21 |
|
---|
| 22 | #include "histos.h"
|
---|
| 23 | #include "histos2.h"
|
---|
| 24 | #include "hisprof.h"
|
---|
| 25 | #include "ntuple.h"
|
---|
| 26 | #include "generaldata.h"
|
---|
[769] | 27 |
|
---|
| 28 | #ifdef SANS_EVOLPLANCK
|
---|
[333] | 29 | #include "cvector.h"
|
---|
[769] | 30 | #else
|
---|
| 31 | #include "tvector.h"
|
---|
| 32 | #endif
|
---|
[293] | 33 |
|
---|
| 34 |
|
---|
| 35 | /* --Methode-- */
|
---|
| 36 | PIABaseExecutor::PIABaseExecutor(PIACmd* piac, NamedObjMgr* omg, PIStdImgApp* app)
|
---|
| 37 | {
|
---|
| 38 | mpiac = piac;
|
---|
| 39 | mObjMgr = omg;
|
---|
| 40 | mImgApp = app;
|
---|
[312] | 41 | dynlink = NULL;
|
---|
[1276] | 42 | dynlink2 = NULL;
|
---|
[293] | 43 | RegisterCommands();
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | PIABaseExecutor::~PIABaseExecutor()
|
---|
| 47 | {
|
---|
[1276] | 48 | if (dynlink) delete dynlink;
|
---|
| 49 | if (dynlink2) delete dynlink2;
|
---|
[293] | 50 | }
|
---|
| 51 |
|
---|
| 52 |
|
---|
[2263] | 53 | /* Macro pour tester si flag normalized coordinate est present */
|
---|
| 54 | #define _CkBoolNC_(_jk_) ((tokens.size()>_jk_) && (tokens[_jk_] == "true")) ? true : false;
|
---|
[2755] | 55 |
|
---|
| 56 |
|
---|
[293] | 57 | /* --Methode-- */
|
---|
[1268] | 58 | int PIABaseExecutor::Execute(string& kw, vector<string>& tokens, string& toks)
|
---|
[293] | 59 | {
|
---|
[333] | 60 | Services2NObjMgr* srvo = mObjMgr->GetServiceObj();
|
---|
[293] | 61 | // >>>>> Chargement de modules
|
---|
[2307] | 62 | if (kw == "loadmodule") {
|
---|
[293] | 63 | if (tokens.size() < 2) { cout << "Usage: loadmodule fnameso modulename" << endl; return(0); }
|
---|
| 64 | mpiac->LoadModule(tokens[0], tokens[1]);
|
---|
| 65 | }
|
---|
| 66 | // >>>>>>>>>>> Fenetre graphique , changement d'attributs graphiques
|
---|
| 67 | else if (kw == "zone") {
|
---|
[384] | 68 | while (tokens.size() < 2) tokens.push_back("1");
|
---|
[293] | 69 | int nx, ny;
|
---|
| 70 | nx = ny = 1;
|
---|
| 71 | nx = atoi(tokens[0].c_str()); ny = atoi(tokens[1].c_str());
|
---|
[2494] | 72 | if (mImgApp) {
|
---|
| 73 | mImgApp->LockMutex(); // <ZThread> global event loop synchronisation
|
---|
| 74 | mImgApp->SetZone(nx, ny);
|
---|
| 75 | mImgApp->UnlockMutex(true); // <ZThread> global event loop synchronisation
|
---|
| 76 | }
|
---|
| 77 | }
|
---|
[293] | 78 | else if (kw == "newwin") {
|
---|
[1451] | 79 | int nx=1, ny=1;
|
---|
[2243] | 80 | int sx=0, sy=0;
|
---|
[1451] | 81 | //if(tokens.size() < 2) { cout << "Usage: newwin nx ny" << endl; return(0); }
|
---|
| 82 | if(tokens.size() > 0) nx = atoi(tokens[0].c_str());
|
---|
| 83 | if(tokens.size() > 1) ny = atoi(tokens[1].c_str());
|
---|
[2243] | 84 | if(tokens.size() > 3) {
|
---|
| 85 | sx = atoi(tokens[2].c_str());
|
---|
| 86 | sy = atoi(tokens[3].c_str());
|
---|
| 87 | }
|
---|
[2494] | 88 | if (mImgApp) {
|
---|
| 89 | mImgApp->LockMutex(); // <ZThread> global event loop synchronisation
|
---|
| 90 | mImgApp->CreateGraphWin(nx, ny, sx, sy);
|
---|
| 91 | mImgApp->UnlockMutex(true); // <ZThread> global event loop synchronisation
|
---|
| 92 | }
|
---|
[2243] | 93 | }
|
---|
[2494] | 94 | else if (kw == "stacknext") {
|
---|
| 95 | mImgApp->LockMutex(); // <ZThread> global event loop synchronisation
|
---|
| 96 | mImgApp->StackWinNext();
|
---|
| 97 | mImgApp->UnlockMutex(true); // <ZThread> global event loop synchronisation
|
---|
| 98 | }
|
---|
[553] | 99 | else if (kw == "graphicatt") {
|
---|
| 100 | if (tokens.size() < 1) { cout << "Usage: graphicatt attributes_list (att=def->defaut)" << endl; return(0); }
|
---|
[1971] | 101 | string opts = tokens[0];
|
---|
| 102 | if (tokens.size() > 1)
|
---|
[2089] | 103 | for(unsigned int kt=1; kt<tokens.size(); kt++) { opts += ' '; opts += tokens[kt]; }
|
---|
[1971] | 104 | if (mImgApp) mImgApp->SetDefaultGraphicAttributes(opts);
|
---|
[293] | 105 | }
|
---|
[1971] | 106 | else if (kw == "setaxesatt") {
|
---|
| 107 | if (tokens.size() < 1) { cout << "Usage: setaxesatt attributes_list " << endl; return(0); }
|
---|
| 108 | string opts = tokens[0];
|
---|
| 109 | if (tokens.size() > 1)
|
---|
[2089] | 110 | for(unsigned int kt=1; kt<tokens.size(); kt++) { opts += ' '; opts += tokens[kt]; }
|
---|
[1971] | 111 | if (mImgApp) mImgApp->SetDefaultAxesAttributes(opts);
|
---|
[331] | 112 | }
|
---|
[548] | 113 | else if (kw == "setinsetlimits") {
|
---|
| 114 | if (tokens.size() < 4) { cout << "Usage: setinsetlimits xmin xmax ymin ymax" << endl; return(0); }
|
---|
| 115 | double xmin = atof(tokens[0].c_str());
|
---|
| 116 | double xmax = atof(tokens[1].c_str());
|
---|
| 117 | double ymin = atof(tokens[2].c_str());
|
---|
| 118 | double ymax = atof(tokens[3].c_str());
|
---|
| 119 | mImgApp->SetInsetLimits(xmin, xmax, ymin, ymax);
|
---|
| 120 | }
|
---|
[2243] | 121 | else if (kw == "drpanel") {
|
---|
| 122 | if (tokens.size() < 4) {
|
---|
| 123 | cout << "Usage: drpanel xmin xmax ymin ymax [gratt] [name]" << endl;
|
---|
| 124 | return(0);
|
---|
| 125 | }
|
---|
| 126 | double xmin = atof(tokens[0].c_str());
|
---|
| 127 | double xmax = atof(tokens[1].c_str());
|
---|
| 128 | double ymin = atof(tokens[2].c_str());
|
---|
| 129 | double ymax = atof(tokens[3].c_str());
|
---|
| 130 | char buff[128];
|
---|
[2265] | 131 | sprintf(buff, "axesnone xylimits=%g,%g,%g,%g ", xmin, xmax, ymin, ymax);
|
---|
[2243] | 132 | string sop = buff;
|
---|
| 133 | if (tokens.size() > 4) sop += tokens[4];
|
---|
| 134 | string name;
|
---|
[2265] | 135 | if (tokens.size() > 5) name = tokens[5];
|
---|
[2243] | 136 | PIFuncDrawer* gdr = new PIFuncDrawer(NULL);
|
---|
| 137 | mImgApp->DispScDrawer(gdr, name, sop);
|
---|
| 138 | }
|
---|
[349] | 139 | else if (kw == "addtext") {
|
---|
[2263] | 140 | if (tokens.size() < 3) {
|
---|
| 141 | cout << "Usage: addtext x y txt [colfontatt] [fgnc]" << endl;
|
---|
| 142 | return(0);
|
---|
| 143 | }
|
---|
[349] | 144 | double xp = atof(tokens[0].c_str());
|
---|
| 145 | double yp = atof(tokens[1].c_str());
|
---|
[1642] | 146 | string txt = tokens[2];
|
---|
[1971] | 147 | string sop;
|
---|
| 148 | if (tokens.size() > 3) sop = tokens[3];
|
---|
[2263] | 149 | bool fgnc = _CkBoolNC_(4);
|
---|
| 150 | mImgApp->AddText(txt, xp, yp, sop, fgnc);
|
---|
[349] | 151 | }
|
---|
[2263] | 152 | else if (kw == "addctext") {
|
---|
| 153 | if (tokens.size() < 5) {
|
---|
| 154 | cout << "Usage: addctext x y txt s_up s_dn [colfontatt] [updnfatt] [fgnc] " << endl;
|
---|
| 155 | return(0);
|
---|
| 156 | }
|
---|
| 157 | double xp = atof(tokens[0].c_str());
|
---|
| 158 | double yp = atof(tokens[1].c_str());
|
---|
| 159 | string sop;
|
---|
| 160 | if (tokens.size() > 5) sop = tokens[5];
|
---|
| 161 | string sopfss;
|
---|
| 162 | if (tokens.size() > 6) sopfss = tokens[6];
|
---|
| 163 | bool fgnc = _CkBoolNC_(7);
|
---|
| 164 | mImgApp->AddCompText(tokens[2], tokens[3], tokens[4], xp, yp, sop, sopfss, fgnc);
|
---|
| 165 | }
|
---|
[2243] | 166 | else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect") ||
|
---|
[2638] | 167 | (kw == "addoval") || (kw == "addfoval") ||
|
---|
[2243] | 168 | (kw == "addarrow") ) {
|
---|
[2263] | 169 | if (tokens.size() < 4) {
|
---|
[2638] | 170 | if ( (kw == "addoval") || (kw == "addfoval") )
|
---|
| 171 | cout << "Usage addoval/addfoval/addarrow xc yc dx dy [colatt] [fgnc]" << endl;
|
---|
| 172 | else
|
---|
| 173 | cout << "Usage: addline/addrect/addfrect/addarrow x1 y1 x2 y2 [colatt] [fgnc]" << endl;
|
---|
[2263] | 174 | return(0);
|
---|
| 175 | }
|
---|
[1642] | 176 | double xp1 = atof(tokens[0].c_str());
|
---|
| 177 | double yp1 = atof(tokens[1].c_str());
|
---|
| 178 | double xp2 = atof(tokens[2].c_str());
|
---|
| 179 | double yp2 = atof(tokens[3].c_str());
|
---|
[1971] | 180 | string sop;
|
---|
| 181 | if (tokens.size() > 4) sop = tokens[4];
|
---|
[2263] | 182 | bool fgnc = _CkBoolNC_(5);
|
---|
| 183 | if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, false, fgnc);
|
---|
| 184 | else if (kw == "addarrow") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, true, fgnc);
|
---|
[2638] | 185 | else {
|
---|
| 186 | bool fgfill = ((kw == "addrect") || (kw == "addoval")) ? false : true;
|
---|
| 187 | if ( (kw == "addrect") || (kw == "addfrect") )
|
---|
| 188 | mImgApp->AddRectangle(xp1, yp1, xp2, yp2, sop, fgfill, fgnc);
|
---|
| 189 | else mImgApp->AddOval(xp1, yp1, xp2, yp2, sop, fgfill, fgnc);
|
---|
[1642] | 190 | }
|
---|
[2243] | 191 | }
|
---|
[1642] | 192 | else if ((kw == "addcirc") || (kw == "addfcirc")) {
|
---|
[2263] | 193 | if (tokens.size() < 3) {
|
---|
| 194 | cout << "Usage: addcirc/addfcirc xc yc r [colatt] [fgnc]" << endl;
|
---|
| 195 | return(0);
|
---|
| 196 | }
|
---|
[1642] | 197 | double xc = atof(tokens[0].c_str());
|
---|
| 198 | double yc = atof(tokens[1].c_str());
|
---|
| 199 | double rad = atof(tokens[2].c_str());
|
---|
[1971] | 200 | string sop;
|
---|
| 201 | if (tokens.size() > 3) sop = tokens[3];
|
---|
[2263] | 202 | bool fgnc = _CkBoolNC_(4);
|
---|
[1642] | 203 | bool fgfill = (kw == "addcirc") ? false : true;
|
---|
[2263] | 204 | mImgApp->AddCircle(xc, yc, rad, sop, fgfill, fgnc);
|
---|
[1642] | 205 | }
|
---|
[2265] | 206 | else if ((kw == "addarca") || (kw == "addfarca")) {
|
---|
| 207 | if (tokens.size() < 5) {
|
---|
| 208 | cout << "Usage: addarca/addfarca xc yc r a da [colatt] [fgnc]" << endl;
|
---|
| 209 | return(0);
|
---|
| 210 | }
|
---|
| 211 | double xc = atof(tokens[0].c_str());
|
---|
| 212 | double yc = atof(tokens[1].c_str());
|
---|
| 213 | double rad = atof(tokens[2].c_str());
|
---|
| 214 | double ang = atof(tokens[3].c_str());
|
---|
| 215 | double dang = atof(tokens[4].c_str());
|
---|
| 216 | string sop;
|
---|
| 217 | if (tokens.size() > 5) sop = tokens[5];
|
---|
| 218 | bool fgnc = _CkBoolNC_(6);
|
---|
| 219 | bool fgfill = (kw == "addarca") ? false : true;
|
---|
| 220 | mImgApp->AddArc(xc, yc, rad, ang, dang, sop, fgfill, fgnc);
|
---|
| 221 | }
|
---|
[2243] | 222 | else if (kw == "addmarker") {
|
---|
| 223 | if (tokens.size() < 2) {
|
---|
[2263] | 224 | cout << "Usage: addmarker x y [gratt] [fgnc]" << endl;
|
---|
[2243] | 225 | return(0);
|
---|
| 226 | }
|
---|
| 227 | double xm = atof(tokens[0].c_str());
|
---|
| 228 | double ym = atof(tokens[1].c_str());
|
---|
| 229 | string sop;
|
---|
| 230 | if (tokens.size() > 2) sop = tokens[2];
|
---|
[2263] | 231 | bool fgnc = _CkBoolNC_(3);
|
---|
| 232 | mImgApp->AddCircle(xm, ym, -1, sop, false, fgnc);
|
---|
[2243] | 233 | }
|
---|
| 234 | else if ((kw == "addarc") || (kw == "addfarc") ) {
|
---|
| 235 | if (tokens.size() < 6) {
|
---|
[2263] | 236 | cout << "Usage: addarc/addfarc x1 y1 x2 y2 x3 y3 [gratt] [fgnc]" << endl;
|
---|
[2243] | 237 | return(0);
|
---|
| 238 | }
|
---|
| 239 | double x1 = atof(tokens[0].c_str());
|
---|
| 240 | double y1 = atof(tokens[1].c_str());
|
---|
| 241 | double x2 = atof(tokens[2].c_str());
|
---|
| 242 | double y2 = atof(tokens[3].c_str());
|
---|
| 243 | double x3 = atof(tokens[4].c_str());
|
---|
| 244 | double y3 = atof(tokens[5].c_str());
|
---|
| 245 | string sop;
|
---|
| 246 | if (tokens.size() > 6) sop = tokens[6];
|
---|
[2263] | 247 | bool fgnc = _CkBoolNC_(7);
|
---|
[2243] | 248 | bool fgfill = (kw == "addarc") ? false : true;
|
---|
[2263] | 249 | mImgApp->AddArc(x1, y1, x2, y2, x3, y3, sop, fgfill, fgnc);
|
---|
[2243] | 250 | }
|
---|
[2263] | 251 | else if ((kw == "addpoly") || (kw == "addfpoly")) {
|
---|
| 252 | if (tokens.size() < 1) {
|
---|
| 253 | cout << "Usage: addpoly/addfpoly 'x1,y1 x2,y2 x3,y3 ...' [gratt] [fgnc]" << endl;
|
---|
| 254 | return(0);
|
---|
| 255 | }
|
---|
| 256 | vector<string> sxy;
|
---|
| 257 | vector<double> xpol, ypol;
|
---|
| 258 | double xp, yp;
|
---|
| 259 | FillVStringFrString(tokens[0], sxy);
|
---|
| 260 | for(int jkk=0; jkk<sxy.size(); jkk++) {
|
---|
| 261 | xp = yp = 0;
|
---|
| 262 | if (sscanf(sxy[jkk].c_str(), "%lg,%lg", &xp, &yp) == 2) {
|
---|
| 263 | xpol.push_back(xp);
|
---|
| 264 | ypol.push_back(yp);
|
---|
| 265 | }
|
---|
| 266 | }
|
---|
| 267 | string sop;
|
---|
| 268 | if (tokens.size() > 1) sop = tokens[1];
|
---|
| 269 | bool fgnc = _CkBoolNC_(2);
|
---|
| 270 | bool fgfill = (kw == "addpoly") ? false : true;
|
---|
| 271 | mImgApp->AddPoly(xpol, ypol, sop, fgfill, fgnc);
|
---|
| 272 | }
|
---|
[1642] | 273 |
|
---|
| 274 |
|
---|
[2165] | 275 | else if ((kw == "settitle") || (kw == "addtitle")) {
|
---|
| 276 | if (tokens.size() < 1) { cout << "Usage: settitle/addtitle TopTitle [BotTitle] [fontatt]" << endl; return(0); }
|
---|
[2154] | 277 | if(tokens.size()<2) tokens.push_back("");
|
---|
[2165] | 278 | string gropt;
|
---|
| 279 | if(tokens.size()>2) gropt = tokens[2];
|
---|
| 280 | mImgApp->SetTitle(tokens[0], tokens[1], gropt);
|
---|
[2154] | 281 | }
|
---|
[2165] | 282 |
|
---|
| 283 | else if ((kw == "setaxelabels") || (kw == "addaxelabels")) {
|
---|
| 284 | if (tokens.size() < 2) { cout << "Usage: setaxelabels/addaxelabels xLabel yLabel [fontatt]" << endl; return(0); }
|
---|
| 285 | string gropt;
|
---|
| 286 | if(tokens.size()>2) gropt = tokens[2];
|
---|
| 287 | mImgApp->SetAxeLabels(tokens[0], tokens[1], gropt);
|
---|
| 288 | }
|
---|
[349] | 289 |
|
---|
[293] | 290 | // >>>>>>>>>>> Link dynamique de fonctions C++
|
---|
| 291 | else if (kw == "link" ) {
|
---|
| 292 | if (tokens.size() < 2) { cout << "Usage: link fnameso f1 [f2 f3]" << endl; return(0); }
|
---|
| 293 | string sph = "";
|
---|
| 294 | for(int gg=0; gg<5; gg++) tokens.push_back(sph);
|
---|
| 295 | int rc = LinkUserFuncs(tokens[0], tokens[1], tokens[2], tokens[3]);
|
---|
| 296 | if (rc == 0) cout << "PIABaseExecutor: Link from " << tokens[0] << " OK " << endl;
|
---|
| 297 | }
|
---|
[1276] | 298 | else if (kw == "linkff2" ) {
|
---|
| 299 | if (tokens.size() < 2) { cout << "Usage: linkff2 fnameso f1 [f2 f3]" << endl; return(0); }
|
---|
| 300 | string sph = "";
|
---|
| 301 | for(int gg=0; gg<5; gg++) tokens.push_back(sph);
|
---|
| 302 | int rc = LinkUserFuncs2(tokens[0], tokens[1], tokens[2], tokens[3]);
|
---|
| 303 | if (rc == 0) cout << "PIABaseExecutor: Link2 from " << tokens[0] << " OK " << endl;
|
---|
| 304 | }
|
---|
[293] | 305 | else if (kw == "call" ) {
|
---|
| 306 | if (tokens.size() < 1) { cout << "Usage: call userf [arg1 arg2 ...]" << endl; return(0); }
|
---|
[1276] | 307 | UsFmap::iterator it;
|
---|
| 308 | UsFmap::iterator it1 = usfmap.find(tokens[0]);
|
---|
| 309 | UsFmap::iterator it2 = usfmap2.find(tokens[0]);
|
---|
| 310 | if ((it1 == usfmap.end()) && (it2 == usfmap2.end()) ) {
|
---|
[293] | 311 | cerr << "PIABaseExecutor: No User Function " << tokens[0] << endl;
|
---|
| 312 | return(0);
|
---|
| 313 | }
|
---|
[1276] | 314 | if (it1 == usfmap.end()) it = it2;
|
---|
| 315 | else it = it1;
|
---|
[293] | 316 | cout << "PIABaseExecutor: Call " << tokens[0] << "( ... )" << endl;
|
---|
| 317 | // on est oblige de faire un cast etant donne qu'on
|
---|
| 318 | // utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
|
---|
| 319 | DlUserProcFunction fuf = (DlUserProcFunction)(*it).second;
|
---|
[2494] | 320 | /*DEL----- Plus besoin en multi-thread ? / Reza 06/01/2004
|
---|
[293] | 321 | // On redirige la sortie sur le terminal
|
---|
| 322 | bool red = mImgApp->HasRedirectedStdOutErr();
|
---|
| 323 | mImgApp->RedirectStdOutErr(false);
|
---|
[2494] | 324 | --------DEL */
|
---|
[1276] | 325 | #ifdef SANS_EVOLPLANCK
|
---|
[293] | 326 | TRY {
|
---|
| 327 | tokens.erase(tokens.begin());
|
---|
| 328 | fuf(tokens);
|
---|
| 329 | } CATCH(merr) {
|
---|
| 330 | fflush(stdout);
|
---|
[1276] | 331 | string es = PeidaExc(merr);
|
---|
| 332 | cerr << "\n PIABaseExecutor: Call UserFunc Exception :" << merr << es;
|
---|
[293] | 333 | cout << endl;
|
---|
| 334 | }
|
---|
[1276] | 335 | #else
|
---|
| 336 | try {
|
---|
| 337 | tokens.erase(tokens.begin());
|
---|
| 338 | fuf(tokens);
|
---|
| 339 | }
|
---|
| 340 | catch ( PThrowable & exc ) {
|
---|
| 341 | cerr << "\n PIABaseExecutor: Call / Catched Exception :"
|
---|
| 342 | << (string)typeid(exc).name() << " Msg= "
|
---|
| 343 | << exc.Msg() << endl;
|
---|
| 344 | cout << endl;
|
---|
| 345 | }
|
---|
| 346 | catch ( ... ) {
|
---|
| 347 | cerr << "\n PIABaseExecutor: Call / Catched Exception ... "
|
---|
| 348 | << endl;
|
---|
| 349 | cout << endl;
|
---|
| 350 | }
|
---|
| 351 | #endif
|
---|
[2494] | 352 | /*DEL----- Plus besoin en multi-thread ? / Reza 06/01/2004
|
---|
[293] | 353 | mImgApp->RedirectStdOutErr(red);
|
---|
[2494] | 354 | --------DEL */
|
---|
[293] | 355 | }
|
---|
| 356 |
|
---|
| 357 | // >>>>>>>>>>> lecture/ecriture des objets, gestion des objets
|
---|
| 358 | else if (kw == "openfits" ) {
|
---|
| 359 | if (tokens.size() < 1) { cout << "Usage: openfits file " << endl; return(0); }
|
---|
[331] | 360 | else { string nomobj = ""; mObjMgr->ReadFits(tokens[0], nomobj); }
|
---|
[293] | 361 | }
|
---|
| 362 | else if (kw == "savefits" ) {
|
---|
| 363 | if (tokens.size() < 2) { cout << "Usage: savefits nameobj filename " << endl; return(0); }
|
---|
| 364 | else mObjMgr->SaveFits(tokens[0], tokens[1]);
|
---|
| 365 | }
|
---|
| 366 | else if (kw == "openppf" ) {
|
---|
[2645] | 367 | if (tokens.size()<1) {cout<<"Usage: openppf file [objname1 objname2 ...]"<<endl; return(0); }
|
---|
| 368 | else if (tokens.size()==1) mObjMgr->ReadAll(tokens[0]);
|
---|
| 369 | else mObjMgr->ReadObj(tokens);
|
---|
[293] | 370 | }
|
---|
[2132] | 371 | else if ((kw == "saveobjs") || (kw == "saveppf")) {
|
---|
[333] | 372 | if (tokens.size() < 2) { cout << "Usage: saveobjs patt filename " << endl; return(0); }
|
---|
| 373 | mObjMgr->SaveObjects(tokens[0], tokens[1]);
|
---|
| 374 | }
|
---|
[2669] | 375 | else if (kw == "savelist") {
|
---|
| 376 | if (tokens.size() < 2) {
|
---|
| 377 | cout << "Usage: savelist objname1 [objname2 ...] filename "<<endl;
|
---|
| 378 | return(0);
|
---|
| 379 | }
|
---|
| 380 | mObjMgr->SaveListObjects(tokens);
|
---|
| 381 | }
|
---|
[293] | 382 | else if (kw == "saveall" ) {
|
---|
| 383 | if (tokens.size() < 1) { cout << "Usage: saveall file " << endl; return(0); }
|
---|
| 384 | mObjMgr->SaveAll(tokens[0]);
|
---|
| 385 | }
|
---|
| 386 | else if (kw == "print" ) {
|
---|
| 387 | if (tokens.size() < 1) { cout << "Usage: print nameobj " << endl; return(0); }
|
---|
| 388 | mObjMgr->PrintObj(tokens[0]);
|
---|
| 389 | }
|
---|
[333] | 390 | else if ( (kw == "rename" ) || (kw == "mv") ) {
|
---|
[2132] | 391 | if (tokens.size() < 2) { cout << "Usage: rename/mv nameobj namenew" << endl; return(0); }
|
---|
[293] | 392 | mObjMgr->RenameObj(tokens[0], tokens[1]);
|
---|
| 393 | }
|
---|
[333] | 394 | else if ( (kw == "del" ) || (kw == "rm") ) {
|
---|
[1655] | 395 | if (tokens.size() < 1) { cout << "Usage: del nameobj [nameobj2 ...]" << endl; return(0); }
|
---|
| 396 | if (tokens.size()>0)
|
---|
| 397 | for(uint_4 i=0;i<tokens.size();i++) mObjMgr->DelObj(tokens[i]);
|
---|
[293] | 398 | }
|
---|
| 399 | else if (kw == "delobjs" ) {
|
---|
| 400 | if (tokens.size() < 1) { cout << "Usage: delobjs nomobjpattern (*,?) " << endl; return(0); }
|
---|
| 401 | mObjMgr->DelObjects(tokens[0]);
|
---|
| 402 | }
|
---|
[333] | 403 | else if ( (kw == "listobjs") || (kw == "ls") ) {
|
---|
[331] | 404 | if (tokens.size() < 1) tokens.push_back("*");
|
---|
[2519] | 405 | if (tokens.size() < 2) mObjMgr->ListObjs(tokens[0]);
|
---|
| 406 | else {
|
---|
| 407 | vector<string> olv;
|
---|
| 408 | mObjMgr->GetObjList(tokens[0], olv);
|
---|
| 409 | mpiac->SetVar(tokens[1], olv);
|
---|
| 410 | }
|
---|
[331] | 411 | }
|
---|
[2519] | 412 |
|
---|
[333] | 413 | // Gestion des repertoires
|
---|
| 414 | else if (kw == "mkdir" ) {
|
---|
[344] | 415 | if (tokens.size() < 1) { cout << "Usage: mkdir dirname [true]" << endl; return(0); }
|
---|
| 416 | bool crd = mObjMgr->CreateDir(tokens[0]);
|
---|
| 417 | if ( crd && (tokens.size() > 1) && (tokens[1] == "true") )
|
---|
| 418 | mObjMgr->SetKeepOldDirAtt(tokens[0], true);
|
---|
[333] | 419 | }
|
---|
| 420 | else if (kw == "rmdir" ) {
|
---|
| 421 | if (tokens.size() < 1) { cout << "Usage: rmdir dirname " << endl; return(0); }
|
---|
| 422 | mObjMgr->DeleteDir(tokens[0]);
|
---|
| 423 | }
|
---|
[2132] | 424 | else if (kw == "setdiratt" ) {
|
---|
| 425 | if (tokens.size() < 2) { cout << "Usage: setdiratt dirname true/false" << endl; return(0); }
|
---|
| 426 | if (tokens[1] == "true") mObjMgr->SetKeepOldDirAtt(tokens[0], true);
|
---|
| 427 | else mObjMgr->SetKeepOldDirAtt(tokens[0], false);
|
---|
| 428 | }
|
---|
[333] | 429 | else if (kw == "cd") {
|
---|
| 430 | if (tokens.size() < 1) tokens.push_back("home");
|
---|
| 431 | mObjMgr->SetCurrentDir(tokens[0]);
|
---|
| 432 | }
|
---|
[345] | 433 | else if (kw == "pwd") {
|
---|
| 434 | string dirn;
|
---|
| 435 | mObjMgr->GetCurrentDir(dirn);
|
---|
| 436 | cout << "CurrentDirectory: " << dirn << endl;
|
---|
| 437 | }
|
---|
[333] | 438 | else if (kw == "listdirs") {
|
---|
| 439 | if (tokens.size() < 1) tokens.push_back("*");
|
---|
| 440 | mObjMgr->ListDirs(tokens[0]);
|
---|
| 441 | }
|
---|
[293] | 442 |
|
---|
| 443 | // >>>>>>>>>>> Creation d'histos 1D-2D
|
---|
| 444 | else if (kw == "newh1d") {
|
---|
| 445 | if (tokens.size() < 4) { cout << "Usage: newh1d name xmin xmax nbin" << endl; return(0); }
|
---|
[1091] | 446 | int_4 nbx = 100;
|
---|
| 447 | r_8 xmin = 0., xmax = 1.;
|
---|
[293] | 448 | nbx = atoi(tokens[3].c_str());
|
---|
| 449 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
| 450 | Histo* h = new Histo(xmin, xmax, nbx);
|
---|
| 451 | mObjMgr->AddObj(h, tokens[0]);
|
---|
| 452 | }
|
---|
| 453 | else if (kw == "newh2d") {
|
---|
| 454 | if (tokens.size() < 7) {
|
---|
| 455 | cout << "Usage: newh2d name xmin xmax nbinx ymin ymax nbiny" << endl;
|
---|
| 456 | return(0);
|
---|
| 457 | }
|
---|
[1091] | 458 | int_4 nbx = 50, nby = 50;
|
---|
| 459 | r_8 xmin = 0., xmax = 1.;
|
---|
| 460 | r_8 ymin = 0., ymax = 1.;
|
---|
[293] | 461 | nbx = atoi(tokens[3].c_str());
|
---|
| 462 | nby = atoi(tokens[6].c_str());
|
---|
| 463 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
| 464 | ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());
|
---|
| 465 | Histo2D* h = new Histo2D(xmin, xmax, nbx, ymin, ymax, nby);
|
---|
| 466 | mObjMgr->AddObj(h, tokens[0]);
|
---|
| 467 | }
|
---|
[1035] | 468 | else if (kw == "newprof" || kw == "newprofe") {
|
---|
[293] | 469 | if (tokens.size() < 4)
|
---|
[1035] | 470 | { cout << "Usage: newprof[e] name xmin xmax nbin [ymin ymax]" << endl; return(0); }
|
---|
[1091] | 471 | int_4 nbx = 100;
|
---|
| 472 | r_8 xmin = 0., xmax = 1., ymin = 1., ymax = -1.;
|
---|
[293] | 473 | if(tokens.size() > 5)
|
---|
| 474 | {ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());}
|
---|
| 475 | nbx = atoi(tokens[3].c_str());
|
---|
| 476 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
| 477 | HProf* h = new HProf(xmin, xmax, nbx, ymin, ymax);
|
---|
[1035] | 478 | if(kw == "newprofe") h->SetErrOpt(false);
|
---|
[293] | 479 | mObjMgr->AddObj(h, tokens[0]);
|
---|
| 480 | }
|
---|
[447] | 481 |
|
---|
| 482 | // Creation de NTuple
|
---|
| 483 | else if (kw == "newnt") {
|
---|
| 484 | if(tokens.size() < 2)
|
---|
| 485 | {cout<<"Usage: newnt name v1 v2 ... vn / newnt name nvar"<<endl; return(0);}
|
---|
| 486 | vector<string> varname;
|
---|
| 487 | int nvar = 0;
|
---|
| 488 | const char *c = tokens[1].c_str();
|
---|
| 489 | if(isdigit(c[0])) {
|
---|
| 490 | nvar = atoi(tokens[1].c_str());
|
---|
| 491 | if(nvar<=0 || nvar>=10000)
|
---|
| 492 | {cout<<"newnt name nvar : nvar must be an positive integer<10000"<<endl;
|
---|
| 493 | return(0);}
|
---|
| 494 | for(int i=0;i<nvar;i++) {
|
---|
| 495 | char str[16]; sprintf(str,"%d",i);
|
---|
| 496 | string dum = "v"; dum += str;
|
---|
| 497 | varname.push_back(dum.c_str());
|
---|
| 498 | }
|
---|
| 499 | } else if( islower(c[0]) || isupper(c[0]) ) {
|
---|
[1548] | 500 | for(int i=1;i<(int)tokens.size();i++) {
|
---|
[447] | 501 | varname.push_back(tokens[i].c_str());
|
---|
| 502 | nvar++;
|
---|
| 503 | }
|
---|
| 504 | } else {
|
---|
| 505 | cout<<"newnt name v1 v2 ... vn : name vi must begin by a letter"<<endl
|
---|
| 506 | <<"newnt name nvar : nvar must be an positive integer"<<endl;
|
---|
| 507 | return(0);
|
---|
| 508 | }
|
---|
| 509 | char **noms = new char*[nvar];
|
---|
| 510 | for(int i=0;i<nvar;i++) noms[i] = (char *)varname[i].c_str();
|
---|
| 511 | NTuple* nt = new NTuple(nvar,noms);
|
---|
| 512 | delete [] noms;
|
---|
| 513 | mObjMgr->AddObj(nt,tokens[0]);
|
---|
| 514 | }
|
---|
| 515 |
|
---|
| 516 | // Creation de GeneralFitData
|
---|
[293] | 517 | else if (kw == "newgfd") {
|
---|
| 518 | if (tokens.size() < 3)
|
---|
| 519 | { cout << "Usage: newgfd nvar nalloc [errx(0/1)]" << endl; return(0); }
|
---|
| 520 | int nvar, nalloc, errx=0;
|
---|
| 521 | if (tokens.size() > 3)
|
---|
| 522 | { errx = atoi(tokens[3].c_str()); if(errx>0) errx=1; else errx = 0;}
|
---|
| 523 | nvar = atoi(tokens[1].c_str()); nalloc = atoi(tokens[2].c_str());
|
---|
| 524 | if(nvar>0 && nalloc>0) {
|
---|
| 525 | GeneralFitData* gfd = new GeneralFitData(nvar,nalloc,errx);
|
---|
| 526 | mObjMgr->AddObj(gfd, tokens[0]);
|
---|
| 527 | }
|
---|
| 528 | }
|
---|
| 529 |
|
---|
[333] | 530 | // Creation/remplissage de vecteur et de matrice
|
---|
| 531 | else if (kw == "newvec") {
|
---|
| 532 | if (tokens.size() < 2) {
|
---|
| 533 | cout << "Usage: newvec name size [f(i) dopt] " << endl; return(0);
|
---|
| 534 | }
|
---|
| 535 | int n = atoi(tokens[1].c_str());
|
---|
| 536 | double xmin, xmax;
|
---|
| 537 | xmin = 0.; xmax = n;
|
---|
[357] | 538 | if (tokens.size() < 3) {
|
---|
| 539 | Vector* v = new Vector(n);
|
---|
| 540 | mObjMgr->AddObj(v, tokens[0]);
|
---|
| 541 | }
|
---|
| 542 | else {
|
---|
| 543 | if (tokens.size() < 4) tokens.push_back("");
|
---|
| 544 | mObjMgr->GetServiceObj()->PlotFunc(tokens[2], tokens[0], xmin, xmax, n, tokens[3]);
|
---|
| 545 | }
|
---|
[333] | 546 | }
|
---|
| 547 | else if (kw == "newmtx") {
|
---|
| 548 | if (tokens.size() < 3) {
|
---|
[1917] | 549 | cout << "Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) dopt] " << endl; return(0);
|
---|
[333] | 550 | }
|
---|
| 551 | int nx = atoi(tokens[1].c_str());
|
---|
| 552 | int ny = atoi(tokens[2].c_str());
|
---|
| 553 | double xmin, xmax, ymin, ymax;
|
---|
| 554 | xmin = 0.; xmax = nx;
|
---|
| 555 | ymin = 0.; ymax = ny;
|
---|
[357] | 556 | if (tokens.size() < 4) {
|
---|
| 557 | Matrix* mtx = new Matrix(ny,nx);
|
---|
| 558 | mObjMgr->AddObj(mtx, tokens[0]);
|
---|
| 559 | }
|
---|
| 560 | else {
|
---|
[1971] | 561 | if (tokens.size() < 5) tokens.push_back("next");
|
---|
[357] | 562 | mObjMgr->GetServiceObj()->PlotFunc2D(tokens[3], tokens[0], xmin, xmax, ymin, ymax,
|
---|
| 563 | nx, ny, tokens[4]);
|
---|
| 564 | }
|
---|
[333] | 565 | }
|
---|
[2305] | 566 | // ----- Vecteur/NTuple <> Lignes/variables interpreteur
|
---|
| 567 | // Creation de vecteur depuis le contenu de la ligne
|
---|
| 568 | else if (kw == "line2vec") {
|
---|
| 569 | if (tokens.size() < 2) {
|
---|
| 570 | cout << "Usage: line2vec vecname v0 v1 v2 ... " << endl; return(0);
|
---|
| 571 | }
|
---|
| 572 | int vsz = tokens.size()-1;
|
---|
| 573 | Vector* v = new Vector(vsz);
|
---|
| 574 | for(int kkv=0; kkv<vsz; kkv++) (*v)(kkv) = atof(tokens[kkv+1].c_str());
|
---|
| 575 | mObjMgr->AddObj(v, tokens[0]);
|
---|
| 576 | }
|
---|
| 577 | // Remplissage de NTuple depuis la ligne
|
---|
| 578 | else if (kw == "line2nt") {
|
---|
| 579 | if (tokens.size() < 2) {
|
---|
| 580 | cout << "Usage: line2nt ntname col0 col1 ..." << endl; return(0);
|
---|
| 581 | }
|
---|
| 582 | AnyDataObj* obj;
|
---|
| 583 | obj = mObjMgr->GetObj(tokens[0]);
|
---|
| 584 | if(obj == NULL) {
|
---|
| 585 | cerr << "line2nt Error , No such object " << tokens[0] << endl;
|
---|
| 586 | return(0);
|
---|
| 587 | }
|
---|
| 588 | NTuple* nt = dynamic_cast<NTuple *>(obj);
|
---|
| 589 | if(nt == NULL) {
|
---|
| 590 | cerr << "line2nt Error " << tokens[0] << " not an NTuple ! " << endl;
|
---|
| 591 | return(0);
|
---|
| 592 | }
|
---|
| 593 | if (nt->NbColumns() < 1) {
|
---|
| 594 | cerr << "line2nt Error: NbColumns < 1" << endl;
|
---|
| 595 | return(0);
|
---|
| 596 | }
|
---|
| 597 | r_4* xnt = new r_4[ nt->NbColumns() ];
|
---|
| 598 | int kkx;
|
---|
| 599 | for(kkx=0; kkx<nt->NbColumns(); kkx++) {
|
---|
| 600 | if (kkx < tokens.size()-1) xnt[kkx] = atof(tokens[kkx+1].c_str());
|
---|
| 601 | else xnt[kkx] = 0.;
|
---|
| 602 | }
|
---|
| 603 | nt->Fill(xnt);
|
---|
| 604 | delete[] xnt;
|
---|
| 605 | }
|
---|
| 606 | // Contenu du vecteur vers variable interpreteur
|
---|
| 607 | #define MAXNWORDSO2V 32768
|
---|
| 608 | else if (kw == "vec2var") {
|
---|
| 609 | if (tokens.size() < 2) {
|
---|
| 610 | cout << "Usage: vec2var vecname varname [loop_param start:end:step] " << endl; return(0);
|
---|
| 611 | }
|
---|
| 612 | AnyDataObj* obj;
|
---|
| 613 | obj = mObjMgr->GetObj(tokens[0]);
|
---|
| 614 | if(obj == NULL) {
|
---|
| 615 | cerr << "vec2var Error , No such object " << tokens[0] << endl;
|
---|
| 616 | return(0);
|
---|
| 617 | }
|
---|
| 618 | Vector* v = dynamic_cast<Vector *>(obj);
|
---|
| 619 | if(v == NULL) {
|
---|
| 620 | cerr << "vec2var Error " << tokens[0] << " not a Vector ! " << endl;
|
---|
| 621 | return(0);
|
---|
| 622 | }
|
---|
[2419] | 623 | int_8 kks = 0;
|
---|
| 624 | int_8 kke = v->NElts();
|
---|
| 625 | int_8 kkp = 1;
|
---|
[2305] | 626 | if (tokens.size() > 2) Services2NObjMgr::DecodeLoopParameters(tokens[2], kks, kke, kkp);
|
---|
| 627 | if (kks < 0) kks = 0;
|
---|
[2419] | 628 | if (kke > (int_8)v->NElts()) kke = v->NElts();
|
---|
[2305] | 629 | if (kkp < 1) kkp = 1;
|
---|
| 630 | int nelt = (kke-kks-1)/kkp;
|
---|
| 631 | if (nelt > MAXNWORDSO2V) {
|
---|
| 632 | nelt = MAXNWORDSO2V;
|
---|
| 633 | cout << "vec2var Warning: Only " << nelt
|
---|
| 634 | << " elements will be converted to string" << endl;
|
---|
| 635 | kke = kks+nelt*kkp;
|
---|
| 636 | }
|
---|
| 637 | string v2str;
|
---|
| 638 | char buff[64];
|
---|
| 639 | for(int kkv=kks; kkv<kke; kkv+=kkp) {
|
---|
| 640 | sprintf(buff, "%lg ", (*v)(kkv));
|
---|
| 641 | v2str += buff;
|
---|
| 642 | }
|
---|
| 643 |
|
---|
| 644 | mObjMgr->SetVar(tokens[1], v2str);
|
---|
| 645 | }
|
---|
| 646 | // Une ligne du NTuple/NTupleInterface -> variable interpreteur
|
---|
| 647 | else if ((kw == "ntline2var") || (kw == "ntcol2var")) {
|
---|
| 648 | if (tokens.size() < 3) {
|
---|
| 649 | cout << "Usage: ntline/col2var objname line_number varname" << endl;
|
---|
| 650 | return(0);
|
---|
| 651 | }
|
---|
| 652 | NObjMgrAdapter* oa = mObjMgr->GetObjAdapter(tokens[0]);
|
---|
| 653 | if(oa == NULL) {
|
---|
| 654 | cerr << "ntline/col2var Error , No such object " << tokens[0] << endl;
|
---|
| 655 | return(0);
|
---|
| 656 | }
|
---|
| 657 | bool adel = false;
|
---|
| 658 | NTupleInterface* nti = oa->GetNTupleInterface(adel);
|
---|
| 659 | if(nti == NULL) {
|
---|
| 660 | cerr << "ntline/col2var Error: objet" << tokens[0] << " has no NTupleInterface" << endl;
|
---|
| 661 | return(0);
|
---|
| 662 | }
|
---|
[333] | 663 |
|
---|
[2305] | 664 | if (nti->NbColumns() < 1 || nti->NbLines() < 1) {
|
---|
| 665 | cerr << "ntline/col2var Error: NbColumns or NbLines < 1" << endl;
|
---|
| 666 | return(0);
|
---|
| 667 | }
|
---|
| 668 | string v2str;
|
---|
| 669 | char buff[64];
|
---|
| 670 | if (kw == "ntline2var") {
|
---|
| 671 | int numline = atoi(tokens[1].c_str());
|
---|
| 672 | if ( (numline >= nti->NbLines()) || (numline < 0) ) {
|
---|
| 673 | cerr << "ntline2var Error: numline" << tokens[1] << " out of bounds" << endl;
|
---|
| 674 | return(0);
|
---|
| 675 | }
|
---|
| 676 | r_8* dline = nti->GetLineD(numline);
|
---|
| 677 | for(int kkv=0; kkv<nti->NbColumns(); kkv++) {
|
---|
| 678 | sprintf(buff, "%lg ", dline[kkv]);
|
---|
| 679 | v2str += buff;
|
---|
| 680 | }
|
---|
| 681 | }
|
---|
| 682 | else {
|
---|
| 683 | int numcol = atoi(tokens[1].c_str());
|
---|
| 684 | if ( (numcol >= nti->NbColumns()) || (numcol < 0) ) {
|
---|
| 685 | cerr << "ntcol2var Error: numcol" << tokens[1] << " out of bounds" << endl;
|
---|
| 686 | return(0);
|
---|
| 687 | }
|
---|
[2419] | 688 | int_8 kks = 0;
|
---|
| 689 | int_8 kke = nti->NbLines();
|
---|
| 690 | int_8 kkp = 1;
|
---|
[2305] | 691 | if (tokens.size() > 3) Services2NObjMgr::DecodeLoopParameters(tokens[3], kks, kke, kkp);
|
---|
| 692 | if (kks < 0) kks = 0;
|
---|
[2419] | 693 | if (kke > (int_8)nti->NbLines()) kke = nti->NbLines();
|
---|
[2305] | 694 | if (kkp < 1) kkp = 1;
|
---|
| 695 | int nelt = (kke-kks-1)/kkp;
|
---|
| 696 | if (nelt > MAXNWORDSO2V) {
|
---|
| 697 | nelt = MAXNWORDSO2V;
|
---|
| 698 | cout << "ntcol2var Warning: Only " << nelt
|
---|
| 699 | << " lines " << " will be converted to string" << endl;
|
---|
| 700 | kke = kks+nelt*kkp;
|
---|
| 701 | }
|
---|
| 702 | r_8* dline;
|
---|
| 703 | for(int kkl=kks; kkl<kke; kkl+=kkp) {
|
---|
| 704 | dline = nti->GetLineD(kkl);
|
---|
| 705 | sprintf(buff, "%lg ", dline[numcol]);
|
---|
| 706 | v2str += buff;
|
---|
| 707 | }
|
---|
| 708 | }
|
---|
| 709 | mObjMgr->SetVar(tokens[2], v2str);
|
---|
| 710 | if (adel) delete nti;
|
---|
| 711 | }
|
---|
| 712 |
|
---|
| 713 | // -------------------------------------------------------
|
---|
[455] | 714 | // Copie d'objets
|
---|
[2176] | 715 | else if ( (kw == "copy") || (kw == "cp") ) {
|
---|
[455] | 716 | if(tokens.size()<2) {
|
---|
| 717 | cout<<"Usage: copy name_from name_to"<<endl;return(0);
|
---|
| 718 | }
|
---|
[463] | 719 | mObjMgr->CopyObj(tokens[0],tokens[1]);
|
---|
[455] | 720 | }
|
---|
| 721 |
|
---|
| 722 |
|
---|
[293] | 723 | // >>>>>>>>>>> Affichage des objets
|
---|
[2651] | 724 | else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") || (kw == "imagnav") ) {
|
---|
| 725 | if (tokens.size() < 1) { cout << "Usage: disp/surf/imag/imagnav nameobj [opt]" << endl; return(0); }
|
---|
[1971] | 726 | string opt = "next";
|
---|
[293] | 727 | if (tokens.size() > 1) opt = tokens[1];
|
---|
| 728 | if (kw == "disp") mObjMgr->DisplayObj(tokens[0], opt);
|
---|
| 729 | else if (kw == "surf") mObjMgr->DisplaySurf3D(tokens[0], opt);
|
---|
[2651] | 730 | else if (kw == "imag") mObjMgr->DisplayImage(tokens[0], opt, false);
|
---|
| 731 | else if (kw == "imagnav") mObjMgr->DisplayImage(tokens[0], opt, true);
|
---|
[293] | 732 | }
|
---|
| 733 |
|
---|
| 734 | else if (kw == "nt2d") {
|
---|
[486] | 735 | if (tokens.size() < 3) {
|
---|
| 736 | cout << "Usage: nt2d nameobj varx vary [errx erry wt label opt]" << endl;
|
---|
| 737 | return(0);
|
---|
[293] | 738 | }
|
---|
[486] | 739 | while (tokens.size() < 8) tokens.push_back("");
|
---|
[333] | 740 | string ph = "";
|
---|
[486] | 741 | mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], ph, tokens[3], tokens[4], ph,
|
---|
| 742 | tokens[5], tokens[6], tokens[7], false);
|
---|
[333] | 743 | }
|
---|
[293] | 744 | else if (kw == "nt3d") {
|
---|
[486] | 745 | if (tokens.size() < 7) {
|
---|
| 746 | cout << "Usage: nt3d nameobj varx vary varz [errx erry errz wt label opt]" << endl;
|
---|
| 747 | return(0);
|
---|
[293] | 748 | }
|
---|
[486] | 749 | while (tokens.size() < 10) tokens.push_back("");
|
---|
| 750 | mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], tokens[3], tokens[4], tokens[5],
|
---|
| 751 | tokens[6], tokens[7], tokens[8], tokens[9], true);
|
---|
| 752 | }
|
---|
[1525] | 753 | else if (kw == "vecplot") {
|
---|
| 754 | if (tokens.size() < 2) {
|
---|
| 755 | cout << "Usage: vecplot nameVecX nameVecY [opt]" << endl;
|
---|
[2275] | 756 | return(0);
|
---|
[1525] | 757 | }
|
---|
| 758 | while (tokens.size() < 3) tokens.push_back("");
|
---|
| 759 | mObjMgr->DisplayVector(tokens[0], tokens[1], tokens[2]);
|
---|
| 760 | }
|
---|
[2536] | 761 | else if (kw == "bargraph") {
|
---|
| 762 | if (tokens.size() < 2) {
|
---|
| 763 | cout << "Usage: bargraph gr_opt v1 [v2 ...]" << endl;
|
---|
| 764 | return(0);
|
---|
| 765 | }
|
---|
| 766 | PIBarGraph* bgd = new PIBarGraph;
|
---|
| 767 | for(int k=1; k<tokens.size(); k++)
|
---|
| 768 | bgd->AddBar(atof(tokens[k].c_str()));
|
---|
| 769 | string grname = "BarGraph";
|
---|
| 770 | mImgApp->DispScDrawer(bgd, grname, tokens[0]);
|
---|
| 771 | }
|
---|
[2545] | 772 | else if (kw == "textdrawer") {
|
---|
| 773 | if (tokens.size() < 2) {
|
---|
| 774 | cout << "Usage: textdrawer gr_opt line1 [line2 ...]" << endl;
|
---|
| 775 | return(0);
|
---|
| 776 | }
|
---|
| 777 | PITextDrawer* txd = new PITextDrawer;
|
---|
| 778 | for(int k=1; k<tokens.size(); k++)
|
---|
| 779 | txd->AddLine(tokens[k]);
|
---|
| 780 | string grname = "TextDrawer";
|
---|
| 781 | tokens[0] += " inset";
|
---|
| 782 | mImgApp->DispScDrawer(txd, grname, tokens[0]);
|
---|
| 783 | }
|
---|
[293] | 784 |
|
---|
[339] | 785 | // Obsolete : ne pas virer SVP, cmv 26/7/99
|
---|
[293] | 786 | else if (kw == "gfd2d") {
|
---|
[339] | 787 | cout<<"----- gfd2d OBSOLETE: utilisez nt2d -----"<<endl;
|
---|
[293] | 788 | if(tokens.size()<2)
|
---|
| 789 | {cout<<"Usage: gfd2d nomobj numvarx erreur=(x y xy) opt"<<endl;
|
---|
| 790 | return(0);}
|
---|
| 791 | string numvary = "";
|
---|
| 792 | string err = "";
|
---|
[1971] | 793 | string opt = "next";
|
---|
[293] | 794 | if(tokens.size()>2) err = tokens[2];
|
---|
| 795 | if(tokens.size()>3) opt = tokens[3];
|
---|
| 796 | mObjMgr->DisplayGFD(tokens[0],tokens[1],numvary,err,opt);
|
---|
| 797 | }
|
---|
| 798 | else if (kw == "gfd3d") {
|
---|
[339] | 799 | cout<<"----- gfd3d OBSOLETE: utilisez nt3d -----"<<endl;
|
---|
[293] | 800 | if(tokens.size()<3)
|
---|
| 801 | {cout<<"Usage: gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) opt"<<endl;
|
---|
| 802 | return(0);}
|
---|
| 803 | string err = "";
|
---|
[1971] | 804 | string opt = "next";
|
---|
[293] | 805 | if(tokens.size()>3) err = tokens[3];
|
---|
| 806 | if(tokens.size()>4) opt = tokens[4];
|
---|
| 807 | mObjMgr->DisplayGFD(tokens[0],tokens[1],tokens[2],err,opt);
|
---|
| 808 | }
|
---|
| 809 |
|
---|
| 810 | // >>>>>>>>>>> Trace de fonctions
|
---|
| 811 | else if ( (kw == "func") ) {
|
---|
[1938] | 812 | if(tokens.size()<3) {cout<<"Usage: func f(x) xmin xmax [npt opt]"<<endl; return(0);}
|
---|
| 813 | int np = 100;
|
---|
| 814 | double xmin=0., xmax=1.;
|
---|
| 815 | string opt = "", nom = "";
|
---|
| 816 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
| 817 | if (tokens.size() > 3) np = atoi(tokens[3].c_str());
|
---|
[293] | 818 | if (tokens.size() > 4) opt = tokens[4];
|
---|
[333] | 819 | mObjMgr->GetServiceObj()->PlotFunc(tokens[0], nom, xmin, xmax, np, opt);
|
---|
[293] | 820 | }
|
---|
[326] | 821 | else if ( (kw == "funcff") ) {
|
---|
[1938] | 822 | if (tokens.size()<4) {cout<<"Usage: funcff C-filename f(x)-name xmin xmax [npt opt]"<<endl; return(0);}
|
---|
| 823 | int np = 100;
|
---|
| 824 | double xmin=0., xmax=1.;
|
---|
| 825 | string opt = "", nom = "";
|
---|
| 826 | xmin = atof(tokens[2].c_str()); xmax = atof(tokens[3].c_str());
|
---|
| 827 | if(tokens.size()>4) np = atoi(tokens[4].c_str());
|
---|
| 828 | if(tokens.size()>5) opt = tokens[5];
|
---|
[333] | 829 | mObjMgr->GetServiceObj()->PlotFuncFrCFile(tokens[0], tokens[1], nom, xmin, xmax, np, opt);
|
---|
[326] | 830 | }
|
---|
[293] | 831 | else if ( (kw == "func2d") ) {
|
---|
| 832 | if (tokens.size() < 7) {
|
---|
[357] | 833 | cout << "Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [opt]" << endl;
|
---|
[293] | 834 | return(0);
|
---|
| 835 | }
|
---|
| 836 | int npx, npy;
|
---|
[333] | 837 | double xmin, xmax;
|
---|
| 838 | double ymin, ymax;
|
---|
[293] | 839 | npx = npy = 50;
|
---|
| 840 | xmin = 0.; xmax = 1.;
|
---|
| 841 | ymin = 0.; ymax = 1.;
|
---|
| 842 | npx = atoi(tokens[3].c_str());
|
---|
| 843 | npy = atoi(tokens[6].c_str());
|
---|
| 844 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
| 845 | ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());
|
---|
[357] | 846 | string opt = "";
|
---|
[293] | 847 | if (tokens.size() > 7) opt = tokens[7];
|
---|
[333] | 848 | string nom = "";
|
---|
| 849 | mObjMgr->GetServiceObj()->PlotFunc2D(tokens[0], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
|
---|
[293] | 850 | }
|
---|
[326] | 851 | else if ( (kw == "func2dff") ) {
|
---|
| 852 | if (tokens.size() < 8) {
|
---|
[357] | 853 | cout << "Usage: func2d C-filename F(x,y)-name xmax nptx ymin ymax npty [opt]" << endl;
|
---|
[326] | 854 | return(0);
|
---|
| 855 | }
|
---|
| 856 | int npx, npy;
|
---|
[333] | 857 | double xmin, xmax;
|
---|
| 858 | double ymin, ymax;
|
---|
[326] | 859 | npx = npy = 50;
|
---|
| 860 | xmin = 0.; xmax = 1.;
|
---|
| 861 | ymin = 0.; ymax = 1.;
|
---|
| 862 | npx = atoi(tokens[4].c_str());
|
---|
| 863 | npy = atoi(tokens[7].c_str());
|
---|
| 864 | xmin = atof(tokens[2].c_str()); xmax = atof(tokens[3].c_str());
|
---|
| 865 | ymin = atof(tokens[5].c_str()); ymax = atof(tokens[6].c_str());
|
---|
[357] | 866 | string opt = "";
|
---|
[326] | 867 | if (tokens.size() > 8) opt = tokens[8];
|
---|
[333] | 868 | string nom = "";
|
---|
| 869 | mObjMgr->GetServiceObj()->PlotFunc2DFrCFile(tokens[0], tokens[1], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
|
---|
[326] | 870 | }
|
---|
[293] | 871 |
|
---|
| 872 | // >>>>>>>>>>> Trace d'expressions de N_Tuple, StarList, etc ...
|
---|
| 873 | else if (kw == "plot2d" ) {
|
---|
[357] | 874 | if (tokens.size() < 3) {
|
---|
| 875 | cout << "Usage: plot2d nameobj expx expy [expcut opt loop_par]" << endl;
|
---|
[293] | 876 | return(0);
|
---|
| 877 | }
|
---|
[357] | 878 | string errx = ""; string erry = "";
|
---|
| 879 | if (tokens.size() < 4) tokens.push_back("1");
|
---|
| 880 | while (tokens.size() < 6) tokens.push_back("");
|
---|
| 881 | srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],errx,erry,tokens[3],tokens[4],tokens[5]);
|
---|
| 882 | }
|
---|
| 883 |
|
---|
| 884 | else if (kw == "plot2de" ) { // Plot2D avec les erreurs
|
---|
| 885 | if (tokens.size() < 5) {
|
---|
| 886 | cout << "Usage: plot2de nameobj expx expy experrx experry [expcut opt loop_par]" << endl;
|
---|
| 887 | return(0);
|
---|
[293] | 888 | }
|
---|
[357] | 889 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
| 890 | while (tokens.size() < 8) tokens.push_back("");
|
---|
| 891 | srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4],
|
---|
| 892 | tokens[5],tokens[6],tokens[7]);
|
---|
[293] | 893 | }
|
---|
| 894 |
|
---|
[357] | 895 | else if (kw == "plot2dw" ) { // Plot2d avec poids
|
---|
| 896 | if (tokens.size() < 4) {
|
---|
| 897 | cout << "Usage: plot2dw nomobj expx expy expwt [expcut opt loop_par]" << endl;
|
---|
[333] | 898 | return(0);
|
---|
| 899 | }
|
---|
[357] | 900 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
| 901 | while (tokens.size() < 7) tokens.push_back("");
|
---|
| 902 | srvo->DisplayPoints2DW(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]);
|
---|
[333] | 903 | }
|
---|
[357] | 904 | else if (kw == "plot3d" ) {
|
---|
| 905 | if (tokens.size() < 4) {
|
---|
| 906 | cout << "Usage: plot3d nomobj expx expy expz [expcut opt loop_par]" << endl;
|
---|
[293] | 907 | return(0);
|
---|
| 908 | }
|
---|
[357] | 909 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
| 910 | while (tokens.size() < 7) tokens.push_back("");
|
---|
| 911 | srvo->DisplayPoints3D(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]);
|
---|
[293] | 912 | }
|
---|
| 913 |
|
---|
| 914 | else if (kw == "projh1d" ) {
|
---|
[357] | 915 | if (tokens.size() < 3) {
|
---|
| 916 | cout << "Usage: projh1d nomh1 nomobj expx [expwt expcut opt loop_par]" << endl;
|
---|
[293] | 917 | return(0);
|
---|
| 918 | }
|
---|
[357] | 919 | if (tokens.size() < 4) tokens.push_back("1.");
|
---|
| 920 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
| 921 | while (tokens.size() < 7) tokens.push_back("");
|
---|
| 922 | srvo->ProjectH1(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] );
|
---|
[293] | 923 | }
|
---|
| 924 |
|
---|
[357] | 925 |
|
---|
| 926 | // Projection dans histogrammes
|
---|
[293] | 927 | else if (kw == "projh2d" ) {
|
---|
[357] | 928 | if (tokens.size() < 4) {
|
---|
| 929 | cout << "Usage: projh2d nomh2 nomobj expx expy [expwt expcut opt loop_par]" << endl;
|
---|
[293] | 930 | return(0);
|
---|
| 931 | }
|
---|
[357] | 932 | if (tokens.size() < 5) tokens.push_back("1.");
|
---|
| 933 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
| 934 | while (tokens.size() < 8) tokens.push_back("");
|
---|
| 935 | srvo->ProjectH2(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
|
---|
| 936 | tokens[6], tokens[7] );
|
---|
[293] | 937 | }
|
---|
| 938 |
|
---|
| 939 | else if (kw == "projprof" ) {
|
---|
[357] | 940 | if (tokens.size() < 4) {
|
---|
| 941 | cout << "Usage: projprof nomprof nomobj expx expy [expwt expcut opt loop_par]" << endl;
|
---|
[293] | 942 | return(0);
|
---|
| 943 | }
|
---|
[357] | 944 | if (tokens.size() < 5) tokens.push_back("1.");
|
---|
| 945 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
| 946 | while (tokens.size() < 8) tokens.push_back("");
|
---|
| 947 | srvo->ProjectHProf(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
|
---|
[1091] | 948 | tokens[6], tokens[7] );
|
---|
[357] | 949 | }
|
---|
[293] | 950 |
|
---|
[357] | 951 | // Projection dans vector/matrix
|
---|
| 952 | else if (kw == "fillvec" ) {
|
---|
| 953 | if (tokens.size() < 4) {
|
---|
| 954 | cout << "Usage: fillvec nomvec nomobj expx expv [expcut opt loop_par]" << endl;
|
---|
| 955 | return(0);
|
---|
| 956 | }
|
---|
| 957 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
| 958 | while (tokens.size() < 7) tokens.push_back("");
|
---|
| 959 | srvo->FillVect(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] );
|
---|
[293] | 960 | }
|
---|
| 961 |
|
---|
[357] | 962 | else if (kw == "fillmtx" ) {
|
---|
| 963 | if (tokens.size() < 5) {
|
---|
| 964 | cout << "Usage: fillmtx nommtx nomobj expx expy expv [expcut opt loop_par]" << endl;
|
---|
| 965 | return(0);
|
---|
| 966 | }
|
---|
| 967 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
| 968 | while (tokens.size() < 8) tokens.push_back("");
|
---|
| 969 | srvo->FillMatx(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
|
---|
| 970 | tokens[6], tokens[7] );
|
---|
| 971 | }
|
---|
| 972 |
|
---|
| 973 | // Remplissage NTuple,Vecteurs, ... , boucle de NTuple
|
---|
[447] | 974 | else if (kw == "ntfrascii" ) {
|
---|
| 975 | if(tokens.size() < 2) {
|
---|
| 976 | cout<<"Usage: ntfrascii nt_name file_name [def_init_val]"<<endl;
|
---|
| 977 | return(0);
|
---|
| 978 | }
|
---|
| 979 | double def_val = 0.;
|
---|
| 980 | if(tokens.size()>=3) def_val = atof(tokens[2].c_str());
|
---|
| 981 | srvo->NtFromASCIIFile(tokens[0],tokens[1],def_val);
|
---|
| 982 | }
|
---|
| 983 |
|
---|
[2263] | 984 | #ifndef SANS_EVOLPLANCK
|
---|
| 985 | /* Lecture matrice/vecteur depuis fichier ASCII */
|
---|
| 986 | else if ((kw == "mtxfrascii") || (kw == "vecfrascii") ) {
|
---|
| 987 | if(tokens.size() < 2) {
|
---|
[2289] | 988 | cout<<"Usage: mtxfrascii/vecfrascii mtx/vec_name file_name [CommLine Separator]"<<endl;
|
---|
[2263] | 989 | return(0);
|
---|
| 990 | }
|
---|
| 991 | TMatrix<r_8> mtx;
|
---|
| 992 | TVector<r_8> vec;
|
---|
| 993 | FILE* fip = fopen(tokens[1].c_str(), "r");
|
---|
| 994 | if (fip == NULL) {
|
---|
| 995 | cout << "vec/mtxfrascii: can not open file " << tokens[1] << endl;
|
---|
| 996 | return(0);
|
---|
| 997 | }
|
---|
| 998 | fclose(fip);
|
---|
| 999 | ifstream is(tokens[1].c_str());
|
---|
| 1000 | sa_size_t nr, nc;
|
---|
[2289] | 1001 | char clm = '#';
|
---|
| 1002 | string sep = " \t";
|
---|
| 1003 | if (tokens.size()>2) clm = tokens[2][0];
|
---|
| 1004 | if (tokens.size()>3) sep = tokens[3];
|
---|
[2263] | 1005 | if (kw == "mtxfrascii") {
|
---|
[2289] | 1006 | mtx.ReadASCII(is, nr, nc, clm, sep.c_str());
|
---|
[2263] | 1007 | mObjMgr->AddObj(mtx, tokens[0]);
|
---|
| 1008 | cout << "mtxfrascii: TMatrix<r_8> " << tokens[0] << " read from file "
|
---|
| 1009 | << tokens[1] << endl;
|
---|
| 1010 | }
|
---|
| 1011 | else {
|
---|
[2289] | 1012 | vec.ReadASCII(is, nr, nc, clm, sep.c_str());
|
---|
[2263] | 1013 | mObjMgr->AddObj(vec, tokens[0]);
|
---|
| 1014 | cout << "vecfrascii: TVector<r_8> " << tokens[0] << " read from file "
|
---|
| 1015 | << tokens[1] << endl;
|
---|
| 1016 | }
|
---|
| 1017 | }
|
---|
[2268] | 1018 | else if (kw == "arrtoascii") {
|
---|
| 1019 | if(tokens.size() < 2) {
|
---|
| 1020 | cout<<"Usage: arrtoascii array_name file_name "<<endl;
|
---|
| 1021 | return(0);
|
---|
| 1022 | }
|
---|
| 1023 |
|
---|
| 1024 | AnyDataObj* obj;
|
---|
| 1025 | obj = mObjMgr->GetObj(tokens[0]);
|
---|
| 1026 | if(obj == NULL) {
|
---|
| 1027 | cerr << "arrtoascii Error , No such object " << tokens[0] << endl;
|
---|
| 1028 | return(0);
|
---|
| 1029 | }
|
---|
| 1030 | BaseArray* ba = dynamic_cast<BaseArray *>(obj);
|
---|
| 1031 | if(ba == NULL) {
|
---|
| 1032 | cerr << "arrtoascii Error " << tokens[0] << " not a BaseArray ! " << endl;
|
---|
| 1033 | return(0);
|
---|
| 1034 | }
|
---|
| 1035 | ofstream os(tokens[1].c_str());
|
---|
| 1036 | ba->WriteASCII(os);
|
---|
| 1037 | cout << "arrtoascii: Array " << tokens[0] << " written to file " << tokens[1] << endl;
|
---|
| 1038 | }
|
---|
| 1039 |
|
---|
[2263] | 1040 | #endif
|
---|
| 1041 |
|
---|
[293] | 1042 | else if (kw == "fillnt" ) {
|
---|
[357] | 1043 | if (tokens.size() < 5) {
|
---|
| 1044 | cout << "Usage: fillnt nameobj expx expy expz expt [expcut ntname loop_par]" << endl;
|
---|
[293] | 1045 | return(0);
|
---|
| 1046 | }
|
---|
[357] | 1047 | while (tokens.size() < 8) tokens.push_back("");
|
---|
| 1048 | srvo->FillNT(tokens[0],tokens[1],tokens[2], tokens[3], tokens[4], tokens[5], tokens[6], tokens[7] );
|
---|
[293] | 1049 | }
|
---|
| 1050 |
|
---|
[333] | 1051 | else if (kw == "ntloop" ) {
|
---|
| 1052 | if (tokens.size() < 3) {
|
---|
[357] | 1053 | cout << "Usage: ntloop nameobj fname funcname [ntname loop_par ]" << endl;
|
---|
[333] | 1054 | return(0);
|
---|
| 1055 | }
|
---|
[357] | 1056 | while (tokens.size() < 5) tokens.push_back("");
|
---|
| 1057 | srvo->FillNTFrCFile(tokens[0],tokens[1], tokens[2], tokens[3], tokens[4]);
|
---|
[333] | 1058 | }
|
---|
| 1059 |
|
---|
| 1060 | else if (kw == "ntexpcfile" ) {
|
---|
| 1061 | if (tokens.size() < 3) {
|
---|
| 1062 | cout << "Usage: ntexpcfile nameobj fname funcname" << endl;
|
---|
| 1063 | return(0);
|
---|
| 1064 | }
|
---|
| 1065 | srvo->PrepareNTExpressionCFile(tokens[0],tokens[1], tokens[2]);
|
---|
| 1066 | }
|
---|
| 1067 |
|
---|
[357] | 1068 | else if (kw == "exptovec" ) {
|
---|
| 1069 | if (tokens.size() < 3) {
|
---|
| 1070 | cout << "Usage: exptovec nomvec nameobj expx [expcut opt loop_par]" << endl;
|
---|
[293] | 1071 | return(0);
|
---|
| 1072 | }
|
---|
[357] | 1073 | while (tokens.size() < 6) tokens.push_back("");
|
---|
| 1074 | srvo->ExpressionToVector(tokens[1],tokens[2],tokens[3],tokens[0],tokens[4],tokens[5]);
|
---|
[293] | 1075 | }
|
---|
| 1076 |
|
---|
| 1077 | else if (kw == "fillgd1" ) {
|
---|
| 1078 | if (tokens.size() < 5) {
|
---|
[357] | 1079 | cout << "Usage: fillgd1 nomgfd nomobj expx expy experry [expcut loop_par] " << endl;
|
---|
[293] | 1080 | return(0);
|
---|
| 1081 | }
|
---|
[357] | 1082 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
| 1083 | if (tokens.size() < 7) tokens.push_back("");
|
---|
[293] | 1084 | string expy = "";
|
---|
[357] | 1085 | srvo->FillGFD(tokens[1],tokens[2], expy, tokens[3], tokens[4], tokens[5], tokens[0]);
|
---|
[293] | 1086 | }
|
---|
| 1087 |
|
---|
| 1088 | else if (kw == "fillgd2" ) {
|
---|
| 1089 | if (tokens.size() < 6) {
|
---|
[357] | 1090 | cout << "Usage: fillgd2 nomgfd nomobj expx expy expz experrz [expcut loop_par]" << endl;
|
---|
[293] | 1091 | return(0);
|
---|
| 1092 | }
|
---|
[357] | 1093 | if (tokens.size() < 7) tokens.push_back("1");
|
---|
| 1094 | if (tokens.size() < 8) tokens.push_back("");
|
---|
| 1095 | srvo->FillGFD(tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6], tokens[0], tokens[7]);
|
---|
[293] | 1096 | }
|
---|
| 1097 |
|
---|
[1067] | 1098 | else if (kw == "gdfrvec" ) {
|
---|
| 1099 | if(tokens.size()<3) {
|
---|
| 1100 | cout<<"Usage: gdfrvec namegfd X Y\n"
|
---|
| 1101 | <<" gdfrvec namegfd X Y"
|
---|
| 1102 | <<" gdfrvec namegfd X Y ! EY\n"
|
---|
| 1103 | <<" gdfrvec namegfd X Y Z\n"
|
---|
| 1104 | <<" gdfrvec namegfd X Y Z EZ"<<endl;
|
---|
| 1105 | return(0);
|
---|
| 1106 | }
|
---|
| 1107 | while(tokens.size()<5) tokens.push_back("!");
|
---|
| 1108 | srvo->FillGFDfrVec(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4]);
|
---|
| 1109 | }
|
---|
[293] | 1110 |
|
---|
[2180] | 1111 | // >>>>>>>>>>> Calcul d'expression arithmetique
|
---|
| 1112 | else if ( (kw == "eval") ) {
|
---|
| 1113 | if(tokens.size()<2)
|
---|
| 1114 | {cout<<"Usage: eval resultvarname arithmetic expression...."<<endl; return(0);}
|
---|
| 1115 | string expval = "";
|
---|
| 1116 | for(unsigned int i=1;i<tokens.size();i++) expval+=tokens[i];
|
---|
| 1117 | string resultvarname = "";
|
---|
| 1118 | if(isalpha(tokens[0][0])) resultvarname=tokens[0];
|
---|
| 1119 | mObjMgr->GetServiceObj()->ExpVal(expval,resultvarname);
|
---|
| 1120 | }
|
---|
[293] | 1121 |
|
---|
| 1122 | else {
|
---|
| 1123 | cerr << "PIABaseExecutor::Do() Erreur - Commande " << kw << " inconuue ! " << endl;
|
---|
| 1124 | return(-1);
|
---|
| 1125 | }
|
---|
| 1126 |
|
---|
| 1127 | return(0);
|
---|
| 1128 | }
|
---|
| 1129 |
|
---|
[2755] | 1130 | /* --Methode-- */
|
---|
| 1131 | bool PIABaseExecutor::IsThreadable(string const & keyw)
|
---|
| 1132 | {
|
---|
| 1133 | if ( (keyw == "fillvec") || (keyw == "fillmtx") ||
|
---|
| 1134 | (keyw == "fillnt") || (keyw == "ntloop") ) return true;
|
---|
| 1135 | else if (keyw.substr(0,4) == "func") return true;
|
---|
| 1136 | else {
|
---|
| 1137 | string skw = keyw.substr(0,5);
|
---|
| 1138 | if ( (skw == "plot2") || (skw == "plot3") || (skw == "projh") ) return true;
|
---|
| 1139 | }
|
---|
| 1140 | return false;
|
---|
| 1141 | }
|
---|
| 1142 |
|
---|
[388] | 1143 | // Fonction pour enregistrer le Help des Widgets et Windows de piapp
|
---|
| 1144 | static void RegisterPIGraphicsHelp(PIACmd* piac);
|
---|
| 1145 |
|
---|
[293] | 1146 | /* --Methode-- */
|
---|
| 1147 | void PIABaseExecutor::RegisterCommands()
|
---|
| 1148 | {
|
---|
[2419] | 1149 | string kw, usage, grp;
|
---|
[2465] | 1150 | grp = "External Modules";
|
---|
| 1151 | string gdesc = "Dynamic load (shared object modules) management command group";
|
---|
| 1152 | mpiac->AddHelpGroup(grp, gdesc);
|
---|
[293] | 1153 | kw = "loadmodule";
|
---|
| 1154 | usage = "To load and initialize modules \n Usage: loadmodule fnameso modulename";
|
---|
| 1155 | usage += "\n Related commands: link";
|
---|
[2465] | 1156 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[293] | 1157 | kw = "link";
|
---|
| 1158 | usage = "Dynamic linking of compiled user functions \n Usage: link fnameso f1 [f2 f3]";
|
---|
| 1159 | usage += "\n fnameso: Shared-object file name, f1,f2,f3 : User function names ";
|
---|
[1276] | 1160 | usage += "\n Related commands: call loadmodule linkff2";
|
---|
[2465] | 1161 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[1276] | 1162 | kw = "linkff2";
|
---|
| 1163 | usage = "Dynamic linking of compiled user functions (Set 2)\n Usage: linkff2 fnameso f1 [f2 f3]";
|
---|
| 1164 | usage += "\n fnameso: Shared-object file name, f1,f2,f3 : User function names ";
|
---|
| 1165 | usage += "\n Related commands: call link loadmodule";
|
---|
[2465] | 1166 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[293] | 1167 | kw = "call";
|
---|
| 1168 | usage = "Dynamically linked user function call \n Usage: call userf [arg1 arg2 ...]";
|
---|
| 1169 | usage += "\n User function : f(vector<string>& args)";
|
---|
| 1170 | usage += "\n Related commands: link";
|
---|
[2465] | 1171 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[293] | 1172 |
|
---|
[2465] | 1173 | grp = "Graphics";
|
---|
| 1174 | gdesc = "Basic graphics and object display commands";
|
---|
| 1175 | mpiac->AddHelpGroup(grp, gdesc);
|
---|
[293] | 1176 | kw = "zone";
|
---|
[384] | 1177 | usage = "To Divide the Graphic window \n Usage: zone [nx=1 ny=1]";
|
---|
[388] | 1178 | usage += "\n Related commands: newwin";
|
---|
[2465] | 1179 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[293] | 1180 | kw = "newwin";
|
---|
[2243] | 1181 | usage = "To Create a New Graphic window, with zones \n";
|
---|
| 1182 | usage += " Window size can be specified \n";
|
---|
| 1183 | usage += " Usage: newwin [nx ny [sizeX sizeY]] ";
|
---|
[388] | 1184 | usage += "\n Related commands: zone";
|
---|
[2465] | 1185 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[293] | 1186 | kw = "stacknext";
|
---|
| 1187 | usage = "Displays the next widget on stack window \n Usage: stacknext";
|
---|
[2465] | 1188 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[293] | 1189 |
|
---|
[553] | 1190 | kw = "graphicatt";
|
---|
[2718] | 1191 | usage = "To change default graphic options\n Usage: graphicatt att_list\n";
|
---|
[1971] | 1192 | usage += "att_list=def back to default values, Example: gratt 'red circlemarker5'";
|
---|
[2718] | 1193 | usage += "\n ------------------ Graphic attribute list ------------------\n";
|
---|
| 1194 | usage += ">> Colors: defcol black white grey red blue green yellow\n";
|
---|
| 1195 | usage += " magenta cyan turquoise navyblue orange siennared purple\n";
|
---|
| 1196 | usage += " limegreen gold violet violetred blueviolet darkviolet\n";
|
---|
| 1197 | usage += " or \"color=name\" \"fgcolor=name\" \"bgcolor=name\" ex: \"color=red\"\n";
|
---|
| 1198 | usage += ">> Lines: defline normalline thinline thickline dashedline thindashedline\n";
|
---|
| 1199 | usage += " thickdashedline dottedline thindottedline thickdottedline\n";
|
---|
| 1200 | usage += " or \"line=type,width\" ex: \"line=dotted,7\"\n";
|
---|
| 1201 | usage += ">> Fonts:\n";
|
---|
| 1202 | usage += " > Att: deffontatt normalfont boldfont italicfont bolditalicfont \n";
|
---|
| 1203 | usage += " smallfont smallboldfont smallitalicfont smallbolditalicfont\n";
|
---|
| 1204 | usage += " bigfont bigboldfont bigitalicfont bigbolditalicfont\n";
|
---|
| 1205 | usage += " hugefont hugeboldfont hugeitalicfont hugebolditalicfont\n";
|
---|
| 1206 | usage += " > Names: deffont courierfont helveticafont timesfont symbolfont \n";
|
---|
| 1207 | usage += " or \"font=name,type,size\" ex: \"font=courrier,bolditalic,10\"\n";
|
---|
| 1208 | usage += ">> Marker: dotmarker<T> plusmarker<T> crossmarker<T> circlemarker<T>\n";
|
---|
| 1209 | usage += " fcirclemarker<T> boxmarker<T> fboxmarker<T> trianglemarker<T>\n";
|
---|
| 1210 | usage += " ftrianglemarker<T> starmarker<T> fstarmarker<T>\n";
|
---|
| 1211 | usage += " with <T> = 1 3 5 7 .. 15 , Example fboxmarker5 , plusmarker9 ...\n";
|
---|
| 1212 | usage += " or \"marker=type,size\" ex: \"marker=plus,10\"\n";
|
---|
| 1213 | usage += ">> ArrowMarker: basicarrow<T> trianglearrow<T> ftrianglearrow<T>\n";
|
---|
| 1214 | usage += " arrowshapedarrow<T> farrowshapedarrow<T>\n";
|
---|
| 1215 | usage += " with <T> = 5 7 .. 15 , Example trianglearrow7 ...\n";
|
---|
| 1216 | usage += " or \"arrow=type,size\" ex: \"arrow=arrowshaped,10\"\n";
|
---|
| 1217 | usage += "------ Specific options for image displays:\n";
|
---|
| 1218 | usage += ">> ColorTables: defcmap grey32 invgrey32 colrj32 colbr32\n";
|
---|
| 1219 | usage += " grey128 invgrey128 colrj128 colbr128\n";
|
---|
| 1220 | usage += " red32cm green32cm blue32cm yellow32cm\n";
|
---|
| 1221 | usage += " orange32cm cyan32cm violet32cm\n";
|
---|
[1126] | 1222 | usage += " midas_pastel midas_heat midas_rainbow3 midas_bluered\n";
|
---|
[2718] | 1223 | usage += " midas_bluewhite midas_redwhite\n";
|
---|
| 1224 | usage += " multicol16 multicol64\n";
|
---|
| 1225 | usage += ">> revcmap : reverse colorMap\n";
|
---|
| 1226 | usage += ">> ZoomFactors : zoomxN ex: zoomx1 zoomx2 zoomx3 ...\n";
|
---|
| 1227 | usage += " zoom/N ex: zoom/2 zoom/3 zoom/4 ...\n";
|
---|
| 1228 | usage += ">> imagecenter=ix,iy : Position the image in widget\n";
|
---|
| 1229 | usage += ">> lut=ltyp,min,max : Sets LUT type and min/max\n";
|
---|
| 1230 | usage += " (ltyp=lin/log/sqrt/square)\n";
|
---|
| 1231 | usage += ">> invx,invy,exchxy : image axes configuration\n";
|
---|
| 1232 | usage += ">> for Axes / Axe labels / LogScale / xylimits / defdrrect\n";
|
---|
| 1233 | usage += " see setaxesatt command\n";
|
---|
| 1234 | usage += "--- General purpose options:\n";
|
---|
| 1235 | usage += ">> stat,stats / nsta,nstat,nostat,nostats : Toggle statistic display\n";
|
---|
| 1236 | usage += ">> title,tit / notitle,notit -> Toggle automatic title display\n";
|
---|
| 1237 | usage += ">> Choose display window: next same win stack inset\n";
|
---|
| 1238 | usage += "\n";
|
---|
[1971] | 1239 | usage += " Related commands: setaxesatt setinsetlimits ";
|
---|
[2465] | 1240 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[293] | 1241 |
|
---|
[1971] | 1242 | kw = "setaxesatt";
|
---|
| 1243 | usage = "To set default axes attributes \n Usage: setaxesatt att_list \n";
|
---|
[2217] | 1244 | usage += "Color/Line/Font attributes and axes attributes \n";
|
---|
[2718] | 1245 | usage += ">> Axes: axesnone stdaxes=defaxes=boxaxes boxaxesgrid \n";
|
---|
| 1246 | usage += " fineaxes fineaxesgrid centeredaxes finecenteredaxes \n";
|
---|
| 1247 | usage += " centeredaxesgrid finecenteredaxesgrid\n";
|
---|
| 1248 | usage += " axescenter=x0,y0 (only with centered axes, default \"axescenter=\")\n";
|
---|
| 1249 | usage += " grid nogrid labels nolabels \n";
|
---|
| 1250 | usage += " ticks noticks minorticks nominorticks \n";
|
---|
| 1251 | usage += " extticks intticks extintticks \n";
|
---|
| 1252 | usage += " nbticks=X_NTicks,Y_NTicks \n";
|
---|
| 1253 | usage += " tickslen=MajTickLenFrac,MinTickLenFrac \n";
|
---|
[2350] | 1254 | usage += ">> Axe labels font size: fixedfontsize/autofontsize=fszf \n";
|
---|
[2718] | 1255 | usage += " autofontsize=fsizef: Font size computed automatically \n";
|
---|
| 1256 | usage += " fixedfontsize: Use font size attribute (BaseDrawer) \n";
|
---|
| 1257 | usage += ">> Scale type: linx liny logx logy -> Lin/Log Scales for 2D plots \n";
|
---|
[1971] | 1258 | usage += ">> xylimits=xmin,xmax,ymin,ymax -> Forces X-Y limits in 2-D plots \n";
|
---|
[2296] | 1259 | usage += ">> defdrrect=xmin,xmax,ymin,ymax -> Defines drawing rectangle 2-D plots \n";
|
---|
| 1260 | usage += " The rectangle is defined as a fraction of the widget size\n";
|
---|
[2465] | 1261 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[331] | 1262 |
|
---|
[548] | 1263 | kw = "setinsetlimits";
|
---|
| 1264 | usage = "Define the display rectangle for drawers added as insets \n";
|
---|
| 1265 | usage += " over existing graphic objects - limits expressed as fraction \n";
|
---|
| 1266 | usage += " graphic object size (0. .. 1.) Xmax at right, YMax top. ";
|
---|
| 1267 | usage += " Usage: setinsetlimits xmin xmax ymin ymax";
|
---|
[558] | 1268 | usage += "\n Related commands: graphicatt /inset";
|
---|
[2465] | 1269 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[548] | 1270 |
|
---|
[2243] | 1271 | kw = "drpanel";
|
---|
| 1272 | usage = "Creates a new 2D drawing zone for addtext, addline \n";
|
---|
| 1273 | usage += " Usage: drpanel xmin xmax ymin ymax [GrAtt] [Name]";
|
---|
| 1274 | usage += "\n Related commands: addtext addline addrect addcirc ...";
|
---|
[2465] | 1275 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[2243] | 1276 |
|
---|
[349] | 1277 | kw = "addtext";
|
---|
| 1278 | usage = "Adds a text string to the current graphic object";
|
---|
[2243] | 1279 | usage += "\n at the specified position (+ color/font/pos/dir attributes) ";
|
---|
[1642] | 1280 | usage += "\n The Base/AxesDrawer is used to handle added text strings" ;
|
---|
[2265] | 1281 | usage += "\n Alt<E> to remove the added element";
|
---|
[2263] | 1282 | usage += "\n Usage: addtext x y TextString [ColFontPosAtt] [fgnc=false/true]";
|
---|
[1642] | 1283 | usage += "\n (use quotes '' for multi word text strings) ";
|
---|
[2263] | 1284 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
[2243] | 1285 | usage += "\n Text position/direction attribute: ";
|
---|
| 1286 | usage += "\n horizleft horizcenter horizright";
|
---|
| 1287 | usage += "\n vertbottom vertcenter verttop ";
|
---|
| 1288 | usage += "\n textdirhoriz textdirvertup textdirvertdown ";
|
---|
[2263] | 1289 | usage += "\n Related commands: addctext addline addarrow addrect addfrect";
|
---|
| 1290 | usage += "\n addcirc addfcirc addarc addfrac addpoly addfpoly settitle graphicatt";
|
---|
[2265] | 1291 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[349] | 1292 |
|
---|
[2263] | 1293 | kw = "addctext";
|
---|
| 1294 | usage = "Adds a composite text string with superscript and subscripts ";
|
---|
| 1295 | usage += "\n at the specified position (+ color/font/pos/dir attributes) ";
|
---|
| 1296 | usage += "\n Usage: addctext x y Text sUp sDown [ColFontPosAtt] [UpDownFontAtt] [fgnc]";
|
---|
| 1297 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
| 1298 | usage += "\n Related commands: addtext addline addrect ...";
|
---|
| 1299 | usage += "\n (See command addtext and graphicatt for more details)";
|
---|
[2265] | 1300 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[2263] | 1301 |
|
---|
[1642] | 1302 | kw = "addline";
|
---|
| 1303 | usage = "Adds a line to the current graphic object";
|
---|
[2243] | 1304 | usage += "\n at the specified position (+ graphic attribute)";
|
---|
[1642] | 1305 | usage += "\n The Base/AxesDrawer is used to handle added lines";
|
---|
[2265] | 1306 | usage += "\n Alt<E> to remove the added element";
|
---|
[2263] | 1307 | usage += "\n Usage: addline x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
|
---|
| 1308 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
[2243] | 1309 | usage += "\n Related commands: addarrow addtext addrect addfrect ";
|
---|
[2263] | 1310 | usage += "\n addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
|
---|
[2265] | 1311 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[1642] | 1312 |
|
---|
[2243] | 1313 | kw = "addarrow";
|
---|
| 1314 | usage = "Adds an arrow to the current graphic object";
|
---|
| 1315 | usage += "\n at the specified position (+ graphic attribute)";
|
---|
| 1316 | usage += "\n The Base/AxesDrawer is used to handle added lines";
|
---|
[2265] | 1317 | usage += "\n Alt<E> to remove the added element";
|
---|
[2263] | 1318 | usage += "\n Usage: addarrow x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
|
---|
| 1319 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
[2243] | 1320 | usage += "\n Related commands: addline addtext addrect addfrect ";
|
---|
[2263] | 1321 | usage += "\n addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
|
---|
[2265] | 1322 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[2263] | 1323 | kw = "addarrow_nc";
|
---|
[2243] | 1324 |
|
---|
[1642] | 1325 | kw = "addrect";
|
---|
| 1326 | usage = "Adds a rectangle to the current graphic object";
|
---|
[2243] | 1327 | usage += "\n between the specified positions (+ graphic attribute)";
|
---|
[1642] | 1328 | usage += "\n The Base/AxesDrawer is used to handle added rectangle";
|
---|
[2265] | 1329 | usage += "\n Alt<E> to remove added element";
|
---|
[2263] | 1330 | usage += "\n Usage: addrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
|
---|
| 1331 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
[2243] | 1332 | usage += "\n Related commands: addtext addline addarrow addfrect";
|
---|
[2263] | 1333 | usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
|
---|
[2265] | 1334 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[1642] | 1335 |
|
---|
| 1336 | kw = "addfrect";
|
---|
| 1337 | usage = "Adds a filled rectangle to the current graphic object";
|
---|
[2243] | 1338 | usage += "\n between the specified positions (+ graphic attribute)";
|
---|
[1642] | 1339 | usage += "\n The Base/AxesDrawer is used to handle added rectangle";
|
---|
[2265] | 1340 | usage += "\n Alt<E> to remove added element";
|
---|
[2263] | 1341 | usage += "\n Usage: addfrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
|
---|
| 1342 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
[2243] | 1343 | usage += "\n Related commands: addtext addline addarrow addrect";
|
---|
[2263] | 1344 | usage += "\n addcirc addfcirc addpoly addfpoly graphicatt";
|
---|
[2265] | 1345 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[1642] | 1346 |
|
---|
[2243] | 1347 | kw = "addmarker";
|
---|
| 1348 | usage = "Adds a marker to the current graphic object";
|
---|
| 1349 | usage += "\n at the specified position (+ graphic attribute)";
|
---|
| 1350 | usage += "\n The Base/AxesDrawer is used to handle added circles";
|
---|
[2265] | 1351 | usage += "\n Alt<E> to remove added element";
|
---|
[2263] | 1352 | usage += "\n Usage: addmarker xpos ypos [GraphicAtt] [fgnc=false/true]";
|
---|
| 1353 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
[2243] | 1354 | usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
|
---|
[2263] | 1355 | usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
|
---|
[2265] | 1356 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[2243] | 1357 |
|
---|
[1642] | 1358 | kw = "addcirc";
|
---|
| 1359 | usage = "Adds a circle to the current graphic object";
|
---|
[2243] | 1360 | usage += "\n with the specified center and radius (+ graphic attribute)";
|
---|
[1642] | 1361 | usage += "\n The Base/AxesDrawer is used to handle added circles";
|
---|
[2265] | 1362 | usage += "\n Alt<E> to remove added element";
|
---|
[2263] | 1363 | usage += "\n Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]";
|
---|
| 1364 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
[2243] | 1365 | usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
|
---|
[2263] | 1366 | usage += "\n addfcirc addarc addfarc addpoly addfpoly graphicatt";
|
---|
[2265] | 1367 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[1642] | 1368 |
|
---|
| 1369 | kw = "addfcirc";
|
---|
| 1370 | usage = "Adds a filled circle to the current graphic object";
|
---|
[2243] | 1371 | usage += "\n with the specified center and radius (+ graphic attribute)";
|
---|
[1642] | 1372 | usage += "\n The Base/AxesDrawer is used to handle added circles";
|
---|
[2265] | 1373 | usage += "\n Alt<E> to remove added element";
|
---|
[2263] | 1374 | usage += "\n Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]";
|
---|
| 1375 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
[2243] | 1376 | usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
|
---|
[2263] | 1377 | usage += "\n addcirc addarc addfarc addpoly addfpoly graphicatt";
|
---|
[2265] | 1378 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[1642] | 1379 |
|
---|
[2638] | 1380 | kw = "addoval";
|
---|
| 1381 | usage = "Adds an oval (ellipse) to the current graphic object";
|
---|
| 1382 | usage += "\n centered on xc,yc - semi-axis ds,dy (+ graphic attribute)";
|
---|
| 1383 | usage += "\n The Base/AxesDrawer is used to handle added rectangle";
|
---|
| 1384 | usage += "\n Alt<E> to remove added element";
|
---|
| 1385 | usage += "\n Usage: addoval xc yc dx dy [GraphicAtt] [fgnc=false/true]";
|
---|
| 1386 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
| 1387 | usage += "\n Related commands: addfoval addline addarrow addfrect addcirc addfcirc";
|
---|
| 1388 | usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
|
---|
| 1389 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
| 1390 |
|
---|
| 1391 | kw = "addfoval";
|
---|
| 1392 | usage = "Adds a filled oval (ellipse) to the current graphic object";
|
---|
| 1393 | usage += "\n centered on xc,yc - semi-axis ds,dy (+ graphic attribute)";
|
---|
| 1394 | usage += "\n The Base/AxesDrawer is used to handle added rectangle";
|
---|
| 1395 | usage += "\n Alt<E> to remove added element";
|
---|
| 1396 | usage += "\n Usage: addfoval xc yc dx dy [GraphicAtt] [fgnc=false/true]";
|
---|
| 1397 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
| 1398 | usage += "\n Related commands: addoval addline addarrow addfrect addcirc addfcirc";
|
---|
| 1399 | usage += "\n addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";
|
---|
| 1400 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
| 1401 |
|
---|
[2265] | 1402 | kw = "addarca";
|
---|
| 1403 | usage = "Adds an arc to the current graphic object";
|
---|
| 1404 | usage += "\n defined by the circle (center+radius), start angle and angular extension";
|
---|
| 1405 | usage += "\n Angles are specified in degrees";
|
---|
| 1406 | usage += "\n Usage: addarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]";
|
---|
| 1407 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
| 1408 | usage += "\n Related commands: addtext addline addfarca addarc ...";
|
---|
| 1409 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
| 1410 |
|
---|
| 1411 | kw = "addfarca";
|
---|
| 1412 | usage = "Adds a filled arc to the current graphic object";
|
---|
| 1413 | usage += "\n defined by the circle (center+radius), start angle and angular extension";
|
---|
| 1414 | usage += "\n Angles are specified in degrees";
|
---|
| 1415 | usage += "\n Usage: addfarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]";
|
---|
| 1416 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
| 1417 | usage += "\n Related commands: addtext addline addarca addarc ...";
|
---|
| 1418 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
| 1419 |
|
---|
[2243] | 1420 | kw = "addarc";
|
---|
| 1421 | usage = "Adds an arc to the current graphic object";
|
---|
| 1422 | usage += "\n defined by 3 points (+ graphic attribute)";
|
---|
| 1423 | usage += "\n The Base/AxesDrawer is used to handle added arcs";
|
---|
[2265] | 1424 | usage += "\n Alt<E> to remove the added element";
|
---|
[2263] | 1425 | usage += "\n Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
|
---|
| 1426 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
[2243] | 1427 | usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
|
---|
[2265] | 1428 | usage += "\n addcirc addfcirc addfarc addarca addpoly addfpoly graphicatt";
|
---|
| 1429 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[2243] | 1430 |
|
---|
| 1431 | kw = "addfarc";
|
---|
| 1432 | usage = "Adds a filled arc to the current graphic object";
|
---|
| 1433 | usage += "\n defined by 3 points (+ graphic attribute)";
|
---|
| 1434 | usage += "\n The Base/AxesDrawer is used to handle added arcs";
|
---|
[2265] | 1435 | usage += "\n Alt<E> to remove added element";
|
---|
[2263] | 1436 | usage += "\n Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
|
---|
| 1437 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
[2243] | 1438 | usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
|
---|
[2263] | 1439 | usage += "\n addcirc addfcirc addfarc addpoly addfpoly graphicatt";
|
---|
[2265] | 1440 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[2243] | 1441 |
|
---|
[2263] | 1442 | kw = "addpoly";
|
---|
| 1443 | usage = "Adds a polyline/polygon to the current graphic object";
|
---|
| 1444 | usage += "\n Usage: addploy 'x1,y1 x2,y2 x3,y3 ...' [GraphicAtt] [fgnc=false/true]";
|
---|
| 1445 | usage += "\n Coordinates specified as pairs x,y in a single word (use simple or double quotes";
|
---|
| 1446 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
| 1447 | usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
|
---|
| 1448 | usage += "\n addcirc addfcirc addfarc graphicatt";
|
---|
[2265] | 1449 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[2263] | 1450 |
|
---|
| 1451 | kw = "addfpoly";
|
---|
| 1452 | usage = "Adds a filled polygon to the current graphic object";
|
---|
| 1453 | usage += "\n Usage: addploy 'x1,y1 x2,y2 x3,y3 ...' [GraphicAtt] [fgnc=false/true]";
|
---|
| 1454 | usage += "\n Coordinates specified as pairs x,y in a single word (use simple or double quotes";
|
---|
| 1455 | usage += "\n if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
|
---|
| 1456 | usage += "\n Related commands: addtext addline addarrow addfrect addfrect";
|
---|
| 1457 | usage += "\n addcirc addfcirc addfarc graphicatt";
|
---|
[2265] | 1458 | mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
|
---|
[2263] | 1459 |
|
---|
[1131] | 1460 | kw = "settitle";
|
---|
[1642] | 1461 | usage = "Set the title string (top title / bottom title) for the current graphic object";
|
---|
| 1462 | usage += "\n Usage: settitle TopTitle [BottomTitle] [fontAtt]";
|
---|
[1131] | 1463 | usage += "\n Related commands: addtext graphicatt";
|
---|
[2465] | 1464 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[1131] | 1465 |
|
---|
[2165] | 1466 | kw = "addtitle";
|
---|
| 1467 | usage = "Set the title string (top title / bottom title) \n";
|
---|
| 1468 | usage += " alias for settitle ";
|
---|
[2465] | 1469 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[2165] | 1470 |
|
---|
| 1471 | kw = "setaxelabels";
|
---|
| 1472 | usage = "Set the X and Y axis labels for the current 2D graphic object \n";
|
---|
| 1473 | usage += "\n Usage: setaxelabels xLabel yLabel [ColorFntAtt]";
|
---|
| 1474 | usage += "\n Related commands: settitle addtext graphicatt";
|
---|
[2465] | 1475 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[2165] | 1476 |
|
---|
| 1477 | kw = "addaxelabels";
|
---|
| 1478 | usage = "Set the X and Y axis labels for the current 2D graphic object";
|
---|
| 1479 | usage += " alias for setaxelabels ";
|
---|
[2465] | 1480 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[2165] | 1481 |
|
---|
[388] | 1482 | RegisterPIGraphicsHelp(mpiac);
|
---|
| 1483 |
|
---|
[293] | 1484 | kw = "openfits";
|
---|
[2263] | 1485 | usage = "Loads a FITS file into an appropriate object \n Usage: openfits filename";
|
---|
[293] | 1486 | usage += "\n Related commands: savefits openppf";
|
---|
[330] | 1487 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[293] | 1488 | kw = "savefits";
|
---|
| 1489 | usage = "Save an object into a FITS file \n Usage: savefits nameobj filename";
|
---|
[2132] | 1490 | usage += "\n Related commands: openfits saveobjs saveall";
|
---|
[330] | 1491 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[293] | 1492 | kw = "openppf";
|
---|
[2645] | 1493 | usage = "Reads all or some objects from a PPF file \n Usage: openppf filename [objname1 objname2 ...]";
|
---|
[293] | 1494 | usage += "\n Related commands: saveall openfits";
|
---|
[330] | 1495 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[2132] | 1496 | kw = "saveppf";
|
---|
| 1497 | usage = "Saves objects with names matching a pattern into a\n";
|
---|
| 1498 | usage += " PPF file (pattern: x?y*) - Alias saveppf\n";
|
---|
| 1499 | usage += "Usage: saveppf nameobjpattern filename";
|
---|
[2669] | 1500 | usage += "\n Related commands: saveobjs savelist saveall openppf savefits";
|
---|
[2132] | 1501 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[333] | 1502 | kw = "saveobjs";
|
---|
[2132] | 1503 | usage = "Saves objects with names matching a pattern into a\n";
|
---|
| 1504 | usage += " PPF file (pattern: x?y*) - Alias saveppf\n";
|
---|
[1068] | 1505 | usage += "Usage: saveobjs nameobjpattern filename";
|
---|
[2669] | 1506 | usage += "\n Related commands: saveppf savelist saveall openppf savefits";
|
---|
[333] | 1507 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[293] | 1508 | kw = "saveall";
|
---|
| 1509 | usage = "Saves all objects into a PPF file \n Usage: saveall filename";
|
---|
[2669] | 1510 | usage += "\n Related commands: saveobj savelist openppf savefits";
|
---|
| 1511 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
| 1512 | kw = "savelist";
|
---|
| 1513 | usage = "Saves a list of objects into a PPF file";
|
---|
| 1514 | usage = "\n Usage: savelist objname1 [objname2 ...] filename";
|
---|
[333] | 1515 | usage += "\n Related commands: saveobj openppf savefits";
|
---|
[330] | 1516 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[449] | 1517 | kw = "ntfrascii";
|
---|
| 1518 | usage = "Fills an existing NTuple from ASCII table file";
|
---|
| 1519 | usage += "\n Usage: ntfrascii nt_name file_name [def_init_val]";
|
---|
| 1520 | usage += "\n Related commands: ntloop fillnt ";
|
---|
| 1521 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[2263] | 1522 | #ifndef SANS_EVOLPLANCK
|
---|
| 1523 | kw = "mtxfrascii";
|
---|
| 1524 | usage = "Reads a matrix from an ASCII file (TMatrix<r_8>)";
|
---|
[2289] | 1525 | usage += "\n Usage: mtxfrascii mtx_name file_name [CommChar Separator]";
|
---|
[2268] | 1526 | usage += "\n Related commands: arrtoascii vecfrascii ntfrascii ";
|
---|
[2263] | 1527 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
| 1528 | kw = "vecfrascii";
|
---|
[2268] | 1529 | usage = "Reads a vector from an ASCII file (TVector<r_8>)";
|
---|
[2263] | 1530 | usage += "\n Usage: vecfrascii vec_name file_name";
|
---|
[2289] | 1531 | usage += "\n Related commands: arrtoascii mtxfrascii ntfrascii [CommChar Separator]";
|
---|
[2263] | 1532 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[2268] | 1533 | kw = "arrtoascii";
|
---|
| 1534 | usage = "Writes an array (TArray<T>) to an ASCII file ";
|
---|
| 1535 | usage += "\n Usage: arrtoascii array_name file_name";
|
---|
| 1536 | usage += "\n Related commands: mtxfrascii vecfrascii ntfrascii ";
|
---|
| 1537 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[2263] | 1538 | #endif
|
---|
[293] | 1539 |
|
---|
| 1540 | kw = "print";
|
---|
| 1541 | usage = "Prints an object \n Usage: print nameobj";
|
---|
[330] | 1542 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[293] | 1543 |
|
---|
[333] | 1544 | kw = "mkdir";
|
---|
| 1545 | usage = "Create a directory";
|
---|
[344] | 1546 | usage += "\n Usage: mkdir dirname [true]";
|
---|
| 1547 | usage += "\n if second argument==true, the directory's KeepOld attribute is set to true";
|
---|
[463] | 1548 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[333] | 1549 | kw = "rmdir";
|
---|
| 1550 | usage = "Removes an empty directory";
|
---|
| 1551 | usage += "\n Usage: remove dirname";
|
---|
[463] | 1552 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[2132] | 1553 | kw = "setdiratt";
|
---|
| 1554 | usage = "Sets directory attributes";
|
---|
| 1555 | usage += "\n Usage: setdiratt dirname KeepOldFlag(=true/false)";
|
---|
| 1556 | usage += "\n KeepOldFlag=true Object with the same name is moved to old";
|
---|
| 1557 | usage += "\n when adding objects";
|
---|
| 1558 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[333] | 1559 | kw = "cd";
|
---|
| 1560 | usage = "Change current directory";
|
---|
| 1561 | usage += "\n Usage: cd [dirname]";
|
---|
[463] | 1562 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[333] | 1563 | kw = "pwd";
|
---|
| 1564 | usage = "Prints current directory";
|
---|
| 1565 | usage += "\n Usage: pwd";
|
---|
[463] | 1566 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[333] | 1567 | kw = "listdirs";
|
---|
| 1568 | usage = "Prints the list of directories";
|
---|
| 1569 | usage += "\n Usage: listdirs [patt=*] \n patt : * , ? ";
|
---|
[463] | 1570 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[295] | 1571 | kw = "listobjs";
|
---|
[333] | 1572 | usage = "Prints the list of objects (Alias: ls)";
|
---|
| 1573 | usage += "\n Usage: listobjs [patt=*] \n patt : /*/x?y* ... ";
|
---|
[463] | 1574 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[293] | 1575 | kw = "rename";
|
---|
[333] | 1576 | usage = "Rename an object (Alias: mv) \n Usage: rename nameobj namenew";
|
---|
[2132] | 1577 | usage += "\n Related commands: mv del delobjs";
|
---|
[463] | 1578 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[2132] | 1579 | kw = "mv";
|
---|
| 1580 | usage = "Rename an object (Alias: rename) \n Usage: mv nameobj namenew";
|
---|
| 1581 | usage += "\n Related commands: rename del delobjs";
|
---|
| 1582 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[463] | 1583 | kw = "copy";
|
---|
[2132] | 1584 | usage = "Copy objects (Alias cp) \n";
|
---|
[463] | 1585 | usage +=" Usage: copy name_from name_to";
|
---|
[2132] | 1586 | usage += "\n Related commands: cp new...";
|
---|
[2176] | 1587 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[2132] | 1588 | kw = "cp";
|
---|
| 1589 | usage = "Copy objects (Alias copy) \n";
|
---|
| 1590 | usage +=" Usage: cp name_from name_to";
|
---|
| 1591 | usage += "\n Related commands: copy new...";
|
---|
[463] | 1592 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[293] | 1593 | kw = "del";
|
---|
[1655] | 1594 | usage = "Deletes an object (Alias: rm) \n Usage: del nameobj [nameobj2 ...]";
|
---|
[2132] | 1595 | usage += "\n Related commands: rm delobjs rename";
|
---|
[463] | 1596 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[2132] | 1597 | kw = "rm";
|
---|
| 1598 | usage = "Deletes an object (Alias: del) \n Usage: rm nameobj [nameobj2 ...]";
|
---|
| 1599 | usage += "\n Related commands: del delobjs rename";
|
---|
| 1600 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[293] | 1601 | kw = "delobjs";
|
---|
| 1602 | usage = "Delete a set of objects with names matching a pattern (x?y*)";
|
---|
| 1603 | usage += "\n Usage: delobjs nameobjpattern \n";
|
---|
| 1604 | usage += "\n Related commands: del rename";
|
---|
[463] | 1605 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[293] | 1606 |
|
---|
| 1607 | kw = "newh1d";
|
---|
| 1608 | usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin";
|
---|
[1035] | 1609 | usage += "\n Related commands: newh2d newprof[e] newnt newgfd ";
|
---|
[333] | 1610 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[293] | 1611 | kw = "newh2d";
|
---|
| 1612 | usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny";
|
---|
[1035] | 1613 | usage += "\n Related commands: newh1d newprof[e] newnt newgfd ";
|
---|
[333] | 1614 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[293] | 1615 | kw = "newprof";
|
---|
| 1616 | usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]";
|
---|
[1035] | 1617 | usage += "\n Errors represent the data spread in the X bin ";
|
---|
| 1618 | usage += "\n Related commands: newh1d newh2d newprofe newnt newgfd ";
|
---|
[333] | 1619 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[1035] | 1620 | kw = "newprofe";
|
---|
| 1621 | usage = "Creates a profile histogramm \n Usage: newprofe name xmin xmax nbin [ymin ymax]";
|
---|
| 1622 | usage += "\n Errors represent the error on the data mean in the X bin ";
|
---|
| 1623 | usage += "\n Related commands: newh1d newh2d newprof newnt newgfd ";
|
---|
| 1624 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[447] | 1625 | kw = "newnt";
|
---|
| 1626 | usage = "Creates a ntuple \n Usage: newnt name v1 v2 v3 .. vn";
|
---|
| 1627 | usage += "\n newnt name nvar";
|
---|
[1035] | 1628 | usage += "\n Related commands: newh1d newh2d newprof[e] newgfd ";
|
---|
[447] | 1629 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[293] | 1630 | kw = "newgfd";
|
---|
| 1631 | usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]";
|
---|
[1035] | 1632 | usage += "\n Related commands: newh1d newh2d newprof[e] newnt ";
|
---|
[333] | 1633 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
| 1634 | kw = "newvec";
|
---|
[357] | 1635 | usage = "Creates (and optionaly fills) a vector \n Usage: newvec name size [f(i) [dopt] ] ";
|
---|
[2305] | 1636 | usage += "\n Related commands: newmtx line2vec";
|
---|
[357] | 1637 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[333] | 1638 | kw = "newmtx";
|
---|
[357] | 1639 | usage = "Creates (and optionaly fills) a matrix \n";
|
---|
[1917] | 1640 | usage +=" Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) [dopt] ] ";
|
---|
[333] | 1641 | usage += "\n Related commands: newvec";
|
---|
[357] | 1642 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[2305] | 1643 | kw = "line2vec";
|
---|
| 1644 | usage = "Creates a vector from the line \n";
|
---|
| 1645 | usage += " Usage: line2vec vecname v0 v1 v2 ... \n";
|
---|
| 1646 | usage += " Related commands: newvec line2nt";
|
---|
| 1647 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
| 1648 | kw = "line2nt";
|
---|
| 1649 | usage = "Fills (append) an NTuple from the line content \n";
|
---|
| 1650 | usage += " Usage: line2nt ntname col0 col1 ... \n";
|
---|
| 1651 | usage += " Related commands: newnt line2vec ntline2var ntcol2var";
|
---|
| 1652 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
| 1653 | kw = "vec2var";
|
---|
| 1654 | usage = "Vector content to an interpreter variable varname = 'v0 v1 v2 ...' \n";
|
---|
| 1655 | usage += " Usage: line2vec vecname varname [LoopParam start:end[:step] ]\n";
|
---|
| 1656 | usage += " Related commands: line2vec ntline2var";
|
---|
| 1657 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
| 1658 | kw = "ntline2var";
|
---|
| 1659 | usage = "Object NTupleInterface line to an interpreter variable \n";
|
---|
| 1660 | usage += " Usage: ntline2var objname line_number varname \n";
|
---|
| 1661 | usage += " Related commands: vec2var ntcol2var";
|
---|
| 1662 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
| 1663 | kw = "ntcol2var";
|
---|
| 1664 | usage = "Object NTupleInterface column to an interpreter variable \n";
|
---|
| 1665 | usage += " Usage: ntline2var objname column_number varname [LoopParam start:end[:step] ] \n";
|
---|
| 1666 | usage += " Related commands: vec2var ntline2var";
|
---|
| 1667 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[293] | 1668 |
|
---|
| 1669 | kw = "disp";
|
---|
| 1670 | usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]";
|
---|
[1525] | 1671 | usage += "\n Related commands: surf nt2d nt3d vecplot";
|
---|
[330] | 1672 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
[295] | 1673 | kw = "imag";
|
---|
| 1674 | usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]";
|
---|
[2651] | 1675 | usage += "\n Related commands: disp imagnav surf nt2d nt3d vecplot";
|
---|
[330] | 1676 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
[2651] | 1677 | kw = "imagnav";
|
---|
| 1678 | usage = "Displays an object as an image with the ImageNavigator viewer \n";
|
---|
| 1679 | usage += "Usage: imagnav nameobj [graphic_attributes]";
|
---|
| 1680 | usage += "\n Related commands: disp imag surf nt2d nt3d vecplot";
|
---|
| 1681 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
[293] | 1682 | kw = "surf";
|
---|
| 1683 | usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]";
|
---|
[1525] | 1684 | usage += "\n Related commands: disp nt2d nt3d vecplot";
|
---|
[330] | 1685 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
[293] | 1686 | kw = "nt2d";
|
---|
[486] | 1687 | usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple ";
|
---|
| 1688 | usage += "\n Usage : nt2d nameobj varx vary [errx erry wt label graphic_attributes]";
|
---|
[1525] | 1689 | usage += "\n Related commands: disp surf nt3d gfd2d vecplot";
|
---|
[330] | 1690 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
[293] | 1691 | kw = "nt3d";
|
---|
[486] | 1692 | usage = "Displays 3D-Points (X-Y-Z) [with error-bars / Weight / Label ] from an NTuple ";
|
---|
| 1693 | usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz wt label graphic_attributes]";
|
---|
| 1694 | usage += "\n Related commands: disp surf nt2d gfd3d ";
|
---|
[330] | 1695 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
[1525] | 1696 | kw = "vecplot";
|
---|
| 1697 | usage = "Displays Points (X-Y) with coordinates defined by two vectors ";
|
---|
| 1698 | usage += "\n Usage : vecplot nameVecX nameVecY [graphic_attributes]";
|
---|
| 1699 | usage += "\n Related commands: disp nt2d ";
|
---|
| 1700 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
[2536] | 1701 | kw = "bargraph";
|
---|
[2545] | 1702 | usage = "Bar-Graph view of a sequence of values (test)";
|
---|
[2536] | 1703 | usage += "\n Usage : bargraph graphic_attributes v1 [v2 v3 ...] ";
|
---|
| 1704 | usage += "\n Related commands: disp nt2d vecplot";
|
---|
| 1705 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
[2545] | 1706 | kw = "textdrawer";
|
---|
| 1707 | usage = "Multi line text darwer (test)";
|
---|
| 1708 | usage += "\n Usage : textdrawer graphic_attributes line1 [line2 line3 ...] ";
|
---|
| 1709 | usage += "\n Related commands: disp ";
|
---|
| 1710 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
[339] | 1711 |
|
---|
| 1712 | // Ceci est maintenant obsolete, on garde pour info.
|
---|
[293] | 1713 | kw = "gfd2d";
|
---|
| 1714 | usage = "Displays Points (X-Y) with error-bars from a GeneralFit Data ";
|
---|
| 1715 | usage += "\n Usage : gfd2d nameobj numvarx erreur=(x y xy) [graphic_attributes]";
|
---|
[339] | 1716 | usage += "\n Related commands: gfd3d nt2d nt3d ";
|
---|
| 1717 | usage += "\n ----- OBSOLETE: utilisez nt2d -----";
|
---|
[330] | 1718 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
[293] | 1719 | kw = "gfd3d";
|
---|
| 1720 | usage = "Displays 3D-Points (X-Y-Z) with error-bars from a GeneralFit Data ";
|
---|
| 1721 | usage += "\n Usage : gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) [graphic_attributes]";
|
---|
| 1722 | usage += "\n Related commands: gfd2d nt2d nt3d ";
|
---|
[339] | 1723 | usage += "\n ----- OBSOLETE: utilisez nt3d -----";
|
---|
[330] | 1724 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
|
---|
[293] | 1725 |
|
---|
| 1726 | kw = "func";
|
---|
| 1727 | usage = "Displays a function y=f(x) (Fills a vector with function values)";
|
---|
[1938] | 1728 | usage += "\n Usage: func f(x) xmin xmax [npt graphic_attributes]";
|
---|
[326] | 1729 | usage += "\n Related commands: funcff func2d func2dff ";
|
---|
[330] | 1730 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
[326] | 1731 | kw = "funcff";
|
---|
| 1732 | usage = "Displays a function y=f(x) from a C-file (Fills a vector with function values)";
|
---|
[1938] | 1733 | usage += "\n Usage: funcff C-FileName FunctionName xmin xmax [npt graphic_attributes]";
|
---|
[326] | 1734 | usage += "\n Related commands: func func2d func2dff ";
|
---|
[330] | 1735 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
[293] | 1736 | kw = "func2d";
|
---|
| 1737 | usage = "Displays a function z=f(x,y) (Fills a matrix with function values)";
|
---|
| 1738 | usage += "\n Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [graphic_attributes]";
|
---|
| 1739 | usage += "\n Related commands: func";
|
---|
[330] | 1740 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
[326] | 1741 | kw = "func2dff";
|
---|
| 1742 | usage = "Displays a function z=f(x,y) from a C-file (Fills a matrix with function values)";
|
---|
| 1743 | usage += "\n Usage: func2dff C-FileName FunctionName xmin xmax nptx ymin ymax npty [graphic_attributes]";
|
---|
| 1744 | usage += "\n Related commands: func funcff func2d ";
|
---|
[330] | 1745 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
[293] | 1746 |
|
---|
[357] | 1747 | kw = "ObjectExpressions";
|
---|
| 1748 | usage = "Any mathematical expression (math.h) with object variables can be used";
|
---|
| 1749 | usage += "\n ------ Object Variable names (double) -------- ";
|
---|
[2419] | 1750 | usage += "\n (_nl is the table line number or the sequential index)";
|
---|
| 1751 | usage += "\n- NTuple: ntuple variable names,_nl";
|
---|
| 1752 | usage += "\n- Histo1D/HProf: i,x,val,err,_nl";
|
---|
| 1753 | usage += "\n- Histo2D: i,j,x,y,val,err,_nl";
|
---|
| 1754 | usage += "\n- Vector/Matrix: n,r,c,val,real,imag,mod,phas,_nl";
|
---|
| 1755 | usage += "\n- TArray: n,x,y,z,t,u,val,real,imag,mod,phas,_nl";
|
---|
| 1756 | usage += "\n- Image: i,j,x,y,val(=pix),_nl";
|
---|
| 1757 | usage += "\n- GeneralFitData: x0,ex0 x1,ex1 ... xn,exn y,ey ok ,_nl";
|
---|
[1548] | 1758 | usage += "\n- LocalMap/SphereThetaPhi/SphereHEALPix: ";
|
---|
[2419] | 1759 | usage += "\n- i,k,val,real,imag,mod,phas,teta,phi,_nl";
|
---|
| 1760 | usage += "\n- FITS Binary/ASCII table: fits column names,_nl";
|
---|
[2128] | 1761 | #ifdef SANS_EVOLPLANCK
|
---|
| 1762 | usage += "\n ------ Eros Variable names (double) -------- ";
|
---|
| 1763 | usage += "\n- StarList: x,y,flux,fond,pixmax,flags,";
|
---|
[2419] | 1764 | usage += "\n- xref,yref,fluxref,fondref,pixmaxref,_nl";
|
---|
[2128] | 1765 | #endif
|
---|
[1548] | 1766 | usage += "\n ------ Other parameters -------- ";
|
---|
[357] | 1767 | usage += "\nLoop parameters can be specified as I1[:I2[:DI]] for(int i=I1; i<I2; i+=DI)";
|
---|
| 1768 | usage += "\nThe default Cut() expression in true (=1) for all";
|
---|
[1548] | 1769 | usage += "\n\n Related commands: plot2d plot2de plot2dw plot3d ";
|
---|
[357] | 1770 | usage += "\n projh1d projh2d projprof fillvec fillmtx ";
|
---|
| 1771 | usage += "\n fillnt fillgd1 fillgd2 ntloop exptovec ... ";
|
---|
[2419] | 1772 | grp = "Expr. Plotting";
|
---|
| 1773 | mpiac->RegisterHelp(kw, usage, grp);
|
---|
[293] | 1774 | kw = "plot2d";
|
---|
| 1775 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) --- Object Variable names (double) :";
|
---|
[357] | 1776 | usage += "\n Usage: plot2d nameobj f_X() g_Y() [f_Cut() graphic_attributes loop_param]";
|
---|
| 1777 | usage += "\n Related commands: plot2de plot2dw plot3d ObjectExpressions ...";
|
---|
[330] | 1778 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[357] | 1779 | kw = "plot2de";
|
---|
| 1780 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with error bars eX/Y=f_ErrX/Y(Object) ";
|
---|
| 1781 | usage += "\n Usage: plot2de nameobj f_X() g_Y() f_ErrX() f_ErrY() [f_Cut() graphic_attributes loop_param]";
|
---|
| 1782 | usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
|
---|
| 1783 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[333] | 1784 | kw = "plot2dw";
|
---|
| 1785 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with Weight W=h(Object) ";
|
---|
[357] | 1786 | usage += "\n Usage: plot2dw nameobj f_X() g_Y() h_Wt() [Cut() graphic_attributes loop_param]";
|
---|
| 1787 | usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
|
---|
[333] | 1788 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1789 | kw = "plot3d";
|
---|
| 1790 | usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs ";
|
---|
[357] | 1791 | usage += "\n Usage: plot3d nameobj f_X() g_Y() h_Z() [Cut() graphic_attributes loop_param]";
|
---|
| 1792 | usage += "\n Related commands: plot2d plot2dw plot2de plot3d ObjectExpressions ...";
|
---|
[330] | 1793 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1794 |
|
---|
| 1795 | kw = "projh1d";
|
---|
| 1796 | usage = "Projects X=f(Object) with weight WT=h(Object) into a 1D histogram ";
|
---|
[357] | 1797 | usage += "\n Usage: projh1d nameh1d nameobj f_X() [h_WT()=1. Cut() graphic_attributes loop_param]";
|
---|
[293] | 1798 | usage += "\n Histo1D nameh1d is created if necessary ";
|
---|
[357] | 1799 | usage += "\n Related commands: projh2d projprof ObjectExpressions ...";
|
---|
[330] | 1800 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1801 | kw = "projh2d";
|
---|
| 1802 | usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a 2D histogram ";
|
---|
[357] | 1803 | usage += "\n Usage: projh2d nameh2d nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
|
---|
[293] | 1804 | usage += "\n Histo2D nameh2d is created if necessary ";
|
---|
[357] | 1805 | usage += "\n Related commands: projh1d projprof ObjectExpressions ...";
|
---|
[330] | 1806 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1807 | kw = "projprof";
|
---|
| 1808 | usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a profile histogram ";
|
---|
[709] | 1809 | usage += "\n Usage: projprof nameprof nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
|
---|
[293] | 1810 | usage += "\n HProf nameprof is created if necessary ";
|
---|
[357] | 1811 | usage += "\n Related commands: projh1d projh2d ObjectExpressions ...";
|
---|
[330] | 1812 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[357] | 1813 | kw = "fillvec";
|
---|
| 1814 | usage = "Fills a Vector V((int)(f_X(Object)+0.5)) = h_V(Object) ";
|
---|
| 1815 | usage += "\n Usage: fillvec namevec nameobj f_X() h_V() [Cut() graphic_attributes loop_param]";
|
---|
| 1816 | usage += "\n Related commands: fillmtx fillnt ObjectExpressions ...";
|
---|
| 1817 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
| 1818 | kw = "fillmtx";
|
---|
| 1819 | usage = "Fills a Matrix M(Line=g_Y(Object)+0.5, Col=f_X(Object)+0.5)) = h_V(Object) ";
|
---|
| 1820 | usage += "\n Usage: fillvec namevec nameobj f_X() g_Y() h_V() [Cut() graphic_attributes loop_param]";
|
---|
| 1821 | usage += "\n Related commands: fillvec fillnt ObjectExpressions ...";
|
---|
| 1822 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1823 |
|
---|
| 1824 | kw = "fillnt";
|
---|
| 1825 | usage = "Creates and Fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
|
---|
[357] | 1826 | usage += "\n Usage: fillnt nameobj f_X() g_Y() h_Z() k_T() [Cut() nameNt loop_param]";
|
---|
[333] | 1827 | usage += "\n Related commands: ntloop plot2d projh1d projh2d projprof ";
|
---|
[357] | 1828 | usage += "\n Related commands: fillvec fillmtx ntloop exptovec fillgd1 fillgd2 ObjectExpressions ...";
|
---|
[330] | 1829 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[357] | 1830 |
|
---|
[333] | 1831 | kw = "ntloop";
|
---|
| 1832 | usage = "Loops over an Object NTupleInterface calling a function from a C-file \n";
|
---|
| 1833 | usage += "and optionaly fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
|
---|
[357] | 1834 | usage += "\n Usage: ntloop nameobj CFileName FuncName [NtupleName loop_param]";
|
---|
| 1835 | usage += "\n Related commands: fillvec fillmtx fillnt fillgd1 fillgd2 exptovec ObjectExpressions ...";
|
---|
[333] | 1836 | usage += "\n Related commands: ntexpcfile fillnt";
|
---|
| 1837 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[357] | 1838 |
|
---|
[333] | 1839 | kw = "ntexpcfile";
|
---|
| 1840 | usage = "Creates a C-File with declarations suitable to be used for ntloop";
|
---|
| 1841 | usage += "\n Usage: ntexpcfile nameobj CFileName FuncName ";
|
---|
| 1842 | usage += "\n Related commands: ntloop";
|
---|
| 1843 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
| 1844 |
|
---|
[357] | 1845 | kw = "exptovec";
|
---|
[293] | 1846 | usage = "Creates and Fills a Vector with X=f(Object)";
|
---|
[357] | 1847 | usage += "\n Usage: exptovec namevec nameobj f_X() [Cut() graphic_attributes loop_param]";
|
---|
| 1848 | usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
|
---|
[330] | 1849 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1850 | kw = "fillgd1";
|
---|
| 1851 | usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), ErrY=h(...))";
|
---|
[357] | 1852 | usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_ErrY() [Cut() loop_param]";
|
---|
| 1853 | usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
|
---|
[330] | 1854 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1855 | kw = "fillgd2";
|
---|
| 1856 | usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), Z=h(...)) ErrZ=k(...)";
|
---|
[357] | 1857 | usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_Z() k_ErrZ() [Cut() loop_param]";
|
---|
| 1858 | usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
|
---|
[330] | 1859 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[1067] | 1860 | kw = "gdfrvec";
|
---|
| 1861 | usage = "Fills a GeneralFitData with vectors X,Y,Z,EZ";
|
---|
| 1862 | usage += "\n Usage: gdfrvec namegfd X Y";
|
---|
| 1863 | usage += "\n Usage: gdfrvec namegfd X Y ! EY";
|
---|
| 1864 | usage += "\n Usage: gdfrvec namegfd X Y Z";
|
---|
| 1865 | usage += "\n Usage: gdfrvec namegfd X Y Z EZ";
|
---|
| 1866 | usage += "\n Related commands: fillgd1 fillgd2 ...";
|
---|
| 1867 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1868 |
|
---|
[2180] | 1869 |
|
---|
| 1870 | kw = "eval";
|
---|
| 1871 | usage = "Compute arithmetic expression\n";
|
---|
| 1872 | usage += "\n Usage: eval resultvarname arithmetic expression....";
|
---|
| 1873 | usage += "\n resultvarname: store result in variable resultvarname";
|
---|
| 1874 | usage += "\n - If first character is not alphabetic, just print result";
|
---|
| 1875 | usage += "\n arithmetic expression:";
|
---|
| 1876 | usage += "\n ex: x + sqrt(y)+z +3.14 (x,y,z are variables)";
|
---|
| 1877 | usage += "\n ex: $x + sqrt($y)+$z +3.14 (x,y,z are variables)";
|
---|
| 1878 | usage += "\n ex: 360 * M_PI / 180.";
|
---|
| 1879 | mpiac->RegisterCommand(kw, usage, this, "Expr. Arithmetic");
|
---|
| 1880 |
|
---|
[293] | 1881 | }
|
---|
| 1882 |
|
---|
| 1883 | /* --Methode-- */
|
---|
| 1884 | int PIABaseExecutor::LinkUserFuncs(string& fnameso, string& func1, string& func2, string& func3)
|
---|
| 1885 | // string& func4, string& func5)
|
---|
| 1886 | {
|
---|
| 1887 | string cmd;
|
---|
| 1888 |
|
---|
| 1889 | if (dynlink) delete dynlink; dynlink = NULL;
|
---|
| 1890 | usfmap.clear();
|
---|
| 1891 |
|
---|
| 1892 | dynlink = new PDynLinkMgr(fnameso, true);
|
---|
| 1893 | if (dynlink == NULL) {
|
---|
| 1894 | string sn = fnameso;
|
---|
| 1895 | cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur ouverture SO " << sn << endl;
|
---|
| 1896 | return(2);
|
---|
| 1897 | }
|
---|
| 1898 |
|
---|
| 1899 | int nok=0;
|
---|
| 1900 | // on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
|
---|
| 1901 | // DlUserProcFunction f = NULL;
|
---|
| 1902 | DlFunction f = NULL;
|
---|
| 1903 | if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
|
---|
| 1904 | // f = (DlUserProcFunction) dlsym(dlhandle, func1.c_str());
|
---|
| 1905 | f = dynlink->GetFunction(func1);
|
---|
| 1906 | if (f) { nok++; usfmap[func1] = f; }
|
---|
| 1907 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func1 << endl;
|
---|
| 1908 |
|
---|
| 1909 | if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
|
---|
| 1910 | // f = (DlUserProcFunction) dlsym(dlhandle, func2.c_str());
|
---|
| 1911 | f = dynlink->GetFunction(func2);
|
---|
| 1912 | if (f) { nok++; usfmap[func2] = f; }
|
---|
| 1913 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func2 << endl;
|
---|
| 1914 |
|
---|
| 1915 | if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
|
---|
| 1916 | // f = (DlUserProcFunction) dlsym(dlhandle, func3.c_str());
|
---|
| 1917 | f = dynlink->GetFunction(func3);
|
---|
| 1918 | if (f) { nok++; usfmap[func3] = f; }
|
---|
| 1919 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func3 << endl;
|
---|
| 1920 |
|
---|
| 1921 | /* Pb compile g++ 2.7.2
|
---|
| 1922 | if ((func4.length() < 1) || (func4 == "-") || (func4 == ".") ) goto fin;
|
---|
| 1923 | // f = (DlUserProcFunction) dlsym(dlhandle, func4.c_str());
|
---|
| 1924 | f = dynlink->GetFunction(func4);
|
---|
| 1925 | if (f) { nok++; usfmap[func4] = f; }
|
---|
| 1926 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func4 << endl;
|
---|
| 1927 |
|
---|
| 1928 | if ((func5.length() < 1) || (func5 == "-") || (func5 == ".") ) goto fin;
|
---|
| 1929 | // f = (DlUserProcFunction) dlsym(dlhandle, func5.c_str());
|
---|
| 1930 | f = dynlink->GetFunction(func5);
|
---|
| 1931 | if (f) { nok++; usfmap[func5] = f; }
|
---|
| 1932 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func5 << endl;
|
---|
| 1933 | */
|
---|
| 1934 | fin:
|
---|
| 1935 | if (nok < 1) { if (dynlink) delete dynlink; dynlink = NULL; return(3); }
|
---|
| 1936 | else return(0);
|
---|
| 1937 | }
|
---|
| 1938 |
|
---|
[1276] | 1939 | /* --Methode-- */
|
---|
| 1940 | int PIABaseExecutor::LinkUserFuncs2(string& fnameso, string& func1, string& func2, string& func3)
|
---|
| 1941 | {
|
---|
| 1942 | string cmd;
|
---|
| 1943 |
|
---|
| 1944 | if (dynlink2) delete dynlink2; dynlink2 = NULL;
|
---|
| 1945 | usfmap2.clear();
|
---|
| 1946 |
|
---|
| 1947 | dynlink2 = new PDynLinkMgr(fnameso, true);
|
---|
| 1948 | if (dynlink2 == NULL) {
|
---|
| 1949 | string sn = fnameso;
|
---|
| 1950 | cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur ouverture SO " << sn << endl;
|
---|
| 1951 | return(2);
|
---|
| 1952 | }
|
---|
| 1953 |
|
---|
| 1954 | int nok=0;
|
---|
| 1955 | // on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
|
---|
| 1956 | // DlUserProcFunction f = NULL;
|
---|
| 1957 | DlFunction f = NULL;
|
---|
| 1958 | if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
|
---|
| 1959 | f = dynlink2->GetFunction(func1);
|
---|
| 1960 | if (f) { nok++; usfmap2[func1] = f; }
|
---|
| 1961 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func1 << endl;
|
---|
| 1962 |
|
---|
| 1963 | if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
|
---|
| 1964 | f = dynlink2->GetFunction(func2);
|
---|
| 1965 | if (f) { nok++; usfmap2[func2] = f; }
|
---|
| 1966 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func2 << endl;
|
---|
| 1967 |
|
---|
| 1968 | if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
|
---|
| 1969 | f = dynlink2->GetFunction(func3);
|
---|
| 1970 | if (f) { nok++; usfmap2[func3] = f; }
|
---|
| 1971 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func3 << endl;
|
---|
| 1972 |
|
---|
| 1973 | fin:
|
---|
| 1974 | if (nok < 1) { if (dynlink2) delete dynlink2; dynlink2 = NULL; return(3); }
|
---|
| 1975 | else return(0);
|
---|
| 1976 | }
|
---|
| 1977 |
|
---|
[388] | 1978 | /* Nouvelle-Fonction */
|
---|
| 1979 | void RegisterPIGraphicsHelp(PIACmd* piac)
|
---|
| 1980 | {
|
---|
| 1981 | string kw,grp,usage;
|
---|
| 1982 |
|
---|
| 1983 | grp = "Graphics";
|
---|
| 1984 |
|
---|
| 1985 | kw = "PIImage";
|
---|
| 1986 | usage = "Manages the display of a 2-D array (P2DArrayAdapter) as an image \n";
|
---|
| 1987 | usage += "and controls a zoom widget, as well as a global image view widget \n";
|
---|
| 1988 | usage += ">>>> Mouse controls : \n";
|
---|
| 1989 | usage += "o Button-1: Display current coordinates and pixel value\n";
|
---|
| 1990 | usage += " Position the cursor an refresh the zoom widget\n";
|
---|
| 1991 | usage += "o Button-2: Defines an image zone and positions the cursor \n";
|
---|
| 1992 | usage += "o Button-3: Moves the viewed portion of the array inside the window \n";
|
---|
| 1993 | usage += ">>>> Keyboard controls : \n";
|
---|
| 1994 | usage += "o <Alt>R : Refresh display \n";
|
---|
| 1995 | usage += "o <Alt>O : Shows the PIImageTools (image display parameter controls) \n";
|
---|
| 1996 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of overlayed graphics (Drawers)) \n";
|
---|
[2545] | 1997 | usage += "o <Alt>D : Shows the drawer manipulation pop-up menu \n";
|
---|
[388] | 1998 | usage += "o <Alt>V : Copy/Paste / Text paste at the current cursor position \n";
|
---|
| 1999 | usage += "o <Alt>C : Copy/Paste / Copies the selected regions content as text in the copy/paste buffer \n";
|
---|
| 2000 | usage += "o <Alt>X : Show/Hide the Cut Window \n";
|
---|
[2263] | 2001 | usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n";
|
---|
| 2002 | usage += "o <Alt>E : Removes the last added graphic element \n";
|
---|
[2158] | 2003 | usage += "o <Alt>+ or <Cntl>+ : Zoom in \n";
|
---|
| 2004 | usage += "o <Alt>- or <Cntl>- : Zoom out \n";
|
---|
[388] | 2005 | usage += "o Cursor keys : Moves the image cursor \n";
|
---|
| 2006 | piac->RegisterHelp(kw, usage, grp);
|
---|
| 2007 |
|
---|
| 2008 | kw = "PIScDrawWdg";
|
---|
| 2009 | usage = "Manages display of 2-D drawers with interactive zoom \n";
|
---|
| 2010 | usage += ">>>> Mouse controls : \n";
|
---|
| 2011 | usage += "o Button-1: Display current coordinates \n";
|
---|
| 2012 | usage += "o Button-2: Defines a rectangle for zoom \n";
|
---|
| 2013 | usage += "o Button-3: Defines a rectangle for Text-Info (<Alt>I) \n";
|
---|
| 2014 | usage += ">>>> Keyboard controls : \n";
|
---|
| 2015 | usage += "o <Alt>R : Refresh display \n";
|
---|
| 2016 | usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n";
|
---|
[2545] | 2017 | usage += " (2-D histograms, contour plot ...) \n";
|
---|
[388] | 2018 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
|
---|
| 2019 | usage += " Drawer 0 manages the axes, as well as the added text \n";
|
---|
[2545] | 2020 | usage += "o <Alt>D : Shows the drawer manipulation pop-up menu \n";
|
---|
[388] | 2021 | usage += "o <Alt>V : Copy/Paste / Text paste at the current position \n";
|
---|
[2263] | 2022 | usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n";
|
---|
| 2023 | usage += "o <Alt>E : Removes the last added graphic element \n";
|
---|
[1134] | 2024 | usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n";
|
---|
[1911] | 2025 | usage += "o <Alt>M : Activate/Deactivate a measurement cursor on Button-1\n";
|
---|
| 2026 | usage += "o <Alt>L : Deactivate DX,DY print (see below)\n";
|
---|
[1883] | 2027 | usage += ">>>> Mouse + Keyboard controls : \n";
|
---|
| 2028 | usage += "o Button-1 + <Alt>K : Set (reset) the reference point for DX,DY print \n";
|
---|
[388] | 2029 | piac->RegisterHelp(kw, usage, grp);
|
---|
| 2030 |
|
---|
| 2031 | kw = "PIDraw3DWdg";
|
---|
| 2032 | usage = "Manages display of 3-D objects (drawers) \n";
|
---|
| 2033 | usage += ">>>> Mouse controls : \n";
|
---|
| 2034 | usage += "o Button-2: Rotates the observer (camera) around object \n";
|
---|
| 2035 | usage += "o Shift-Button-2: Rotates object with camera fixed \n";
|
---|
| 2036 | usage += " The object rotation mode can be assigned to Button-2 with <Alt>S \n";
|
---|
| 2037 | usage += "o Button-3: Zoom control (Camera distance And/Or view angle) \n";
|
---|
| 2038 | usage += ">>>> Keyboard controls : \n";
|
---|
| 2039 | usage += "o <Alt>R : Resets the 3-D view and refreshes the display \n";
|
---|
[2545] | 2040 | usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n";
|
---|
| 2041 | usage += " (2-D histograms, contour plot ...) \n";
|
---|
[388] | 2042 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
|
---|
[2545] | 2043 | usage += " Drawer 0 manages the axes, as well as the added text \n";
|
---|
| 2044 | usage += "o <Alt>D : Shows the drawer manipulation pop-up menu \n";
|
---|
[388] | 2045 | usage += "o <Alt>V : Copy/Paste / Text paste at the current position (Drawer 0)\n";
|
---|
[2263] | 2046 | usage += "o <Alt>Z : Removes added graphic elements (handled by BaseDrawer - 0) \n";
|
---|
| 2047 | usage += "o <Alt>E : Removes the last added graphic element \n";
|
---|
[388] | 2048 | usage += "o <Alt>A : Activate/Deactivate axes drawing \n";
|
---|
| 2049 | usage += "o <Alt>S : Activate/Deactivate object rotation mode on Button-2 \n";
|
---|
| 2050 | piac->RegisterHelp(kw, usage, grp);
|
---|
| 2051 |
|
---|
| 2052 | kw = "Windows";
|
---|
| 2053 | usage = "Objects can be displayed in different windows, or overlayed on the \n";
|
---|
| 2054 | usage += "previous display. The graphics attributes next,win,stack,same control \n";
|
---|
| 2055 | usage += "the display window. \n";
|
---|
| 2056 | usage += "o GraphicWindow : This is the default mode (gr_att=next)\n";
|
---|
| 2057 | usage += " Graphic windows can be divided int zones. Object is displayed \n";
|
---|
| 2058 | usage += " in the next available position, removing a previously displayed \n";
|
---|
| 2059 | usage += " widget if necessary \n";
|
---|
| 2060 | usage += "o Window : An object is displayed in its own window (gr_att= win) \n";
|
---|
| 2061 | usage += "o StackWindow : multpile widgets can be stacked in a StackWindow (gr_att= stack) \n";
|
---|
| 2062 | usage += " A single widget is displayed a any time. Different widgets in a StackWindow \n";
|
---|
| 2063 | usage += " can be displayed using the stacknext command, as well as the StackTools item \n";
|
---|
| 2064 | usage += " in the Tools menu (from Menubar). An automatic cyclic display mode can also \n";
|
---|
| 2065 | usage += " be activated using the StackTools menu (Blink) \n";
|
---|
[548] | 2066 | usage += "o Most objects can be also be displayed overlayed \n";
|
---|
| 2067 | usage += " on the last displayed widget (gr_att= same) \n";
|
---|
| 2068 | usage += "o The overlay can be on a selected rectangle of the \n";
|
---|
| 2069 | usage += " last displayed widget (gr_att= inset) - See setinsetlimits\n";
|
---|
[553] | 2070 | usage += "\n Related commands: newwin zone stacknext graphicatt setinsetlimits";
|
---|
[388] | 2071 | piac->RegisterHelp(kw, usage, grp);
|
---|
[484] | 2072 |
|
---|
| 2073 | kw = "PIConsole";
|
---|
| 2074 | usage = "Text output area and command editing window (console) \n";
|
---|
| 2075 | usage += ">>>> Mouse controls : \n";
|
---|
| 2076 | usage += "o Button-1: Rectangle selection for copy/paste \n";
|
---|
| 2077 | usage += "o Button-2: Paste text in the command editing line \n";
|
---|
| 2078 | usage += "o Button-3: activate display option menu \n";
|
---|
| 2079 | usage += ">>>> Keyboard controls : \n";
|
---|
| 2080 | usage += "o <Alt>O : activate display option menu \n";
|
---|
| 2081 | usage += "o <Alt>V : Paste text in the command editing line \n";
|
---|
| 2082 | usage += "o <Alt>A : Selection of the whole window for copy \n";
|
---|
| 2083 | usage += "o <Alt>L : Command history (List of command history buffer) \n";
|
---|
| 2084 | usage += "o <Ctl>A : Command editing -> Goto the beginning of line \n";
|
---|
| 2085 | usage += "o <Ctl>E : Command editing -> Goto the end of line \n";
|
---|
| 2086 | usage += "o <Ctl>K : Command editing -> Clear to the end of line \n";
|
---|
| 2087 | usage += "o <Ctl>C : Command editing -> Clear the line \n";
|
---|
| 2088 | usage += "o Cursor left,right : Command editing -> Move cursor \n";
|
---|
| 2089 | usage += "o Cursor Up,Down : recall command from history buffer \n";
|
---|
| 2090 | usage += "o Backspace,Del : Command editing \n";
|
---|
| 2091 | usage += "o <Return>,<Enter> : Execute command \n";
|
---|
| 2092 | piac->RegisterHelp(kw, usage, grp);
|
---|
[388] | 2093 | }
|
---|