Index: trunk/FACT++/gui/BasicGlCamera.cc
===================================================================
--- trunk/FACT++/gui/BasicGlCamera.cc	(revision 11982)
+++ trunk/FACT++/gui/BasicGlCamera.cc	(revision 11985)
@@ -255,4 +255,6 @@
                  this, SLOT(minus90RotationPlease(bool)));
 
+        connect(this, SIGNAL(signalUpdateCamera()),
+                this, SLOT(timedUpdate()));
 
 
@@ -345,7 +347,13 @@
         median /= 2;
 
-        str << "Min: " << min << " Max: " << max << " Mean: " << mean << " RMS: " << rms << " Median: " << median;
+        str << "Min: " << min << endl << " Max: " << max << " Mean: " << mean << " RMS: " << rms << " Median: " << median;
         str << " Units: " << unitsText;
         dataText = str.str();
+
+        fmin = min;
+        fmax = max;
+        fmean = mean;
+        frms = rms;
+        fmedian = median;
     }
     void BasicGlCamera::DrawCameraText()
@@ -359,5 +367,5 @@
         float shiftx = 0.01f;//0.55f;
         float shifty = 0.01f;//0.65f;
-        renderText(-shownSizex/2.f + shiftx, -shownSizey/2.f + shifty, 0.f, QString(dataText.c_str()));
+        renderText(-shownSizex/2.f + shiftx, 0.f, 0.f, QString(dataText.c_str()));//-shownSizey/2.f + shifty, 0.f, QString(dataText.c_str()));
 
 
@@ -652,4 +660,13 @@
     {
 
+    }
+    void BasicGlCamera::timedUpdate()
+    {
+        if (isVisible())
+            updateGL();
+    }
+    void BasicGlCamera::updateCamera()
+    {
+        emit signalUpdateCamera();
     }
     void BasicGlCamera::drawCamera(bool alsoWire)
Index: trunk/FACT++/gui/BasicGlCamera.h
===================================================================
--- trunk/FACT++/gui/BasicGlCamera.h	(revision 11982)
+++ trunk/FACT++/gui/BasicGlCamera.h	(revision 11985)
@@ -75,4 +75,5 @@
     void SetMax(int64_t max);
     void SetAutoRefresh(bool on);
+    void updateCamera();
 
     float ss[5];// = {0.00, 0.25, 0.5, 0.75, 1.00};
@@ -91,4 +92,5 @@
         void plus90RotationPlease(bool);
         void minus90RotationPlease(bool);
+        void timedUpdate();
 
 Q_SIGNALS:
@@ -97,4 +99,5 @@
          void signalPixelDoubleClick(int pixel);
          void colorPaletteHasChanged();
+         void signalUpdateCamera();
 
 
@@ -111,4 +114,5 @@
     virtual void setPatchColor(int id, float color[3]);
     virtual int PixelAtPosition(const QPoint &pos);
+    virtual void DrawCameraText();
     void drawHexagon(int index, bool solid);
 
@@ -131,5 +135,4 @@
     float shownSizey;
     float pixelSize;
-    void DrawCameraText();
     virtual void UpdateText();
     void DrawScale();
@@ -166,4 +169,6 @@
     float hexTolerance;
      int numVertices;
+  protected:
+     float fmin, fmax, fmean, frms, fmedian;
 
 
Index: trunk/FACT++/gui/QCameraWidget.cc
===================================================================
--- trunk/FACT++/gui/QCameraWidget.cc	(revision 11982)
+++ trunk/FACT++/gui/QCameraWidget.cc	(revision 11985)
@@ -21,4 +21,5 @@
 
          glTranslatef(0,-0.44,0);
+         glTranslatef(-0.1,0,0);
          glRotatef(cameraRotation, 0,0,-1);
          if (cameraRotation == 90)
@@ -33,4 +34,6 @@
          glScalef(1.5, 1.5, 1.5);
          drawCamera(true);
+
+         drawPatches();
 
          glLineWidth(1.0f);
@@ -40,5 +43,4 @@
              drawHexagon(*it, false);
          }
-         drawPatches();
 
         glLineWidth(1.0f);
@@ -59,4 +61,5 @@
     void QCameraWidget::drawCamera(bool alsoWire)
     {
+
         if (!pixelColorUpToDate)
             CalculatePixelsColor();
@@ -76,7 +79,97 @@
         }
     }
+    void QCameraWidget::DrawCameraText()
+    {
+        glPushMatrix();
+        glLoadIdentity();
+
+
+
+        int textSize = (int)(height()*14/600);
+        setFont(QFont("Monospace", textSize));
+        qglColor(QColor(255, 223, 127));
+
+        //first let's draw the usual data
+        //title
+        renderText(-shownSizex/2.f + 0.01f, shownSizey/2.f - textSize*pixelSize - 0.01f, 0.f, QString(titleText.c_str()));
+        //stats
+        ostringstream str;
+        str.precision(2);
+        str.setf(ios::fixed,ios::floatfield);
+        str << "Med. " << fmedian << unitsText;
+        renderText(1, height()-4*textSize-10, QString(str.str().c_str()));
+        str.str("");
+        str << "Mea. " << fmean <<  unitsText;
+        renderText(1, height()-3*textSize-8, QString(str.str().c_str()));
+        str.str("");
+        str << "Rms  " << frms <<  unitsText;
+        renderText(1, height()-2*textSize-6, QString(str.str().c_str()));
+        str.str("");
+        str << "Min. " << fmin << unitsText;
+        renderText(1, height()-1*textSize-4, QString(str.str().c_str()));
+        str.str("");
+        str << "Max. " << fmax << unitsText;
+        renderText(1, height()-2, QString(str.str().c_str()));
+        //then draw the values beside the scale
+        //the difficulty here is to write the correct min/max besides the scale
+        //it depends whether the actual mean of the data is given by the user
+        //or not. the values given by user are fMin and fMax, while the data
+        //real min/max are fmin and fmax (I know, quite confusing... sorry about that)
+        //so. first let's see what is the span of one pixel
+        float min = (fMin < 0) ? fmin : fMin;
+        float max = (fMax < 0) ? fmax : fMax;
+        textSize = (int)(height()*12/600);
+        setFont(QFont("Monospace", textSize));
+        float pixelSpan = (height() - textSize - 1)/(max - min);
+
+        //draw the scale values
+        float value = min;
+        int fontWidth = textSize;
+        if (textSize > 12) fontWidth-=3; else fontWidth -=2;
+        if (textSize < 7) fontWidth++;
+        for (int i=0;i<6;i++)
+        {
+            str.str("");
+            str << value << unitsText;
+            int h = (value - min)*pixelSpan;
+            if (logScale && h != 0)
+            {
+                float fh = h;
+                float mult = (max - min)*pixelSpan;
+                fh = log10(h*10.f/mult);
+                fh *= mult;
+                h = (int)fh;
+            }
+            h = height()-h;
+            int w = width() - (width()/50) - fontWidth*str.str().size();
+            if (i==0 || i==5) w -= width()/50;
+            if (i!=0 && i!=5) h -= textSize/2;
+            renderText(w, h, QString(str.str().c_str()));
+            value += (max - min)/5;
+        }
+
+/*
+        str.str("");
+        str << min << unitsText;
+        int fontWidth = textSize;
+        if (textSize > 12) fontWidth-=3; else fontWidth -= 2;
+        //height of min ?
+        int hmin = (min - min)*pixelSpan;
+        hmin = height() - hmin;
+        renderText(width() - (width()/25) - fontWidth*str.str().size(), hmin, QString(str.str().c_str()));
+        str.str("");
+        str << max << unitsText;
+        int hmax = (max - min)*pixelSpan;
+        hmax = height() - hmax;
+        renderText(width() - (width()/25) - fontWidth*str.str().size(), hmax, QString(str.str().c_str()));
+*/
+        glPopMatrix();
+
+        textSize = (int)(600*14/600);
+        setFont(QFont("Times", textSize));
+    }
     void QCameraWidget::drawPatches()
     {
-        glLineWidth(2.0f);
+        glLineWidth(3.0f);
         glColor3fv(patchesCoulour);
          glBegin(GL_LINES);
Index: trunk/FACT++/gui/QCameraWidget.h
===================================================================
--- trunk/FACT++/gui/QCameraWidget.h	(revision 11982)
+++ trunk/FACT++/gui/QCameraWidget.h	(revision 11985)
@@ -41,4 +41,5 @@
     void Reset();
     void drawCamera(bool alsoWire);
+    void DrawCameraText();
     void drawPatches();
      void SetEnable(int idx, bool b);
