Index: /trunk/FACT++/gui/FactGui.h
===================================================================
--- /trunk/FACT++/gui/FactGui.h	(revision 11278)
+++ /trunk/FACT++/gui/FactGui.h	(revision 11279)
@@ -20,4 +20,5 @@
 #include "src/DimNetwork.h"
 #include "src/tools.h"
+#include "src/FAD.h"
 
 
@@ -394,5 +395,6 @@
     DimStampedInfo fDimFadRefClock;
     DimStampedInfo fDimFadStatus;
-    DimStampedInfo fDimFadStatistics;
+    DimStampedInfo fDimFadStatistics1;
+    DimStampedInfo fDimFadStatistics2;
 
     map<string, DimInfo*> fServices;
@@ -922,4 +924,5 @@
             fFadTempMin->setEnabled(false);
             fFadTempMax->setEnabled(false);
+            SetLedColor(fFadLedTemp, kLedGray, d.time);
             return;
         }
@@ -1084,5 +1087,12 @@
     {
         if (!CheckSize(d, 41))
-            return;
+        {
+            fStatusEventBuilderLabel->setText("Offline");
+            fStatusEventBuilderLabel->setToolTip("FADs or fadctrl seems to be offline.");
+            fEvtBldWidget->setEnabled(false);
+
+            SetLedColor(fStatusEventBuilderLed, kLedGray, d.time);
+            return;
+        }
 
         const uint8_t *ptr = d.ptr<uint8_t>();
@@ -1266,15 +1276,38 @@
     }
 
-    void handleFadStatistics(const DimData &d)
-    {
-        if (!CheckSize(d, 8*sizeof(int64_t)))
-            return;
-
-        const int64_t *stat = d.ptr<int64_t>();
-
-        fFadBufferMax->setValue(stat[0]/1000000);
-        fFadBuffer->setMaximum(stat[0]);
-        fFadBuffer->setValue(stat[5]);
-
+    void handleFadStatistics1(const DimData &d)
+    {
+        if (!CheckSize(d, sizeof(GUI_STAT)))
+            return;
+
+        const GUI_STAT &stat = d.ref<GUI_STAT>();
+
+        /*
+         //info about status of the main threads
+         int32_t  readStat ;          //read thread
+         int32_t  procStat ;          //processing thread(s)
+         int32_t  writStat ;          //write thread
+
+         //info about some rates
+         int32_t  deltaT ;            //time in milli-seconds for rates
+         int32_t  readEvt ;           //#events read
+         int32_t  procEvt ;           //#events processed
+         int32_t  writEvt ;           //#events written
+         int32_t  skipEvt ;           //#events skipped
+
+         //some info about current state of event buffer (snapspot)
+         int32_t  evtBuf;             //#Events currently waiting in Buffer
+         uint64_t totMem;             //#Bytes available in Buffer
+         uint64_t usdMem;             //#Bytes currently used
+         uint64_t maxMem;             //max #Bytes used during past Second
+         */
+
+        fFadBufferMax->setValue(stat.totMem/1000000);
+        fFadBuffer->setMaximum(stat.totMem/100);
+        fFadBuffer->setValue(stat.maxMem/100);
+
+        cout << stat.totMem << " " << stat.maxMem << endl;
+
+        /*
         fFadEvtWait->setValue(stat[1]);
         fFadEvtSkip->setValue(stat[2]);
@@ -1284,6 +1317,49 @@
         fFadEthernetRateAvg->setValue(stat[6]/1024./stat[7]);
         fFadEvtConn->setValue(stat[7]);
-    }
-
+        */
+    }
+
+    void handleFadStatistics2(const DimData &d)
+    {
+        if (!CheckSize(d, sizeof(EVT_STAT)))
+            return;
+
+        const EVT_STAT &stat = d.ref<EVT_STAT>();
+
+        /*
+         //some info about what happened since start of program (or last 'reset')
+         uint32_t reset ;             //#if increased, reset all counters
+         uint32_t numRead[MAX_SOCK] ; //how often succesfull read from N sockets per loop
+
+         uint64_t gotByte[NBOARDS] ;  //#Bytes read per Board
+         uint32_t gotErr[NBOARDS] ;   //#Communication Errors per Board
+
+         uint32_t evtGet;             //#new Start of Events read
+         uint32_t evtTot;             //#complete Events read
+
+         uint32_t evtErr;             //#Events with Errors
+         uint32_t evtSkp;             //#Events incomplete (timeout)
+
+
+         uint32_t procTot;            //#Events processed
+         uint32_t procErr;            //#Events showed problem in processing
+         uint32_t procTrg;            //#Events accepted by SW trigger
+         uint32_t procSkp;            //#Events rejected by SW trigger
+
+         uint32_t feedTot;            //#Events used for feedBack system
+         uint32_t feedErr;            //#Events rejected by feedBack
+
+         uint32_t wrtTot;             //#Events written to disk
+         uint32_t wrtErr;             //#Events with write-error
+
+         uint32_t runOpen;            //#Runs opened
+         uint32_t runClose;           //#Runs closed
+         uint32_t runErr;             //#Runs with open/close errors
+
+
+         //info about current connection status
+         uint8_t  numConn[NBOARDS] ;  //#Sockets succesfully open per board
+         */
+    }
 
     // ===================== FTM ============================================
@@ -1808,9 +1884,11 @@
                 SetLedColor(fStatusFADLed, kLedGray, time);
 
-                fStatusEventBuilderLabel->setText("Offline");
-                fStatusEventBuilderLabel->setToolTip("No connection to fadctrl.");
-                fEvtBldWidget->setEnabled(false);
-
-                SetLedColor(fStatusEventBuilderLed, kLedGray, time);
+                /*
+                 fStatusEventBuilderLabel->setText("Offline");
+                 fStatusEventBuilderLabel->setToolTip("No connection to fadctrl.");
+                 fEvtBldWidget->setEnabled(false);
+
+                 SetLedColor(fStatusEventBuilderLed, kLedGray, time);
+                 */
             }
             if (s.index==FAD::kOffline) // Dim connection / FTM disconnected
@@ -2094,6 +2172,9 @@
             return PostInfoHandler(&FactGui::handleFadStatus);
 
-        if (getInfo()==&fDimFadStatistics)
-            return PostInfoHandler(&FactGui::handleFadStatistics);
+        if (getInfo()==&fDimFadStatistics1)
+            return PostInfoHandler(&FactGui::handleFadStatistics1);
+
+        if (getInfo()==&fDimFadStatistics2)
+            return PostInfoHandler(&FactGui::handleFadStatistics2);
 
         if (getInfo()==&fDimFadEvents)
@@ -2539,5 +2620,6 @@
         fDimFadRefClock        ("FAD_CONTROL/REFERENCE_CLOCK",  (void*)NULL, 0, this),
         fDimFadStatus          ("FAD_CONTROL/STATUS",           (void*)NULL, 0, this),
-        fDimFadStatistics      ("FAD_CONTROL/STATISTICS",       (void*)NULL, 0, this),
+        fDimFadStatistics1     ("FAD_CONTROL/STATISTICS1",      (void*)NULL, 0, this),
+        fDimFadStatistics2     ("FAD_CONTROL/STATISTICS2",      (void*)NULL, 0, this),
         //-
         fEventData(0)
@@ -2554,5 +2636,6 @@
         fFtuWidget->setEnabled(false);
         fRatesWidget->setEnabled(false);
-//        fFadWidget->setEnabled(false);
+        fFadWidget->setEnabled(false);
+        fEvtBldWidget->setEnabled(false);
         fLoggerWidget->setEnabled(false);
 
