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