Index: trunk/SophyaPI/PIext/cxxexecwin.cc
===================================================================
--- trunk/SophyaPI/PIext/cxxexecwin.cc	(revision 1320)
+++ trunk/SophyaPI/PIext/cxxexecwin.cc	(revision 1321)
@@ -160,11 +160,11 @@
   switch (msg)  {
     case 600:    // Bouton Execute C++
-      dap->SetBusy();
       SetUnSensitive();
       dap->GetConsole()->AddStr(
 	 "CxxExecWind::Process() - Executing C++ Code ... \n", PIVA_Magenta);
+      dap->SetBusy();
       cxxex->ExecuteCXX(mText[1]->GetText(),mText[0]->GetText());
       dap->GetConsole()->AddStr(
-	 "CxxExecWind ... End of Executing C++ Code \n", PIVA_Magenta);
+	 "CxxExecWind ... End of Executing C++ Code \n");
       SetSensitive();
       dap->SetReady();
Index: trunk/SophyaPI/PIext/nobjmgr.cc
===================================================================
--- trunk/SophyaPI/PIext/nobjmgr.cc	(revision 1320)
+++ trunk/SophyaPI/PIext/nobjmgr.cc	(revision 1321)
@@ -22,4 +22,6 @@
 #ifdef SANS_EVOLPLANCK
 #include "fitsimage.h"  
+#else
+#include "fitsautoreader.h"
 #endif
 
@@ -536,5 +538,5 @@
 
 if ( (myImgApp != NULL) && (myImgApp->ObjMgrW())->Visible() ) {
-  string oln = nobj + "  (T= " + typeid(*obj).name() + ")" ; 
+  string oln = nobj + "  (T= " + no.obja->GetDataObjType() + ")" ; 
   (myImgApp->ObjMgrW())->AddObjList(did, oln.c_str(), no.oid);
   }
@@ -604,5 +606,5 @@
 if ( (myImgApp != NULL) && (myImgApp->ObjMgrW())->Visible() ) {
   (myImgApp->ObjMgrW())->DelObjList(dids, no.oid);
-  string oln = n2 + "  (T= " + typeid(*(no.obj)).name() + ")" ; 
+  string oln = n2 + "  (T= " + no.obja->GetDataObjType() + ")" ; 
   (myImgApp->ObjMgrW())->AddObjList(did, oln.c_str(), no.oid);
 }
@@ -942,5 +944,32 @@
 }
 #else
- cerr << " NamedObjMgr::ReadFits() Vide ! A faire Reza ! " << endl;
+ try {
+   FITS_AutoReader fiar(flnm);
+   char buff[512], bun[16];
+   strncpy(buff, flnm.c_str(), 512);
+   int nhdu = FitsInFile::NbBlocks(buff);
+   if (nobj.length()<1)  nobj = servnobjm->FileName2Name(flnm);
+   string name;
+   AnyDataObj* obj;
+   for(int k=1; k<=nhdu; k++) {
+     obj = fiar.ReadObject(k);
+     if (obj) 
+       cout << " NamedObjMgr::ReadFits() " << (string)typeid(*obj).name()
+	    << "  read From HDU " << k << endl;
+     else cerr << " NamedObjMgr::ReadFits()  NULL pointer from FITS_AutoReader" << endl;
+     if (k > 1) { 
+       sprintf(bun, "%d", k);
+       name = nobj + bun;
+     }
+     else name = nobj;
+     AddObj(obj, name);
+   }
+ }
+ catch(PThrowable & exc) {
+   cerr << " NamedObjMgr::ReadFits() / Error - Catched Exception \n " 
+	<< "    Type= " << (string)typeid(exc).name()
+	<< " - Msg= " << exc.Msg() << endl;
+
+   }
 #endif
 
@@ -1374,5 +1403,6 @@
   if ((*it).second.dirid != did) continue;
   cn = (*it).first.substr(1);
-  cn = cn.substr(cn.find('/')+1) + "  (T= " + typeid(*((*it).second.obj)).name() + ")" ;
+  //  cn = cn.substr(cn.find('/')+1) + "  (T= " + typeid(*((*it).second.obj)).name() + ")" ;
+  cn = cn.substr(cn.find('/')+1) + "  (T= " + (*it).second.obja->GetDataObjType() + ")" ;
   (myImgApp->ObjMgrW())->AddObj(cn.c_str(), (*it).second.oid);
   }
Index: trunk/SophyaPI/PIext/nomhistadapter.cc
===================================================================
--- trunk/SophyaPI/PIext/nomhistadapter.cc	(revision 1320)
+++ trunk/SophyaPI/PIext/nomhistadapter.cc	(revision 1321)
@@ -13,4 +13,6 @@
 #ifndef SANS_EVOLPLANCK
 #include "objfitter.h"
+#include "fitsntuple.h"
+#include "fitsxntuple.h"
 #endif
 
@@ -417,4 +419,28 @@
 
 /* --Methode-- */
+void NOMAdapter_NTuple::ReadFits(string const & flnm)
+{
+#ifdef SANS_EVOLPLANCK
+  cerr << " NOMAdapter_NTuple::ReadFits() Non disponible !! " << endl;
+#else
+  FitsInFile fis(flnm);
+  fis >> (*mNt);
+#endif
+}
+
+/* --Methode-- */
+void NOMAdapter_NTuple::SaveFits(string const & flnm)
+{
+#ifdef SANS_EVOLPLANCK
+  cerr << " NOMAdapter_NTuple::SaveFits() Non disponible !! " << endl;
+#else
+  FitsOutFile fos(flnm);
+  fos << (*mNt);
+
+#endif
+}
+
+
+/* --Methode-- */
 void NOMAdapter_NTuple::SavePPF(POutPersist& pos, string const & nom)
 {
@@ -482,4 +508,27 @@
 
 /* --Methode-- */
+void NOMAdapter_XNTuple::ReadFits(string const & flnm)
+{
+#ifdef SANS_EVOLPLANCK
+  cerr << " NOMAdapter_XNTuple::ReadFits() Non disponible !! " << endl;
+#else
+  FitsInFile fis(flnm);
+  fis >> (*mNt);
+#endif
+}
+
+/* --Methode-- */
+void NOMAdapter_XNTuple::SaveFits(string const & flnm)
+{
+#ifdef SANS_EVOLPLANCK
+  cerr << " NOMAdapter_XNTuple::SaveFits() Non disponible !! " << endl;
+#else
+  FitsOutFile fos(flnm);
+  fos << (*mNt);
+
+#endif
+}
+
+/* --Methode-- */
 void NOMAdapter_XNTuple::SavePPF(POutPersist& pos, string const & nom)
 {
Index: trunk/SophyaPI/PIext/nomhistadapter.h
===================================================================
--- trunk/SophyaPI/PIext/nomhistadapter.h	(revision 1320)
+++ trunk/SophyaPI/PIext/nomhistadapter.h	(revision 1321)
@@ -127,6 +127,6 @@
   virtual AnyDataObj*		CloneDataObj(bool share=false);
 
-  //  virtual void			ReadFits(string const & flnm);
-  //  virtual void			SaveFits(string const & flnm);
+  virtual void			ReadFits(string const & flnm);
+  virtual void			SaveFits(string const & flnm);
   virtual void			SavePPF(POutPersist& s, string const & nom);
 
@@ -153,6 +153,6 @@
   virtual AnyDataObj*		CloneDataObj(bool share=false);
 
-  //  virtual void			ReadFits(string const & flnm);
-  //  virtual void			SaveFits(string const & flnm);
+  virtual void			ReadFits(string const & flnm);
+  virtual void			SaveFits(string const & flnm);
   virtual void			SavePPF(POutPersist& s, string const & nom);
 
Index: trunk/SophyaPI/PIext/nomimagadapter.cc
===================================================================
--- trunk/SophyaPI/PIext/nomimagadapter.cc	(revision 1320)
+++ trunk/SophyaPI/PIext/nomimagadapter.cc	(revision 1321)
@@ -14,4 +14,5 @@
 #else
 #include "objfitter.h"
+#include "fitstarray.h"
 #endif
 
@@ -72,4 +73,16 @@
 /* --Methode-- */
 template <class T>
+void NOMAdapter_Image<T>::ReadFits(string const & flnm)
+{
+#ifdef SANS_EVOLPLANCK
+  cerr << " NOMAdapter_Image<T>::ReadFits() Non disponible !! " << endl;
+#else
+  FitsInFile fis(flnm);
+  fis >> (*mImg);
+#endif
+}
+
+/* --Methode-- */
+template <class T>
 void NOMAdapter_Image<T>::SaveFits(string const & flnm)
 {
@@ -78,8 +91,22 @@
 fim.Save(flnm);
 #else
-string s = typeid(*mImg).name();
-cout << "NOMAdapter_Image<T>::SaveFits() - Error : Not supported for " << s << endl;
-#endif
-}
+  FitsOutFile fos(flnm);
+  fos << (*mImg);
+#endif
+}
+
+#ifndef SANS_EVOLPLANCK
+void NOMAdapter_Image< uint_2 >::SaveFits(string const & flnm)
+{
+cout << " NOMAdapter_Image< uint_2 >::SaveFits() - Error " 
+     << " Not supported uint_2 data type ! " << endl;
+}
+
+void NOMAdapter_Image< uint_2 >::ReadFits(string const & flnm)
+{
+cout << " NOMAdapter_Image< uint_2 >::ReadFits() - Error " 
+     << " Not supported uint_2 data type ! " << endl;
+}
+#endif
 
 /* --Methode-- */
Index: trunk/SophyaPI/PIext/nomimagadapter.h
===================================================================
--- trunk/SophyaPI/PIext/nomimagadapter.h	(revision 1320)
+++ trunk/SophyaPI/PIext/nomimagadapter.h	(revision 1321)
@@ -27,5 +27,5 @@
   virtual AnyDataObj*		CloneDataObj(bool share=false);
 
-  //  virtual void			ReadFits(string const & flnm);
+  virtual void			ReadFits(string const & flnm);
   virtual void			SaveFits(string const & flnm);
   virtual void			SavePPF(POutPersist& s, string const & nom);
Index: trunk/SophyaPI/PIext/nomskymapadapter.cc
===================================================================
--- trunk/SophyaPI/PIext/nomskymapadapter.cc	(revision 1320)
+++ trunk/SophyaPI/PIext/nomskymapadapter.cc	(revision 1321)
@@ -14,4 +14,8 @@
 #include "complexios.h"
 
+#include "fitsspherehealpix.h"
+#include "fitslocalmap.h"
+
+
 //  Classe array adapter pour localMap
 template <class T> 
@@ -105,4 +109,72 @@
 return(NULL);
 }
+
+/* --Methode-- */
+template <class T> 
+void NOMAdapter_PixelMap<T>::ReadFits(string const & flnm)
+{
+LocalMap<T>* lm = dynamic_cast< LocalMap<T> * >(mMap); 
+if (lm != NULL) {
+  FitsInFile fis(flnm);
+  fis >> (*lm);
+  return;
+}
+SphereHEALPix<T>* sg = dynamic_cast< SphereHEALPix<T> * >(mMap); 
+if (sg != NULL) {
+  FitsInFile fis(flnm);
+  fis >> (*sg);
+  return;
+}
+string s = typeid(*mMap).name();
+cout << " NOMAdapter_PixelMap<T>::ReadFits() - Error " 
+     << " Not supported for " << s << endl;
+return;
+}
+
+
+/* --Methode-- */
+template <class T> 
+void NOMAdapter_PixelMap<T>::SaveFits(string const & flnm)
+{
+LocalMap<T>* lm = dynamic_cast< LocalMap<T> * >(mMap); 
+if (lm != NULL) {
+  FitsOutFile fos(flnm);
+  fos << (*lm);
+  return;
+}
+SphereHEALPix<T>* sg = dynamic_cast< SphereHEALPix<T> * >(mMap); 
+if (sg != NULL) {
+  FitsOutFile fos(flnm);
+  fos << (*sg);
+  return;
+}
+string s = typeid(*mMap).name();
+cout << " NOMAdapter_PixelMap<T>::SaveFits() - Error " 
+     << " Not supported for " << s << endl;
+return;
+}
+
+// ---- Specialisation pour complexes -----
+void NOMAdapter_PixelMap< complex<r_4> >::ReadFits(string const & flnm)
+{
+cout << " void NOMAdapter_PixelMap< complex<r_4> >::ReadFits() - Error " 
+     << " Not supported (complex data type)" << endl;
+}
+void NOMAdapter_PixelMap< complex<r_4> >::SaveFits(string const & flnm)
+{
+cout << " void NOMAdapter_PixelMap< complex<r_4> >::SaveFits() - Error " 
+     << " Not supported (complex data type)" << endl;
+}
+void NOMAdapter_PixelMap< complex<r_8> >::ReadFits(string const & flnm)
+{
+cout << " void NOMAdapter_PixelMap< complex<r_4> >::ReadFits() - Error " 
+     << " Not supported (complex data type)" << endl;
+}
+void NOMAdapter_PixelMap< complex<r_8> >::SaveFits(string const & flnm)
+{
+cout << " void NOMAdapter_PixelMap< complex<r_8> >::SaveFits() - Error " 
+     << " Not supported (complex data type)" << endl;
+}
+
 
 /* --Methode-- */
Index: trunk/SophyaPI/PIext/nomskymapadapter.h
===================================================================
--- trunk/SophyaPI/PIext/nomskymapadapter.h	(revision 1320)
+++ trunk/SophyaPI/PIext/nomskymapadapter.h	(revision 1321)
@@ -30,6 +30,6 @@
   virtual AnyDataObj*		CloneDataObj(bool share=false);
 
-  //  virtual void			ReadFits(string const & flnm);
-  //  virtual void			SaveFits(string const & flnm);
+  virtual void			ReadFits(string const & flnm);
+  virtual void			SaveFits(string const & flnm);
   virtual void			SavePPF(POutPersist& s, string const & nom);
 
Index: trunk/SophyaPI/PIext/nomtarradapter.cc
===================================================================
--- trunk/SophyaPI/PIext/nomtarradapter.cc	(revision 1320)
+++ trunk/SophyaPI/PIext/nomtarradapter.cc	(revision 1321)
@@ -9,6 +9,10 @@
 
 #include "nomtarradapter.h"
+#include "tvector.h"
+#include "pitvmaad.h"
+#include "piscdrawwdg.h"
 
 #include "fioarr.h"
+#include "fitstarray.h"
 
 
@@ -63,4 +67,43 @@
 /* --Methode-- */
 template <class T> 
+void NOMAdapter_TArray<T>::ReadFits(string const & flnm)
+{
+  FitsInFile fis(flnm);
+  fis >> (*mArr);
+}
+
+/* --Methode-- */
+template <class T> 
+void NOMAdapter_TArray<T>::SaveFits(string const & flnm)
+{
+  FitsOutFile fos(flnm);
+  fos << (*mArr);
+}
+
+// ---- Specialisation pour complexes -----
+void NOMAdapter_TArray< complex<r_4> >::ReadFits(string const & flnm)
+{
+cout << " NOMAdapter_TArray< complex<r_4> >::ReadFits() - Error " 
+     << " Not supported (complex data type)" << endl;
+}
+void NOMAdapter_TArray< complex<r_4> >::SaveFits(string const & flnm)
+{
+cout << " NOMAdapter_TArray< complex<r_4> >::SaveFits() - Error " 
+     << " Not supported (complex data type)" << endl;
+}
+
+void NOMAdapter_TArray< complex<r_8> >::ReadFits(string const & flnm)
+{
+cout << " NOMAdapter_TArray< complex<r_8> >::ReadFits() - Error " 
+     << " Not supported (complex data type)" << endl;
+}
+void NOMAdapter_TArray< complex<r_8> >::SaveFits(string const & flnm)
+{
+cout << " NOMAdapter_TArray< complex<r_8> >::SaveFits() - Error " 
+     << " Not supported (complex data type)" << endl;
+}
+
+/* --Methode-- */
+template <class T> 
 void NOMAdapter_TArray<T>::SavePPF(POutPersist& pos, string const & nom)
 {
@@ -76,4 +119,28 @@
 }
 
+/* --Methode-- */
+template <class T> 
+PIDrawer * NOMAdapter_TArray<T>::GetDrawer(string & dopt)
+{
+if (mArr->NbDimensions() == 1) {
+  // On peut en faire un vecteur ...
+  TVector<T>* v = new TVector<T>(*mArr, true);  // on partage les donnees
+  dopt = "thinline," + dopt;
+  return( new PIYfXDrawer( new POTVectorAdapter<T>(v, true), NULL, true) );
+}
+ else return(NULL);
+}
+
+/* --Methode-- */
+template <class T> 
+P2DArrayAdapter* NOMAdapter_TArray<T>::Get2DArray(string &)
+{
+if (mArr->NbDimensions() <= 2) {
+  // On peut en faire un tableau 2-D ...
+  TMatrix<T>* m = new TMatrix<T>(*mArr, true);  // on partage les donnees
+  return ( new POTMatrixAdapter<T>(m, true) );
+}
+else return(NULL);
+}
 
 /* --Methode-- */
Index: trunk/SophyaPI/PIext/nomtarradapter.h
===================================================================
--- trunk/SophyaPI/PIext/nomtarradapter.h	(revision 1320)
+++ trunk/SophyaPI/PIext/nomtarradapter.h	(revision 1321)
@@ -27,19 +27,12 @@
   virtual AnyDataObj*		CloneDataObj(bool share=false);
 
-  //  virtual void			ReadFits(string const & flnm);
-  //  virtual void			SaveFits(string const & flnm);
+  virtual void			ReadFits(string const & flnm);
+  virtual void			SaveFits(string const & flnm);
   virtual void			SavePPF(POutPersist& s, string const & nom);
 
   virtual void			Print(ostream& os);
-  //  virtual PIDrawer*		GetDrawer(string& dopt);
-  //  virtual P2DArrayAdapter*	Get2DArray(string& dopt);
+  virtual PIDrawer*		GetDrawer(string& dopt);
+  virtual P2DArrayAdapter*	Get2DArray(string& dopt);
   virtual NTupleInterface*	GetNTupleInterface(bool& adel);
-
-  //  virtual GeneralFitData* GetGeneralFitData(bool& adel
-  //        ,GeneralFitData::FitErrType errtype=GeneralFitData::DefaultError
-  //        ,double errscale=1.,double errmin=0.
-  //        ,int i1=0,int i2=-1,int j1=0,int j2=-1);
-  // virtual AnyDataObj* FitResidusObj(GeneralFit& mfit);
-  // virtual AnyDataObj* FitFunctionObj(GeneralFit& mfit);
 
 protected:
Index: trunk/SophyaPI/PIext/nomtmatvecadapter.cc
===================================================================
--- trunk/SophyaPI/PIext/nomtmatvecadapter.cc	(revision 1320)
+++ trunk/SophyaPI/PIext/nomtmatvecadapter.cc	(revision 1321)
@@ -15,5 +15,5 @@
 
 #include "fioarr.h"
-
+#include "fitstarray.h"
 
 
@@ -69,4 +69,42 @@
 if (v != NULL) return( new TVector<T>(*v, share) );
 else return ( new TMatrix<T>(*mMtx, share) );
+}
+
+/* --Methode-- */
+template <class T> 
+void NOMAdapter_TMatrix<T>::ReadFits(string const & flnm)
+{
+  FitsInFile fis(flnm);
+  fis >> (*mMtx);
+}
+
+/* --Methode-- */
+template <class T> 
+void NOMAdapter_TMatrix<T>::SaveFits(string const & flnm)
+{
+  FitsOutFile fos(flnm);
+  fos << (*mMtx);
+}
+// ---- Specialisation pour complexes -----
+void NOMAdapter_TMatrix< complex<r_4> >::ReadFits(string const & flnm)
+{
+cout << " NOMAdapter_TMatrix< complex<r_4> >::ReadFits() - Error " 
+     << " Not supported (complex data type)" << endl;
+}
+void NOMAdapter_TMatrix< complex<r_4> >::SaveFits(string const & flnm)
+{
+cout << " NOMAdapter_TMatrix< complex<r_4> >::SaveFits() - Error " 
+     << " Not supported (complex data type)" << endl;
+}
+
+void NOMAdapter_TMatrix< complex<r_8> >::ReadFits(string const & flnm)
+{
+cout << " NOMAdapter_TMatrix< complex<r_8> >::ReadFits() - Error " 
+     << " Not supported (complex data type)" << endl;
+}
+void NOMAdapter_TMatrix< complex<r_8> >::SaveFits(string const & flnm)
+{
+cout << " NOMAdapter_TMatrix< complex<r_8> >::SaveFits() - Error " 
+     << " Not supported (complex data type)" << endl;
 }
 
Index: trunk/SophyaPI/PIext/nomtmatvecadapter.h
===================================================================
--- trunk/SophyaPI/PIext/nomtmatvecadapter.h	(revision 1320)
+++ trunk/SophyaPI/PIext/nomtmatvecadapter.h	(revision 1321)
@@ -28,6 +28,6 @@
   virtual AnyDataObj*		CloneDataObj(bool share=false);
 
-  //  virtual void			ReadFits(string const & flnm);
-  //  virtual void			SaveFits(string const & flnm);
+  virtual void			ReadFits(string const & flnm);
+  virtual void			SaveFits(string const & flnm);
   virtual void			SavePPF(POutPersist& s, string const & nom);
 
Index: trunk/SophyaPI/PIext/pistdimgapp.cc
===================================================================
--- trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 1320)
+++ trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 1321)
@@ -428,4 +428,6 @@
 gimv->SetUnSensitive();
 PIApplication::SetBusy();
+// Attention : Appel XSync specifique X11 -  en attendant multi-thread
+XSync(PIXDisplay(), False);  
 }
 
@@ -436,4 +438,6 @@
 gimv->SetUnSensitive();
 PIApplication::SetBlocked();
+// Attention : Appel XSync specifique X11 -  en attendant multi-thread
+XSync(PIXDisplay(), False);  
 }
 
