Index: trunk/FACT++/gui/FactGui.h
===================================================================
--- trunk/FACT++/gui/FactGui.h	(revision 10521)
+++ trunk/FACT++/gui/FactGui.h	(revision 10524)
@@ -26,20 +26,27 @@
 #include "TMarker.h"
 #include "TColor.h"
+#include "TQtTimer.h"
+
+#define HAS_ROOT
 
 using namespace std;
-    class Camera : public TObject
-    {
-        typedef pair<double,double> Position;
-        typedef vector<Position> Positions;
-        Positions fGeom;
+
+// #########################################################################
+
+class Camera : public TObject
+{
+    typedef pair<double,double> Position;
+    typedef vector<Position> Positions;
+
+    Positions fGeom;
 
     void CreatePalette()
-        {
-            /*
-        double ss[5] = {0., 0.10, 0.45, 0.75, 1.00};
-        double rr[5] = {0., 0.35, 0.85, 1.00, 1.00};
-        double gg[5] = {0., 0.10, 0.20, 0.73, 1.00};
-        double bb[5] = {0., 0.03, 0.06, 0.00, 1.00};
-              */
+    {
+        /*
+         double ss[5] = {0., 0.10, 0.45, 0.75, 1.00};
+         double rr[5] = {0., 0.35, 0.85, 1.00, 1.00};
+         double gg[5] = {0., 0.10, 0.20, 0.73, 1.00};
+         double bb[5] = {0., 0.03, 0.06, 0.00, 1.00};
+         */
         double ss[5] = {0., 0.25, 0.50, 0.75, 1.00};
         double rr[5] = {0., 0.00, 0.00, 1.00, 1.00};
@@ -56,5 +63,5 @@
     void CreateGeometry()
     {
-        const double gsSin60 = sqrt(3.)/2;  
+        const double gsSin60 = sqrt(3.)/2;
 
         const int rings = 23;
@@ -298,7 +305,7 @@
         fData = data;
     }
-
-
-    };
+};
+
+// #########################################################################
 
 
@@ -317,4 +324,6 @@
         bool Exec() { fFunction(*this); return true; }
     };
+
+    vector<bool> fFtuDisabled;
 
     DimStampedInfo fDimDNS;
@@ -852,5 +861,5 @@
 
         // ----------------------------------------------
-
+#ifdef HAS_ROOT
         TCanvas *c = fFtmTempCanv->GetCanvas();
 
@@ -883,4 +892,5 @@
         c->Modified();
         c->Update();
+#endif
     }
 
@@ -932,19 +942,26 @@
         fEnableTimeMarker->setChecked(sdata.HasTimeMarker());
 
-        cout << hex << sdata.fActiveFTU << dec << endl;
-
-        for (int i=0; i<64; i++)
-            std::cout << (sdata.fActiveFTU&(1<<i) ? 1 : 0);
-        std::cout << std::endl;
-
         for (int i=0; i<40; i++)
+        {
             if (!sdata.IsActive(i))
+            {
                 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/gray circle 1.png"));
+                fFtuDisabled[i] = true;
+            }
             else
-                fFtuLED[i]->setIcon(QIcon(":/Resources/icons/green circle 1.png"));
-
+            {
+                if (fFtuDisabled[i])
+                {
+                    fFtuLED[i]->setIcon(QIcon(":/Resources/icons/green circle 1.png"));
+                    fFtuDisabled[i] = false;
+                }
+            }
+        }
+
+#ifdef HAS_ROOT
         Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera");
         for (int i=0; i<1438; i++)
             cam->SetEnable(i, sdata.IsEnabled(i));
+#endif
 
         const int patch1 = fThresholdIdx->value();
@@ -1013,19 +1030,26 @@
         fFtuAnswersCrate3->setValue(sdata.fNumBoardsCrate[3]);
 
-        cout << "FtuList received: fActiveFTU not handled yet." << endl;
-
+        // Same: When error received: Needs decoding
         for (int i=0; i<40; i++)
         {
             if (sdata.IsActive(i))
             {
-                if (sdata.fPing[i]>0)
+                if (sdata.fPing[i]==0)
                     fFtuLED[i]->setIcon(QIcon(":/Resources/icons/red circle 1.png"));
-                else
+
+                if (sdata.fPing[i]==1)
                     fFtuLED[i]->setIcon(QIcon(":/Resources/icons/green circle 1.png"));
-                //if (sdata.fCRC[i]>0)
-                //    fFtuLED[i]->setIcon(QIcon(":/Resources/icons/warning 1.png"));
+
+                if (sdata.fPing[i]>1)
+                    fFtuLED[i]->setIcon(QIcon(":/Resources/icons/orange circle 1.png"));
+
+                fFtuDisabled[i] = false;
             }
             else
+            {
                 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/gray circle 1.png"));
+                fFtuDisabled[i] = true;
+            }
+
         }
     }
@@ -1035,4 +1059,5 @@
         if (d.size()==0)
             return;
+
         const Converter conv(d.format);
         cout << "Error:" << endl;
@@ -1102,5 +1127,4 @@
                 fStatusLoggerLed->setIcon(QIcon(":/Resources/icons/green circle 1.png"));
 
-            cout << "enable " << s.index << " " << enable << endl;
             fLoggerWidget->setEnabled(enable);
         }
@@ -1389,4 +1413,5 @@
     }
 
+#ifdef HAS_ROOT
     void slot_RootEventProcessed(TObject *obj, unsigned int evt, TCanvas *)
     {
@@ -1398,5 +1423,4 @@
         // kEnterEvent            // TCanvas processed QEvent enterEvent
         // kLeaveEvent            // TCanvas processed QEvent leaveEvent
-
         if (dynamic_cast<TCanvas*>(obj))
             return;
@@ -1476,6 +1500,7 @@
     {
         gSystem->ProcessEvents();
-        QTimer::singleShot(100, this, SLOT(slot_RootUpdate()));
-    }
+        QTimer::singleShot(0, this, SLOT(slot_RootUpdate()));
+    }
+
     void on_fThresholdIdx_valueChanged(int idx)
     {
@@ -1483,4 +1508,5 @@
         ChoosePatch(*cam, idx);
     }
+#endif
 
     TGraph fGraphFtmTemp[4];
@@ -1490,4 +1516,5 @@
 public:
     FactGui() :
+        fFtuDisabled(40),
         fDimDNS("DIS_DNS/VERSION_NUMBER", 1, int(0), this),
 
@@ -1551,5 +1578,5 @@
 
         // --------------------------------------------------------------------------
-
+#ifdef HAS_ROOT
         TCanvas *c = fFtmTempCanv->GetCanvas();
         c->SetBit(TCanvas::kNoContextMenu);
@@ -1608,5 +1635,5 @@
         ChoosePixel(*cam, 1);
 
-        QTimer::singleShot(100, this, SLOT(slot_RootUpdate()));
+//        QTimer::singleShot(0, this, SLOT(slot_RootUpdate()));
 
         //widget->setMouseTracking(true);
@@ -1619,9 +1646,11 @@
         fRatesCanv->EnableSignalEvents(kMouseMoveEvent|kMouseReleaseEvent|kMouseDoubleClickEvent);
 
-        connect(fRatesCanv,   SIGNAL(     RootEventProcessed(TObject *, unsigned int, TCanvas *)),
-                this,         SLOT  (slot_RootEventProcessed(TObject *, unsigned int, TCanvas *)));
-        connect(fFtmTempCanv, SIGNAL(     RootEventProcessed(TObject *, unsigned int, TCanvas *)),
-                this,         SLOT  (slot_RootEventProcessed(TObject *, unsigned int, TCanvas *)));
-    }
+        connect(fRatesCanv,   SIGNAL(     RootEventProcessed(TObject*, unsigned int, TCanvas*)),
+                this,         SLOT  (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*)));
+        connect(fFtmTempCanv, SIGNAL(     RootEventProcessed(TObject*, unsigned int, TCanvas*)),
+                this,         SLOT  (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*)));
+#endif
+    }
+
     ~FactGui()
     {
