Index: trunk/FACT++/gui/FactGui.h
===================================================================
--- trunk/FACT++/gui/FactGui.h	(revision 11117)
+++ trunk/FACT++/gui/FactGui.h	(revision 11127)
@@ -387,4 +387,5 @@
     DimStampedInfo fDimFadEvents;
     DimStampedInfo fDimFadCurrentEvent;
+    DimStampedInfo fDimFadEventData;
     DimStampedInfo fDimFadConnections;
 
@@ -960,7 +961,86 @@
     }
 
+    struct DimEventData
+    {
+	uint16_t Roi ;            // #slices per pixel (same for all pixels and tmarks)
+	uint32_t EventNum ;       // EventNumber as from FTM
+	uint16_t TriggerType ;    // Trigger Type from FTM
+
+	uint32_t PCTime ;         // when did event start to arrive at PC
+	uint32_t BoardTime;       //
+
+	int16_t StartPix;         // First Channel per Pixel (Pixels sorted according Software ID)  ; -1 if not filled
+	int16_t StartTM;          // First Channel for TimeMark (sorted Hardware ID) ; -1 if not filled
+
+	uint16_t Adc_Data[];     // final length defined by malloc ....
+
+    } __attribute__((__packed__));;
+
+    void handleFadEventData(const DimData &d)
+    {
+	if (d.size()==0)
+            return;
+
+#ifdef HAVE_ROOT
+	const DimEventData &dat = d.ref<DimEventData>();
+
+        if (d.size()<sizeof(DimEventData))
+        {
+            cout << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected=" << sizeof(DimEventData) << endl;
+            return;
+        }
+
+        if (d.size()!=dat.Roi*2+sizeof(DimEventData))
+        {
+            cout << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected=" << dat.Roi*2+sizeof(DimEventData) << endl;
+            return;
+        }
+
+	TCanvas *c = fAdcDataCanv->GetCanvas();
+
+	TH1 *h = dynamic_cast<TH1*>(c->FindObject("EventData"));
+	if (h && h->GetNbinsX()!=dat.Roi)
+	{
+	    delete h;
+	    h = 0;
+	}
+
+	if (!h)
+	{
+	    c->cd();
+
+	    TH1D hist("EventData", "", dat.Roi, -0.5, dat.Roi-0.5);
+	    hist.SetStats(kFALSE);
+	    //hist->SetBit(TH1::kNoTitle);
+	    hist.SetMarkerStyle(kFullDotMedium);
+	    hist.SetYTitle("Voltage [mV]");
+	    hist.GetXaxis()->CenterTitle();
+	    hist.GetYaxis()->CenterTitle();
+	    hist.SetMinimum(-1025);
+	    hist.SetMaximum(1025);
+	    h = hist.DrawCopy("P");
+	    h->SetDirectory(0);
+
+	}
+
+	ostringstream str;
+	str << "ADC Pipeline (start=" << dat.StartTM << ")";
+	h->SetXTitle(str.str().c_str());
+
+	//str.str("");
+	//str << "Crate=" << crate << " Board=" << board << " Channel=" << channel << " [" << d.time() << "]" << endl;
+	//hist->SetTitle(str.str().c_str());
+
+	for (int i=0; i<dat.Roi; i++)
+	    h->SetBinContent(i+1, dat.Adc_Data[i]-1024);
+
+	c->Modified();
+	c->Update();
+#endif
+    }
+
     void handleFadConnections(const DimData &d)
     {
-        if (!CheckSize(d, 40))
+        if (!CheckSize(d, 41))
             return;
 
@@ -976,46 +1056,7 @@
             }
         }
-    }
-
-    /*
-     TCanvas *c = fAdcDataCanv->GetCanvas();
-
-     TH1D *hist = c->FindObject("Hist");
-     if (hist && hist->GetNbinsX()!=...)
-     {
-         delete hist;
-         hist = 0;
-
-     }
-     if (!hist)
-     {
-         hist = new TH1D("Hist", "", n, -0.5, n-0.5);
-         hist->SetStats(kFALSE);
-         hist->SetDirectory(0);
-         //hist->SetBit(TH1::kNoTitle);
-         hist->SetBit(kCanDelete);
-         hist->SetMarkerStyle(kFullDotMedium);
-         hist->SetYTitle("Voltage [mV]");
-         hist->GetXaxis()->CenterTitle();
-         hist->GetYaxis()->CenterTitle();
-         hist->SetMinimum(-1025);
-         hist->SetMaximum(1025);
-         hist->Draw("P");
-     }
-
-     ostringstream str;
-     str << "ADC Pipeline (start=" << startbin << ")";
-     hist->SetXTitle(str.str().c_str());
-
-     str.str("");
-     str << "Crate=" << crate << " Board=" << board << " Channel=" << channel << " [" << d.time() << "]" << endl;
-     hist->SetTitle(str.str().c_str());
-
-     for (int i=0; i<n; i++)
-        hist->SetBinContent(i+1, value[i]-1024);
-
-     c->Modified();
-     c->Update();
-     */
+
+        SetLedColor(fFadLEDEventBuilder, ptr[40]==0?kLedRed:kLedGreen, d.time);
+    }
 
     // ===================== FTM ============================================
@@ -1077,5 +1118,5 @@
             return;
 
-        const double avgrate = sdata.fTimeStamp>0 ? double(sdata.fTriggerCounter)/sdata.fTimeStamp*1000000 : 1;
+//        const double avgrate = sdata.fTimeStamp>0 ? double(sdata.fTriggerCounter)/sdata.fTimeStamp*1000000 : 1;
 
         const double t1 = h->GetXaxis()->GetXmax();
@@ -1800,4 +1841,7 @@
             return PostInfoHandler(&FactGui::handleFadCurrentEvent);
 
+	if (getInfo()==&fDimFadEventData)
+            return PostInfoHandler(&FactGui::handleFadEventData);
+
 /*
         if (getInfo()==&fDimFadSetup)
@@ -2223,11 +2267,11 @@
         fDimFadEvents        ("FAD_CONTROL/EVENTS",          (void*)NULL, 0, this),
         fDimFadCurrentEvent  ("FAD_CONTROL/CURRENT_EVENT",   (void*)NULL, 0, this),
+        fDimFadEventData     ("FAD_CONTROL/EVENT_DATA",      (void*)NULL, 0, this),
         fDimFadConnections   ("FAD_CONTROL/CONNECTIONS",     (void*)NULL, 0, this)
     {
-        fClockCondFreq->addItem("-/-", QVariant(-1));
-        fClockCondFreq->addItem("700 MHz", QVariant(700));
+        fClockCondFreq->addItem("--- Hz",  QVariant(-1));
+        fClockCondFreq->addItem("800 MHz", QVariant(800));
         fClockCondFreq->addItem("1 GHz",   QVariant(1000));
         fClockCondFreq->addItem("2 GHz",   QVariant(2000));
-        fClockCondFreq->addItem("2 GHz (*)",   QVariant(2001));
         fClockCondFreq->addItem("3 GHz",   QVariant(3000));
         fClockCondFreq->addItem("4 GHz",   QVariant(4000));
