Changeset 449 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc
- Timestamp:
- Oct 1, 1999, 3:47:18 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nobjmgr.cc
r440 r449 86 86 static string* TmpDir; // Repertoire pour les compilations / link dynamique 87 87 88 static bool BeQuiet = false; // Moins de messages ...89 88 90 89 // Pour completer le nom de l'objet avec le nom du repertoire … … 172 171 } 173 172 173 174 static bool verbeux = false; // true -> plus de message (creation/suppression d'objets) 175 void NamedObjMgr::SetVerbose(bool fg) 176 { 177 verbeux = fg; 178 } 179 174 180 /* --Methode-- */ 175 181 PIStdImgApp* NamedObjMgr::GetImgApp() … … 207 213 (myImgApp->ObjMgrW())->AddDirectory(str.c_str(), myDirId); 208 214 } 209 cout << "NamedObjMgr::CreateDir() " << dirname << " Created " << endl;215 if (verbeux) cout << "NamedObjMgr::CreateDir() " << dirname << " Created " << endl; 210 216 return(true); 211 217 } … … 239 245 (myImgApp->ObjMgrW())->DelDirectory((*it).second.id); 240 246 myDirs->erase(it); 241 cout << "NamedObjMgr::DeleteDir() " << dirname << " deleted " << endl;247 if (verbeux) cout << "NamedObjMgr::DeleteDir() " << dirname << " deleted " << endl; 242 248 return(true); 243 249 } … … 250 256 if (it == myDirs->end()) return; 251 257 (*it).second.lock = true; 252 cout << "NamedObjMgr::LockDir() " << dirname << " Locked " << endl;258 if (verbeux) cout << "NamedObjMgr::LockDir() " << dirname << " Locked " << endl; 253 259 return; 254 260 } … … 261 267 if (it == myDirs->end()) return; 262 268 (*it).second.lock = true; 263 cout << "NamedObjMgr::UnlockDir() " << dirname << " Unlocked " << endl;269 if (verbeux) cout << "NamedObjMgr::UnlockDir() " << dirname << " Unlocked " << endl; 264 270 return; 265 271 } … … 272 278 if (it == myDirs->end()) return; 273 279 (*it).second.keepold = keepold; 280 if (!verbeux) return; 274 281 cout << "NamedObjMgr::SetKeepOldDirAtt() " << dirname << " -> "; 275 282 if ( keepold ) cout << " True " << endl; … … 292 299 } 293 300 *currDir = dirname; 294 cout << "NamedObjMgr::SetCurrentDir() -> " << dirname << endl;301 if (verbeux) cout << "NamedObjMgr::SetCurrentDir() -> " << dirname << endl; 295 302 return(true); 296 303 } … … 413 420 // Si c'est le repertoire /func, on nettoie 414 421 if (nrep == "func") { 415 BeQuiet = true;416 422 CleanDir(nrep); 417 BeQuiet = false;418 423 } 419 424 … … 459 464 (*itr).second.nobj++; 460 465 461 cout << "NamedObjMgr::AddObj() Object " << nom << " ( "466 if (verbeux) cout << "NamedObjMgr::AddObj() Object " << nom << " ( " 462 467 << typeid(*obj).name() << " ) added (Total= " << myObjs->size() << ")" << endl; 463 468 return(true); … … 505 510 itr = myDirs->find(r2); 506 511 (*itr).second.nobj++; 507 cout << "NamedObjMgr::RenameObj() - Object " << nom << " renamed to " << nomnew << endl; 512 if (verbeux) 513 cout << "NamedObjMgr::RenameObj() - Object " << nom << " renamed to " << nomnew << endl; 508 514 return(true); 509 515 } … … 534 540 (*itr).second.nobj--; 535 541 536 if ( BeQuiet) return(true);542 if (!verbeux) return(true); 537 543 if (fgd) cout << "NamedObjMgr::DelObj() Object " << nom << " deleted (Total= " << myObjs->size() << ")" << endl; 538 544 else cout << "NamedObjMgr::DelObj() Object " << nom << " removed (Total= " << myObjs->size() << ")" << endl; … … 686 692 string nom; 687 693 694 int nread = 0; 688 695 if ( (s.NbTags() < 1) || (num >= s.NbTags()) ) { 689 696 if (num >= 0) { … … 701 708 nom = ""; 702 709 AddObj(obj->DataObj(), nom); 710 nread++; 703 711 } 704 712 … … 717 725 ok = false; 718 726 } ENDTRY; 719 if (ok) AddObj(obj->DataObj(), nom, true); 720 } 721 727 if (ok) { AddObj(obj->DataObj(), nom, true); nread++; } 728 } 729 730 cout << "NamedObjMgr::ReadObj(...) " << nread << " Objects read " << endl; 722 731 return; 723 732 } … … 919 928 obja = GetObjAdapter(nom); 920 929 if (obja == NULL) { 921 cout << "NamedObjMgr::DisplayImage() Error , Pas d'objet de nom" << nom << endl;930 cout << "NamedObjMgr::DisplayImage() Error , No such object " << nom << endl; 922 931 return; 923 932 } … … 928 937 if (!arr) { 929 938 string ctyp = typeid(*(obja->GetDataObj())).name(); 930 cout << "NamedObjMgr::DisplayImage() Error , No n supporte pour " << ctyp << endl;939 cout << "NamedObjMgr::DisplayImage() Error , Not supported for " << ctyp << endl; 931 940 return; 932 941 } … … 954 963 obja = GetObjAdapter(nom); 955 964 if (obja == NULL) { 956 cout << "NamedObjMgr::Display Image() Error , Pas d'objet de nom" << nom << endl;965 cout << "NamedObjMgr::DisplaySurf3D() Error , No such object " << nom << endl; 957 966 return; 958 967 } … … 963 972 if (!arr) { 964 973 string ctyp = typeid(*(obja->GetDataObj())).name(); 965 cout << "NamedObjMgr::DisplaySurf3D() Error , No n supporte pour" << ctyp << endl;974 cout << "NamedObjMgr::DisplaySurf3D() Error , Not supported " << ctyp << endl; 966 975 return; 967 976 } … … 969 978 if ((arr->XSize() > 250) || (arr->YSize() > 250)) { 970 979 cout << "NamedObjMgr::DisplaySurf3D() Error , 2D-Array(" << arr->XSize() 971 << "x" << arr->YSize() << ") t rop grand(max=250x250)" << endl;980 << "x" << arr->YSize() << ") too big (max=250x250)" << endl; 972 981 delete arr; 973 982 return; … … 998 1007 AnyDataObj* obj=GetObj(nom); 999 1008 if (obj == NULL) { 1000 cout << "NamedObjMgr::DisplayNT() Error , Pas d'objet de nom" << nom << endl;1009 cout << "NamedObjMgr::DisplayNT() Error , No such object " << nom << endl; 1001 1010 return; 1002 1011 } … … 1007 1016 // if (typeid(*obj) != typeid(NTupleInterface)) { 1008 1017 string ctyp = typeid(*obj).name(); 1009 cout << "NamedObjMgr::DisplayNT() Error , Obje t n'est pas un NTuple " << ctyp << endl;1018 cout << "NamedObjMgr::DisplayNT() Error , Object not an NTuple " << ctyp << endl; 1010 1019 return; 1011 1020 } … … 1061 1070 AnyDataObj* obj=GetObj(nom); 1062 1071 if(obj == NULL) 1063 {cout << "NamedObjMgr::DisplayGFD() Error , Pas d'objet de nom" << nom << endl;1072 {cout << "NamedObjMgr::DisplayGFD() Error , No such object " << nom << endl; 1064 1073 return;} 1065 1074 if(!myImgApp) return; 1066 1075 if(typeid(*obj) != typeid(GeneralFitData)) 1067 1076 {string ctyp = typeid(*obj).name(); 1068 cout<<"NamedObjMgr::DisplayGFD() Error , Obje t n'est pas unGeneralFitData "<<ctyp<<endl;1077 cout<<"NamedObjMgr::DisplayGFD() Error , Object not a GeneralFitData "<<ctyp<<endl; 1069 1078 return;} 1070 1079
Note:
See TracChangeset
for help on using the changeset viewer.