Changeset 495 in Sophya for trunk/SophyaPI/PIext


Ignore:
Timestamp:
Oct 21, 1999, 8:58:45 PM (26 years ago)
Author:
ercodmgr
Message:

Portage -> DPPlanck , Reza+cmv 21/10/99

Location:
trunk/SophyaPI/PIext
Files:
15 edited

Legend:

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

    r486 r495  
    2222#include "cvector.h"
    2323
    24 
     24using namespace PlanckDPC;
    2525
    2626/* --Methode-- */
     
    118118    cout << endl;
    119119    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;
    122122    }
    123123  mImgApp->RedirectStdOutErr(red);
  • trunk/SophyaPI/PIext/exclude

    r385 r495  
    11modrecst.cc
    22userfitfunex.c
     3nomstladapter.cc
     4pistlist.cc
  • trunk/SophyaPI/PIext/nobjmgr.cc

    r493 r495  
    684684void NamedObjMgr::ReadObj(string const & flnm, string & nobj)
    685685{
    686 PPersist* obj=NULL;
     686PPersist* ppobj=NULL;
    687687bool ok = true;
    688 
     688#ifdef SANS_EVOLPLANCK
    689689TRY{
    690690  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;
    693693}  CATCH(merr)
    694694  { printf("NamedObjMgr::ReadObj()/Error Exception= %ld (%s) \n",
    695695    (long)merr, PeidaExc(merr));  ok = false; } ENDTRY;
    696 
     696#else
     697try {
     698  PInPersist pis(flnm);
     699  ppobj = pis.ReadObject();
     700  }
     701catch (IOExc iox) {
     702  cerr << "NamedObjMgr::ReadObj()/Error Exception - Msg= " << iox.Msg() << endl;
     703  ok = false;
     704  }
     705#endif
    697706if (!ok)  return;
    698707if (nobj.length()<1)  nobj = servnobjm->FileName2Name(flnm);
    699 AddObj(obj->DataObj(), nobj, true);
     708AddObj(ppobj->DataObj(), nobj, true);
    700709return;
    701710}
     
    713722if ( (s.NbTags() < 1) || (num >= s.NbTags()) ) {
    714723  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;
    716726    return;
    717727  }
     728
     729#ifdef SANS_EVOLPLANCK
    718730  TRY {
    719731    obj = PPersistMgr::ReadObject(s);
     
    723735    ok = false;
    724736  } ENDTRY;
     737#else
     738try {
     739  obj = s.ReadObject();
     740  }
     741catch (IOExc iox) {
     742  cerr << "NamedObjMgr::ReadObj()/Error Exception - Msg= " << iox.Msg() << endl;
     743  ok = false;
     744  }
     745#endif
     746
    725747  if (!ok)  return;
    726748  nom = "";
     
    732754else { n0 = num; n1 = num+1; }
    733755for(i=n0; i<n1; i++) {
     756#ifdef SANS_EVOLPLANCK
    734757  key = s.TagKey(i, cid, ln);
    735758  if (ln <= 0)  nom = "";
     
    743766    ok = false;
    744767  } 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
    745781  if (ok)  { AddObj(obj->DataObj(), nom, true);  nread++; }
    746782}
     
    756792
    757793PInPersist* ppin;
     794#ifdef SANS_EVOLPLANCK
    758795TRY{
    759796  ppin = new PInPersist(flnm);
     
    763800  { printf("NamedObjMgr::ReadAll()/Error Exception= %ld (%s) \n",
    764801    (long)merr, PeidaExc(merr));  ok = false; } ENDTRY;
    765 
     802#else
     803try {
     804  ppin = new PInPersist(flnm);
     805  if (ppin->NbTags() < 1)  obj = ppin->ReadObject();
     806  else   obj = NULL;
     807}
     808catch (IOExc iox) {
     809    cerr << "NamedObjMgr::ReadAll()/Error Exception - Msg= " << iox.Msg() << endl;
     810    ok = false;
     811}
     812#endif
    766813if (!ok)  return;
    767814if (obj) {
     
    784831#endif
    785832
    786 TRY{
    787833//  obj = RzReadFits((char*)flnm.c_str(), ImgOffX, ImgOffY, ImgSizX, ImgSizY, ImgBitSgn);
    788834#ifdef SANS_EVOLPLANCK
     835TRY{
    789836  obj = RzReadFits((char*)flnm.c_str());
    790 #else
    791   printf("NamedObjMgr::ReadFITS( NON-Disponible EVOL-PLANCK) \n");
    792   obj = NULL;
    793 #endif
    794837  if (obj == NULL)   ok = false;
    795838}  CATCH(merr) {
     
    801844  AddObj((AnyDataObj*)obj, nobj);
    802845}
     846#else
     847  printf("NamedObjMgr::ReadFITS( NON-Disponible EVOL-PLANCK) \n");
     848#endif
    803849return;
    804850}
     
    834880bool ok = true;
    835881POutPersist* pout;
     882#ifdef SANS_EVOLPLANCK
    836883TRY{
    837884  pout = new POutPersist(flnm);
     
    839886  { printf("NamedObjMgr::SaveObjects()/Error Exception= %ld (%s) \n",
    840887    (long)merr, PeidaExc(merr));  ok = false; } ENDTRY;
     888#else
     889try {
     890 pout = new POutPersist(flnm);
     891}
     892catch (IOExc iox) {
     893    cerr << "NamedObjMgr::SaveObjects()/Error Exception - Msg= " << iox.Msg() << endl;
     894    ok = false;
     895}
     896#endif
    841897if (!ok)  return;
    842898NObjList::iterator it;
     
    857913
    858914POutPersist* pout;
     915#ifdef SANS_EVOLPLANCK
    859916TRY{
    860917  pout = new POutPersist(flnm);
     
    862919  { printf("NamedObjMgr::SaveAll()/Error Exception= %ld (%s) \n",
    863920    (long)merr, PeidaExc(merr));  ok = false; } ENDTRY;
     921#else
     922try {
     923 pout = new POutPersist(flnm);
     924}
     925catch (IOExc iox) {
     926    cerr << "NamedObjMgr::SaveAll()/Error Exception - Msg= " << iox.Msg() << endl;
     927    ok = false;
     928}
     929#endif
    864930if (!ok)  return;
    865931NObjList::iterator it;
  • trunk/SophyaPI/PIext/nobjmgr.h

    r486 r495  
    99#include "machdefs.h"
    1010#include "anydataobj.h"
     11#include "ppersist.h"
    1112#include "dlftypes.h"
    1213
  • trunk/SophyaPI/PIext/nomhistadapter.cc

    r463 r495  
    315315}
    316316
     317#ifdef SANS_EVOLPLANCK
    317318//-------------------------------------------------------------------------
    318319// Class Adaptateur d'objet (Pour NamedObjMgr) d'objet XNTuple
     
    368369}
    369370
    370 
     371#endif  // SANS_EVOLPLANCK
     372
  • trunk/SophyaPI/PIext/nomhistadapter.h

    r463 r495  
    1212#include "hisprof.h"
    1313#include "ntuple.h"
     14
     15#ifdef SANS_EVOLPLANCK
    1416#include "xntuple.h"
     17#endif
    1518
    1619//-------------------------------------------------------------------------
     
    115118};
    116119
     120#ifdef SANS_EVOLPLANCK
    117121//-------------------------------------------------------------------------
    118122// Class Adaptateur d'objet (Pour NamedObjMgr) d'objet XNTuple
     
    137141};
    138142
     143#endif  // SANS_EVOLPLANCK
    139144
    140145
  • trunk/SophyaPI/PIext/nomimagadapter.cc

    r463 r495  
    66
    77#include "nomimagadapter.h"
     8#ifdef SANS_EVOLPLANCK
    89#include "fitsimage.h"
     10#endif
    911#include "pimgadapter.h"
    1012
     
    4244AnyDataObj* NOMAdapter_Image<T>::GetCopyObj()
    4345{
     46#ifdef SANS_EVOLPLANCK
    4447FitsImage<T> * fima = dynamic_cast<FitsImage<T> *>(mImg);
    4548if (fima == NULL)   return( new Image<T>(*mImg ) );
    4649else return ( new FitsImage<T>(*fima) );
     50#else
     51return( new Image<T>(*mImg ) );
     52#endif
    4753}
    4854
     
    5561fim.Save(flnm);
    5662#else
     63string s = typeid(*mImg).name();
    5764cout << "NOMAdapter_Image<T>::SaveFits() - Error : Not supported for " << s << endl;
    5865#endif
  • trunk/SophyaPI/PIext/piafitting.cc

    r493 r495  
    12481248, saveI1(0), saveI2(0), saveJ1(0), saveJ2(0), ErrValue(1.)
    12491249{
     1250#ifdef SANS_EVOLPLANCK
    12501251COMPATIBLE_ASSERT(mFitter);
     1252#else
     1253ASSERT(mFitter);
     1254#endif
     1255
    12511256int npar = mFitter->mNPar;
    12521257
  • trunk/SophyaPI/PIext/piafitting.h

    r493 r495  
    2020class PIStdImgApp;
    2121class PIAFitterWind;
     22class Matrix;
     23class RzImage; //CMV_A_FAIRE class RzImage;
     24
     25#ifdef SANS_EVOLPLANCK
    2226class GeneralFunction; class GeneralFunc; class GeneralFit;
    2327class GeneralFitData;
    24 class Histo; class Matrix; class Histo2D;
    25 #ifdef SANS_EVOLPLANCK
    26 class RzImage;
     28class Histo;  class Histo2D;
    2729#else
    28 //CMV_A_FAIRE class RzImage;
     30namespace PlanckDPC {
     31class GeneralFunction; class GeneralFunc; class GeneralFit;
     32class GeneralFitData;
     33class Histo; class Histo2D;
     34}
    2935#endif
    3036
     
    94100Vector* mV; Histo* mH; // Do not delete
    95101Matrix* mM; Histo2D* mH2; // Do not delete
    96 #ifdef SANS_EVOLPLANCK
    97102RzImage* mIm; // Do not delete
    98 #else
    99 //CMV_A_FAIRE RzImage* mIm; // Do not delete
    100 #endif
    101103GeneralFitData* mG; // Do not delete
    102104// Gestion des fonctions de fit predefinies
  • trunk/SophyaPI/PIext/piinit.cc

    r455 r495  
    77#include "nommatvecadapter.h"
    88#include "nomimagadapter.h"
     9
     10#ifdef SANS_EVOLPLANCK
    911#include "fitsimage.h"
    1012#include "nomstladapter.h"
     13#endif
    1114
    1215int PIAppInitiator::FgInit = 0;
     
    2427  serv->RegisterClass(new Histo2D, new NOMAdapter_Histo2D );
    2528  serv->RegisterClass(new NTuple, new NOMAdapter_NTuple );
     29#ifdef SANS_EVOLPLANCK
    2630  serv->RegisterClass(new XNTuple, new NOMAdapter_XNTuple );
    2731  char* varenv=NULL;
    2832  if ( (varenv=getenv("PEIDA_TMP")) == NULL )   varenv=getenv("TMPDIR") ;
    2933  if (varenv)  XNTuple::SetSwapPath(varenv);
     34#endif
    3035
    3136  serv->RegisterClass(new GeneralFitData, new NOMAdapter_GeneralFitData );
     
    3944  serv->RegisterClass(new Image<r_4>, new  NOMAdapter_Image<r_4> );
    4045 
     46#ifdef SANS_EVOLPLANCK
    4147  serv->RegisterClass(new FitsImage<uint_2>, new  NOMAdapter_Image<uint_2> );
    4248  serv->RegisterClass(new FitsImage<int_2>, new  NOMAdapter_Image<int_2> );
     
    4551
    4652  serv->RegisterClass(new StarList, new NOMAdapter_StarList );
     53#endif
    4754
    4855}
  • trunk/SophyaPI/PIext/pipodrw.h

    r205 r495  
    77#define PIPODRW_H_SEEN
    88
     9#include "machdefs.h"
    910#include "pidrawer.h"
    1011#include "parradapter.h"
     
    1314#include "histos2.h"
    1415
     16#ifdef SANS_EVOLPLANCK
     17class GeneralFunction;
     18#else
     19namespace PlanckDPC {class GeneralFunction;}
     20#endif
    1521
    16 class GeneralFunction;
    1722class PIGFFDrawer : public PIDrawer {
    1823public:
  • trunk/SophyaPI/PIext/pisiadw.cc

    r380 r495  
    205205
    206206bool ok = true;
    207 
     207#ifdef SANS_EVOLPLANCK
    208208TRY {
    209209  mPin = new PInPersist(flnm);
     
    220220  return;
    221221}
    222 
     222#endif
    223223if (objlist)  delete objlist;
    224224SetSize(ttx,tty);
     
    229229
    230230
     231#ifdef SANS_EVOLPLANCK
    231232for(i=0; i<mPin->NbTags(); i++) {
    232233  key = mPin->TagKey(i, cid, ln);  // $CHECK$ non-const & reference initialized to temporary, car int -> long&
     
    237238  objlist->AppendItem(strg, 5000+i);
    238239}
     240#endif
    239241
    240242}
  • trunk/SophyaPI/PIext/pistdimgapp.cc

    r454 r495  
    330330  mCons->AddStr(s2.c_str(), PIVA_Blue, true);
    331331  SetBusy();
     332#ifdef SANS_EVOLPLANCK
    332333  TRY {
    333334    mCmd->Interpret(s);
     
    337338    cerr << endl;
    338339    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
    342353  SetReady();
    343354  }
  • trunk/SophyaPI/PIext/servnobjm.cc

    r466 r495  
    2323#include "ntuple.h"
    2424#include "cimage.h"
    25 #include "fitsimage.h"
    2625
    2726#include "histos.h"
     
    6261ObjAdaptList::iterator it;
    6362for(it = objadaplist.begin(); it != objadaplist.end(); it++)
     63#ifdef SANS_EVOLPLANCK
    6464    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
    6669dataobj_adapter oba;
    6770oba.obj = o;
     
    182185double xx;
    183186double dx = (xmax-xmin)/np;
     187#ifdef SANS_EVOLPLANCK
    184188TRY {
    185189  for(k=0; k<np; k++) { xx = xmin+dx*k; (*vpy)(k) = f(xx); }
     
    193197  vpy = NULL;
    194198  } ENDTRY;
    195 
     199#else
     200try {
     201  for(k=0; k<np; k++) { xx = xmin+dx*k; (*vpy)(k) = f(xx); }
     202}
     203catch ( 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
    196212
    197213if (vpy) {
     
    240256double dy = (ymax-ymin)/npy;
    241257// printf(" -- DBG -- %d %d , %g %g , %g %g \n", npx, npy, xmin, xmax, ymin, ymax);
     258#ifdef SANS_EVOLPLANCK
    242259TRY {
    243260  for(j=0; j<npy; j++) {
     
    256273  delete mtx;  mtx = NULL;
    257274  } ENDTRY;
     275#else
     276try {
     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}
     285catch ( 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
    258293
    259294if (mtx) {
  • trunk/SophyaPI/PIext/servnobjm.h

    r463 r495  
    1717#include "anydataobj.h"
    1818
     19#ifdef SANS_EVOLPLANCK
    1920class NTuple;
    2021class Histo;
    2122class Histo2D;
    2223class HProf;
     24#else
     25namespace PlanckDPC {
     26class NTuple;
     27class Histo;
     28class Histo2D;
     29class HProf;
     30}
     31#endif
     32
    2333class NamedObjMgr;
    2434class PIStdImgApp;
Note: See TracChangeset for help on using the changeset viewer.