Changeset 449 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc


Ignore:
Timestamp:
Oct 1, 1999, 3:47:18 PM (26 years ago)
Author:
ercodmgr
Message:

Fin lecture NtupleASCII, amelioration/niveau de print ds NamedObjMgr Reza 1/10/99

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/nobjmgr.cc

    r440 r449  
    8686static string* TmpDir;  // Repertoire pour les compilations / link dynamique
    8787
    88 static bool BeQuiet = false;  // Moins de messages ...
    8988
    9089// Pour completer le nom de l'objet avec le nom du repertoire
     
    172171}
    173172
     173
     174static bool verbeux = false;  // true -> plus de message (creation/suppression d'objets)
     175void NamedObjMgr::SetVerbose(bool fg)
     176{
     177verbeux = fg;
     178}
     179
    174180/* --Methode-- */
    175181PIStdImgApp* NamedObjMgr::GetImgApp()
     
    207213  (myImgApp->ObjMgrW())->AddDirectory(str.c_str(), myDirId);
    208214  }
    209 cout << "NamedObjMgr::CreateDir() " << dirname << " Created " << endl;
     215if (verbeux) cout << "NamedObjMgr::CreateDir() " << dirname << " Created " << endl;
    210216return(true);
    211217}
     
    239245  (myImgApp->ObjMgrW())->DelDirectory((*it).second.id);
    240246myDirs->erase(it);
    241 cout << "NamedObjMgr::DeleteDir() " << dirname << " deleted " << endl; 
     247if (verbeux) cout << "NamedObjMgr::DeleteDir() " << dirname << " deleted " << endl; 
    242248return(true);
    243249}
     
    250256if (it == myDirs->end()) return;
    251257(*it).second.lock = true;
    252 cout << "NamedObjMgr::LockDir() " << dirname << " Locked " << endl;
     258if (verbeux) cout << "NamedObjMgr::LockDir() " << dirname << " Locked " << endl;
    253259return;
    254260}
     
    261267if (it == myDirs->end()) return;
    262268(*it).second.lock = true;
    263 cout << "NamedObjMgr::UnlockDir() " << dirname << " Unlocked " << endl;
     269if (verbeux) cout << "NamedObjMgr::UnlockDir() " << dirname << " Unlocked " << endl;
    264270return;
    265271}
     
    272278if (it == myDirs->end()) return;
    273279(*it).second.keepold = keepold;
     280if (!verbeux) return;
    274281cout << "NamedObjMgr::SetKeepOldDirAtt() " << dirname << "  ->  ";
    275282if ( keepold ) cout << " True " << endl;
     
    292299  }
    293300*currDir = dirname;
    294 cout << "NamedObjMgr::SetCurrentDir() -> " << dirname << endl;
     301if (verbeux) cout << "NamedObjMgr::SetCurrentDir() -> " << dirname << endl;
    295302return(true);
    296303}
     
    413420// Si c'est le repertoire /func, on nettoie
    414421if (nrep == "func")  {
    415   BeQuiet = true;   
    416422  CleanDir(nrep);
    417   BeQuiet = false;
    418423  }
    419424
     
    459464(*itr).second.nobj++;
    460465
    461 cout << "NamedObjMgr::AddObj()  Object " << nom << " ( " 
     466if (verbeux) cout << "NamedObjMgr::AddObj()  Object " << nom << " ( " 
    462467     << typeid(*obj).name() << " ) added (Total= " << myObjs->size() << ")" << endl; 
    463468return(true);
     
    505510itr = myDirs->find(r2);
    506511(*itr).second.nobj++;
    507 cout << "NamedObjMgr::RenameObj() - Object " << nom << " renamed to " << nomnew << endl;
     512if (verbeux)
     513  cout << "NamedObjMgr::RenameObj() - Object " << nom << " renamed to " << nomnew << endl;
    508514return(true);
    509515}
     
    534540(*itr).second.nobj--;
    535541
    536 if (BeQuiet) return(true); 
     542if (!verbeux) return(true); 
    537543if (fgd) cout << "NamedObjMgr::DelObj()  Object " << nom << " deleted (Total= " << myObjs->size() << ")" << endl;
    538544else  cout << "NamedObjMgr::DelObj()  Object " << nom << " removed (Total= " << myObjs->size() << ")" << endl;
     
    686692string nom;
    687693
     694int nread = 0;
    688695if ( (s.NbTags() < 1) || (num >= s.NbTags()) ) {
    689696  if (num >= 0) {
     
    701708  nom = "";
    702709  AddObj(obj->DataObj(), nom);
     710  nread++;
    703711}
    704712 
     
    717725    ok = false;
    718726  } ENDTRY;
    719   if (ok)  AddObj(obj->DataObj(), nom, true); 
    720 }
    721 
     727  if (ok)  { AddObj(obj->DataObj(), nom, true);  nread++; }
     728}
     729
     730cout << "NamedObjMgr::ReadObj(...) " << nread << " Objects read " << endl;
    722731return;
    723732}
     
    919928obja = GetObjAdapter(nom);
    920929if (obja == NULL) {
    921   cout << "NamedObjMgr::DisplayImage() Error , Pas d'objet de nom " << nom << endl;
     930  cout << "NamedObjMgr::DisplayImage() Error , No such object " << nom << endl;
    922931  return;
    923932}
     
    928937if (!arr) {
    929938  string ctyp = typeid(*(obja->GetDataObj())).name();
    930   cout << "NamedObjMgr::DisplayImage() Error , Non supporte pour " << ctyp << endl;
     939  cout << "NamedObjMgr::DisplayImage() Error , Not supported for " << ctyp << endl;
    931940  return;
    932941  }
     
    954963obja = GetObjAdapter(nom);
    955964if (obja == NULL) {
    956   cout << "NamedObjMgr::DisplayImage() Error , Pas d'objet de nom " << nom << endl;
     965  cout << "NamedObjMgr::DisplaySurf3D() Error , No such object " << nom << endl;
    957966  return;
    958967}
     
    963972if (!arr) {
    964973  string ctyp = typeid(*(obja->GetDataObj())).name();
    965   cout << "NamedObjMgr::DisplaySurf3D() Error , Non supporte pour " << ctyp << endl;
     974  cout << "NamedObjMgr::DisplaySurf3D() Error , Not supported " << ctyp << endl;
    966975  return;
    967976  }
     
    969978if ((arr->XSize() > 250) || (arr->YSize() > 250)) {
    970979  cout << "NamedObjMgr::DisplaySurf3D() Error , 2D-Array(" <<  arr->XSize()
    971        << "x" << arr->YSize() << ") trop grand (max=250x250)" << endl;
     980       << "x" << arr->YSize() << ") too big (max=250x250)" << endl;
    972981  delete arr;
    973982  return;
     
    9981007AnyDataObj* obj=GetObj(nom);
    9991008if (obj == NULL) {
    1000   cout << "NamedObjMgr::DisplayNT() Error , Pas d'objet de nom " << nom << endl;
     1009  cout << "NamedObjMgr::DisplayNT() Error , No such object " << nom << endl;
    10011010  return;
    10021011}
     
    10071016// if (typeid(*obj) != typeid(NTupleInterface)) {
    10081017  string ctyp = typeid(*obj).name();
    1009   cout << "NamedObjMgr::DisplayNT() Error , Objet n'est pas un NTuple " << ctyp << endl;
     1018  cout << "NamedObjMgr::DisplayNT() Error , Object not an NTuple " << ctyp << endl;
    10101019  return;
    10111020  }
     
    10611070AnyDataObj* obj=GetObj(nom);
    10621071if(obj == NULL)
    1063   {cout << "NamedObjMgr::DisplayGFD() Error , Pas d'objet de nom " << nom << endl;
     1072  {cout << "NamedObjMgr::DisplayGFD() Error , No such object " << nom << endl;
    10641073   return;}
    10651074if(!myImgApp) return;
    10661075if(typeid(*obj) != typeid(GeneralFitData))
    10671076  {string ctyp = typeid(*obj).name();
    1068    cout<<"NamedObjMgr::DisplayGFD() Error , Objet n'est pas un GeneralFitData "<<ctyp<<endl;
     1077   cout<<"NamedObjMgr::DisplayGFD() Error , Object not a GeneralFitData "<<ctyp<<endl;
    10691078   return;}
    10701079
Note: See TracChangeset for help on using the changeset viewer.