Index: trunk/FACT++/gui/FactGui.h
===================================================================
--- trunk/FACT++/gui/FactGui.h	(revision 10732)
+++ trunk/FACT++/gui/FactGui.h	(revision 10733)
@@ -866,4 +866,59 @@
         fFtmTime->setText(QString::number(sdata.fTimeStamp));
         fTriggerCounter->setText(QString::number(sdata.fTriggerCounter));
+
+
+        // ----------------------------------------------
+#ifdef HAVE_ROOT
+
+        if (fTriggerCounter0<0)
+        {
+            fTriggerCounter0 = sdata.fTriggerCounter;
+            return;
+        }
+
+        TCanvas *c = fFtmRateCanv->GetCanvas();
+
+        TH1 *h = (TH1*)c->FindObject("TimeFrame");
+
+        const double rate = sdata.fTriggerCounter-fTriggerCounter0;
+        fTriggerCounter0 = sdata.fTriggerCounter;
+
+        if (rate<0)
+        {
+            fGraphFtmRate.Set(0);
+
+            const double tm = Time().RootTime();
+
+            h->SetBins(1, tm, tm+60);
+            h->GetXaxis()->SetTimeFormat("%M'%S\"");
+            h->GetXaxis()->SetTitle("Time");
+
+            c->Modified();
+            c->Update();
+            return;
+        }
+
+        const double avgrate = sdata.fTimeStamp>0 ? double(sdata.fTriggerCounter)/sdata.fTimeStamp : 1;
+
+        const double t1 = h->GetXaxis()->GetXmax();
+        const double t0 = h->GetXaxis()->GetXmin();
+
+        h->SetBins(h->GetNbinsX()+1, t0, t0+sdata.fTriggerCounter+1);
+        fGraphFtmRate.SetPoint(fGraphFtmRate.GetN(),
+                               t0+sdata.fTriggerCounter, rate);
+
+        if (t1-t0>60)
+        {
+            h->GetXaxis()->SetTimeFormat("%Hh%M'");
+            h->GetXaxis()->SetTitle("Time");
+        }
+
+        h->SetMinimum(0);
+        h->SetMaximum(2*avgrate);
+
+        c->Modified();
+        c->Update();
+#endif
+        // ----------------------------------------------
     }
 
@@ -889,4 +944,6 @@
     }
 
+    int64_t fTriggerCounter0;
+
     void handleFtmDynamicData(const DimData &d)
     {
@@ -911,6 +968,8 @@
 
 
+#ifdef HAVE_ROOT
+
         // ----------------------------------------------
-#ifdef HAVE_ROOT
+/*
         TCanvas *c = fFtmTempCanv->GetCanvas();
 
@@ -920,5 +979,5 @@
         double tm = d.time.RootTime();
 
-        TH1 *h = (TH1*)c->FindObject("MyFrame");
+        TH1 *h = (TH1*)c->FindObject("TimeFrame");
         h->FindBin(tm);
 
@@ -930,5 +989,5 @@
         c->Modified();
         c->Update();
-
+*/
         // ----------------------------------------------
 
@@ -938,5 +997,5 @@
             dat[i] = sdata.fRatePatch[fPatch[i]];
 
-        c = fRatesCanv->GetCanvas();
+        TCanvas *c = fRatesCanv->GetCanvas();
         Camera *cam = (Camera*)c->FindObject("Camera");
 
@@ -1057,4 +1116,6 @@
             cam->SetEnable(i, sdata.IsEnabled(i));
 #endif
+
+        fPixelEnable->setChecked(sdata.IsEnabled(fPixelIdx->value()));
 
         const int patch1 = fThresholdIdx->value();
@@ -1527,4 +1588,6 @@
         cam.SetWhite(idx);
         ChoosePatch(cam, fPatch[idx]);
+
+        fPixelEnable->setChecked(fFtmStaticData.IsEnabled(idx));
     }
 
@@ -1555,4 +1618,6 @@
 
                 ChoosePixel(*cam, idx);
+
+                fPixelIdx->setValue(idx);
             }
             return;
@@ -1624,9 +1689,41 @@
         ChoosePatch(*cam, idx);
     }
+
+    void on_fPixelIdx_valueChanged(int idx)
+    {
+        Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera");
+        ChoosePixel(*cam, idx);
+    }
 #endif
 
     TGraph fGraphFtmTemp[4];
+    TGraph fGraphFtmRate;
 
     map<int, int> fPatch;
+
+#ifdef HAVE_ROOT
+    void DrawTimeFrame(const char *ytitle)
+    {
+        const double tm = Time().RootTime();
+
+        TH1F h("TimeFrame", "", 1, tm, tm+60);//Time().RootTime()-1./24/60/60, Time().RootTime());
+        h.SetDirectory(0);
+//        h.SetBit(TH1::kCanRebin);
+        h.SetStats(kFALSE);
+//        h.SetMinimum(0);
+//        h.SetMaximum(1);
+        h.SetXTitle("Time");
+        h.SetYTitle(ytitle);
+        h.GetXaxis()->CenterTitle();
+	h.GetYaxis()->CenterTitle();
+        h.GetXaxis()->SetTimeDisplay(true);
+        h.GetXaxis()->SetTimeFormat("%Mh%S'");
+	h.GetXaxis()->SetLabelSize(0.025);
+	h.GetYaxis()->SetLabelSize(0.025);
+        h.GetYaxis()->SetTitleOffset(1.2);
+//        h.GetYaxis()->SetTitleSize(1.2);
+        h.DrawCopy();
+    }
+#endif
 
 public:
@@ -1685,4 +1782,5 @@
         // --------------------------------------------------------------------------
 #ifdef HAVE_ROOT
+        /*
         TCanvas *c = fFtmTempCanv->GetCanvas();
         c->SetBit(TCanvas::kNoContextMenu);
@@ -1693,20 +1791,6 @@
         c->SetTopMargin(0.03);
         c->cd();
-
-        TH1F h("MyFrame", "", 1000, 0, 1);//Time().RootTime()-1./24/60/60, Time().RootTime());
-        h.SetDirectory(0);
-        h.SetBit(TH1::kCanRebin);
-        h.SetStats(kFALSE);
-        h.SetMinimum(-20);
-        h.SetMaximum(100);
-        h.SetXTitle("Time");
-        h.SetYTitle("Temperature / °C");
-        h.GetXaxis()->CenterTitle();
-	h.GetYaxis()->CenterTitle();
-        h.GetXaxis()->SetTimeDisplay(true);
-	h.GetXaxis()->SetTimeFormat("%H:%M");
-	h.GetXaxis()->SetLabelSize(0.025);
-//        h.GetYaxis()->SetTitleSize(1.2);
-        h.DrawCopy();
+        */
+        //CreateTimeFrame("Temperature / °C");
 
         fGraphFtmTemp[0].SetMarkerStyle(kFullDotSmall);
@@ -1723,8 +1807,27 @@
         fGraphFtmTemp[3].SetMarkerColor(kGreen);
 
-        fGraphFtmTemp[0].Draw("LP");
-        fGraphFtmTemp[1].Draw("LP");
-        fGraphFtmTemp[2].Draw("LP");
-        fGraphFtmTemp[3].Draw("LP");
+        //fGraphFtmTemp[0].Draw("LP");
+        //fGraphFtmTemp[1].Draw("LP");
+        //fGraphFtmTemp[2].Draw("LP");
+        //fGraphFtmTemp[3].Draw("LP");
+
+        // --------------------------------------------------------------------------
+
+        TCanvas *c = fFtmRateCanv->GetCanvas();
+        c->SetBit(TCanvas::kNoContextMenu);
+        c->SetBorderMode(0);
+        c->SetFrameBorderMode(0);
+        c->SetFillColor(kWhite);
+        c->SetRightMargin(0.03);
+        c->SetTopMargin(0.03);
+        c->SetGrid();
+        c->cd();
+
+        DrawTimeFrame("Trigger rate [Hz]");
+
+        fTriggerCounter0 = -1;
+
+        fGraphFtmRate.SetMarkerStyle(kFullDotSmall);
+        fGraphFtmRate.Draw("LP");
 
         // --------------------------------------------------------------------------
@@ -1748,6 +1851,6 @@
         //widget->EnableSignalEvents(kMouseMoveEvent);
 
-        fFtmTempCanv->setMouseTracking(true);
-        fFtmTempCanv->EnableSignalEvents(kMouseMoveEvent);
+        fFtmRateCanv->setMouseTracking(true);
+        fFtmRateCanv->EnableSignalEvents(kMouseMoveEvent);
 
         fRatesCanv->setMouseTracking(true);
@@ -1756,5 +1859,5 @@
         connect(fRatesCanv,   SIGNAL(     RootEventProcessed(TObject*, unsigned int, TCanvas*)),
                 this,         SLOT  (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*)));
-        connect(fFtmTempCanv, SIGNAL(     RootEventProcessed(TObject*, unsigned int, TCanvas*)),
+        connect(fFtmRateCanv, SIGNAL(     RootEventProcessed(TObject*, unsigned int, TCanvas*)),
                 this,         SLOT  (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*)));
 #endif
Index: trunk/FACT++/gui/MainWindow.h
===================================================================
--- trunk/FACT++/gui/MainWindow.h	(revision 10732)
+++ trunk/FACT++/gui/MainWindow.h	(revision 10733)
@@ -81,4 +81,5 @@
     void on_fThresholdVal_valueChanged(int v);
     virtual void on_fThresholdIdx_valueChanged(int) { }
+    virtual void on_fPixelIdx_valueChanged(int) { }
 
     // Tab: Chat
Index: trunk/FACT++/gui/design.ui
===================================================================
--- trunk/FACT++/gui/design.ui	(revision 10732)
+++ trunk/FACT++/gui/design.ui	(revision 10733)
@@ -52,5 +52,5 @@
       </property>
       <property name="currentIndex">
-       <number>0</number>
+       <number>2</number>
       </property>
       <property name="documentMode">
@@ -494,5 +494,15 @@
                   </widget>
                  </item>
-                 <item row="3" column="3">
+                 <item row="3" column="5">
+                  <widget class="QLabel" name="label_33">
+                   <property name="text">
+                    <string>:</string>
+                   </property>
+                   <property name="alignment">
+                    <set>Qt::AlignCenter</set>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="3" column="6">
                   <widget class="QSpinBox" name="fTriggerSeqLPint">
                    <property name="enabled">
@@ -513,5 +523,5 @@
                   </widget>
                  </item>
-                 <item row="3" column="5">
+                 <item row="3" column="4">
                   <widget class="QSpinBox" name="fTriggerSeqLPext">
                    <property name="enabled">
@@ -532,28 +542,18 @@
                   </widget>
                  </item>
-                 <item row="3" column="4">
-                  <widget class="QLabel" name="label_33">
+                 <item row="2" column="6">
+                  <widget class="QLabel" name="label_36">
                    <property name="text">
-                    <string>:</string>
+                    <string>LPint</string>
                    </property>
                    <property name="alignment">
-                    <set>Qt::AlignCenter</set>
+                    <set>Qt::AlignBottom|Qt::AlignHCenter</set>
                    </property>
                   </widget>
                  </item>
-                 <item row="2" column="5">
+                 <item row="2" column="4">
                   <widget class="QLabel" name="label_38">
                    <property name="text">
                     <string>LPext</string>
-                   </property>
-                   <property name="alignment">
-                    <set>Qt::AlignBottom|Qt::AlignHCenter</set>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="2" column="3">
-                  <widget class="QLabel" name="label_36">
-                   <property name="text">
-                    <string>LPint</string>
                    </property>
                    <property name="alignment">
@@ -998,5 +998,5 @@
                 <widget class="QLabel" name="label_13">
                  <property name="text">
-                  <string>Calibration</string>
+                  <string>LPext</string>
                  </property>
                 </widget>
@@ -1803,5 +1803,5 @@
                   </property>
                   <item row="0" column="0">
-                   <widget class="RootWidget" name="fFtmTempCanv" native="true">
+                   <widget class="RootWidget" name="fFtmRateCanv" native="true">
                     <property name="sizePolicy">
                      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
@@ -2304,4 +2304,57 @@
                <number>0</number>
               </property>
+              <item>
+               <widget class="QLabel" name="label_68">
+                <property name="text">
+                 <string>Pixel</string>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="horizontalLayout_12">
+                <property name="topMargin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <widget class="QSpinBox" name="fPixelIdx">
+                  <property name="alignment">
+                   <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                  </property>
+                  <property name="maximum">
+                   <number>1439</number>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QCheckBox" name="fPixelEnable">
+                  <property name="maximumSize">
+                   <size>
+                    <width>20</width>
+                    <height>16777215</height>
+                   </size>
+                  </property>
+                  <property name="text">
+                   <string/>
+                  </property>
+                 </widget>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <spacer name="verticalSpacer_16">
+                <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>20</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
               <item>
                <widget class="QLabel" name="label_25">
