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