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