Index: trunk/SophyaPI/PIext/pistdimgapp.cc
===================================================================
--- trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 2105)
+++ trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 2106)
@@ -42,4 +42,38 @@
 static void showInfoWindow(PIStdImgApp* app);
 static void hideInfoWindow(PIStdImgApp* app);
+
+
+/* ........................................................... */
+/*    Classe SIA_RU__Periodic : mise a jour periodique de      */
+/*    la fenetre Stat/Ressource info                           */
+/* ........................................................... */
+
+class SIA_RU__Periodic : public PIPeriodic 
+{
+public:
+  SIA_RU__Periodic(PIStdImgApp* app);
+  virtual ~SIA_RU__Periodic();
+  virtual void DoPeriodic();
+private:
+  PIStdImgApp* _app;
+};
+
+SIA_RU__Periodic::SIA_RU__Periodic(PIStdImgApp* app)
+  : PIPeriodX(1)
+{
+  _app = app;
+}
+
+SIA_RU__Periodic::~SIA_RU__Periodic()
+{
+}
+
+void SIA_RU__Periodic::DoPeriodic()
+{
+  if (_app) _app->UpdateStatResourceInfo();
+}
+
+/* ............................................................. */
+
 
 /* ........................................................... */
@@ -156,9 +190,29 @@
 cmapv = new PICMapView(statcont, "CMapView", msx-10, 14+mFgScSz*2, 5, bss+10); 
 cmapv->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free); 
-labstat = new PILabel(statcont, "statlabel", msx-2*(bss+20), 20, 2*bss+20, 10);
-labstat->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free); 
-labstat->SetLabel("Stat-Zoom-ColMap Window");
-labstat->SetForegroundColor(PI_Red);
-labstat->SetBorderWidth(1);
+
+// Widget pour affichage des stats / ressources 
+lab_mem = new PILabel(statcont, "memlab", msx-2*(bss+20), 20, 2*bss+20, 10);
+lab_mem->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free); 
+lab_mem->SetLabel("MemoryUsage");
+lab_mem->SetForegroundColor(PI_Red);
+lab_mem->SetBorderWidth(1);
+therm_mem = new PIThermometer(statcont, "memtherm", msx-2*(bss+20), 20, 2*bss+20, 35);
+therm_mem->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free); 
+therm_mem->SetThreshold(0.5, 0.75);
+
+lab_cpu = new PILabel(statcont, "cpulab", msx-2*(bss+20), 20, 2*bss+20, 60);
+lab_cpu->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free); 
+lab_cpu->SetLabel("CPUUsage");
+lab_cpu->SetForegroundColor(PI_Black);
+lab_cpu->SetBorderWidth(1);
+therm_cpu = new PIThermometer(statcont, "cputherm", msx-2*(bss+20), 20, 2*bss+20, 85);
+therm_cpu->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free); 
+therm_cpu->SetThreshold(0.75, 0.90);
+
+UpdateStatResourceInfo();
+resupd_periodic = new SIA_RU__Periodic(this);
+//resupd_periodic->SetIntervalms(500);
+resupd_periodic->Start();
+
 statcont->Show();
 // StatZoomWindowSetVisible(true);
@@ -276,5 +330,9 @@
 delete gimv;
 delete cmapv;
-delete labstat;
+
+delete lab_mem;
+delete therm_mem;
+delete lab_cpu;
+delete therm_cpu;
 
 delete statcont;
@@ -285,5 +343,5 @@
 
 delete mCons;
- delete consolecont;
+delete consolecont;
 
 delete mObjmgrw;
@@ -296,5 +354,8 @@
 if (mPpfout) delete mPpfout;
 
+if (resupd_periodic) delete resupd_periodic;
+
 if (glst_piai) delete glst_piai;   glst_piai = NULL;
+
 }  
 
@@ -1068,4 +1129,26 @@
 
 /* --Methode-- */
+void PIStdImgApp::UpdateStatResourceInfo()
+{
+  resusg.Update();
+  char buff[256];
+  string lab;
+  double frac;
+  sprintf(buff, "Mem: %ld/Max= %ld kb" , resusg.getMemorySize(), 
+	  resusg.getMaxMemorySize());
+  lab = buff;
+  lab_mem->SetLabel(lab);
+  frac = (double)resusg.getMemorySize()/(double)resusg.getMaxMemorySize();
+  therm_mem->SetValue(frac);
+
+  sprintf(buff, "CPU: %ld/elap= %ld ms" , resusg.getCPUTime(), 
+	  resusg.getElapsedTime());
+  lab = buff;
+  lab_cpu->SetLabel(lab);
+  therm_cpu->SetValue(resusg.getAverageCPULoad());
+  
+}
+
+/* --Methode-- */
 void PIStdImgApp::RedirectStdOutErr(bool fg)
 {
@@ -1669,2 +1752,3 @@
 }
 
+
Index: trunk/SophyaPI/PIext/pistdimgapp.h
===================================================================
--- trunk/SophyaPI/PIext/pistdimgapp.h	(revision 2105)
+++ trunk/SophyaPI/PIext/pistdimgapp.h	(revision 2106)
@@ -21,4 +21,6 @@
 
 #include PIFILECHO_H 
+#include PIPERIODIC_H
+
 #include "picons.h"
 
@@ -29,4 +31,8 @@
 #include "pisiadw.h"
 #include "pistzwin.h"
+
+#include "pitherm.h"
+
+#include "resusage.h"
 
 
@@ -100,4 +106,7 @@
     void   StatZoomWindowSetVisible(bool fg=true);
 
+// Update de l'info de la fenetre stats/ressources
+    void   UpdateStatResourceInfo();
+
 // Redirection ou Non de StdOut/StdErr
      void  RedirectStdOutErr(bool fg = true);
@@ -144,5 +153,9 @@
     PIPixmap* gimv;
     PICMapView* cmapv;
-    PILabel* labstat;
+  // Pour afficher des stats
+    PILabel* lab_mem;
+    PIThermometer* therm_mem;
+    PILabel* lab_cpu;
+    PIThermometer* therm_cpu;
 
     PIFileChooser * pfc_fits;   // Pour les fichiers FITS
@@ -183,4 +196,8 @@
     int mFgScSz;   // Flag ScreenSize
     bool mFgCWImg; // true -> Current Widget is PIImage
+
+  // Pour comptabiliser l'utilisation des ressources
+    ResourceUsage resusg;
+    PIPeriodic* resupd_periodic;
 };
 
