Index: /trunk/FACT++/gui/BasicGlCamera.cc
===================================================================
--- /trunk/FACT++/gui/BasicGlCamera.cc	(revision 11940)
+++ /trunk/FACT++/gui/BasicGlCamera.cc	(revision 11941)
@@ -24,4 +24,5 @@
         fMin = -1;
         fMax = -1;
+        autoRefresh = false;
         logScale = false;
         cameraRotation = 0;
@@ -260,9 +261,15 @@
     {
     }
+    void BasicGlCamera::setPatchColor(int id, float color[3])
+    {
+        for (int i=0;i<9;i++)
+            for (int j=0;j<3;j++)
+                pixelsColor[softwareMapping[patches[id][i]]][j] = color[j];
+    }
     void BasicGlCamera::setUnits(const string& units)
     {
         unitsText = units;
         pixelColorUpToDate = false;
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -271,5 +278,5 @@
         titleText = title;
         pixelColorUpToDate = false;
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -278,5 +285,5 @@
         fWhite = idx;
         fWhitePatch = pixelsPatch[fWhite];
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
 //         CalculatePatchColor();
@@ -287,5 +294,5 @@
         fMin = min;
         pixelColorUpToDate = false;
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -295,5 +302,5 @@
         fMax = max;
         pixelColorUpToDate = false;
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -304,5 +311,5 @@
         pixelColorUpToDate = false;
         emit colorPaletteHasChanged();
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -355,8 +362,11 @@
 
 
-        int textLength = titleText.size();
+//        int textLength = titleText.size();
         renderText(-shownSizex/2.f + shiftx, shownSizey/2.f - textSize*pixelSize - shifty, 0.f, QString(titleText.c_str()));
 
         glPopMatrix();
+
+        textSize = (int)(600*14/600);
+        setFont(QFont("Times", textSize));
     }
     void BasicGlCamera::DrawScale()
@@ -421,7 +431,7 @@
             else
                 value = (float)(i)/10.f;
-            float y = -shownSizey/2.f + value*shownSizey;
-            glVertex2f(oneX, y);
-            glVertex2f(twoX, y);
+            float yy = -shownSizey/2.f + value*shownSizey;
+            glVertex2f(oneX, yy);
+            glVertex2f(twoX, yy);
         }
         glEnd();
@@ -435,5 +445,5 @@
         pixelColorUpToDate = false;
         emit colorPaletteHasChanged();
-          if (isVisible())
+          if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -455,5 +465,5 @@
         emit colorPaletteHasChanged();
 
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -475,5 +485,5 @@
         emit colorPaletteHasChanged();
 
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -495,5 +505,5 @@
         emit colorPaletteHasChanged();
 
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -515,5 +525,11 @@
         emit colorPaletteHasChanged();
 
-        if (isVisible())
+        if (isVisible() && autoRefresh)
+            updateGL();
+    }
+    void BasicGlCamera::SetAutoRefresh(bool on)
+    {
+        autoRefresh = on;
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -523,5 +539,5 @@
         cameraRotation = 0;
         pixelColorUpToDate = false;
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -531,5 +547,5 @@
         cameraRotation = 90;
         pixelColorUpToDate = false;
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -539,5 +555,5 @@
         cameraRotation = -90;
         pixelColorUpToDate = false;
-        if (isVisible())
+        if (isVisible() && autoRefresh)
             updateGL();
     }
@@ -625,13 +641,13 @@
     }
 
-    void BasicGlCamera::mousePressEvent(QMouseEvent *cEvent)
-    {
-
-    }
-    void BasicGlCamera::mouseMoveEvent(QMouseEvent *cEvent)
-    {
-
-    }
-    void BasicGlCamera::mouseDoubleClickEvent(QMouseEvent *cEvent)
+    void BasicGlCamera::mousePressEvent(QMouseEvent *)
+    {
+
+    }
+    void BasicGlCamera::mouseMoveEvent(QMouseEvent *)
+    {
+
+    }
+    void BasicGlCamera::mouseDoubleClickEvent(QMouseEvent *)
     {
 
Index: /trunk/FACT++/gui/BasicGlCamera.h
===================================================================
--- /trunk/FACT++/gui/BasicGlCamera.h	(revision 11940)
+++ /trunk/FACT++/gui/BasicGlCamera.h	(revision 11941)
@@ -74,4 +74,5 @@
     void SetMin(int64_t min);
     void SetMax(int64_t max);
+    void SetAutoRefresh(bool on);
 
     float ss[5];// = {0.00, 0.25, 0.5, 0.75, 1.00};
@@ -108,5 +109,6 @@
     virtual void drawCamera(bool alsoWire);
     virtual void drawPatches();
-    int PixelAtPosition(const QPoint &pos);
+    virtual void setPatchColor(int id, float color[3]);
+    virtual int PixelAtPosition(const QPoint &pos);
     void drawHexagon(int index, bool solid);
 
@@ -130,5 +132,5 @@
     float pixelSize;
     void DrawCameraText();
-    void UpdateText();
+    virtual void UpdateText();
     void DrawScale();
     void toggleInterfaceDisplay();
@@ -157,4 +159,6 @@
     void calculatePixelsCoords();
     float viewSize;
+    bool autoRefresh;
+
   private:
     void skipPixels(int start, int howMany);
@@ -163,4 +167,5 @@
      int numVertices;
 
+
 };
 
Index: /trunk/FACT++/gui/QCameraWidget.cc
===================================================================
--- /trunk/FACT++/gui/QCameraWidget.cc	(revision 11940)
+++ /trunk/FACT++/gui/QCameraWidget.cc	(revision 11941)
@@ -104,4 +104,5 @@
          if (fWhitePatch != -1)
          {
+             glTranslatef(0,0,0.01);
              glColor3f(1.f, 0.5f, 0.f);//patchColour);//[0],patchColour[1],patchColour[2]);//0.5f, 0.5f, 0.3f);
              glBegin(GL_LINES);
Index: /trunk/FACT++/gui/QCameraWidget.h
===================================================================
--- /trunk/FACT++/gui/QCameraWidget.h	(revision 11940)
+++ /trunk/FACT++/gui/QCameraWidget.h	(revision 11941)
@@ -16,4 +16,5 @@
     typedef vector<Position> Positions;
 
+    //FIXME this variable seems to be deprecated
     Positions fGeom;
 
Index: /trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
===================================================================
--- /trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc	(revision 11940)
+++ /trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc	(revision 11941)
@@ -25,6 +25,4 @@
 
 #include "src/Configuration.h"
-
-//#include "../BasicGlCamera.cc"
 
 #undef ACTUAL_NUM_PIXELS
@@ -353,4 +351,5 @@
     drawBlur = false;
     loopCurrentEvent = false;
+    SetAutoRefresh(true);
 #ifdef LOAD_RAW
     loadEvents("/scratch/00000043.001_T.bin");
@@ -908,6 +907,6 @@
      int16_t* origTheWayIWant = new int16_t[1024*1440];
 
-     int numPixels = 1024;
-         int leftOver = 1440-numPixels;
+//     int numPixels = 1024;
+//         int leftOver = 1440-numPixels;
          for (int k=0;k<1024;k++)
              for (int j=0;j<1440;j++)
@@ -957,5 +956,5 @@
     ofstream outBin("/scratch/bin/outputBin.bin", ios_base::out | ios_base::binary);
     ofstream outWave("/scratch/bin/outputWave.bin", ios_base::out | ios_base::binary);
-    int16_t* waveLetArray = new int16_t[1024*1440];
+    int16_t* waveLetArray_ = new int16_t[1024*1440];
     int16_t* origTheWayIWant = new int16_t[1024*1440];
 
@@ -967,6 +966,6 @@
         outBin.write((const char*)(rawEventData), 1440*1024*2);
 
-        int numPixels = 1024;
-        int leftOver = 1440-numPixels;
+//       int numPixels = 1024;
+//        int leftOver = 1440-numPixels;
         for (int k=0;k<1024;k++)
             for (int j=0;j<1440;j++)
@@ -983,5 +982,5 @@
         {
             if (j + waveSpan < totalNumSamples)
-            if (!doWaveLetsPlease(waveSpan, &origTheWayIWant[j], &waveLetArray[j], true))
+            if (!doWaveLetsPlease(waveSpan, &origTheWayIWant[j], &waveLetArray_[j], true))
                 return;
         }
@@ -997,5 +996,5 @@
             {
 //                   cout << "   Doint one last run of " << lastRun << " samples" << endl;
-                doWaveLetsPlease(lastRun, &origTheWayIWant[j], &waveLetArray[j], true);
+                doWaveLetsPlease(lastRun, &origTheWayIWant[j], &waveLetArray_[j], true);
             }
             else
@@ -1003,5 +1002,5 @@
 //                    cout << " Filling in " << lastRun << " samples" << endl;
                 for (int l=0;l<lastRun;l++)
-                    waveLetArray[j+l] = origTheWayIWant[j+l];
+                    waveLetArray_[j+l] = origTheWayIWant[j+l];
             }
             if (!lastRun)
@@ -1009,5 +1008,5 @@
             j += lastRun;
         }
-       outWave.write((const char*)(waveLetArray), 1440*1024*2);
+       outWave.write((const char*)(waveLetArray_), 1440*1024*2);
     }
     outWave.close();
@@ -1015,5 +1014,5 @@
     inputFile->GetRow(0);
 
-    delete[] waveLetArray;
+    delete[] waveLetArray_;
     delete[] origTheWayIWant;
 }
@@ -1266,6 +1265,4 @@
                 for (int j=0;j<viewer->nRoi;j++)
                 {
-//                    cout << "start value: " << viewer->eventData[i*1024+j] << " baseline: " << viewer->baseLineMean[i*1024+j];
-//                    cout << " triggerOffset: " << viewer->triggerOffsetMean[i*1024+j] << " gain: " << viewer->gainMean[i*1024+j];
                     int realj = (j+viewer->startPix[j])%1024;
                     viewer->eventData[i*1024+j] *= 2000.f/4096.f;
@@ -1273,5 +1270,4 @@
                     viewer->eventData[i*1024+j] /= viewer->gainMean[i*1024+realj];
                     viewer->eventData[i*1024+j] *= (50000.f/65536.f) * 2500.f;
-//                    cout << " end value: " << viewer->eventData[i*1024+j] << endl;
                 }
             viewer->updateGL();
