Changeset 2975 in Sophya
- Timestamp:
- Jun 20, 2006, 6:04:51 PM (19 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r2944 r2975 149 149 } 150 150 else if (kw == "print" ) { 151 if (tokens.size() < 1) { cout << "Usage: print nameobj " << endl; return(0); } 152 mObjMgr->PrintObj(tokens[0]); 151 if (tokens.size() < 1) { cout << "Usage: print nameobj [prtlev]" << endl; return(0); } 152 int lev = 0; 153 if (tokens.size()>1) lev = atoi(tokens[1].c_str()); 154 mObjMgr->PrintObj(tokens[0], lev); 153 155 } 154 156 else if ( (kw == "rename" ) || (kw == "mv") ) { … … 944 946 945 947 kw = "print"; 946 usage = "Prints an object \n Usage: print nameobj"; 948 usage = "Prints an object \n Usage: print nameobj [prtlev]"; 949 usage += "\n prtlev = 0,1,2... default: prtlev=0"; 947 950 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 948 951 -
trunk/SophyaPI/PIext/nobjmgr.cc
r2933 r2975 1248 1248 1249 1249 /* --Methode-- */ 1250 void NamedObjMgr::PrintObj(string& nom )1250 void NamedObjMgr::PrintObj(string& nom, int lev) 1251 1251 { 1252 1252 ZSync zs(*myMutex); zs.NOp(); … … 1261 1261 string ctyp = typeid(*ob).name(); 1262 1262 cout << "NamedObjMgr::PrintObj(" << nom << ") Type: " << ctyp << endl; 1263 obja->Print(cout );1263 obja->Print(cout, lev); 1264 1264 1265 1265 return; -
trunk/SophyaPI/PIext/nobjmgr.h
r2933 r2975 78 78 79 79 // Info sur les objets 80 virtual void PrintObj(string & nom );80 virtual void PrintObj(string & nom, int lev=0); 81 81 82 82 // Affichage des objets -
trunk/SophyaPI/PIext/nomgadapter.cc
r2933 r2975 86 86 87 87 /* --Methode-- */ 88 void NObjMgrAdapter::Print(ostream& 88 void NObjMgrAdapter::Print(ostream&, int /*lev*/) 89 89 { 90 90 string s = typeid(*mObj).name(); 91 cout << "NObjMgrAdapter::Print() - Error : Not supported for " << s << endl; 91 cout << "NObjMgrAdapter::Print() " << typeid(*mObj).name() << hex 92 << " @" << (unsigned long long)mObj << dec << endl; 92 93 } 93 94 -
trunk/SophyaPI/PIext/nomgadapter.h
r2933 r2975 48 48 virtual void SavePPF(POutPersist& s, string const & nom); 49 49 50 virtual void Print(ostream& os );50 virtual void Print(ostream& os, int lev=0); 51 51 virtual PIDrawer* GetDrawer(string& dopt); 52 52 virtual P2DArrayAdapter* Get2DArray(string& dopt); -
trunk/SophyaPI/PIext/nomgfdadapter.cc
r2615 r2975 63 63 64 64 /* --Methode-- */ 65 void NOMAdapter_GeneralFitData::Print(ostream& os )65 void NOMAdapter_GeneralFitData::Print(ostream& os, int) 66 66 { 67 67 os << *(mG); -
trunk/SophyaPI/PIext/nomgfdadapter.h
r1315 r2975 27 27 virtual void SavePPF(POutPersist& s, string const & nom); 28 28 29 virtual void Print(ostream& os );29 virtual void Print(ostream& os, int lev=0); 30 30 virtual NTupleInterface* GetNTupleInterface(bool& adel); 31 31 -
trunk/SophyaPI/PIext/nomhistadapter.cc
r2933 r2975 103 103 104 104 /* --Methode-- */ 105 void NOMAdapter_Histo::Print(ostream& os) 106 { 107 mHis->Print(60); 105 void NOMAdapter_Histo::Print(ostream& os, int lev) 106 { 107 mHis->Show(os); 108 if (lev > 0) mHis->Print(60); 108 109 } 109 110 … … 275 276 276 277 /* --Methode-- */ 277 void NOMAdapter_Histo2D::Print(ostream& os) 278 { 279 mHis->Print(); 278 void NOMAdapter_Histo2D::Print(ostream& os, int lev) 279 { 280 mHis->Show(os); 281 if (lev > 0) mHis->Print(); 280 282 } 281 283 … … 465 467 466 468 /* --Methode-- */ 467 void NOMAdapter_NTuple::Print(ostream& os )468 { 469 os << mNt->Info();470 os << *(mNt);469 void NOMAdapter_NTuple::Print(ostream& os, int lev) 470 { 471 mNt->Show(os); 472 if (lev > 0) os << mNt->Info(); 471 473 } 472 474 … … 530 532 531 533 /* --Methode-- */ 532 void NOMAdapter_XNTuple::Print(ostream& os )534 void NOMAdapter_XNTuple::Print(ostream& os, int lev) 533 535 { 534 536 // os << mNt->Info(); … … 614 616 615 617 /* --Methode-- */ 616 void NOMAdapter_DataTable::Print(ostream& os )618 void NOMAdapter_DataTable::Print(ostream& os, int lev) 617 619 { 618 620 mDT->Show(os); 621 if (lev < 1) return; 622 if (lev < 5) mDT->Print(os, 0, lev*10); 623 else mDT->Print(os); 619 624 } 620 625 -
trunk/SophyaPI/PIext/nomhistadapter.h
r2933 r2975 36 36 virtual string GetInfoString(int lev=0); 37 37 38 virtual void Print(ostream& os );38 virtual void Print(ostream& os, int lev=0); 39 39 virtual PIDrawer* GetDrawer(string& dopt); 40 40 virtual NTupleInterface* GetNTupleInterface(bool& adel); … … 82 82 virtual void SavePPF(POutPersist& s, string const & nom); 83 83 84 virtual void Print(ostream& os );84 virtual void Print(ostream& os, int lev=0); 85 85 virtual PIDrawer* GetDrawer(string& dopt); 86 86 virtual P2DArrayAdapter* Get2DArray(string& dopt); … … 130 130 virtual void SavePPF(POutPersist& s, string const & nom); 131 131 132 virtual void Print(ostream& os );132 virtual void Print(ostream& os, int lev=0); 133 133 virtual NTupleInterface* GetNTupleInterface(bool& adel); 134 134 … … 154 154 virtual void SavePPF(POutPersist& s, string const & nom); 155 155 156 virtual void Print(ostream& os );156 virtual void Print(ostream& os, int lev=0); 157 157 virtual NTupleInterface* GetNTupleInterface(bool& adel); 158 158 … … 178 178 virtual void SavePPF(POutPersist& s, string const & nom); 179 179 180 virtual void Print(ostream& os );180 virtual void Print(ostream& os, int lev=0); 181 181 virtual NTupleInterface* GetNTupleInterface(bool& adel); 182 182 -
trunk/SophyaPI/PIext/nomimagadapter.cc
r2933 r2975 88 88 /* --Methode-- */ 89 89 template <class T> 90 void NOMAdapter_Image<T>::Print(ostream& os) 91 { 92 mImg->Print(os); 90 void NOMAdapter_Image<T>::Print(ostream& os, int lev) 91 { 92 if (lev < 3) mImg->Show(os, false); 93 else mImg->Show(os, true); 94 if (lev > 0) mImg->Print(os, 10*lev); 93 95 } 94 96 -
trunk/SophyaPI/PIext/nomimagadapter.h
r2933 r2975 29 29 virtual void SavePPF(POutPersist& s, string const & nom); 30 30 31 virtual void Print(ostream& os );31 virtual void Print(ostream& os, int lev); 32 32 virtual P2DArrayAdapter* Get2DArray(string& dopt); 33 33 virtual NTupleInterface* GetNTupleInterface(bool& adel); -
trunk/SophyaPI/PIext/nommatvecadapter.cc
r2683 r2975 61 61 62 62 /* --Methode-- */ 63 void NOMAdapter_Vector::Print(ostream& os )63 void NOMAdapter_Vector::Print(ostream& os, int) 64 64 { 65 65 os << (*mVec); … … 223 223 224 224 /* --Methode-- */ 225 void NOMAdapter_Matrix::Print(ostream& os )225 void NOMAdapter_Matrix::Print(ostream& os, int) 226 226 { 227 227 os << (*mMtx); -
trunk/SophyaPI/PIext/nommatvecadapter.h
r2933 r2975 35 35 virtual void SavePPF(POutPersist& s, string const & nom); 36 36 37 virtual void Print(ostream& os );37 virtual void Print(ostream& os, int lev=0); 38 38 virtual PIDrawer* GetDrawer(string& dopt); 39 39 virtual NTupleInterface* GetNTupleInterface(bool& adel); … … 83 83 virtual void SavePPF(POutPersist& s, string const & nom); 84 84 85 virtual void Print(ostream& os );85 virtual void Print(ostream& os, int lev=0); 86 86 virtual P2DArrayAdapter* Get2DArray(string& dopt); 87 87 virtual NTupleInterface* GetNTupleInterface(bool& adel); -
trunk/SophyaPI/PIext/nomskymapadapter.cc
r2933 r2975 156 156 /* --Methode-- */ 157 157 template <class T> 158 void NOMAdapter_PixelMap<T>::Print(ostream& os) 159 { 160 string s = typeid(*mMap).name(); 161 T moy, sig; 162 MeanSig(moy, sig); 163 cout << "SkyMap Type: " << s << " NbPixels= " << mMap->NbPixels() << endl; 164 cout << " Mean= " << moy << " Sig2= " << sig << endl; 158 void NOMAdapter_PixelMap<T>::Print(ostream& os, int lev) 159 { 160 mMap->Show(os); 161 if (lev > 0) { 162 T moy, sig; 163 MeanSig(moy, sig); 164 os << "PixelMap: Mean= " << moy << " Sig2= " << sig << endl; 165 } 166 if (lev > 1) { 167 os << "[k] (Theta,Phi) : PixVal" << endl; 168 double t, p; 169 for(int k=0; k<10*(lev-1); k++) { 170 mMap->PixThetaPhi(k, t, p); 171 os << "[" << k << "] (" << t << "," << p << ") : " << mMap->PixVal(k) << endl; 172 } 173 } 174 165 175 } 166 176 -
trunk/SophyaPI/PIext/nomskymapadapter.h
r2933 r2975 32 32 virtual void SavePPF(POutPersist& s, string const & nom); 33 33 34 virtual void Print(ostream& os );34 virtual void Print(ostream& os, int lev=0); 35 35 virtual P2DArrayAdapter* Get2DArray(string& dopt); 36 36 virtual NTupleInterface* GetNTupleInterface(bool& adel); -
trunk/SophyaPI/PIext/nomspecrespadapter.cc
r2615 r2975 119 119 120 120 /* --Methode-- */ 121 void NOMAdapter_SpectralResponse::Print(ostream& os )121 void NOMAdapter_SpectralResponse::Print(ostream& os, int) 122 122 { 123 123 os << (*mSR); -
trunk/SophyaPI/PIext/nomspecrespadapter.h
r2933 r2975 24 24 virtual void SavePPF(POutPersist& s, string const & nom); 25 25 26 virtual void Print(ostream& os );26 virtual void Print(ostream& os, int lev=0); 27 27 virtual PIDrawer* GetDrawer(string& dopt); 28 28 // virtual NTupleInterface* GetNTupleInterface(bool& adel); -
trunk/SophyaPI/PIext/nomstladapter.cc
r2615 r2975 52 52 53 53 /* --Methode-- */ 54 void NOMAdapter_StarList::Print(ostream& os )54 void NOMAdapter_StarList::Print(ostream& os, int) 55 55 { 56 56 os << (*mStl); -
trunk/SophyaPI/PIext/nomstladapter.h
r344 r2975 26 26 virtual void SavePPF(POutPersist& s, string const & nom); 27 27 28 virtual void Print(ostream& os );28 virtual void Print(ostream& os, int lev=0); 29 29 virtual PIDrawer* GetDrawer(string& dopt); 30 30 virtual NTupleInterface* GetNTupleInterface(bool& adel); -
trunk/SophyaPI/PIext/nomtarradapter.cc
r2933 r2975 76 76 /* --Methode-- */ 77 77 template <class T> 78 void NOMAdapter_TArray<T>::Print(ostream& os) 79 { 80 os << (*mArr); 78 void NOMAdapter_TArray<T>::Print(ostream& os, int lev) 79 { 80 if (lev < 3) mArr->Show(os, false); 81 else mArr->Show(os, true); 82 if (lev > 0) mArr->Print(os, 10*lev); 81 83 } 82 84 -
trunk/SophyaPI/PIext/nomtarradapter.h
r2930 r2975 29 29 virtual void SavePPF(POutPersist& s, string const & nom); 30 30 31 virtual void Print(ostream& os );31 virtual void Print(ostream& os, int lev=0); 32 32 virtual PIDrawer* GetDrawer(string& dopt); 33 33 virtual P2DArrayAdapter* Get2DArray(string& dopt); -
trunk/SophyaPI/PIext/nomtmatvecadapter.cc
r2933 r2975 90 90 /* --Methode-- */ 91 91 template <class T> 92 void NOMAdapter_TMatrix<T>::Print(ostream& os )93 { 94 TVector<T>* v = dynamic_cast<TVector<T> *>(mMtx);95 if (v != NULL) os << (*v);96 else os << (*mMtx);92 void NOMAdapter_TMatrix<T>::Print(ostream& os, int lev) 93 { 94 if (lev < 3) mMtx->Show(os, false); 95 else mMtx->Show(os, true); 96 if (lev > 0) mMtx->Print(os, 10*lev); 97 97 } 98 98 -
trunk/SophyaPI/PIext/nomtmatvecadapter.h
r2930 r2975 30 30 virtual void SavePPF(POutPersist& s, string const & nom); 31 31 32 virtual void Print(ostream& os );32 virtual void Print(ostream& os, int lev=0); 33 33 virtual PIDrawer* GetDrawer(string& dopt); 34 34 virtual P2DArrayAdapter* Get2DArray(string& dopt);
Note:
See TracChangeset
for help on using the changeset viewer.