Index: /trunk/FACT++/gui/FactGui.h
===================================================================
--- /trunk/FACT++/gui/FactGui.h	(revision 11173)
+++ /trunk/FACT++/gui/FactGui.h	(revision 11174)
@@ -392,4 +392,5 @@
     DimStampedInfo fDimFadPllLock;
     DimStampedInfo fDimFadDrsEnabled;
+    DimStampedInfo fDimFadStatus;
     DimStampedInfo fDimFadStatistics;
 
@@ -1114,5 +1115,5 @@
         SetLedColor(fFadLedFwVersion, d.qos?kLedGreen:kLedOrange, d.time);
     }
-
+/*
     void handleFadPllLock(const DimData &d)
     {
@@ -1120,5 +1121,5 @@
             return;
 
-        SetLedColor(fFadLedPllLock, d.qos?kLedGreen:kLedOrange, d.time);
+//        SetLedColor(fFadLedPllLock, d.qos?kLedGreen:kLedOrange, d.time);
 
         const uint8_t *ptr = d.ptr<uint8_t>();
@@ -1156,5 +1157,5 @@
         const uint8_t *ptr = d.ptr<uint8_t>();
 
-        SetLedColor(fFadLedDrsEnabled, d.qos?(ptr[0]?kLedGreen:kLedRed):kLedOrange, d.time);
+//        SetLedColor(fFadLedDrsEnabled, d.qos?(ptr[0]?kLedGreen:kLedRed):kLedOrange, d.time);
 
         ostringstream tip;
@@ -1178,4 +1179,51 @@
 
         fFadLedDrsEnabled->setToolTip(tip.str().c_str());
+
+    }
+*/
+    void SetFadLed(QPushButton *led, const DimData &d, uint16_t bitmask)
+    {
+        const uint16_t  quality = d.ptr<uint16_t>()[0];
+        const uint16_t  value   = d.ptr<uint16_t>()[1];
+        const uint16_t *ptr     = d.ptr<uint16_t>()+2;
+
+        SetLedColor(led, quality&bitmask?(value&bitmask?kLedGreen:kLedRed):kLedOrange, d.time);
+
+        ostringstream tip;
+        tip << "<table border='1'><tr><th colspan='11'>" << d.time.GetAsStr() << "</th></tr><tr><th></th>";
+        for (int b=0; b<10; b++)
+            tip << "<th>" << b << "</th>";
+        tip << "</tr>";
+
+        for (int c=0; c<4; c++)
+        {
+            tip << "<tr><th>" << dec << c << "</th>" << hex;
+            for (int b=0; b<10; b++)
+            {
+                tip << "<td>"
+                    << (ptr[c*10+b]&bitmask)
+                    << "</td>";
+            }
+            tip << "</tr>";
+        }
+        tip << "</table>";
+
+        led->setToolTip(tip.str().c_str());
+    }
+
+    void handleFadStatus(const DimData &d)
+    {
+        if (!CheckSize(d, 42*sizeof(uint16_t)))
+            return;
+
+        SetFadLed(fFadLedDrsEnabled,     d, FAD::EventHeader::kDenable);
+        SetFadLed(fFadLedDrsWrite,       d, FAD::EventHeader::kDwrite);
+        SetFadLed(fFadLedRefClockTooLow, d, FAD::EventHeader::kRefClkTooLow);
+        SetFadLed(fFadLedBusy,           d, FAD::EventHeader::kBusy);
+        SetFadLed(fFadLedTriggerLine,    d, FAD::EventHeader::kTriggerLine);
+        SetFadLed(fFadLedContTrigger,    d, FAD::EventHeader::kContTrigger);
+        SetFadLed(fFadLedSocket,         d, FAD::EventHeader::kSock17);
+        SetFadLed(fFadLedPllLock,        d, 0xf000);
+
 
     }
@@ -1976,9 +2024,12 @@
             return PostInfoHandler(&FactGui::handleFadFwVersion);
 
-        if (getInfo()==&fDimFadPllLock)
-            return PostInfoHandler(&FactGui::handleFadPllLock);
-
-        if (getInfo()==&fDimFadDrsEnabled)
-            return PostInfoHandler(&FactGui::handleFadDrsEnabled);
+//        if (getInfo()==&fDimFadPllLock)
+//            return PostInfoHandler(&FactGui::handleFadPllLock);
+
+//        if (getInfo()==&fDimFadDrsEnabled)
+//            return PostInfoHandler(&FactGui::handleFadDrsEnabled);
+
+        if (getInfo()==&fDimFadStatus)
+            return PostInfoHandler(&FactGui::handleFadStatus);
 
         if (getInfo()==&fDimFadStatistics)
@@ -2425,4 +2476,5 @@
         fDimFadPllLock         ("FAD_CONTROL/PLL_LOCK",         (void*)NULL, 0, this),
         fDimFadDrsEnabled      ("FAD_CONTROL/DRS_ENABLED",      (void*)NULL, 0, this),
+        fDimFadStatus          ("FAD_CONTROL/STATUS",           (void*)NULL, 0, this),
         fDimFadStatistics      ("FAD_CONTROL/STATISTICS",       (void*)NULL, 0, this)
     {
Index: /trunk/FACT++/gui/design.ui
===================================================================
--- /trunk/FACT++/gui/design.ui	(revision 11173)
+++ /trunk/FACT++/gui/design.ui	(revision 11174)
@@ -3126,5 +3126,5 @@
              </item>
              <item row="2" column="0">
-              <widget class="QPushButton" name="fFadLedDwrite">
+              <widget class="QPushButton" name="fFadLedDrsWrite">
                <property name="enabled">
                 <bool>true</bool>
@@ -3498,5 +3498,5 @@
              </item>
              <item row="7" column="0">
-              <widget class="QPushButton" name="fFadLedContinousTrigger">
+              <widget class="QPushButton" name="fFadLedContTrigger">
                <property name="enabled">
                 <bool>true</bool>
@@ -3897,5 +3897,5 @@
              </item>
              <item row="4" column="1">
-              <widget class="QPushButton" name="fStatusDNSLed_11">
+              <widget class="QPushButton" name="fFadLedRefClockTooLow">
                <property name="enabled">
                 <bool>true</bool>
Index: /trunk/FACT++/src/EventBuilderWrapper.h
===================================================================
--- /trunk/FACT++/src/EventBuilderWrapper.h	(revision 11173)
+++ /trunk/FACT++/src/EventBuilderWrapper.h	(revision 11174)
@@ -721,6 +721,10 @@
     DimDescribedService fDimEventData;
     DimDescribedService fDimFwVersion;
-    DimDescribedService fDimPllLock;
-    DimDescribedService fDimDrsEnabled;
+    //DimDescribedService fDimPllLock;
+    //DimDescribedService fDimDrsEnabled;
+    //DimDescribedService fDimTriggerLine;
+    //DimDescribedService fDimContinousTrigger;
+    //DimDescribedService fDimSocket;
+    DimDescribedService fDimStatus;
     DimDescribedService fDimStatistics;
 
@@ -742,6 +746,10 @@
 	fDimEventData("FAD_CONTROL/EVENT_DATA", "S:1;I:1;S:1;I:2;S:1;S", ""),
         fDimFwVersion("FAD_CONTROL/FIRMWARE_VERSION", "F:43", ""),
-        fDimPllLock("FAD_CONTROL/PLL_LOCK", "C:41", ""),
-        fDimDrsEnabled("FAD_CONTROL/DRS_ENABLED", "C:41", ""),
+        //fDimPllLock("FAD_CONTROL/PLL_LOCK", "C:41", ""),
+        //fDimDrsEnabled("FAD_CONTROL/DRS_ENABLED", "C:41", ""),
+        //fDimTriggerLine("FAD_CONTROL/TRIGGER_LINE", "C:41", ""),
+        //fDimContinousTrigger("FAD_CONTROL/CONTINOUS_TRIGGER", "C:41", ""),
+        //fDimBusy("FAD_CONTROL/BUSY", "C:41", ""),
+        fDimStatus("FAD_CONTROL/STATUS", "S:42", ""),
         fDimStatistics("FAD_CONTROL/STATISTICS", "X:8", ""),
         fDebugStream(false), fDebugRead(false)
@@ -1387,4 +1395,42 @@
     }
 
+    template<typename T>
+    boost::array<T, 42> CompareBits(const FAD::EventHeader *h, const T *t)
+    {
+        const int offset = reinterpret_cast<const char *>(t) - reinterpret_cast<const char *>(h);
+
+        T val;  // All bits 0
+        T rc;
+
+        boost::array<T, 42> vec;
+
+        bool first = true;
+
+        for (int i=0; i<40; i++)
+        {
+            const char *base = reinterpret_cast<const char*>(&fVecHeader[i]);
+            const T *ref = reinterpret_cast<const T*>(base+offset);
+
+            vec[i+2] = *ref;
+
+            if (gi_NumConnect[i/7]!=7)
+                continue;
+
+            if (first)
+            {
+                first = false;
+                val = *ref;
+                rc = ~0;
+            }
+
+            rc |= val^*ref;
+        }
+
+        vec[0] = rc;
+        vec[1] = val;
+
+        return vec;
+    }
+
     template<typename T, size_t N>
     void Update(DimDescribedService &svc, const pair<bool,boost::array<T, N>> &data)
@@ -1442,5 +1488,5 @@
             Print("Run", run);
         }
-
+/*
         if (old.PLLLCK() != h.PLLLCK())
         {
@@ -1476,5 +1522,5 @@
             Print("Owf", owf);
         }
-
+*/
         if (old.IsDcmLocked() != h.IsDcmLocked())
         {
@@ -1494,9 +1540,14 @@
             Print("Spi", spi);
         }
-
+/*
         if (old.HasBusy() != h.HasBusy())
         {
             const pair<bool, boost::array<uint16_t,43>> bsy = Compare(&h, &h.fStatus, FAD::EventHeader::kBusy);
-            Print("Bsy", bsy);
+            pair<bool, boost::array<uint8_t,43>> data;
+            data.first = bsy.first;
+            data.second[0] = bsy.second[1];
+            for (int i=0; i<40; i++)
+                data.second[i+1] = bsy.second[i+3];
+            Update(fDimBusy, data);
         }
 
@@ -1504,5 +1555,10 @@
         {
             const pair<bool, boost::array<uint16_t,43>> trg = Compare(&h, &h.fStatus, FAD::EventHeader::kTriggerLine);
-            Print("Trg", trg);
+            pair<bool, boost::array<uint8_t,43>> data;
+            data.first = trg.first;
+            data.second[0] = trg.second[1];
+            for (int i=0; i<40; i++)
+                data.second[i+1] = trg.second[i+3];
+            Update(fDimTriggerLine, data);
         }
 
@@ -1510,5 +1566,10 @@
         {
             const pair<bool, boost::array<uint16_t,43>> cnt = Compare(&h, &h.fStatus, FAD::EventHeader::kContTrigger);
-            Print("Cnt", cnt);
+            pair<bool, boost::array<uint8_t,43>> data;
+            data.first = cnt.first;
+            data.second[0] = cnt.second[1];
+            for (int i=0; i<40; i++)
+                data.second[i+1] = cnt.second[i+3];
+            Update(fDimContinousTrigger, data);
         }
 
@@ -1518,5 +1579,13 @@
             Print("Sck", sck);
         }
-
+*/
+        if (old.fStatus != h.fStatus)
+        {
+            const boost::array<uint16_t,42> sts = CompareBits(&h, &h.fStatus);
+            fDimStatus.setData(const_cast<uint16_t*>(sts.data()), 42*sizeof(uint16_t));
+            fDimStatus.updateService();
+
+            cout << "EMMIT" << endl;
+        }
 
 
