Changeset 495 in Sophya for trunk/SophyaPI/PIext
- Timestamp:
- Oct 21, 1999, 8:58:45 PM (26 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r486 r495 22 22 #include "cvector.h" 23 23 24 24 using namespace PlanckDPC; 25 25 26 26 /* --Methode-- */ … … 118 118 cout << endl; 119 119 cerr << endl; 120 string es = PeidaExc(merr);121 cerr << "PIABaseExecutor: Call UserFunc Exception :" << merr << es;120 //CMV_A_FAIRE string es = PeidaExc(merr); 121 //CMV_A_FAIRE cerr << "PIABaseExecutor: Call UserFunc Exception :" << merr << es; 122 122 } 123 123 mImgApp->RedirectStdOutErr(red); -
trunk/SophyaPI/PIext/exclude
r385 r495 1 1 modrecst.cc 2 2 userfitfunex.c 3 nomstladapter.cc 4 pistlist.cc -
trunk/SophyaPI/PIext/nobjmgr.cc
r493 r495 684 684 void NamedObjMgr::ReadObj(string const & flnm, string & nobj) 685 685 { 686 PPersist* obj=NULL;686 PPersist* ppobj=NULL; 687 687 bool ok = true; 688 688 #ifdef SANS_EVOLPLANCK 689 689 TRY{ 690 690 PInPersist pis(flnm); 691 obj = PPersistMgr::ReadObject(pis);692 if ( obj == NULL) ok = false;691 ppobj = PPersistMgr::ReadObject(pis); 692 if (ppobj == NULL) ok = false; 693 693 } CATCH(merr) 694 694 { printf("NamedObjMgr::ReadObj()/Error Exception= %ld (%s) \n", 695 695 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY; 696 696 #else 697 try { 698 PInPersist pis(flnm); 699 ppobj = pis.ReadObject(); 700 } 701 catch (IOExc iox) { 702 cerr << "NamedObjMgr::ReadObj()/Error Exception - Msg= " << iox.Msg() << endl; 703 ok = false; 704 } 705 #endif 697 706 if (!ok) return; 698 707 if (nobj.length()<1) nobj = servnobjm->FileName2Name(flnm); 699 AddObj( obj->DataObj(), nobj, true);708 AddObj(ppobj->DataObj(), nobj, true); 700 709 return; 701 710 } … … 713 722 if ( (s.NbTags() < 1) || (num >= s.NbTags()) ) { 714 723 if (num >= 0) { 715 printf("NamedObjMgr::ReadObj(PInPersist, %d) Error! NbTags = %d \n", num, s.NbTags()); 724 cerr << "NamedObjMgr::ReadObj(PInPersist, " << num << " Error! NbTags =" 725 << s.NbTags() << endl; 716 726 return; 717 727 } 728 729 #ifdef SANS_EVOLPLANCK 718 730 TRY { 719 731 obj = PPersistMgr::ReadObject(s); … … 723 735 ok = false; 724 736 } ENDTRY; 737 #else 738 try { 739 obj = s.ReadObject(); 740 } 741 catch (IOExc iox) { 742 cerr << "NamedObjMgr::ReadObj()/Error Exception - Msg= " << iox.Msg() << endl; 743 ok = false; 744 } 745 #endif 746 725 747 if (!ok) return; 726 748 nom = ""; … … 732 754 else { n0 = num; n1 = num+1; } 733 755 for(i=n0; i<n1; i++) { 756 #ifdef SANS_EVOLPLANCK 734 757 key = s.TagKey(i, cid, ln); 735 758 if (ln <= 0) nom = ""; … … 743 766 ok = false; 744 767 } ENDTRY; 768 #else 769 s.GotoTagNum(i); 770 try { 771 obj = s.ReadObject(); 772 char buffnom[64]; 773 sprintf(buffnom,"O%d",i); 774 nom = buffnom; 775 } 776 catch (IOExc iox) { 777 cerr << "NamedObjMgr::ReadObj()/Error Exception - Msg= " << iox.Msg() << endl; 778 ok = false; 779 } 780 #endif 745 781 if (ok) { AddObj(obj->DataObj(), nom, true); nread++; } 746 782 } … … 756 792 757 793 PInPersist* ppin; 794 #ifdef SANS_EVOLPLANCK 758 795 TRY{ 759 796 ppin = new PInPersist(flnm); … … 763 800 { printf("NamedObjMgr::ReadAll()/Error Exception= %ld (%s) \n", 764 801 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY; 765 802 #else 803 try { 804 ppin = new PInPersist(flnm); 805 if (ppin->NbTags() < 1) obj = ppin->ReadObject(); 806 else obj = NULL; 807 } 808 catch (IOExc iox) { 809 cerr << "NamedObjMgr::ReadAll()/Error Exception - Msg= " << iox.Msg() << endl; 810 ok = false; 811 } 812 #endif 766 813 if (!ok) return; 767 814 if (obj) { … … 784 831 #endif 785 832 786 TRY{787 833 // obj = RzReadFits((char*)flnm.c_str(), ImgOffX, ImgOffY, ImgSizX, ImgSizY, ImgBitSgn); 788 834 #ifdef SANS_EVOLPLANCK 835 TRY{ 789 836 obj = RzReadFits((char*)flnm.c_str()); 790 #else791 printf("NamedObjMgr::ReadFITS( NON-Disponible EVOL-PLANCK) \n");792 obj = NULL;793 #endif794 837 if (obj == NULL) ok = false; 795 838 } CATCH(merr) { … … 801 844 AddObj((AnyDataObj*)obj, nobj); 802 845 } 846 #else 847 printf("NamedObjMgr::ReadFITS( NON-Disponible EVOL-PLANCK) \n"); 848 #endif 803 849 return; 804 850 } … … 834 880 bool ok = true; 835 881 POutPersist* pout; 882 #ifdef SANS_EVOLPLANCK 836 883 TRY{ 837 884 pout = new POutPersist(flnm); … … 839 886 { printf("NamedObjMgr::SaveObjects()/Error Exception= %ld (%s) \n", 840 887 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY; 888 #else 889 try { 890 pout = new POutPersist(flnm); 891 } 892 catch (IOExc iox) { 893 cerr << "NamedObjMgr::SaveObjects()/Error Exception - Msg= " << iox.Msg() << endl; 894 ok = false; 895 } 896 #endif 841 897 if (!ok) return; 842 898 NObjList::iterator it; … … 857 913 858 914 POutPersist* pout; 915 #ifdef SANS_EVOLPLANCK 859 916 TRY{ 860 917 pout = new POutPersist(flnm); … … 862 919 { printf("NamedObjMgr::SaveAll()/Error Exception= %ld (%s) \n", 863 920 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY; 921 #else 922 try { 923 pout = new POutPersist(flnm); 924 } 925 catch (IOExc iox) { 926 cerr << "NamedObjMgr::SaveAll()/Error Exception - Msg= " << iox.Msg() << endl; 927 ok = false; 928 } 929 #endif 864 930 if (!ok) return; 865 931 NObjList::iterator it; -
trunk/SophyaPI/PIext/nobjmgr.h
r486 r495 9 9 #include "machdefs.h" 10 10 #include "anydataobj.h" 11 #include "ppersist.h" 11 12 #include "dlftypes.h" 12 13 -
trunk/SophyaPI/PIext/nomhistadapter.cc
r463 r495 315 315 } 316 316 317 #ifdef SANS_EVOLPLANCK 317 318 //------------------------------------------------------------------------- 318 319 // Class Adaptateur d'objet (Pour NamedObjMgr) d'objet XNTuple … … 368 369 } 369 370 370 371 #endif // SANS_EVOLPLANCK 372 -
trunk/SophyaPI/PIext/nomhistadapter.h
r463 r495 12 12 #include "hisprof.h" 13 13 #include "ntuple.h" 14 15 #ifdef SANS_EVOLPLANCK 14 16 #include "xntuple.h" 17 #endif 15 18 16 19 //------------------------------------------------------------------------- … … 115 118 }; 116 119 120 #ifdef SANS_EVOLPLANCK 117 121 //------------------------------------------------------------------------- 118 122 // Class Adaptateur d'objet (Pour NamedObjMgr) d'objet XNTuple … … 137 141 }; 138 142 143 #endif // SANS_EVOLPLANCK 139 144 140 145 -
trunk/SophyaPI/PIext/nomimagadapter.cc
r463 r495 6 6 7 7 #include "nomimagadapter.h" 8 #ifdef SANS_EVOLPLANCK 8 9 #include "fitsimage.h" 10 #endif 9 11 #include "pimgadapter.h" 10 12 … … 42 44 AnyDataObj* NOMAdapter_Image<T>::GetCopyObj() 43 45 { 46 #ifdef SANS_EVOLPLANCK 44 47 FitsImage<T> * fima = dynamic_cast<FitsImage<T> *>(mImg); 45 48 if (fima == NULL) return( new Image<T>(*mImg ) ); 46 49 else return ( new FitsImage<T>(*fima) ); 50 #else 51 return( new Image<T>(*mImg ) ); 52 #endif 47 53 } 48 54 … … 55 61 fim.Save(flnm); 56 62 #else 63 string s = typeid(*mImg).name(); 57 64 cout << "NOMAdapter_Image<T>::SaveFits() - Error : Not supported for " << s << endl; 58 65 #endif -
trunk/SophyaPI/PIext/piafitting.cc
r493 r495 1248 1248 , saveI1(0), saveI2(0), saveJ1(0), saveJ2(0), ErrValue(1.) 1249 1249 { 1250 #ifdef SANS_EVOLPLANCK 1250 1251 COMPATIBLE_ASSERT(mFitter); 1252 #else 1253 ASSERT(mFitter); 1254 #endif 1255 1251 1256 int npar = mFitter->mNPar; 1252 1257 -
trunk/SophyaPI/PIext/piafitting.h
r493 r495 20 20 class PIStdImgApp; 21 21 class PIAFitterWind; 22 class Matrix; 23 class RzImage; //CMV_A_FAIRE class RzImage; 24 25 #ifdef SANS_EVOLPLANCK 22 26 class GeneralFunction; class GeneralFunc; class GeneralFit; 23 27 class GeneralFitData; 24 class Histo; class Matrix; class Histo2D; 25 #ifdef SANS_EVOLPLANCK 26 class RzImage; 28 class Histo; class Histo2D; 27 29 #else 28 //CMV_A_FAIRE class RzImage; 30 namespace PlanckDPC { 31 class GeneralFunction; class GeneralFunc; class GeneralFit; 32 class GeneralFitData; 33 class Histo; class Histo2D; 34 } 29 35 #endif 30 36 … … 94 100 Vector* mV; Histo* mH; // Do not delete 95 101 Matrix* mM; Histo2D* mH2; // Do not delete 96 #ifdef SANS_EVOLPLANCK97 102 RzImage* mIm; // Do not delete 98 #else99 //CMV_A_FAIRE RzImage* mIm; // Do not delete100 #endif101 103 GeneralFitData* mG; // Do not delete 102 104 // Gestion des fonctions de fit predefinies -
trunk/SophyaPI/PIext/piinit.cc
r455 r495 7 7 #include "nommatvecadapter.h" 8 8 #include "nomimagadapter.h" 9 10 #ifdef SANS_EVOLPLANCK 9 11 #include "fitsimage.h" 10 12 #include "nomstladapter.h" 13 #endif 11 14 12 15 int PIAppInitiator::FgInit = 0; … … 24 27 serv->RegisterClass(new Histo2D, new NOMAdapter_Histo2D ); 25 28 serv->RegisterClass(new NTuple, new NOMAdapter_NTuple ); 29 #ifdef SANS_EVOLPLANCK 26 30 serv->RegisterClass(new XNTuple, new NOMAdapter_XNTuple ); 27 31 char* varenv=NULL; 28 32 if ( (varenv=getenv("PEIDA_TMP")) == NULL ) varenv=getenv("TMPDIR") ; 29 33 if (varenv) XNTuple::SetSwapPath(varenv); 34 #endif 30 35 31 36 serv->RegisterClass(new GeneralFitData, new NOMAdapter_GeneralFitData ); … … 39 44 serv->RegisterClass(new Image<r_4>, new NOMAdapter_Image<r_4> ); 40 45 46 #ifdef SANS_EVOLPLANCK 41 47 serv->RegisterClass(new FitsImage<uint_2>, new NOMAdapter_Image<uint_2> ); 42 48 serv->RegisterClass(new FitsImage<int_2>, new NOMAdapter_Image<int_2> ); … … 45 51 46 52 serv->RegisterClass(new StarList, new NOMAdapter_StarList ); 53 #endif 47 54 48 55 } -
trunk/SophyaPI/PIext/pipodrw.h
r205 r495 7 7 #define PIPODRW_H_SEEN 8 8 9 #include "machdefs.h" 9 10 #include "pidrawer.h" 10 11 #include "parradapter.h" … … 13 14 #include "histos2.h" 14 15 16 #ifdef SANS_EVOLPLANCK 17 class GeneralFunction; 18 #else 19 namespace PlanckDPC {class GeneralFunction;} 20 #endif 15 21 16 class GeneralFunction;17 22 class PIGFFDrawer : public PIDrawer { 18 23 public: -
trunk/SophyaPI/PIext/pisiadw.cc
r380 r495 205 205 206 206 bool ok = true; 207 207 #ifdef SANS_EVOLPLANCK 208 208 TRY { 209 209 mPin = new PInPersist(flnm); … … 220 220 return; 221 221 } 222 222 #endif 223 223 if (objlist) delete objlist; 224 224 SetSize(ttx,tty); … … 229 229 230 230 231 #ifdef SANS_EVOLPLANCK 231 232 for(i=0; i<mPin->NbTags(); i++) { 232 233 key = mPin->TagKey(i, cid, ln); // $CHECK$ non-const & reference initialized to temporary, car int -> long& … … 237 238 objlist->AppendItem(strg, 5000+i); 238 239 } 240 #endif 239 241 240 242 } -
trunk/SophyaPI/PIext/pistdimgapp.cc
r454 r495 330 330 mCons->AddStr(s2.c_str(), PIVA_Blue, true); 331 331 SetBusy(); 332 #ifdef SANS_EVOLPLANCK 332 333 TRY { 333 334 mCmd->Interpret(s); … … 337 338 cerr << endl; 338 339 string es = PeidaExc(merr); 339 cerr << "PIStdImgApp::Process()/ Cmd->Do() Exception :" << es << " (" << merr << ")" << endl ; 340 } 341 340 cerr << "PIStdImgApp::Process()/ Cmd->Do() Exception :" << es << " (" << merr << ")" << endl ; 341 } 342 #else 343 try { 344 mCmd->Interpret(s); 345 } 346 catch ( PException exc ) { 347 fflush(stdout); 348 cout << endl; 349 cerr << endl; 350 cerr << "PIStdImgApp::Process()/ Cmd->Interpret() Exception :" << exc.Msg() << endl; 351 } 352 #endif 342 353 SetReady(); 343 354 } -
trunk/SophyaPI/PIext/servnobjm.cc
r466 r495 23 23 #include "ntuple.h" 24 24 #include "cimage.h" 25 #include "fitsimage.h"26 25 27 26 #include "histos.h" … … 62 61 ObjAdaptList::iterator it; 63 62 for(it = objadaplist.begin(); it != objadaplist.end(); it++) 63 #ifdef SANS_EVOLPLANCK 64 64 if (typeid(*o) == typeid(*((*it).obj))) THROW(dupIdErr); 65 65 #else 66 if (typeid(*o) == typeid(*((*it).obj))) 67 throw(DuplicateIdExc("Services2NObjMgr::RegisterClass() - Duplicate class")); 68 #endif 66 69 dataobj_adapter oba; 67 70 oba.obj = o; … … 182 185 double xx; 183 186 double dx = (xmax-xmin)/np; 187 #ifdef SANS_EVOLPLANCK 184 188 TRY { 185 189 for(k=0; k<np; k++) { xx = xmin+dx*k; (*vpy)(k) = f(xx); } … … 193 197 vpy = NULL; 194 198 } ENDTRY; 195 199 #else 200 try { 201 for(k=0; k<np; k++) { xx = xmin+dx*k; (*vpy)(k) = f(xx); } 202 } 203 catch ( PException exc ) { 204 fflush(stdout); 205 cout << endl; 206 cerr << endl; 207 cerr << "Services2NObjMgr::PlotFunc() Exception :" << exc.Msg() << endl; 208 delete vpy; 209 vpy = NULL; 210 } 211 #endif 196 212 197 213 if (vpy) { … … 240 256 double dy = (ymax-ymin)/npy; 241 257 // printf(" -- DBG -- %d %d , %g %g , %g %g \n", npx, npy, xmin, xmax, ymin, ymax); 258 #ifdef SANS_EVOLPLANCK 242 259 TRY { 243 260 for(j=0; j<npy; j++) { … … 256 273 delete mtx; mtx = NULL; 257 274 } ENDTRY; 275 #else 276 try { 277 for(j=0; j<npy; j++) { 278 yy = ymin+dy*j; 279 for(i=0; i<npx; i++) { 280 xx = xmin+dx*i; 281 (*mtx)(j, i) = f(xx, yy); 282 } 283 } 284 } 285 catch ( PException exc ) { 286 fflush(stdout); 287 cout << endl; 288 cerr << endl; 289 cerr << "Services2NObjMgr::PlotFunc2D() Exception :" << exc.Msg() << endl; 290 delete mtx; mtx = NULL; 291 } 292 #endif 258 293 259 294 if (mtx) { -
trunk/SophyaPI/PIext/servnobjm.h
r463 r495 17 17 #include "anydataobj.h" 18 18 19 #ifdef SANS_EVOLPLANCK 19 20 class NTuple; 20 21 class Histo; 21 22 class Histo2D; 22 23 class HProf; 24 #else 25 namespace PlanckDPC { 26 class NTuple; 27 class Histo; 28 class Histo2D; 29 class HProf; 30 } 31 #endif 32 23 33 class NamedObjMgr; 24 34 class PIStdImgApp;
Note:
See TracChangeset
for help on using the changeset viewer.