Index: /trunk/FACT++/gui/FactGui.h
===================================================================
--- /trunk/FACT++/gui/FactGui.h	(revision 11801)
+++ /trunk/FACT++/gui/FactGui.h	(revision 11802)
@@ -26,5 +26,5 @@
 #include "TSystem.h"
 #include "TGraph.h"
-#include "TH1.h"
+#include "TH2.h"
 #include "TBox.h"
 #include "TStyle.h"
@@ -1178,5 +1178,7 @@
         TH1 *d2 = dynamic_cast<TH1*>(c->FindObject("DrsCalib2"));
 
-	if (hf && hf->GetNbinsX()!=fEventData->Roi)
+        if ((hf && hf->GetNbinsX()!=fEventData->Roi) ||
+            (dynamic_cast<TH2*>(h) && !fAdcPersistant->isChecked()) ||
+            (!dynamic_cast<TH2*>(h) && fAdcPersistant->isChecked()))
         {
             delete hf;
@@ -1197,16 +1199,25 @@
             hf->SetDirectory(0);
             hf->SetBit(kCanDelete);
-	    hf->SetStats(kFALSE);
-	    hf->SetYTitle("Voltage [mV]");
-	    hf->GetXaxis()->CenterTitle();
-	    hf->GetYaxis()->CenterTitle();
-	    hf->SetMinimum(-1026);
-	    hf->SetMaximum(1025);
-
-            h = new TH1F("EventData", "", roi, -0.5, roi-0.5);
+            hf->SetStats(kFALSE);
+            hf->SetYTitle("Voltage [mV]");
+            hf->GetXaxis()->CenterTitle();
+            hf->GetYaxis()->CenterTitle();
+            hf->SetMinimum(-1250);
+            hf->SetMaximum(2150);
+
+            if (!fAdcPersistant->isChecked())
+                h = new TH1F("EventData", "", roi, -0.5, roi-0.5);
+            else
+            {
+                h = new TH2F("EventData", "", roi, -0.5, roi-0.5, 3301, -1150.5, 2150.5);
+                h->SetContour(50);
+                gStyle->SetPalette(1, 0);
+            }
+
             h->SetDirectory(0);
             h->SetBit(kCanDelete);
-	    h->SetMarkerStyle(kFullDotMedium);
-	    h->SetMarkerColor(kBlue);
+            h->SetMarkerStyle(kFullDotMedium);
+            h->SetMarkerColor(kBlue);
+
 
             d0 = new TH1F("DrsCalib0", "", roi, -0.5, roi-0.5);
@@ -1232,8 +1243,14 @@
 
             hf->Draw("");
+
+            if (dynamic_cast<TH2*>(h))
+                h->Draw("col same");
+
             d0->Draw("PEX0same");
 	    d1->Draw("PEX0same");
-	    d2->Draw("PEX0same");
-            h->Draw("PLsame");
+            d2->Draw("PEX0same");
+
+            if (!dynamic_cast<TH2*>(h))
+                h->Draw("PLsame");
 
             gPad = NULL;
@@ -1269,5 +1286,6 @@
             d2->Reset();
 
-        h->SetEntries(0);
+        if (!dynamic_cast<TH2*>(h))
+            h->Reset();
         d0->SetEntries(0);
         d1->SetEntries(0);
@@ -1276,5 +1294,8 @@
         for (int i=0; i<fEventData->Roi; i++)
         {
-            h->SetBinContent(i+1, reinterpret_cast<float*>(fEventData->Adc_Data)[p*fEventData->Roi+i]);
+            //if (dynamic_cast<TH2*>(h))
+                h->Fill(i, reinterpret_cast<float*>(fEventData->Adc_Data)[p*fEventData->Roi+i]);
+            //else
+            //    h->SetBinContent(i+1, reinterpret_cast<float*>(fEventData->Adc_Data)[p*fEventData->Roi+i]);
             if (start<0)
                 continue;
@@ -1299,6 +1320,5 @@
 
         // -----------------------------------------------------------
-
-        if (fAdcDynamicScale->isChecked())
+        if (fAdcDynamicScale->isEnabled() && fAdcDynamicScale->isChecked())
         {
             h->SetMinimum();
@@ -1308,5 +1328,5 @@
             hf->SetMaximum(h->GetMaximum());
         }
-        if (fAdcManualScale->isChecked())
+        if (fAdcManualScale->isEnabled() && fAdcManualScale->isChecked())
 	{
             if (h->GetMinimumStored()==-1111)
@@ -1322,5 +1342,5 @@
         }
 
-        if (fAdcAutoScale->isChecked())
+        if (fAdcAutoScale->isEnabled() && fAdcAutoScale->isChecked())
         {
             h->SetMinimum();
@@ -1331,4 +1351,10 @@
             if (h->GetMaximum()>hf->GetMaximum())
                 hf->SetMaximum(h->GetMaximum());
+        }
+
+        if (dynamic_cast<TH2*>(h))
+        {
+            h->SetMinimum();
+            h->SetMaximum();
         }
 
@@ -1353,5 +1379,6 @@
         for (int i=0; i<fEventData->Roi; i++)
         {
-            hd.Fill(h->GetBinContent(i+1));
+            if (!dynamic_cast<TH2*>(h))
+                hd.Fill(h->GetBinContent(i+1));
             h0.Fill(d0->GetBinContent(i+1));
             h1.Fill(d1->GetBinContent(i+1));
Index: /trunk/FACT++/gui/design.ui
===================================================================
--- /trunk/FACT++/gui/design.ui	(revision 11801)
+++ /trunk/FACT++/gui/design.ui	(revision 11802)
@@ -11,6 +11,6 @@
     <x>0</x>
     <y>0</y>
-    <width>1316</width>
-    <height>965</height>
+    <width>1186</width>
+    <height>850</height>
    </rect>
   </property>
@@ -53,5 +53,5 @@
       </property>
       <property name="currentIndex">
-       <number>2</number>
+       <number>5</number>
       </property>
       <property name="documentMode">
@@ -6893,4 +6893,27 @@
               </item>
               <item>
+               <spacer name="verticalSpacer_55">
+                <property name="orientation">
+                 <enum>Qt::Vertical</enum>
+                </property>
+                <property name="sizeType">
+                 <enum>QSizePolicy::Fixed</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>20</width>
+                  <height>10</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QCheckBox" name="fAdcPersistant">
+                <property name="text">
+                 <string>Persistant</string>
+                </property>
+               </widget>
+              </item>
+              <item>
                <spacer name="verticalSpacer_32">
                 <property name="orientation">
@@ -8739,5 +8762,5 @@
      <x>0</x>
      <y>0</y>
-     <width>1316</width>
+     <width>1186</width>
      <height>21</height>
     </rect>
@@ -8980,6 +9003,6 @@
    <property name="minimumSize">
     <size>
-     <width>287</width>
-     <height>803</height>
+     <width>241</width>
+     <height>687</height>
     </size>
    </property>
@@ -9908,10 +9931,10 @@
    <hints>
     <hint type="sourcelabel">
-     <x>918</x>
-     <y>647</y>
+     <x>1080</x>
+     <y>772</y>
     </hint>
     <hint type="destinationlabel">
-     <x>773</x>
-     <y>739</y>
+     <x>774</x>
+     <y>821</y>
     </hint>
    </hints>
@@ -9924,5 +9947,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>907</x>
+     <x>1069</x>
      <y>109</y>
     </hint>
@@ -9940,10 +9963,10 @@
    <hints>
     <hint type="sourcelabel">
-     <x>979</x>
-     <y>647</y>
+     <x>1141</x>
+     <y>772</y>
     </hint>
     <hint type="destinationlabel">
-     <x>937</x>
-     <y>739</y>
+     <x>938</x>
+     <y>821</y>
     </hint>
    </hints>
@@ -9956,10 +9979,10 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1014</x>
-     <y>647</y>
+     <x>1176</x>
+     <y>772</y>
     </hint>
     <hint type="destinationlabel">
-     <x>925</x>
-     <y>739</y>
+     <x>926</x>
+     <y>821</y>
     </hint>
    </hints>
@@ -9972,5 +9995,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>968</x>
+     <x>1130</x>
      <y>109</y>
     </hint>
@@ -9988,5 +10011,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1003</x>
+     <x>1165</x>
      <y>109</y>
     </hint>
@@ -10004,10 +10027,10 @@
    <hints>
     <hint type="sourcelabel">
-     <x>946</x>
-     <y>570</y>
+     <x>1108</x>
+     <y>695</y>
     </hint>
     <hint type="destinationlabel">
-     <x>1003</x>
-     <y>571</y>
+     <x>1165</x>
+     <y>696</y>
     </hint>
    </hints>
@@ -10020,5 +10043,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>907</x>
+     <x>1069</x>
      <y>105</y>
     </hint>
@@ -10036,5 +10059,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>968</x>
+     <x>1130</x>
      <y>105</y>
     </hint>
@@ -10052,5 +10075,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1003</x>
+     <x>1165</x>
      <y>105</y>
     </hint>
@@ -10100,10 +10123,10 @@
    <hints>
     <hint type="sourcelabel">
-     <x>946</x>
-     <y>570</y>
+     <x>1108</x>
+     <y>695</y>
     </hint>
     <hint type="destinationlabel">
-     <x>1003</x>
-     <y>571</y>
+     <x>1165</x>
+     <y>696</y>
     </hint>
    </hints>
@@ -10212,6 +10235,6 @@
    <hints>
     <hint type="sourcelabel">
-     <x>907</x>
-     <y>371</y>
+     <x>1069</x>
+     <y>442</y>
     </hint>
     <hint type="destinationlabel">
@@ -10228,6 +10251,6 @@
    <hints>
     <hint type="sourcelabel">
-     <x>968</x>
-     <y>371</y>
+     <x>1130</x>
+     <y>442</y>
     </hint>
     <hint type="destinationlabel">
@@ -10244,6 +10267,6 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1003</x>
-     <y>371</y>
+     <x>1165</x>
+     <y>442</y>
     </hint>
     <hint type="destinationlabel">
@@ -10253,4 +10276,52 @@
    </hints>
   </connection>
+  <connection>
+   <sender>fAdcPersistant</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>fAdcAutoScale</receiver>
+   <slot>setDisabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1086</x>
+     <y>423</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1113</x>
+     <y>382</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>fAdcPersistant</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>fAdcDynamicScale</receiver>
+   <slot>setDisabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1152</x>
+     <y>431</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1153</x>
+     <y>367</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>fAdcPersistant</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>fAdcManualScale</receiver>
+   <slot>setDisabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1134</x>
+     <y>420</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1127</x>
+     <y>342</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
 </ui>
