| 1 | #include "piacmd.h"
 | 
|---|
| 2 | 
 | 
|---|
| 3 | #include <stdio.h>
 | 
|---|
| 4 | #include <stdlib.h>
 | 
|---|
| 5 | #include <math.h>
 | 
|---|
| 6 | 
 | 
|---|
| 7 | #include "basexecut.h"
 | 
|---|
| 8 | 
 | 
|---|
| 9 | #include "pdlmgr.h"
 | 
|---|
| 10 | #include "ctimer.h"
 | 
|---|
| 11 | 
 | 
|---|
| 12 | #include "pistdimgapp.h"
 | 
|---|
| 13 | #include "nobjmgr.h"
 | 
|---|
| 14 | #include "servnobjm.h"
 | 
|---|
| 15 | 
 | 
|---|
| 16 | #include "histos.h"
 | 
|---|
| 17 | #include "histos2.h"
 | 
|---|
| 18 | #include "hisprof.h"
 | 
|---|
| 19 | #include "ntuple.h"
 | 
|---|
| 20 | #include "generaldata.h"
 | 
|---|
| 21 | 
 | 
|---|
| 22 | #ifdef SANS_EVOLPLANCK
 | 
|---|
| 23 | #include "cvector.h"
 | 
|---|
| 24 | #else
 | 
|---|
| 25 | #include "tvector.h"
 | 
|---|
| 26 | #endif
 | 
|---|
| 27 | 
 | 
|---|
| 28 | 
 | 
|---|
| 29 | /* --Methode-- */
 | 
|---|
| 30 | PIABaseExecutor::PIABaseExecutor(PIACmd* piac, NamedObjMgr* omg, PIStdImgApp* app)
 | 
|---|
| 31 | {
 | 
|---|
| 32 | mpiac = piac;
 | 
|---|
| 33 | mObjMgr = omg; 
 | 
|---|
| 34 | mImgApp = app;
 | 
|---|
| 35 | dynlink = NULL;
 | 
|---|
| 36 | dynlink2 = NULL;
 | 
|---|
| 37 | RegisterCommands();
 | 
|---|
| 38 | }
 | 
|---|
| 39 | 
 | 
|---|
| 40 | PIABaseExecutor::~PIABaseExecutor()
 | 
|---|
| 41 | {
 | 
|---|
| 42 |   if (dynlink) delete dynlink;
 | 
|---|
| 43 |   if (dynlink2) delete dynlink2;
 | 
|---|
| 44 | }
 | 
|---|
| 45 | 
 | 
|---|
| 46 | 
 | 
|---|
| 47 |  
 | 
|---|
| 48 | /* --Methode-- */
 | 
|---|
| 49 | int PIABaseExecutor::Execute(string& kw, vector<string>& tokens, string& toks)
 | 
|---|
| 50 | {
 | 
|---|
| 51 | Services2NObjMgr* srvo = mObjMgr->GetServiceObj();
 | 
|---|
| 52 | // >>>>> Chargement de modules
 | 
|---|
| 53 | if (kw == "loadmodule") {
 | 
|---|
| 54 |   if (tokens.size() < 2) { cout << "Usage: loadmodule fnameso modulename" << endl;  return(0); }
 | 
|---|
| 55 |   mpiac->LoadModule(tokens[0], tokens[1]);
 | 
|---|
| 56 |   }
 | 
|---|
| 57 | // >>>>>>>>>>> Fenetre graphique , changement d'attributs graphiques 
 | 
|---|
| 58 | else if (kw == "zone") {
 | 
|---|
| 59 |   while (tokens.size() < 2) tokens.push_back("1");
 | 
|---|
| 60 |   int nx, ny;
 | 
|---|
| 61 |   nx = ny = 1;
 | 
|---|
| 62 |   nx = atoi(tokens[0].c_str());    ny = atoi(tokens[1].c_str());
 | 
|---|
| 63 |   mObjMgr->SetGraphicWinZone(nx, ny, false);
 | 
|---|
| 64 |   }  
 | 
|---|
| 65 | else if (kw == "newwin") {
 | 
|---|
| 66 |   if (tokens.size() < 2) { cout << "Usage: newwin nx ny" << endl;  return(0); }
 | 
|---|
| 67 |   int nx, ny;
 | 
|---|
| 68 |   nx = ny = 1;
 | 
|---|
| 69 |   nx = atoi(tokens[0].c_str());    ny = atoi(tokens[1].c_str());
 | 
|---|
| 70 |   mObjMgr->SetGraphicWinZone(nx, ny, true);
 | 
|---|
| 71 |   }  
 | 
|---|
| 72 | else if (kw == "stacknext") mImgApp->StackWinNext(); 
 | 
|---|
| 73 | else if (kw == "graphicatt") {
 | 
|---|
| 74 |   if (tokens.size() < 1) { cout << "Usage: graphicatt attributes_list (att=def->defaut)" << endl;  return(0); }
 | 
|---|
| 75 |   mObjMgr->SetGraphicAttributes(tokens[0]); 
 | 
|---|
| 76 |   }
 | 
|---|
| 77 | else if (kw == "setxylimits") {
 | 
|---|
| 78 |   if (tokens.size() < 4) { cout << "Usage: setxylimits xmin xmax ymin ymax" << endl;  return(0); }
 | 
|---|
| 79 |   double xmin = atof(tokens[0].c_str());
 | 
|---|
| 80 |   double xmax = atof(tokens[1].c_str());
 | 
|---|
| 81 |   double ymin = atof(tokens[2].c_str());
 | 
|---|
| 82 |   double ymax = atof(tokens[3].c_str());
 | 
|---|
| 83 |   mImgApp->SetXYLimits(xmin, xmax, ymin, ymax);
 | 
|---|
| 84 |   }
 | 
|---|
| 85 | else if (kw == "setinsetlimits") {
 | 
|---|
| 86 |   if (tokens.size() < 4) { cout << "Usage: setinsetlimits xmin xmax ymin ymax" << endl;  return(0); }
 | 
|---|
| 87 |   double xmin = atof(tokens[0].c_str());
 | 
|---|
| 88 |   double xmax = atof(tokens[1].c_str());
 | 
|---|
| 89 |   double ymin = atof(tokens[2].c_str());
 | 
|---|
| 90 |   double ymax = atof(tokens[3].c_str());
 | 
|---|
| 91 |   mImgApp->SetInsetLimits(xmin, xmax, ymin, ymax);
 | 
|---|
| 92 |   }
 | 
|---|
| 93 | else if (kw == "setimgcenter") {
 | 
|---|
| 94 |   if (tokens.size() < 2) { cout << "Usage: setimgcenter xc yc" << endl;  return(0); }
 | 
|---|
| 95 |   int xc = atoi(tokens[0].c_str());
 | 
|---|
| 96 |   int yc = atoi(tokens[1].c_str());
 | 
|---|
| 97 |   mImgApp->SetImageCenterPosition(xc, yc);
 | 
|---|
| 98 |   }
 | 
|---|
| 99 | else if (kw == "addtext") {
 | 
|---|
| 100 |   if (tokens.size() < 4) { cout << "Usage: addtext x y colfontatt txt" << endl;  return(0); }
 | 
|---|
| 101 |   double xp = atof(tokens[0].c_str());
 | 
|---|
| 102 |   double yp = atof(tokens[1].c_str());
 | 
|---|
| 103 |   bool fgsr = true;
 | 
|---|
| 104 |   string txt = tokens[3];
 | 
|---|
| 105 |   for(int k=4; k<tokens.size(); k++) txt += (' ' + tokens[k]);
 | 
|---|
| 106 |   int opt = mObjMgr->GetServiceObj()->DecodeDispOption(tokens[2], fgsr);
 | 
|---|
| 107 |   mImgApp->AddText(txt, xp, yp);
 | 
|---|
| 108 |   if (fgsr) mImgApp->RestoreGraphicAtt(); 
 | 
|---|
| 109 |   }
 | 
|---|
| 110 | else if (kw == "settitle") {
 | 
|---|
| 111 |   if (tokens.size() < 2) { cout << "Usage: addtitle fontatt titleup " << endl;  return(0); }
 | 
|---|
| 112 |   bool fgsr = true;
 | 
|---|
| 113 |   int opt = mObjMgr->GetServiceObj()->DecodeDispOption(tokens[0], fgsr);
 | 
|---|
| 114 |   string txt = tokens[1];
 | 
|---|
| 115 |   for(int k=2; k<tokens.size(); k++) txt += (' ' + tokens[k]);
 | 
|---|
| 116 |   string td = "";
 | 
|---|
| 117 |   mImgApp->SetTitle(txt, td);
 | 
|---|
| 118 |   if (fgsr) mImgApp->RestoreGraphicAtt(); 
 | 
|---|
| 119 |   }
 | 
|---|
| 120 |   
 | 
|---|
| 121 | // >>>>>>>>>>> Link dynamique de fonctions C++
 | 
|---|
| 122 | else if (kw == "link" ) {
 | 
|---|
| 123 |   if (tokens.size() < 2) { cout << "Usage: link fnameso f1 [f2 f3]" << endl;  return(0); }
 | 
|---|
| 124 |   string sph = "";
 | 
|---|
| 125 |   for(int gg=0; gg<5; gg++)   tokens.push_back(sph);
 | 
|---|
| 126 |   int rc = LinkUserFuncs(tokens[0], tokens[1], tokens[2], tokens[3]);
 | 
|---|
| 127 |   if (rc == 0)  cout << "PIABaseExecutor: Link from " << tokens[0] << " OK " << endl;
 | 
|---|
| 128 | }
 | 
|---|
| 129 | else if (kw == "linkff2" ) {
 | 
|---|
| 130 |   if (tokens.size() < 2) { cout << "Usage: linkff2 fnameso f1 [f2 f3]" << endl;  return(0); }
 | 
|---|
| 131 |   string sph = "";
 | 
|---|
| 132 |   for(int gg=0; gg<5; gg++)   tokens.push_back(sph);
 | 
|---|
| 133 |   int rc = LinkUserFuncs2(tokens[0], tokens[1], tokens[2], tokens[3]);
 | 
|---|
| 134 |   if (rc == 0)  cout << "PIABaseExecutor: Link2 from " << tokens[0] << " OK " << endl;
 | 
|---|
| 135 | }
 | 
|---|
| 136 | else if (kw == "call" ) {
 | 
|---|
| 137 |   if (tokens.size() < 1) { cout << "Usage: call userf [arg1 arg2 ...]" << endl;  return(0); }
 | 
|---|
| 138 |   UsFmap::iterator it;
 | 
|---|
| 139 |   UsFmap::iterator it1 = usfmap.find(tokens[0]);
 | 
|---|
| 140 |   UsFmap::iterator it2 = usfmap2.find(tokens[0]);
 | 
|---|
| 141 |   if ((it1 == usfmap.end()) && (it2 == usfmap2.end()) ) {
 | 
|---|
| 142 |     cerr << "PIABaseExecutor: No User Function " << tokens[0] << endl;
 | 
|---|
| 143 |     return(0);
 | 
|---|
| 144 |   }
 | 
|---|
| 145 |   if (it1 == usfmap.end())  it = it2;
 | 
|---|
| 146 |   else it = it1;
 | 
|---|
| 147 |   cout << "PIABaseExecutor: Call " << tokens[0] << "( ... )" << endl;
 | 
|---|
| 148 | // on est oblige de faire un cast  etant donne qu'on 
 | 
|---|
| 149 | // utilise donc des DlFunction  (Reza 20/08/98)  voir commentaire ds .h (pb g++)
 | 
|---|
| 150 |   DlUserProcFunction fuf = (DlUserProcFunction)(*it).second;
 | 
|---|
| 151 | //   On redirige la sortie sur le terminal 
 | 
|---|
| 152 |   bool red = mImgApp->HasRedirectedStdOutErr();
 | 
|---|
| 153 |   mImgApp->RedirectStdOutErr(false);
 | 
|---|
| 154 | #ifdef SANS_EVOLPLANCK
 | 
|---|
| 155 |   TRY {
 | 
|---|
| 156 |     tokens.erase(tokens.begin());
 | 
|---|
| 157 |     fuf(tokens);
 | 
|---|
| 158 |   }  CATCH(merr) {
 | 
|---|
| 159 |     fflush(stdout); 
 | 
|---|
| 160 |     string es = PeidaExc(merr);
 | 
|---|
| 161 |     cerr << "\n PIABaseExecutor: Call UserFunc  Exception :" << merr << es;
 | 
|---|
| 162 |     cout << endl; 
 | 
|---|
| 163 |     }
 | 
|---|
| 164 | #else
 | 
|---|
| 165 |   try {
 | 
|---|
| 166 |     tokens.erase(tokens.begin());
 | 
|---|
| 167 |     fuf(tokens);
 | 
|---|
| 168 |   }
 | 
|---|
| 169 |   catch ( PThrowable & exc ) {
 | 
|---|
| 170 |     cerr << "\n PIABaseExecutor: Call / Catched Exception :" 
 | 
|---|
| 171 |          << (string)typeid(exc).name() << " Msg= " 
 | 
|---|
| 172 |          << exc.Msg() << endl;
 | 
|---|
| 173 |     cout << endl; 
 | 
|---|
| 174 |   }
 | 
|---|
| 175 |   catch ( ... ) {
 | 
|---|
| 176 |     cerr << "\n PIABaseExecutor: Call / Catched Exception ... " 
 | 
|---|
| 177 |          << endl;
 | 
|---|
| 178 |     cout << endl; 
 | 
|---|
| 179 |   }
 | 
|---|
| 180 | #endif
 | 
|---|
| 181 |   mImgApp->RedirectStdOutErr(red);
 | 
|---|
| 182 | }
 | 
|---|
| 183 | 
 | 
|---|
| 184 | // >>>>>>>>>>> lecture/ecriture des objets, gestion des objets 
 | 
|---|
| 185 | else if (kw == "openfits" ) {
 | 
|---|
| 186 |   if (tokens.size() < 1) { cout << "Usage: openfits file " << endl;  return(0); }
 | 
|---|
| 187 |   else { string nomobj = "";  mObjMgr->ReadFits(tokens[0], nomobj); }
 | 
|---|
| 188 | }
 | 
|---|
| 189 | else if (kw == "savefits" ) {
 | 
|---|
| 190 |   if (tokens.size() < 2) { cout << "Usage: savefits nameobj filename " << endl;  return(0); }
 | 
|---|
| 191 |   else mObjMgr->SaveFits(tokens[0], tokens[1]);
 | 
|---|
| 192 | }
 | 
|---|
| 193 | else if (kw == "openppf" ) {
 | 
|---|
| 194 |   if (tokens.size() < 1) { cout << "Usage: openppf file " << endl; return(0); }
 | 
|---|
| 195 |   mObjMgr->ReadAll(tokens[0]);  
 | 
|---|
| 196 | }
 | 
|---|
| 197 | else if (kw == "saveobjs" ) {
 | 
|---|
| 198 |   if (tokens.size() < 2) { cout << "Usage: saveobjs patt filename " << endl; return(0); }
 | 
|---|
| 199 |   mObjMgr->SaveObjects(tokens[0], tokens[1]);  
 | 
|---|
| 200 | }
 | 
|---|
| 201 | else if (kw == "saveall" ) {
 | 
|---|
| 202 |   if (tokens.size() < 1) { cout << "Usage: saveall file " << endl; return(0); }
 | 
|---|
| 203 |   mObjMgr->SaveAll(tokens[0]);  
 | 
|---|
| 204 | }
 | 
|---|
| 205 | else if (kw == "print" ) {
 | 
|---|
| 206 |   if (tokens.size() < 1) { cout << "Usage: print nameobj " << endl; return(0); }
 | 
|---|
| 207 |   mObjMgr->PrintObj(tokens[0]);  
 | 
|---|
| 208 | }
 | 
|---|
| 209 | else if ( (kw == "rename" ) || (kw == "mv") )  {
 | 
|---|
| 210 |   if (tokens.size() < 2) { cout << "Usage: rename nameobj namenew" << endl; return(0); }
 | 
|---|
| 211 |   mObjMgr->RenameObj(tokens[0], tokens[1]);  
 | 
|---|
| 212 | }
 | 
|---|
| 213 | else if ( (kw == "del" ) || (kw == "rm") ) {
 | 
|---|
| 214 |   if (tokens.size() < 1) { cout << "Usage: del nameobj " << endl; return(0); }
 | 
|---|
| 215 |   mObjMgr->DelObj(tokens[0]);  
 | 
|---|
| 216 | }
 | 
|---|
| 217 | else if (kw == "delobjs" ) {
 | 
|---|
| 218 |   if (tokens.size() < 1) { cout << "Usage: delobjs nomobjpattern (*,?) " << endl; return(0); }
 | 
|---|
| 219 |   mObjMgr->DelObjects(tokens[0]);  
 | 
|---|
| 220 | }
 | 
|---|
| 221 | else if ( (kw == "listobjs") || (kw == "ls") )    { 
 | 
|---|
| 222 |   if  (tokens.size() < 1)  tokens.push_back("*");
 | 
|---|
| 223 |   mObjMgr->ListObjs(tokens[0]);
 | 
|---|
| 224 | }
 | 
|---|
| 225 | // Gestion des repertoires
 | 
|---|
| 226 | else if (kw == "mkdir" ) {
 | 
|---|
| 227 |   if (tokens.size() < 1) { cout << "Usage: mkdir dirname [true]" << endl; return(0); }
 | 
|---|
| 228 |   bool crd = mObjMgr->CreateDir(tokens[0]);  
 | 
|---|
| 229 |   if ( crd && (tokens.size() > 1) && (tokens[1] == "true") )
 | 
|---|
| 230 |     mObjMgr->SetKeepOldDirAtt(tokens[0], true);
 | 
|---|
| 231 |   }
 | 
|---|
| 232 | else if (kw == "rmdir" ) {
 | 
|---|
| 233 |   if (tokens.size() < 1) { cout << "Usage: rmdir dirname " << endl; return(0); }
 | 
|---|
| 234 |   mObjMgr->DeleteDir(tokens[0]);  
 | 
|---|
| 235 |   }
 | 
|---|
| 236 | else if (kw == "cd")   { 
 | 
|---|
| 237 |   if  (tokens.size() < 1)  tokens.push_back("home");
 | 
|---|
| 238 |   mObjMgr->SetCurrentDir(tokens[0]);
 | 
|---|
| 239 |   }
 | 
|---|
| 240 | else if (kw == "pwd") { 
 | 
|---|
| 241 |   string dirn;
 | 
|---|
| 242 |   mObjMgr->GetCurrentDir(dirn);
 | 
|---|
| 243 |   cout << "CurrentDirectory: " << dirn << endl;
 | 
|---|
| 244 |   }  
 | 
|---|
| 245 | else if (kw == "listdirs")   { 
 | 
|---|
| 246 |   if  (tokens.size() < 1)  tokens.push_back("*");
 | 
|---|
| 247 |   mObjMgr->ListDirs(tokens[0]);
 | 
|---|
| 248 |   }
 | 
|---|
| 249 | 
 | 
|---|
| 250 | // >>>>>>>>>>> Creation d'histos 1D-2D
 | 
|---|
| 251 | else if (kw == "newh1d") {
 | 
|---|
| 252 |   if (tokens.size() < 4) { cout << "Usage: newh1d name xmin xmax nbin" << endl; return(0); }
 | 
|---|
| 253 |   int_4 nbx = 100;
 | 
|---|
| 254 |   r_8 xmin = 0., xmax = 1.;
 | 
|---|
| 255 |   nbx = atoi(tokens[3].c_str());
 | 
|---|
| 256 |   xmin = atof(tokens[1].c_str());   xmax = atof(tokens[2].c_str());
 | 
|---|
| 257 |   Histo* h = new Histo(xmin, xmax, nbx);
 | 
|---|
| 258 |   mObjMgr->AddObj(h, tokens[0]);
 | 
|---|
| 259 |   }
 | 
|---|
| 260 | else if (kw == "newh2d") {
 | 
|---|
| 261 |   if (tokens.size() < 7) { 
 | 
|---|
| 262 |     cout << "Usage: newh2d name xmin xmax nbinx ymin ymax nbiny" << endl; 
 | 
|---|
| 263 |     return(0); 
 | 
|---|
| 264 |     }
 | 
|---|
| 265 |   int_4 nbx = 50, nby = 50;
 | 
|---|
| 266 |   r_8 xmin = 0., xmax = 1.;
 | 
|---|
| 267 |   r_8 ymin = 0., ymax = 1.;
 | 
|---|
| 268 |   nbx = atoi(tokens[3].c_str());
 | 
|---|
| 269 |   nby = atoi(tokens[6].c_str());
 | 
|---|
| 270 |   xmin = atof(tokens[1].c_str());   xmax = atof(tokens[2].c_str());
 | 
|---|
| 271 |   ymin = atof(tokens[4].c_str());   ymax = atof(tokens[5].c_str());
 | 
|---|
| 272 |   Histo2D* h = new Histo2D(xmin, xmax, nbx, ymin, ymax, nby);
 | 
|---|
| 273 |   mObjMgr->AddObj(h, tokens[0]);
 | 
|---|
| 274 |   }
 | 
|---|
| 275 | else if (kw == "newprof" || kw == "newprofe") {
 | 
|---|
| 276 |   if (tokens.size() < 4)
 | 
|---|
| 277 |     { cout << "Usage: newprof[e] name xmin xmax nbin [ymin ymax]" << endl; return(0); }
 | 
|---|
| 278 |   int_4 nbx = 100;
 | 
|---|
| 279 |   r_8 xmin = 0., xmax = 1., ymin = 1., ymax = -1.;
 | 
|---|
| 280 |   if(tokens.size() > 5)
 | 
|---|
| 281 |     {ymin = atof(tokens[4].c_str());   ymax = atof(tokens[5].c_str());}
 | 
|---|
| 282 |   nbx = atoi(tokens[3].c_str());
 | 
|---|
| 283 |   xmin = atof(tokens[1].c_str());   xmax = atof(tokens[2].c_str());
 | 
|---|
| 284 |   HProf* h = new HProf(xmin, xmax, nbx, ymin, ymax);
 | 
|---|
| 285 |   if(kw == "newprofe") h->SetErrOpt(false);
 | 
|---|
| 286 |   mObjMgr->AddObj(h, tokens[0]);
 | 
|---|
| 287 |   }
 | 
|---|
| 288 | 
 | 
|---|
| 289 | // Creation de NTuple
 | 
|---|
| 290 | else if (kw == "newnt") {
 | 
|---|
| 291 |   if(tokens.size() < 2)
 | 
|---|
| 292 |     {cout<<"Usage: newnt name v1 v2 ... vn / newnt name nvar"<<endl; return(0);}
 | 
|---|
| 293 |   vector<string> varname;
 | 
|---|
| 294 |   int nvar = 0;
 | 
|---|
| 295 |   const char *c = tokens[1].c_str();
 | 
|---|
| 296 |   if(isdigit(c[0])) {
 | 
|---|
| 297 |     nvar = atoi(tokens[1].c_str());
 | 
|---|
| 298 |     if(nvar<=0 || nvar>=10000)
 | 
|---|
| 299 |       {cout<<"newnt name nvar : nvar must be an positive integer<10000"<<endl;
 | 
|---|
| 300 |        return(0);}
 | 
|---|
| 301 |     for(int i=0;i<nvar;i++) {
 | 
|---|
| 302 |       char str[16]; sprintf(str,"%d",i);
 | 
|---|
| 303 |       string dum = "v"; dum += str;
 | 
|---|
| 304 |       varname.push_back(dum.c_str());
 | 
|---|
| 305 |     }
 | 
|---|
| 306 |   } else if( islower(c[0]) || isupper(c[0]) ) {
 | 
|---|
| 307 |     for(int i=1;i<tokens.size();i++) {
 | 
|---|
| 308 |       varname.push_back(tokens[i].c_str());
 | 
|---|
| 309 |       nvar++;
 | 
|---|
| 310 |     }
 | 
|---|
| 311 |   } else {
 | 
|---|
| 312 |     cout<<"newnt name v1 v2 ... vn : name vi must begin by a letter"<<endl
 | 
|---|
| 313 |         <<"newnt name nvar : nvar must be an positive integer"<<endl;
 | 
|---|
| 314 |     return(0);
 | 
|---|
| 315 |   }
 | 
|---|
| 316 |   char **noms = new char*[nvar];
 | 
|---|
| 317 |   for(int i=0;i<nvar;i++) noms[i] = (char *)varname[i].c_str();
 | 
|---|
| 318 |   NTuple* nt = new NTuple(nvar,noms);
 | 
|---|
| 319 |   delete [] noms;
 | 
|---|
| 320 |   mObjMgr->AddObj(nt,tokens[0]);
 | 
|---|
| 321 |   }
 | 
|---|
| 322 | 
 | 
|---|
| 323 | // Creation de GeneralFitData
 | 
|---|
| 324 | else if (kw == "newgfd") {
 | 
|---|
| 325 |   if (tokens.size() < 3)
 | 
|---|
| 326 |     { cout << "Usage: newgfd nvar nalloc [errx(0/1)]" << endl; return(0); }
 | 
|---|
| 327 |   int nvar, nalloc, errx=0;
 | 
|---|
| 328 |   if (tokens.size() > 3)
 | 
|---|
| 329 |     { errx = atoi(tokens[3].c_str()); if(errx>0) errx=1; else errx = 0;}
 | 
|---|
| 330 |   nvar = atoi(tokens[1].c_str()); nalloc = atoi(tokens[2].c_str());
 | 
|---|
| 331 |   if(nvar>0 && nalloc>0) {
 | 
|---|
| 332 |     GeneralFitData* gfd = new GeneralFitData(nvar,nalloc,errx);
 | 
|---|
| 333 |     mObjMgr->AddObj(gfd, tokens[0]);
 | 
|---|
| 334 |     }
 | 
|---|
| 335 |   }
 | 
|---|
| 336 | 
 | 
|---|
| 337 | // Creation/remplissage de vecteur et de matrice
 | 
|---|
| 338 | else if (kw == "newvec") {
 | 
|---|
| 339 |   if (tokens.size() < 2) { 
 | 
|---|
| 340 |     cout << "Usage: newvec name size [f(i) dopt] " << endl; return(0); 
 | 
|---|
| 341 |     }
 | 
|---|
| 342 |   int n = atoi(tokens[1].c_str());
 | 
|---|
| 343 |   double xmin, xmax;
 | 
|---|
| 344 |   xmin = 0.;  xmax = n;
 | 
|---|
| 345 |   if (tokens.size() < 3)  { 
 | 
|---|
| 346 |     Vector* v = new Vector(n);
 | 
|---|
| 347 |     mObjMgr->AddObj(v, tokens[0]);
 | 
|---|
| 348 |     }
 | 
|---|
| 349 |   else {
 | 
|---|
| 350 |     if (tokens.size() < 4)  tokens.push_back("");
 | 
|---|
| 351 |     mObjMgr->GetServiceObj()->PlotFunc(tokens[2], tokens[0], xmin, xmax, n, tokens[3]); 
 | 
|---|
| 352 |     }
 | 
|---|
| 353 |   }
 | 
|---|
| 354 | else if (kw == "newmtx") {
 | 
|---|
| 355 |   if (tokens.size() < 3) { 
 | 
|---|
| 356 |     cout << "Usage: newvec name sizeX(Col) sizeY(Lines) [f(i,j) dopt] " << endl; return(0); 
 | 
|---|
| 357 |     }
 | 
|---|
| 358 |   int nx = atoi(tokens[1].c_str());
 | 
|---|
| 359 |   int ny = atoi(tokens[2].c_str());
 | 
|---|
| 360 |   double xmin, xmax, ymin, ymax;
 | 
|---|
| 361 |   xmin = 0.;  xmax = nx;
 | 
|---|
| 362 |   ymin = 0.;  ymax = ny;
 | 
|---|
| 363 |   if (tokens.size() < 4)  {
 | 
|---|
| 364 |     Matrix* mtx = new Matrix(ny,nx);
 | 
|---|
| 365 |     mObjMgr->AddObj(mtx, tokens[0]);
 | 
|---|
| 366 |     }
 | 
|---|
| 367 |   else {
 | 
|---|
| 368 |     if (tokens.size() < 5)  tokens.push_back("n");
 | 
|---|
| 369 |     mObjMgr->GetServiceObj()->PlotFunc2D(tokens[3], tokens[0], xmin, xmax, ymin, ymax, 
 | 
|---|
| 370 |                                          nx, ny, tokens[4]);
 | 
|---|
| 371 |     }
 | 
|---|
| 372 |   }
 | 
|---|
| 373 | 
 | 
|---|
| 374 | // Copie d'objets
 | 
|---|
| 375 | else if (kw == "copy") {
 | 
|---|
| 376 |   if(tokens.size()<2) { 
 | 
|---|
| 377 |     cout<<"Usage: copy name_from  name_to"<<endl;return(0); 
 | 
|---|
| 378 |   }
 | 
|---|
| 379 |   mObjMgr->CopyObj(tokens[0],tokens[1]);
 | 
|---|
| 380 | }
 | 
|---|
| 381 | 
 | 
|---|
| 382 | 
 | 
|---|
| 383 | // >>>>>>>>>>>  Affichage des objets 
 | 
|---|
| 384 | else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") ) {
 | 
|---|
| 385 |   if (tokens.size() < 1) { cout << "Usage: disp/surf/imag nameobj [opt]" << endl; return(0); }
 | 
|---|
| 386 |   string opt = "n";
 | 
|---|
| 387 |   if (tokens.size() > 1)  opt = tokens[1];
 | 
|---|
| 388 |   if (kw == "disp") mObjMgr->DisplayObj(tokens[0], opt);
 | 
|---|
| 389 |   else if (kw == "surf")  mObjMgr->DisplaySurf3D(tokens[0], opt);
 | 
|---|
| 390 |   else if (kw == "imag")  mObjMgr->DisplayImage(tokens[0], opt);
 | 
|---|
| 391 |   }
 | 
|---|
| 392 | 
 | 
|---|
| 393 | else if (kw == "nt2d") {
 | 
|---|
| 394 |   if (tokens.size() < 3) { 
 | 
|---|
| 395 |     cout << "Usage: nt2d nameobj varx vary [errx erry wt label opt]" << endl; 
 | 
|---|
| 396 |     return(0); 
 | 
|---|
| 397 |   }
 | 
|---|
| 398 |   while (tokens.size() < 8) tokens.push_back("");
 | 
|---|
| 399 |   string ph = "";
 | 
|---|
| 400 |   mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], ph, tokens[3], tokens[4], ph, 
 | 
|---|
| 401 |                      tokens[5], tokens[6], tokens[7], false);
 | 
|---|
| 402 |   }
 | 
|---|
| 403 | else if (kw == "nt3d") {
 | 
|---|
| 404 |   if (tokens.size() < 7) { 
 | 
|---|
| 405 |     cout << "Usage: nt3d nameobj varx vary varz [errx erry errz wt label opt]" << endl; 
 | 
|---|
| 406 |     return(0); 
 | 
|---|
| 407 |   }
 | 
|---|
| 408 |   while (tokens.size() < 10) tokens.push_back("");
 | 
|---|
| 409 |   mObjMgr->DisplayNT(tokens[0], tokens[1], tokens[2], tokens[3], tokens[4], tokens[5],
 | 
|---|
| 410 |                      tokens[6], tokens[7], tokens[8], tokens[9], true);
 | 
|---|
| 411 |   }
 | 
|---|
| 412 | 
 | 
|---|
| 413 | // Obsolete : ne pas virer SVP, cmv 26/7/99
 | 
|---|
| 414 | else if (kw == "gfd2d") {
 | 
|---|
| 415 |   cout<<"----- gfd2d OBSOLETE: utilisez nt2d -----"<<endl;
 | 
|---|
| 416 |   if(tokens.size()<2)
 | 
|---|
| 417 |     {cout<<"Usage: gfd2d nomobj numvarx erreur=(x y xy) opt"<<endl;
 | 
|---|
| 418 |      return(0);}
 | 
|---|
| 419 |   string numvary = "";
 | 
|---|
| 420 |   string err = "";
 | 
|---|
| 421 |   string opt = "n";
 | 
|---|
| 422 |   if(tokens.size()>2) err = tokens[2];
 | 
|---|
| 423 |   if(tokens.size()>3) opt = tokens[3];
 | 
|---|
| 424 |   mObjMgr->DisplayGFD(tokens[0],tokens[1],numvary,err,opt);
 | 
|---|
| 425 |   }
 | 
|---|
| 426 | else if (kw == "gfd3d") {
 | 
|---|
| 427 |   cout<<"----- gfd3d OBSOLETE: utilisez nt3d -----"<<endl;
 | 
|---|
| 428 |   if(tokens.size()<3)
 | 
|---|
| 429 |     {cout<<"Usage: gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) opt"<<endl;
 | 
|---|
| 430 |      return(0);}
 | 
|---|
| 431 |   string err = "";
 | 
|---|
| 432 |   string opt = "n";
 | 
|---|
| 433 |   if(tokens.size()>3) err = tokens[3];
 | 
|---|
| 434 |   if(tokens.size()>4) opt = tokens[4];
 | 
|---|
| 435 |   mObjMgr->DisplayGFD(tokens[0],tokens[1],tokens[2],err,opt);
 | 
|---|
| 436 |   }
 | 
|---|
| 437 | 
 | 
|---|
| 438 | // >>>>>>>>>>>  Trace de fonctions 
 | 
|---|
| 439 | else if ( (kw == "func") ) {
 | 
|---|
| 440 |   if (tokens.size() < 4) { cout << "Usage: func f(x) xmin xmax npt [opt]" << endl; return(0); }
 | 
|---|
| 441 |   string opt = "";
 | 
|---|
| 442 |   if (tokens.size() > 4)  opt = tokens[4];
 | 
|---|
| 443 |   int np;
 | 
|---|
| 444 |   double xmin, xmax;
 | 
|---|
| 445 |   np = 100;
 | 
|---|
| 446 |   xmin = 0.;  xmax = 1.;
 | 
|---|
| 447 |   np = atoi(tokens[3].c_str());
 | 
|---|
| 448 |   xmin = atof(tokens[1].c_str());   xmax = atof(tokens[2].c_str());
 | 
|---|
| 449 |   string nom = "";
 | 
|---|
| 450 |   mObjMgr->GetServiceObj()->PlotFunc(tokens[0], nom, xmin, xmax, np, opt); 
 | 
|---|
| 451 |   }
 | 
|---|
| 452 | else if ( (kw == "funcff") ) {
 | 
|---|
| 453 |   if (tokens.size() < 5) { cout << "Usage: funcff C-filename f(x)-name xmin xmax npt [opt]" << endl; return(0); }
 | 
|---|
| 454 |   string opt = "";
 | 
|---|
| 455 |   if (tokens.size() > 5)  opt = tokens[5];
 | 
|---|
| 456 |   int np;
 | 
|---|
| 457 |   double xmin, xmax;
 | 
|---|
| 458 |   np = 100;
 | 
|---|
| 459 |   xmin = 0.;  xmax = 1.;
 | 
|---|
| 460 |   np = atoi(tokens[4].c_str());
 | 
|---|
| 461 |   xmin = atof(tokens[2].c_str());   xmax = atof(tokens[3].c_str());
 | 
|---|
| 462 |   string nom = "";
 | 
|---|
| 463 |   mObjMgr->GetServiceObj()->PlotFuncFrCFile(tokens[0], tokens[1], nom, xmin, xmax, np, opt); 
 | 
|---|
| 464 |   }
 | 
|---|
| 465 | else if ( (kw == "func2d") ) {
 | 
|---|
| 466 |   if (tokens.size() < 7) {
 | 
|---|
| 467 |     cout << "Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [opt]" << endl;
 | 
|---|
| 468 |     return(0);
 | 
|---|
| 469 |     }
 | 
|---|
| 470 |   int npx, npy;
 | 
|---|
| 471 |   double xmin, xmax;
 | 
|---|
| 472 |   double ymin, ymax;
 | 
|---|
| 473 |   npx = npy = 50;
 | 
|---|
| 474 |   xmin = 0.;  xmax = 1.;
 | 
|---|
| 475 |   ymin = 0.;  ymax = 1.;
 | 
|---|
| 476 |   npx = atoi(tokens[3].c_str());
 | 
|---|
| 477 |   npy = atoi(tokens[6].c_str());
 | 
|---|
| 478 |   xmin = atof(tokens[1].c_str());   xmax = atof(tokens[2].c_str());
 | 
|---|
| 479 |   ymin = atof(tokens[4].c_str());   ymax = atof(tokens[5].c_str());
 | 
|---|
| 480 |   string opt = "";
 | 
|---|
| 481 |   if (tokens.size() > 7)  opt = tokens[7];
 | 
|---|
| 482 |   string nom = "";
 | 
|---|
| 483 |   mObjMgr->GetServiceObj()->PlotFunc2D(tokens[0], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
 | 
|---|
| 484 |   }
 | 
|---|
| 485 | else if ( (kw == "func2dff") ) {
 | 
|---|
| 486 |   if (tokens.size() < 8) {
 | 
|---|
| 487 |     cout << "Usage: func2d C-filename F(x,y)-name xmax nptx ymin ymax npty [opt]" << endl;
 | 
|---|
| 488 |     return(0);
 | 
|---|
| 489 |     }
 | 
|---|
| 490 |   int npx, npy;
 | 
|---|
| 491 |   double xmin, xmax;
 | 
|---|
| 492 |   double ymin, ymax;
 | 
|---|
| 493 |   npx = npy = 50;
 | 
|---|
| 494 |   xmin = 0.;  xmax = 1.;
 | 
|---|
| 495 |   ymin = 0.;  ymax = 1.;
 | 
|---|
| 496 |   npx = atoi(tokens[4].c_str());
 | 
|---|
| 497 |   npy = atoi(tokens[7].c_str());
 | 
|---|
| 498 |   xmin = atof(tokens[2].c_str());   xmax = atof(tokens[3].c_str());
 | 
|---|
| 499 |   ymin = atof(tokens[5].c_str());   ymax = atof(tokens[6].c_str());
 | 
|---|
| 500 |   string opt = "";
 | 
|---|
| 501 |   if (tokens.size() > 8)  opt = tokens[8];
 | 
|---|
| 502 |   string nom = "";
 | 
|---|
| 503 |   mObjMgr->GetServiceObj()->PlotFunc2DFrCFile(tokens[0], tokens[1], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
 | 
|---|
| 504 |   }
 | 
|---|
| 505 | 
 | 
|---|
| 506 | // >>>>>>>>>>>  Trace d'expressions de N_Tuple, StarList, etc ...
 | 
|---|
| 507 | else if (kw == "plot2d" ) {
 | 
|---|
| 508 |   if (tokens.size() < 3) {
 | 
|---|
| 509 |     cout << "Usage: plot2d nameobj expx expy [expcut opt loop_par]" << endl;
 | 
|---|
| 510 |     return(0); 
 | 
|---|
| 511 |     }
 | 
|---|
| 512 |   string errx = ""; string erry = ""; 
 | 
|---|
| 513 |   if (tokens.size() < 4) tokens.push_back("1");
 | 
|---|
| 514 |   while (tokens.size() < 6) tokens.push_back("");
 | 
|---|
| 515 |   srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],errx,erry,tokens[3],tokens[4],tokens[5]);
 | 
|---|
| 516 |   }
 | 
|---|
| 517 | 
 | 
|---|
| 518 | else if (kw == "plot2de" ) {  // Plot2D avec les erreurs 
 | 
|---|
| 519 |   if (tokens.size() < 5) {
 | 
|---|
| 520 |     cout << "Usage: plot2de nameobj expx expy experrx experry [expcut opt loop_par]" << endl;
 | 
|---|
| 521 |     return(0); 
 | 
|---|
| 522 |     }
 | 
|---|
| 523 |   if (tokens.size() < 6) tokens.push_back("1");
 | 
|---|
| 524 |   while (tokens.size() < 8) tokens.push_back("");
 | 
|---|
| 525 |   srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4],
 | 
|---|
| 526 |                         tokens[5],tokens[6],tokens[7]);
 | 
|---|
| 527 |   }
 | 
|---|
| 528 | 
 | 
|---|
| 529 | else if (kw == "plot2dw" ) {   // Plot2d avec poids
 | 
|---|
| 530 |   if (tokens.size() < 4) { 
 | 
|---|
| 531 |     cout << "Usage: plot2dw nomobj expx expy expwt [expcut opt loop_par]" << endl;
 | 
|---|
| 532 |     return(0); 
 | 
|---|
| 533 |     }
 | 
|---|
| 534 |   if (tokens.size() < 5) tokens.push_back("1");
 | 
|---|
| 535 |   while (tokens.size() < 7) tokens.push_back("");
 | 
|---|
| 536 |   srvo->DisplayPoints2DW(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]);
 | 
|---|
| 537 |   }
 | 
|---|
| 538 | else if (kw == "plot3d" ) {  
 | 
|---|
| 539 |   if (tokens.size() < 4) { 
 | 
|---|
| 540 |     cout << "Usage: plot3d nomobj expx expy expz [expcut opt loop_par]" << endl;
 | 
|---|
| 541 |     return(0); 
 | 
|---|
| 542 |     }
 | 
|---|
| 543 |   if (tokens.size() < 5) tokens.push_back("1");
 | 
|---|
| 544 |   while (tokens.size() < 7) tokens.push_back("");
 | 
|---|
| 545 |   srvo->DisplayPoints3D(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]);
 | 
|---|
| 546 |   }
 | 
|---|
| 547 | 
 | 
|---|
| 548 | else if (kw == "projh1d" ) {
 | 
|---|
| 549 |   if (tokens.size() < 3) { 
 | 
|---|
| 550 |     cout << "Usage: projh1d nomh1 nomobj expx [expwt expcut opt loop_par]" << endl;
 | 
|---|
| 551 |     return(0);
 | 
|---|
| 552 |     }
 | 
|---|
| 553 |   if (tokens.size() < 4) tokens.push_back("1.");
 | 
|---|
| 554 |   if (tokens.size() < 5) tokens.push_back("1");
 | 
|---|
| 555 |   while (tokens.size() < 7) tokens.push_back("");
 | 
|---|
| 556 |   srvo->ProjectH1(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] );
 | 
|---|
| 557 |   }
 | 
|---|
| 558 | 
 | 
|---|
| 559 | 
 | 
|---|
| 560 | // Projection dans histogrammes
 | 
|---|
| 561 | else if (kw == "projh2d" ) {
 | 
|---|
| 562 |   if (tokens.size() < 4) { 
 | 
|---|
| 563 |     cout << "Usage: projh2d nomh2 nomobj expx expy [expwt expcut opt loop_par]" << endl;
 | 
|---|
| 564 |     return(0);
 | 
|---|
| 565 |     }
 | 
|---|
| 566 |   if (tokens.size() < 5) tokens.push_back("1.");
 | 
|---|
| 567 |   if (tokens.size() < 6) tokens.push_back("1");
 | 
|---|
| 568 |   while (tokens.size() < 8) tokens.push_back("");
 | 
|---|
| 569 |   srvo->ProjectH2(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
 | 
|---|
| 570 |                   tokens[6], tokens[7] );
 | 
|---|
| 571 |   }
 | 
|---|
| 572 | 
 | 
|---|
| 573 | else if (kw == "projprof" ) {
 | 
|---|
| 574 |   if (tokens.size() < 4) { 
 | 
|---|
| 575 |     cout << "Usage: projprof nomprof nomobj expx expy [expwt expcut opt loop_par]" << endl;
 | 
|---|
| 576 |     return(0);
 | 
|---|
| 577 |     }
 | 
|---|
| 578 |   if (tokens.size() < 5) tokens.push_back("1.");
 | 
|---|
| 579 |   if (tokens.size() < 6) tokens.push_back("1");
 | 
|---|
| 580 |   while (tokens.size() < 8) tokens.push_back("");
 | 
|---|
| 581 |   srvo->ProjectHProf(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
 | 
|---|
| 582 |                      tokens[6], tokens[7] );
 | 
|---|
| 583 |   }
 | 
|---|
| 584 | 
 | 
|---|
| 585 | // Projection dans vector/matrix
 | 
|---|
| 586 | else if (kw == "fillvec" ) {
 | 
|---|
| 587 |   if (tokens.size() < 4) { 
 | 
|---|
| 588 |     cout << "Usage: fillvec nomvec nomobj expx expv [expcut opt loop_par]" << endl;
 | 
|---|
| 589 |     return(0);
 | 
|---|
| 590 |     }
 | 
|---|
| 591 |   if (tokens.size() < 5) tokens.push_back("1");
 | 
|---|
| 592 |   while (tokens.size() < 7) tokens.push_back("");
 | 
|---|
| 593 |   srvo->FillVect(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] );
 | 
|---|
| 594 |   }
 | 
|---|
| 595 | 
 | 
|---|
| 596 | else if (kw == "fillmtx" ) {
 | 
|---|
| 597 |   if (tokens.size() < 5) { 
 | 
|---|
| 598 |     cout << "Usage: fillmtx nommtx nomobj expx expy expv [expcut opt loop_par]" << endl;
 | 
|---|
| 599 |     return(0);
 | 
|---|
| 600 |     }
 | 
|---|
| 601 |   if (tokens.size() < 6) tokens.push_back("1");
 | 
|---|
| 602 |   while (tokens.size() < 8) tokens.push_back("");
 | 
|---|
| 603 |   srvo->FillMatx(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
 | 
|---|
| 604 |                     tokens[6], tokens[7] );
 | 
|---|
| 605 |   }
 | 
|---|
| 606 | 
 | 
|---|
| 607 | // Remplissage NTuple,Vecteurs, ... , boucle de NTuple
 | 
|---|
| 608 | else if (kw == "ntfrascii" ) {
 | 
|---|
| 609 |   if(tokens.size() < 2) { 
 | 
|---|
| 610 |     cout<<"Usage: ntfrascii nt_name file_name [def_init_val]"<<endl;
 | 
|---|
| 611 |     return(0);
 | 
|---|
| 612 |     }
 | 
|---|
| 613 |   double def_val = 0.;
 | 
|---|
| 614 |   if(tokens.size()>=3) def_val = atof(tokens[2].c_str());
 | 
|---|
| 615 |   srvo->NtFromASCIIFile(tokens[0],tokens[1],def_val);
 | 
|---|
| 616 |   }
 | 
|---|
| 617 | 
 | 
|---|
| 618 | else if (kw == "fillnt" ) {
 | 
|---|
| 619 |   if (tokens.size() < 5) { 
 | 
|---|
| 620 |     cout << "Usage: fillnt nameobj expx expy expz expt [expcut ntname loop_par]" << endl;
 | 
|---|
| 621 |     return(0);
 | 
|---|
| 622 |     }
 | 
|---|
| 623 |   while (tokens.size() < 8) tokens.push_back("");
 | 
|---|
| 624 |   srvo->FillNT(tokens[0],tokens[1],tokens[2], tokens[3], tokens[4], tokens[5], tokens[6], tokens[7] );
 | 
|---|
| 625 |   }
 | 
|---|
| 626 | 
 | 
|---|
| 627 | else if (kw == "ntloop" ) {
 | 
|---|
| 628 |   if (tokens.size() < 3) { 
 | 
|---|
| 629 |     cout << "Usage: ntloop nameobj fname funcname [ntname loop_par ]" << endl;
 | 
|---|
| 630 |     return(0);
 | 
|---|
| 631 |     }
 | 
|---|
| 632 |   while (tokens.size() < 5) tokens.push_back("");
 | 
|---|
| 633 |   srvo->FillNTFrCFile(tokens[0],tokens[1], tokens[2], tokens[3], tokens[4]);
 | 
|---|
| 634 |   }
 | 
|---|
| 635 | 
 | 
|---|
| 636 | else if (kw == "ntexpcfile" ) {
 | 
|---|
| 637 |   if (tokens.size() < 3) { 
 | 
|---|
| 638 |     cout << "Usage: ntexpcfile nameobj fname funcname" << endl;
 | 
|---|
| 639 |     return(0);
 | 
|---|
| 640 |     }
 | 
|---|
| 641 |   srvo->PrepareNTExpressionCFile(tokens[0],tokens[1], tokens[2]);
 | 
|---|
| 642 |   }
 | 
|---|
| 643 | 
 | 
|---|
| 644 | else if (kw == "exptovec" ) {
 | 
|---|
| 645 |   if (tokens.size() < 3) { 
 | 
|---|
| 646 |     cout << "Usage: exptovec nomvec nameobj expx [expcut opt loop_par]" << endl;
 | 
|---|
| 647 |     return(0);
 | 
|---|
| 648 |     }
 | 
|---|
| 649 |   while (tokens.size() < 6) tokens.push_back("");
 | 
|---|
| 650 |   srvo->ExpressionToVector(tokens[1],tokens[2],tokens[3],tokens[0],tokens[4],tokens[5]);
 | 
|---|
| 651 |   }
 | 
|---|
| 652 | 
 | 
|---|
| 653 | else if (kw == "fillgd1" ) {
 | 
|---|
| 654 |   if (tokens.size() < 5) {
 | 
|---|
| 655 |     cout << "Usage: fillgd1 nomgfd nomobj expx expy experry [expcut loop_par] " << endl;
 | 
|---|
| 656 |     return(0);
 | 
|---|
| 657 |     }
 | 
|---|
| 658 |   if (tokens.size() < 6) tokens.push_back("1");
 | 
|---|
| 659 |   if (tokens.size() < 7) tokens.push_back("");
 | 
|---|
| 660 |   string expy = "";
 | 
|---|
| 661 |   srvo->FillGFD(tokens[1],tokens[2], expy, tokens[3], tokens[4], tokens[5], tokens[0]);
 | 
|---|
| 662 |   }
 | 
|---|
| 663 | 
 | 
|---|
| 664 | else if (kw == "fillgd2" ) {
 | 
|---|
| 665 |   if (tokens.size() < 6) {
 | 
|---|
| 666 |     cout << "Usage: fillgd2 nomgfd nomobj expx expy expz experrz [expcut loop_par]" << endl;
 | 
|---|
| 667 |     return(0);
 | 
|---|
| 668 |     }
 | 
|---|
| 669 |   if (tokens.size() < 7) tokens.push_back("1");
 | 
|---|
| 670 |   if (tokens.size() < 8) tokens.push_back("");
 | 
|---|
| 671 |   srvo->FillGFD(tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6], tokens[0], tokens[7]);
 | 
|---|
| 672 |   }
 | 
|---|
| 673 | 
 | 
|---|
| 674 | else if (kw == "gdfrvec" ) {
 | 
|---|
| 675 |   if(tokens.size()<3) {
 | 
|---|
| 676 |     cout<<"Usage: gdfrvec namegfd X Y\n"
 | 
|---|
| 677 |         <<"       gdfrvec namegfd X Y"
 | 
|---|
| 678 |         <<"       gdfrvec namegfd X Y ! EY\n"
 | 
|---|
| 679 |         <<"       gdfrvec namegfd X Y Z\n"
 | 
|---|
| 680 |         <<"       gdfrvec namegfd X Y Z EZ"<<endl;
 | 
|---|
| 681 |     return(0);
 | 
|---|
| 682 |   }
 | 
|---|
| 683 |   while(tokens.size()<5) tokens.push_back("!");
 | 
|---|
| 684 |   srvo->FillGFDfrVec(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4]);
 | 
|---|
| 685 |   }
 | 
|---|
| 686 | 
 | 
|---|
| 687 | 
 | 
|---|
| 688 | else  { 
 | 
|---|
| 689 |   cerr << "PIABaseExecutor::Do() Erreur - Commande " << kw << " inconuue ! " << endl;    
 | 
|---|
| 690 |   return(-1);
 | 
|---|
| 691 |   }
 | 
|---|
| 692 | 
 | 
|---|
| 693 | return(0);
 | 
|---|
| 694 | }
 | 
|---|
| 695 | 
 | 
|---|
| 696 | // Fonction pour enregistrer le Help des Widgets et Windows de piapp 
 | 
|---|
| 697 | static void RegisterPIGraphicsHelp(PIACmd* piac);
 | 
|---|
| 698 | 
 | 
|---|
| 699 | /* --Methode-- */
 | 
|---|
| 700 | void PIABaseExecutor::RegisterCommands()
 | 
|---|
| 701 | {
 | 
|---|
| 702 | string kw, usage;
 | 
|---|
| 703 | kw = "loadmodule";
 | 
|---|
| 704 | usage = "To load and initialize modules \n  Usage: loadmodule fnameso modulename";
 | 
|---|
| 705 | usage += "\n  Related commands: link";  
 | 
|---|
| 706 | mpiac->RegisterCommand(kw, usage, this, "External Modules");
 | 
|---|
| 707 | kw = "link";
 | 
|---|
| 708 | usage = "Dynamic linking of compiled user functions \n  Usage: link fnameso f1 [f2 f3]";
 | 
|---|
| 709 | usage += "\n  fnameso: Shared-object file name, f1,f2,f3 : User function names ";
 | 
|---|
| 710 | usage += "\n  Related commands: call loadmodule linkff2";  
 | 
|---|
| 711 | mpiac->RegisterCommand(kw, usage, this, "External Modules");
 | 
|---|
| 712 | kw = "linkff2";
 | 
|---|
| 713 | usage = "Dynamic linking of compiled user functions (Set 2)\n  Usage: linkff2 fnameso f1 [f2 f3]";
 | 
|---|
| 714 | usage += "\n  fnameso: Shared-object file name, f1,f2,f3 : User function names ";
 | 
|---|
| 715 | usage += "\n  Related commands: call link loadmodule";  
 | 
|---|
| 716 | mpiac->RegisterCommand(kw, usage, this, "External Modules");
 | 
|---|
| 717 | kw = "call";
 | 
|---|
| 718 | usage = "Dynamically linked user function call \n Usage: call userf [arg1 arg2 ...]";
 | 
|---|
| 719 | usage += "\n  User function : f(vector<string>& args)";
 | 
|---|
| 720 | usage += "\n  Related commands: link";  
 | 
|---|
| 721 | mpiac->RegisterCommand(kw, usage, this, "External Modules");
 | 
|---|
| 722 | 
 | 
|---|
| 723 | kw = "zone";
 | 
|---|
| 724 | usage = "To Divide the Graphic window \n  Usage: zone [nx=1 ny=1]";
 | 
|---|
| 725 | usage += "\n  Related commands: newwin";  
 | 
|---|
| 726 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
 | 
|---|
| 727 | kw = "newwin";
 | 
|---|
| 728 | usage = "To Create a New Graphic window, with zones \n  Usage: newwin nx ny";
 | 
|---|
| 729 | usage += "\n  Related commands: zone";  
 | 
|---|
| 730 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
 | 
|---|
| 731 | kw = "stacknext";
 | 
|---|
| 732 | usage = "Displays the next widget on stack window \n  Usage: stacknext";
 | 
|---|
| 733 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
 | 
|---|
| 734 | 
 | 
|---|
| 735 | kw = "graphicatt";
 | 
|---|
| 736 | usage = "To change default graphic options \n  Usage: graphicatt att_list \n";
 | 
|---|
| 737 | usage += "att_list=def back to default values, Example: gratt red,circlemarker5";
 | 
|---|
| 738 | usage += "\n ------------------ Graphic attribute list ------------------ \n";
 | 
|---|
| 739 | usage += ">> Colors: defcol black white grey red blue green yellow magenta cyan \n";
 | 
|---|
| 740 | usage += "           turquoise navyblue orange siennared purple limegreen gold \n";
 | 
|---|
| 741 | usage += ">> Lines:  defline normalline thinline thickline dashedline thindashedline \n";
 | 
|---|
| 742 | usage += "           thickdashedline dottedline thindottedline thickdottedline \n";
 | 
|---|
| 743 | usage += ">> Fonts:  deffont normalfont boldfont italicfont smallfont smallboldfont \n";
 | 
|---|
| 744 | usage += "           smallitalicfont bigfont bigboldfont bigitalicfont \n";
 | 
|---|
| 745 | usage += "           hugefont  hugeboldfont hugeitalicfont \n";
 | 
|---|
| 746 | usage += ">> Marker: dotmarker<T>  plusmarker<T>  crossmarker<T> circlemarker <T> \n";
 | 
|---|
| 747 | usage += "           fcirclemarker<T> boxmarker<T> fboxmarker<T> trianglemarker<T> \n";
 | 
|---|
| 748 | usage += "           ftrianglemarker<T>  starmarker<T>  fstarmarker<T> \n";
 | 
|---|
| 749 | usage += "   with <T> = 1 3 5 7 9 , Example fboxmarker5 , plusmarker9 ... \n";
 | 
|---|
| 750 | usage += ">> ColorTables: defcmap  grey32  invgrey32  colrj32  colbr32 \n";
 | 
|---|
| 751 | usage += "                grey128  invgrey128  colrj128  colbr128 \n";
 | 
|---|
| 752 | usage += "                midas_pastel midas_heat midas_rainbow3 midas_bluered\n";
 | 
|---|
| 753 | usage += "                midas_bluewhite midas_redwhite \n";
 | 
|---|
| 754 | usage += "                rainbow16 \n";
 | 
|---|
| 755 | usage += ">> ZoomFactors: defzoom zoomx1 zoomx2 zoomx3 zoomx4 zoomx5 \n";
 | 
|---|
| 756 | usage += "                               zoom/2 zoom/3 zoom/4 zoom/5 \n";
 | 
|---|
| 757 | usage += ">> Image centering: centerimg -> Position the image in widget \n";
 | 
|---|
| 758 | usage += ">> Axes:  stdaxes=defaxes=boxaxes  simpleaxes boxaxesgrid \n";
 | 
|---|
| 759 | usage += "          fineaxes  grid=fineaxesgrid \n"; 
 | 
|---|
| 760 | usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n";
 | 
|---|
| 761 | usage += ">> XYLimits : xylimits  -> Forces X-Y limits in 2-D plots \n";
 | 
|---|
| 762 | usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n";
 | 
|---|
| 763 | usage += ">> title/notitle or tit/notit -> Toggle Auto AddTitle flag \n";
 | 
|---|
| 764 | usage += ">> DisplayWindow: next same win stack inset \n";
 | 
|---|
| 765 | usage += "   Related commands: setxylimits setinsetlimits setimgcenter";  
 | 
|---|
| 766 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
 | 
|---|
| 767 | 
 | 
|---|
| 768 | kw = "setxylimits";
 | 
|---|
| 769 | usage = "Define 2-D plot limits \n Usage: setxylimits xmin xmax ymin ymax";
 | 
|---|
| 770 | usage += "\n  Related commands: graphicatt /xylimits";  
 | 
|---|
| 771 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
 | 
|---|
| 772 | 
 | 
|---|
| 773 | kw = "setinsetlimits";
 | 
|---|
| 774 | usage = "Define the display rectangle for drawers added as insets \n";
 | 
|---|
| 775 | usage += " over existing graphic objects - limits expressed as fraction \n";  
 | 
|---|
| 776 | usage += " graphic object size (0. .. 1.) Xmax at right, YMax top. ";
 | 
|---|
| 777 | usage += " Usage: setinsetlimits xmin xmax ymin ymax";
 | 
|---|
| 778 | usage += "\n  Related commands: graphicatt /inset";  
 | 
|---|
| 779 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
 | 
|---|
| 780 | 
 | 
|---|
| 781 | kw = "setimgcenter";
 | 
|---|
| 782 | usage = "Define image center postion \n Usage: setimgcenter xc yc";
 | 
|---|
| 783 | usage += "\n  Related commands: graphicatt /centerimg";  
 | 
|---|
| 784 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
 | 
|---|
| 785 | 
 | 
|---|
| 786 | kw = "addtext";
 | 
|---|
| 787 | usage = "Adds a text string to the current graphic object";
 | 
|---|
| 788 | usage += "\n at the specified position (Gr-Object Coordinate) with graphic attribute specification";
 | 
|---|
| 789 | usage += "\n  Usage: addtext x y ColFontAtt TextString";
 | 
|---|
| 790 | usage += "\n  Related commands: settitle graphicatt";  
 | 
|---|
| 791 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
 | 
|---|
| 792 | 
 | 
|---|
| 793 | kw = "settitle";
 | 
|---|
| 794 | usage = "Set the title string (top title) for the current graphic object";
 | 
|---|
| 795 | usage += "\n  Usage: settitle FontAtt TopTitle";
 | 
|---|
| 796 | usage += "\n  Related commands: addtext graphicatt";  
 | 
|---|
| 797 | mpiac->RegisterCommand(kw, usage, this, "Graphics");
 | 
|---|
| 798 | 
 | 
|---|
| 799 | RegisterPIGraphicsHelp(mpiac);
 | 
|---|
| 800 | 
 | 
|---|
| 801 | kw = "openfits";
 | 
|---|
| 802 | usage = "Loads a FITS file into an Image<T> \n Usage: openfits filename";
 | 
|---|
| 803 | usage += "\n  Related commands: savefits openppf";  
 | 
|---|
| 804 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
 | 
|---|
| 805 | kw = "savefits";
 | 
|---|
| 806 | usage = "Save an object into a FITS file \n Usage: savefits nameobj filename";
 | 
|---|
| 807 | usage += "\n  Related commands: openfits saveall";  
 | 
|---|
| 808 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
 | 
|---|
| 809 | kw = "openppf";
 | 
|---|
| 810 | usage = "Reads all objects from a PPF file \n Usage: openppf filename";
 | 
|---|
| 811 | usage += "\n  Related commands: saveall openfits";  
 | 
|---|
| 812 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
 | 
|---|
| 813 | kw = "saveobjs";
 | 
|---|
| 814 | usage = "Saves objects with names matching a pattern (x?y*) into a PPF file \n";
 | 
|---|
| 815 | usage += "Usage: saveobjs nameobjpattern filename";
 | 
|---|
| 816 | usage += "\n  Related commands: saveall openppf savefits";  
 | 
|---|
| 817 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
 | 
|---|
| 818 | kw = "saveall";
 | 
|---|
| 819 | usage = "Saves all objects into a PPF file \n Usage: saveall filename";
 | 
|---|
| 820 | usage += "\n  Related commands: saveobj openppf savefits";  
 | 
|---|
| 821 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
 | 
|---|
| 822 | kw = "ntfrascii";
 | 
|---|
| 823 | usage = "Fills an existing NTuple from ASCII table file";
 | 
|---|
| 824 | usage += "\n Usage: ntfrascii nt_name file_name [def_init_val]";
 | 
|---|
| 825 | usage += "\n  Related commands: ntloop fillnt ";
 | 
|---|
| 826 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
 | 
|---|
| 827 | 
 | 
|---|
| 828 | 
 | 
|---|
| 829 | kw = "print";
 | 
|---|
| 830 | usage = "Prints an object \n Usage: print nameobj";
 | 
|---|
| 831 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
 | 
|---|
| 832 | 
 | 
|---|
| 833 | kw = "mkdir";
 | 
|---|
| 834 | usage = "Create a directory";
 | 
|---|
| 835 | usage += "\n Usage: mkdir dirname [true]";
 | 
|---|
| 836 | usage += "\n if second argument==true, the directory's KeepOld attribute is set to true";
 | 
|---|
| 837 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
 | 
|---|
| 838 | kw = "rmdir";
 | 
|---|
| 839 | usage = "Removes an empty directory";
 | 
|---|
| 840 | usage += "\n Usage: remove dirname";
 | 
|---|
| 841 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
 | 
|---|
| 842 | kw = "cd";
 | 
|---|
| 843 | usage = "Change current directory";
 | 
|---|
| 844 | usage += "\n Usage: cd [dirname]";
 | 
|---|
| 845 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
 | 
|---|
| 846 | kw = "pwd";
 | 
|---|
| 847 | usage = "Prints current directory";
 | 
|---|
| 848 | usage += "\n Usage: pwd";
 | 
|---|
| 849 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
 | 
|---|
| 850 | kw = "listdirs";
 | 
|---|
| 851 | usage = "Prints the list of directories";
 | 
|---|
| 852 | usage += "\n Usage: listdirs [patt=*] \n patt : * , ? ";
 | 
|---|
| 853 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
 | 
|---|
| 854 | kw = "listobjs";
 | 
|---|
| 855 | usage = "Prints the list of objects (Alias: ls)";
 | 
|---|
| 856 |  usage += "\n Usage: listobjs [patt=*] \n patt : /*/x?y* ... ";
 | 
|---|
| 857 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
 | 
|---|
| 858 | kw = "rename";
 | 
|---|
| 859 | usage = "Rename an object (Alias: mv) \n Usage: rename nameobj namenew";
 | 
|---|
| 860 | usage += "\n  Related commands: del delobjs";  
 | 
|---|
| 861 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
 | 
|---|
| 862 | kw = "copy";
 | 
|---|
| 863 | usage = "Copy objects \n";
 | 
|---|
| 864 | usage +="  Usage: copy name_from name_to";
 | 
|---|
| 865 | usage += "\n  Related commands: new...";  
 | 
|---|
| 866 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
 | 
|---|
| 867 | kw = "del";
 | 
|---|
| 868 | usage = "Deletes an object (Alias: rm) \n Usage: del nameobj";
 | 
|---|
| 869 | usage += "\n  Related commands: delobjs  rename";  
 | 
|---|
| 870 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
 | 
|---|
| 871 | kw = "delobjs";
 | 
|---|
| 872 | usage = "Delete a set of objects with names matching a pattern (x?y*)";
 | 
|---|
| 873 | usage += "\n Usage: delobjs nameobjpattern \n";
 | 
|---|
| 874 | usage += "\n  Related commands: del rename";  
 | 
|---|
| 875 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
 | 
|---|
| 876 | 
 | 
|---|
| 877 | kw = "newh1d";
 | 
|---|
| 878 | usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin";
 | 
|---|
| 879 | usage += "\n  Related commands: newh2d  newprof[e] newnt  newgfd ";  
 | 
|---|
| 880 | mpiac->RegisterCommand(kw, usage, this, "Objects");
 | 
|---|
| 881 | kw = "newh2d";
 | 
|---|
| 882 | usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny";
 | 
|---|
| 883 | usage += "\n  Related commands: newh1d  newprof[e] newnt  newgfd ";  
 | 
|---|
| 884 | mpiac->RegisterCommand(kw, usage, this, "Objects");
 | 
|---|
| 885 | kw = "newprof";
 | 
|---|
| 886 | usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]";
 | 
|---|
| 887 | usage += "\n  Errors represent the data spread in the X bin ";  
 | 
|---|
| 888 | usage += "\n  Related commands: newh1d  newh2d newprofe newnt newgfd ";  
 | 
|---|
| 889 | mpiac->RegisterCommand(kw, usage, this, "Objects");
 | 
|---|
| 890 | kw = "newprofe";
 | 
|---|
| 891 | usage = "Creates a profile histogramm \n Usage: newprofe name xmin xmax nbin [ymin ymax]";
 | 
|---|
| 892 | usage += "\n  Errors represent the error on the data mean in the X bin ";  
 | 
|---|
| 893 | usage += "\n  Related commands: newh1d  newh2d newprof newnt newgfd ";  
 | 
|---|
| 894 | mpiac->RegisterCommand(kw, usage, this, "Objects");
 | 
|---|
| 895 | kw = "newnt";
 | 
|---|
| 896 | usage = "Creates a ntuple \n Usage: newnt name v1 v2 v3 .. vn";
 | 
|---|
| 897 | usage += "\n        newnt name nvar";  
 | 
|---|
| 898 | usage += "\n  Related commands: newh1d  newh2d newprof[e] newgfd ";  
 | 
|---|
| 899 | mpiac->RegisterCommand(kw, usage, this, "Objects");
 | 
|---|
| 900 | kw = "newgfd";
 | 
|---|
| 901 | usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]";
 | 
|---|
| 902 | usage += "\n  Related commands: newh1d  newh2d  newprof[e] newnt ";  
 | 
|---|
| 903 | mpiac->RegisterCommand(kw, usage, this, "Objects");
 | 
|---|
| 904 | kw = "newvec";
 | 
|---|
| 905 | usage = "Creates (and optionaly fills) a vector \n Usage: newvec name size [f(i) [dopt] ] ";
 | 
|---|
| 906 | usage += "\n  Related commands: newmtx";  
 | 
|---|
| 907 | mpiac->RegisterCommand(kw, usage, this, "Objects");
 | 
|---|
| 908 | kw = "newmtx";
 | 
|---|
| 909 | usage = "Creates (and optionaly fills) a matrix \n";
 | 
|---|
| 910 | usage +="  Usage: newvec name sizeX(Col) sizeY(Lines) [f(i,j) [dopt] ] ";
 | 
|---|
| 911 | usage += "\n  Related commands: newvec";  
 | 
|---|
| 912 | mpiac->RegisterCommand(kw, usage, this, "Objects");
 | 
|---|
| 913 | 
 | 
|---|
| 914 | kw = "disp";
 | 
|---|
| 915 | usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]";
 | 
|---|
| 916 | usage += "\n  Related commands: surf nt2d nt3d ";  
 | 
|---|
| 917 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
 | 
|---|
| 918 | kw = "imag";
 | 
|---|
| 919 | usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]";
 | 
|---|
| 920 | usage += "\n  Related commands: disp surf nt2d nt3d ";  
 | 
|---|
| 921 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
 | 
|---|
| 922 | kw = "surf";
 | 
|---|
| 923 | usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]";
 | 
|---|
| 924 | usage += "\n  Related commands: disp nt2d nt3d ";  
 | 
|---|
| 925 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
 | 
|---|
| 926 | kw = "nt2d";
 | 
|---|
| 927 | usage = "Displays Points (X-Y) [with error-bar / Weight / Label ] from an NTuple ";
 | 
|---|
| 928 | usage += "\n Usage : nt2d nameobj varx vary [errx erry wt label graphic_attributes]";
 | 
|---|
| 929 | usage += "\n  Related commands: disp  surf  nt3d  gfd2d ";  
 | 
|---|
| 930 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
 | 
|---|
| 931 | kw = "nt3d";
 | 
|---|
| 932 | usage = "Displays 3D-Points (X-Y-Z) [with error-bars / Weight / Label ] from an NTuple ";
 | 
|---|
| 933 | usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz wt label graphic_attributes]";
 | 
|---|
| 934 | usage += "\n  Related commands: disp  surf  nt2d gfd3d ";  
 | 
|---|
| 935 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
 | 
|---|
| 936 | 
 | 
|---|
| 937 | // Ceci est maintenant obsolete, on garde pour info.
 | 
|---|
| 938 | kw = "gfd2d";
 | 
|---|
| 939 | usage = "Displays Points (X-Y) with error-bars from a GeneralFit Data ";
 | 
|---|
| 940 | usage += "\n Usage : gfd2d nameobj numvarx erreur=(x y xy) [graphic_attributes]";
 | 
|---|
| 941 | usage += "\n  Related commands: gfd3d nt2d nt3d ";
 | 
|---|
| 942 | usage += "\n  ----- OBSOLETE: utilisez nt2d -----";
 | 
|---|
| 943 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
 | 
|---|
| 944 | kw = "gfd3d";
 | 
|---|
| 945 | usage = "Displays 3D-Points (X-Y-Z) with error-bars from a GeneralFit Data ";
 | 
|---|
| 946 | usage += "\n Usage : gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) [graphic_attributes]";
 | 
|---|
| 947 | usage += "\n  Related commands: gfd2d nt2d nt3d ";  
 | 
|---|
| 948 | usage += "\n  ----- OBSOLETE: utilisez nt3d -----";
 | 
|---|
| 949 | mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
 | 
|---|
| 950 | 
 | 
|---|
| 951 | kw = "func";
 | 
|---|
| 952 | usage = "Displays a function y=f(x) (Fills a vector with function values)";
 | 
|---|
| 953 | usage += "\n Usage: func f(x) xmin xmax npt [graphic_attributes]";
 | 
|---|
| 954 | usage += "\n  Related commands: funcff func2d func2dff ";  
 | 
|---|
| 955 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
 | 
|---|
| 956 | kw = "funcff";
 | 
|---|
| 957 | usage = "Displays a function y=f(x) from a C-file (Fills a vector with function values)";
 | 
|---|
| 958 | usage += "\n Usage: funcff C-FileName FunctionName xmin xmax npt [graphic_attributes]";
 | 
|---|
| 959 | usage += "\n  Related commands: func func2d func2dff ";  
 | 
|---|
| 960 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
 | 
|---|
| 961 | kw = "func2d";
 | 
|---|
| 962 | usage = "Displays a function z=f(x,y) (Fills a matrix with function values)";
 | 
|---|
| 963 | usage += "\n Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [graphic_attributes]";
 | 
|---|
| 964 | usage += "\n  Related commands: func";  
 | 
|---|
| 965 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
 | 
|---|
| 966 | kw = "func2dff";
 | 
|---|
| 967 | usage = "Displays a function z=f(x,y) from a C-file (Fills a matrix with function values)";
 | 
|---|
| 968 | usage += "\n Usage: func2dff C-FileName FunctionName xmin xmax nptx ymin ymax npty [graphic_attributes]";
 | 
|---|
| 969 | usage += "\n  Related commands: func funcff func2d ";  
 | 
|---|
| 970 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
 | 
|---|
| 971 | 
 | 
|---|
| 972 | kw = "ObjectExpressions";
 | 
|---|
| 973 | usage = "Any mathematical expression (math.h) with object variables can be used";
 | 
|---|
| 974 | usage += "\n  ------ Object Variable names (double) -------- ";
 | 
|---|
| 975 | usage += "\nNTuple varnames - Histo1D/HProf: i,x,val,err - Histo2D: i,j,x,y,val,err";
 | 
|---|
| 976 | usage += "\nVector: i,val - Matrix: i,j,val - Image: x=i,y=j, pix=val";
 | 
|---|
| 977 | usage += "\nLoop parameters can be specified as I1[:I2[:DI]] for(int i=I1; i<I2; i+=DI)"; 
 | 
|---|
| 978 | usage += "\nThe default Cut() expression in true (=1) for all"; 
 | 
|---|
| 979 | usage += "\n  Related commands: plot2d plot2de plot2dw plot3d "; 
 | 
|---|
| 980 | usage += "\n        projh1d projh2d  projprof fillvec fillmtx "; 
 | 
|---|
| 981 | usage += "\n        fillnt fillgd1 fillgd2 ntloop exptovec ... ";
 | 
|---|
| 982 | mpiac->RegisterCommand(kw, usage, NULL, "Expr. Plotting");
 | 
|---|
| 983 | kw = "plot2d";
 | 
|---|
| 984 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) --- Object Variable names (double) :";
 | 
|---|
| 985 | usage += "\n Usage: plot2d nameobj f_X() g_Y() [f_Cut() graphic_attributes loop_param]";
 | 
|---|
| 986 | usage += "\n  Related commands: plot2de plot2dw plot3d ObjectExpressions ..."; 
 | 
|---|
| 987 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 988 | kw = "plot2de";
 | 
|---|
| 989 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with error bars eX/Y=f_ErrX/Y(Object) ";
 | 
|---|
| 990 | usage += "\n Usage: plot2de nameobj f_X() g_Y() f_ErrX() f_ErrY() [f_Cut() graphic_attributes loop_param]";
 | 
|---|
| 991 | usage += "\n  Related commands: plot2d plot2dw plot3d ObjectExpressions ..."; 
 | 
|---|
| 992 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 993 | kw = "plot2dw";
 | 
|---|
| 994 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with Weight W=h(Object) ";
 | 
|---|
| 995 | usage += "\n Usage: plot2dw nameobj f_X() g_Y() h_Wt() [Cut() graphic_attributes loop_param]";
 | 
|---|
| 996 | usage += "\n  Related commands: plot2d plot2dw plot3d ObjectExpressions ..."; 
 | 
|---|
| 997 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 998 | kw = "plot3d";
 | 
|---|
| 999 | usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs ";
 | 
|---|
| 1000 | usage += "\n Usage: plot3d nameobj f_X() g_Y() h_Z() [Cut() graphic_attributes loop_param]";
 | 
|---|
| 1001 | usage += "\n  Related commands: plot2d plot2dw plot2de plot3d ObjectExpressions ..."; 
 | 
|---|
| 1002 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1003 | 
 | 
|---|
| 1004 | kw = "projh1d";
 | 
|---|
| 1005 | usage = "Projects X=f(Object) with weight WT=h(Object) into a 1D histogram ";
 | 
|---|
| 1006 | usage += "\n Usage: projh1d nameh1d nameobj f_X() [h_WT()=1. Cut() graphic_attributes loop_param]";
 | 
|---|
| 1007 | usage += "\n   Histo1D nameh1d is created if necessary ";
 | 
|---|
| 1008 | usage += "\n  Related commands: projh2d projprof ObjectExpressions ..."; 
 | 
|---|
| 1009 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1010 | kw = "projh2d";
 | 
|---|
| 1011 | usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a 2D histogram ";
 | 
|---|
| 1012 | usage += "\n Usage: projh2d nameh2d nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
 | 
|---|
| 1013 | usage += "\n   Histo2D nameh2d is created if necessary ";
 | 
|---|
| 1014 | usage += "\n  Related commands: projh1d projprof ObjectExpressions ..."; 
 | 
|---|
| 1015 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1016 | kw = "projprof";
 | 
|---|
| 1017 | usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a profile histogram ";
 | 
|---|
| 1018 | usage += "\n Usage: projprof nameprof nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
 | 
|---|
| 1019 | usage += "\n   HProf nameprof is created if necessary ";
 | 
|---|
| 1020 | usage += "\n  Related commands: projh1d projh2d ObjectExpressions ..."; 
 | 
|---|
| 1021 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1022 | kw = "fillvec";
 | 
|---|
| 1023 | usage = "Fills a Vector V((int)(f_X(Object)+0.5)) =  h_V(Object) ";
 | 
|---|
| 1024 | usage += "\n Usage: fillvec namevec nameobj f_X() h_V() [Cut() graphic_attributes loop_param]";
 | 
|---|
| 1025 | usage += "\n  Related commands: fillmtx fillnt ObjectExpressions ..."; 
 | 
|---|
| 1026 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1027 | kw = "fillmtx";
 | 
|---|
| 1028 | usage = "Fills a Matrix M(Line=g_Y(Object)+0.5, Col=f_X(Object)+0.5)) =  h_V(Object) ";
 | 
|---|
| 1029 | usage += "\n Usage: fillvec namevec nameobj f_X() g_Y() h_V() [Cut() graphic_attributes loop_param]";
 | 
|---|
| 1030 | usage += "\n  Related commands: fillvec fillnt ObjectExpressions ..."; 
 | 
|---|
| 1031 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1032 | 
 | 
|---|
| 1033 | kw = "fillnt";
 | 
|---|
| 1034 | usage = "Creates and Fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
 | 
|---|
| 1035 | usage += "\n Usage: fillnt nameobj f_X() g_Y() h_Z() k_T() [Cut() nameNt loop_param]";
 | 
|---|
| 1036 | usage += "\n  Related commands: ntloop plot2d projh1d projh2d projprof ";
 | 
|---|
| 1037 | usage += "\n  Related commands: fillvec fillmtx ntloop exptovec fillgd1 fillgd2 ObjectExpressions ..."; 
 | 
|---|
| 1038 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1039 | 
 | 
|---|
| 1040 | kw = "ntloop";
 | 
|---|
| 1041 | usage = "Loops over an Object NTupleInterface calling a function from a C-file \n";
 | 
|---|
| 1042 | usage += "and optionaly fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
 | 
|---|
| 1043 | usage += "\n Usage: ntloop nameobj CFileName FuncName [NtupleName loop_param]";
 | 
|---|
| 1044 | usage += "\n  Related commands: fillvec fillmtx fillnt fillgd1 fillgd2 exptovec ObjectExpressions ..."; 
 | 
|---|
| 1045 | usage += "\n  Related commands: ntexpcfile fillnt";
 | 
|---|
| 1046 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1047 | 
 | 
|---|
| 1048 | kw = "ntexpcfile";
 | 
|---|
| 1049 | usage = "Creates a C-File with declarations suitable to be used for ntloop";
 | 
|---|
| 1050 | usage += "\n Usage: ntexpcfile nameobj CFileName FuncName ";
 | 
|---|
| 1051 | usage += "\n  Related commands: ntloop";
 | 
|---|
| 1052 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1053 | 
 | 
|---|
| 1054 | kw = "exptovec";
 | 
|---|
| 1055 | usage = "Creates and Fills a Vector with X=f(Object)";
 | 
|---|
| 1056 | usage += "\n Usage: exptovec namevec nameobj f_X() [Cut() graphic_attributes loop_param]";
 | 
|---|
| 1057 | usage += "\n  Related commands: ntloop fillnt ObjectExpressions ..."; 
 | 
|---|
| 1058 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1059 | kw = "fillgd1";
 | 
|---|
| 1060 | usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), ErrY=h(...))";
 | 
|---|
| 1061 | usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_ErrY() [Cut() loop_param]";
 | 
|---|
| 1062 | usage += "\n  Related commands: ntloop fillnt ObjectExpressions ..."; 
 | 
|---|
| 1063 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1064 | kw = "fillgd2";
 | 
|---|
| 1065 | usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), Z=h(...)) ErrZ=k(...)";
 | 
|---|
| 1066 | usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_Z() k_ErrZ() [Cut() loop_param]";
 | 
|---|
| 1067 | usage += "\n  Related commands: ntloop fillnt ObjectExpressions ..."; 
 | 
|---|
| 1068 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1069 | kw = "gdfrvec";
 | 
|---|
| 1070 | usage = "Fills a GeneralFitData with vectors X,Y,Z,EZ";
 | 
|---|
| 1071 | usage += "\n Usage: gdfrvec namegfd X Y";
 | 
|---|
| 1072 | usage += "\n Usage: gdfrvec namegfd X Y ! EY";
 | 
|---|
| 1073 | usage += "\n Usage: gdfrvec namegfd X Y Z";
 | 
|---|
| 1074 | usage += "\n Usage: gdfrvec namegfd X Y Z EZ";
 | 
|---|
| 1075 | usage += "\n  Related commands: fillgd1 fillgd2 ..."; 
 | 
|---|
| 1076 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 | 
|---|
| 1077 | 
 | 
|---|
| 1078 | }
 | 
|---|
| 1079 | 
 | 
|---|
| 1080 | /* --Methode-- */
 | 
|---|
| 1081 | int PIABaseExecutor::LinkUserFuncs(string& fnameso, string& func1, string& func2, string& func3)
 | 
|---|
| 1082 | //                          string& func4, string& func5)
 | 
|---|
| 1083 | {
 | 
|---|
| 1084 | string cmd;
 | 
|---|
| 1085 | 
 | 
|---|
| 1086 | if (dynlink) delete dynlink;    dynlink = NULL;
 | 
|---|
| 1087 | usfmap.clear();
 | 
|---|
| 1088 | 
 | 
|---|
| 1089 | dynlink = new PDynLinkMgr(fnameso, true);
 | 
|---|
| 1090 | if (dynlink == NULL) { 
 | 
|---|
| 1091 |   string sn = fnameso; 
 | 
|---|
| 1092 |   cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur ouverture SO " << sn << endl; 
 | 
|---|
| 1093 |   return(2); 
 | 
|---|
| 1094 |   }
 | 
|---|
| 1095 | 
 | 
|---|
| 1096 | int nok=0;
 | 
|---|
| 1097 | // on utilise donc des DlFunction  (Reza 20/08/98)  voir commentaire ds .h (pb g++)
 | 
|---|
| 1098 | // DlUserProcFunction f = NULL;
 | 
|---|
| 1099 | DlFunction f = NULL;
 | 
|---|
| 1100 | if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") )  goto fin;
 | 
|---|
| 1101 | // f = (DlUserProcFunction)  dlsym(dlhandle, func1.c_str());
 | 
|---|
| 1102 | f = dynlink->GetFunction(func1);
 | 
|---|
| 1103 | if (f) { nok++;  usfmap[func1] = f; }
 | 
|---|
| 1104 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func1 << endl;
 | 
|---|
| 1105 | 
 | 
|---|
| 1106 | if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") )  goto fin;
 | 
|---|
| 1107 | // f = (DlUserProcFunction)  dlsym(dlhandle, func2.c_str());
 | 
|---|
| 1108 | f = dynlink->GetFunction(func2);
 | 
|---|
| 1109 | if (f) { nok++;  usfmap[func2] = f; }
 | 
|---|
| 1110 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func2 << endl;
 | 
|---|
| 1111 | 
 | 
|---|
| 1112 | if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") )  goto fin;
 | 
|---|
| 1113 | // f = (DlUserProcFunction)  dlsym(dlhandle, func3.c_str());
 | 
|---|
| 1114 | f = dynlink->GetFunction(func3);
 | 
|---|
| 1115 | if (f) { nok++;  usfmap[func3] = f; }
 | 
|---|
| 1116 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func3 << endl;
 | 
|---|
| 1117 | 
 | 
|---|
| 1118 | /*  Pb compile g++ 2.7.2 
 | 
|---|
| 1119 | if ((func4.length() < 1) || (func4 == "-") || (func4 == ".") )  goto fin;
 | 
|---|
| 1120 | // f = (DlUserProcFunction)  dlsym(dlhandle, func4.c_str());
 | 
|---|
| 1121 | f = dynlink->GetFunction(func4);
 | 
|---|
| 1122 | if (f) { nok++;  usfmap[func4] = f; }
 | 
|---|
| 1123 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func4 << endl;
 | 
|---|
| 1124 | 
 | 
|---|
| 1125 | if ((func5.length() < 1) || (func5 == "-") || (func5 == ".") )  goto fin;
 | 
|---|
| 1126 | // f = (DlUserProcFunction)  dlsym(dlhandle, func5.c_str());
 | 
|---|
| 1127 | f = dynlink->GetFunction(func5);
 | 
|---|
| 1128 | if (f) { nok++;  usfmap[func5] = f; }
 | 
|---|
| 1129 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func5 << endl;
 | 
|---|
| 1130 | */
 | 
|---|
| 1131 | fin:
 | 
|---|
| 1132 | if (nok < 1) { if (dynlink) delete dynlink;    dynlink = NULL;  return(3); }
 | 
|---|
| 1133 | else return(0);
 | 
|---|
| 1134 | }
 | 
|---|
| 1135 | 
 | 
|---|
| 1136 | /* --Methode-- */
 | 
|---|
| 1137 | int PIABaseExecutor::LinkUserFuncs2(string& fnameso, string& func1, string& func2, string& func3)
 | 
|---|
| 1138 | {
 | 
|---|
| 1139 | string cmd;
 | 
|---|
| 1140 | 
 | 
|---|
| 1141 | if (dynlink2) delete dynlink2;    dynlink2 = NULL;
 | 
|---|
| 1142 | usfmap2.clear();
 | 
|---|
| 1143 | 
 | 
|---|
| 1144 | dynlink2 = new PDynLinkMgr(fnameso, true);
 | 
|---|
| 1145 | if (dynlink2 == NULL) { 
 | 
|---|
| 1146 |   string sn = fnameso; 
 | 
|---|
| 1147 |   cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur ouverture SO " << sn << endl; 
 | 
|---|
| 1148 |   return(2); 
 | 
|---|
| 1149 |   }
 | 
|---|
| 1150 | 
 | 
|---|
| 1151 | int nok=0;
 | 
|---|
| 1152 | // on utilise donc des DlFunction  (Reza 20/08/98)  voir commentaire ds .h (pb g++)
 | 
|---|
| 1153 | // DlUserProcFunction f = NULL;
 | 
|---|
| 1154 | DlFunction f = NULL;
 | 
|---|
| 1155 | if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") )  goto fin;
 | 
|---|
| 1156 | f = dynlink2->GetFunction(func1);
 | 
|---|
| 1157 | if (f) { nok++;  usfmap2[func1] = f; }
 | 
|---|
| 1158 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func1 << endl;
 | 
|---|
| 1159 | 
 | 
|---|
| 1160 | if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") )  goto fin;
 | 
|---|
| 1161 | f = dynlink2->GetFunction(func2);
 | 
|---|
| 1162 | if (f) { nok++;  usfmap2[func2] = f; }
 | 
|---|
| 1163 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func2 << endl;
 | 
|---|
| 1164 | 
 | 
|---|
| 1165 | if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") )  goto fin;
 | 
|---|
| 1166 | f = dynlink2->GetFunction(func3);
 | 
|---|
| 1167 | if (f) { nok++;  usfmap2[func3] = f; }
 | 
|---|
| 1168 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func3 << endl;
 | 
|---|
| 1169 | 
 | 
|---|
| 1170 | fin:
 | 
|---|
| 1171 | if (nok < 1) { if (dynlink2) delete dynlink2;    dynlink2 = NULL;  return(3); }
 | 
|---|
| 1172 | else return(0);
 | 
|---|
| 1173 | }
 | 
|---|
| 1174 | 
 | 
|---|
| 1175 | /* Nouvelle-Fonction */
 | 
|---|
| 1176 | void RegisterPIGraphicsHelp(PIACmd* piac)
 | 
|---|
| 1177 | {
 | 
|---|
| 1178 | string kw,grp,usage;
 | 
|---|
| 1179 | 
 | 
|---|
| 1180 | grp = "Graphics";
 | 
|---|
| 1181 | 
 | 
|---|
| 1182 | kw = "PIImage";
 | 
|---|
| 1183 | usage = "Manages the display of a 2-D array (P2DArrayAdapter) as an image \n";
 | 
|---|
| 1184 | usage += "and controls a zoom widget, as well as a global image view widget \n";
 | 
|---|
| 1185 | usage += ">>>> Mouse controls : \n";
 | 
|---|
| 1186 | usage += "o Button-1: Display current coordinates and pixel value\n";
 | 
|---|
| 1187 | usage += "  Position the cursor an refresh the zoom widget\n";
 | 
|---|
| 1188 | usage += "o Button-2: Defines an image zone and positions the cursor \n";
 | 
|---|
| 1189 | usage += "o Button-3: Moves the viewed portion of the array inside the window \n";
 | 
|---|
| 1190 | usage += ">>>> Keyboard controls : \n";
 | 
|---|
| 1191 | usage += "o <Alt>R : Refresh display \n";
 | 
|---|
| 1192 | usage += "o <Alt>O : Shows the PIImageTools (image display parameter controls) \n";
 | 
|---|
| 1193 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of overlayed graphics (Drawers)) \n";
 | 
|---|
| 1194 | usage += "o <Alt>V : Copy/Paste / Text paste at the current cursor position \n";
 | 
|---|
| 1195 | usage += "o <Alt>C : Copy/Paste / Copies the selected regions content as text in the copy/paste buffer \n";
 | 
|---|
| 1196 | usage += "o <Alt>X : Show/Hide the Cut Window \n";
 | 
|---|
| 1197 | usage += "o <Alt>Z : Removes signs overlayed on image (Drawer 0) \n";
 | 
|---|
| 1198 | usage += "o Cursor keys : Moves the image cursor \n";
 | 
|---|
| 1199 | piac->RegisterHelp(kw, usage, grp);
 | 
|---|
| 1200 | 
 | 
|---|
| 1201 | kw = "PIScDrawWdg";
 | 
|---|
| 1202 | usage = "Manages display of 2-D drawers with interactive zoom \n";
 | 
|---|
| 1203 | usage += ">>>> Mouse controls : \n";
 | 
|---|
| 1204 | usage += "o Button-1: Display current coordinates \n";
 | 
|---|
| 1205 | usage += "o Button-2: Defines a rectangle for zoom \n";
 | 
|---|
| 1206 | usage += "o Button-3: Defines a rectangle for Text-Info (<Alt>I) \n";
 | 
|---|
| 1207 | usage += ">>>> Keyboard controls : \n";
 | 
|---|
| 1208 | usage += "o <Alt>R : Refresh display \n";
 | 
|---|
| 1209 | usage += "o <Alt>O : Displays a specific control window (default: PIDrawerTools) \n";
 | 
|---|
| 1210 | usage += "           Specific controls for 2-D histograms \n";
 | 
|---|
| 1211 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
 | 
|---|
| 1212 | usage += "           Drawer 0 manages the axes, as well as the added text \n";
 | 
|---|
| 1213 | usage += "o <Alt>V : Copy/Paste / Text paste at the current position \n";
 | 
|---|
| 1214 | usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n";
 | 
|---|
| 1215 | usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n";
 | 
|---|
| 1216 | usage += "o <Alt>M : Activate/Deactivate a measurement cursor on Button-1";
 | 
|---|
| 1217 | piac->RegisterHelp(kw, usage, grp);
 | 
|---|
| 1218 | 
 | 
|---|
| 1219 | kw = "PIDraw3DWdg";
 | 
|---|
| 1220 | usage = "Manages display of 3-D objects (drawers)  \n";
 | 
|---|
| 1221 | usage += ">>>> Mouse controls : \n";
 | 
|---|
| 1222 | usage += "o Button-2: Rotates the observer (camera) around object \n";
 | 
|---|
| 1223 | usage += "o Shift-Button-2: Rotates object with camera fixed \n";
 | 
|---|
| 1224 | usage += "  The object rotation mode can be assigned to Button-2 with <Alt>S \n";
 | 
|---|
| 1225 | usage += "o Button-3: Zoom control (Camera distance And/Or view angle) \n";
 | 
|---|
| 1226 | usage += ">>>> Keyboard controls : \n";
 | 
|---|
| 1227 | usage += "o <Alt>R : Resets the 3-D view and refreshes the display \n";
 | 
|---|
| 1228 | usage += "o <Alt>G : Show the PIDrawerTools (Graphic attributes of displayed Drawers) \n";
 | 
|---|
| 1229 | usage += "o <Alt>O : = <Alt>G \n";
 | 
|---|
| 1230 | usage += "o <Alt>V : Copy/Paste / Text paste at the current position (Drawer 0)\n";
 | 
|---|
| 1231 | usage += "o <Alt>Z : Removes added signs (text) to Drawer 0 \n";
 | 
|---|
| 1232 | usage += "o <Alt>A : Activate/Deactivate axes drawing \n";
 | 
|---|
| 1233 | usage += "o <Alt>S : Activate/Deactivate object rotation mode on Button-2 \n";
 | 
|---|
| 1234 | piac->RegisterHelp(kw, usage, grp);
 | 
|---|
| 1235 | 
 | 
|---|
| 1236 | kw = "Windows";
 | 
|---|
| 1237 | usage = "Objects can be displayed in different windows, or overlayed on the \n";
 | 
|---|
| 1238 | usage += "previous display. The graphics attributes next,win,stack,same control \n";
 | 
|---|
| 1239 | usage += "the display window. \n";
 | 
|---|
| 1240 | usage += "o GraphicWindow : This is the default mode (gr_att=next)\n";
 | 
|---|
| 1241 | usage += "  Graphic windows can be divided int zones. Object is displayed \n";
 | 
|---|
| 1242 | usage += "  in the next available position, removing a previously displayed \n";
 | 
|---|
| 1243 | usage += "  widget if necessary \n";
 | 
|---|
| 1244 | usage += "o Window : An object is displayed in its own window (gr_att= win) \n";
 | 
|---|
| 1245 | usage += "o StackWindow : multpile widgets can be stacked in a StackWindow (gr_att= stack) \n";
 | 
|---|
| 1246 | usage += "  A single widget is displayed a any time. Different widgets in a StackWindow \n";
 | 
|---|
| 1247 | usage += "  can be displayed using the stacknext command, as well as the StackTools item \n";
 | 
|---|
| 1248 | usage += "  in the Tools menu (from Menubar). An automatic cyclic display mode can also \n";
 | 
|---|
| 1249 | usage += "  be activated using the StackTools menu (Blink) \n";
 | 
|---|
| 1250 | usage += "o Most objects can be also be displayed overlayed \n";
 | 
|---|
| 1251 | usage += "  on the last displayed widget (gr_att= same) \n";
 | 
|---|
| 1252 | usage += "o The overlay can be on a selected rectangle of the \n";  
 | 
|---|
| 1253 | usage += "  last displayed widget (gr_att= inset) - See setinsetlimits\n";
 | 
|---|
| 1254 | usage += "\n  Related commands: newwin zone stacknext graphicatt setinsetlimits";  
 | 
|---|
| 1255 | piac->RegisterHelp(kw, usage, grp);
 | 
|---|
| 1256 | 
 | 
|---|
| 1257 | kw = "PIConsole";
 | 
|---|
| 1258 | usage = "Text output area and command editing window (console) \n";
 | 
|---|
| 1259 | usage += ">>>> Mouse controls : \n";
 | 
|---|
| 1260 | usage += "o Button-1: Rectangle selection for copy/paste \n";
 | 
|---|
| 1261 | usage += "o Button-2: Paste text in the command editing line \n";
 | 
|---|
| 1262 | usage += "o Button-3: activate display option menu \n";
 | 
|---|
| 1263 | usage += ">>>> Keyboard controls : \n";
 | 
|---|
| 1264 | usage += "o <Alt>O : activate display option menu   \n";
 | 
|---|
| 1265 | usage += "o <Alt>V : Paste text in the command editing line \n";
 | 
|---|
| 1266 | usage += "o <Alt>A : Selection of the whole window for copy \n";
 | 
|---|
| 1267 | usage += "o <Alt>L : Command history (List of command history buffer) \n";
 | 
|---|
| 1268 | usage += "o <Ctl>A : Command editing -> Goto the beginning of line \n";
 | 
|---|
| 1269 | usage += "o <Ctl>E : Command editing -> Goto the end of line \n";
 | 
|---|
| 1270 | usage += "o <Ctl>K : Command editing -> Clear to the end of line \n";
 | 
|---|
| 1271 | usage += "o <Ctl>C : Command editing -> Clear the line \n";
 | 
|---|
| 1272 | usage += "o Cursor left,right : Command editing -> Move cursor \n";
 | 
|---|
| 1273 | usage += "o Cursor Up,Down : recall command from history buffer \n";
 | 
|---|
| 1274 | usage += "o Backspace,Del : Command editing \n";
 | 
|---|
| 1275 | usage += "o <Return>,<Enter> : Execute command \n";
 | 
|---|
| 1276 | piac->RegisterHelp(kw, usage, grp);
 | 
|---|
| 1277 | }
 | 
|---|