Index: trunk/FACT++/gui/FactGui.h
===================================================================
--- trunk/FACT++/gui/FactGui.h	(revision 10947)
+++ trunk/FACT++/gui/FactGui.h	(revision 10948)
@@ -1808,31 +1808,4 @@
         }
     }
-    void ChoosePatch(Camera &cam, int idx)
-    {
-        cam.Reset();
-
-        fThresholdIdx->setValue(idx);
-
-        //fThresholdVal->setEnabled(idx>=0);
-        //fThresholdVolt->setEnabled(idx>=0);
-        fPatchRate->setEnabled(idx>=0);
-        if (idx<0)
-            return;
-
-        fThresholdVal->setValue(fFtmStaticData.fThreshold[idx]);
-        fPatchRate->setValue(cam.GetData(idx));
-
-        for (unsigned int i=0; i<fPatch.size(); i++)
-            if (fPatch[i]==idx)
-                cam.SetBold(i);
-    }
-
-    void ChoosePixel(Camera &cam, int idx)
-    {
-        cam.SetWhite(idx);
-        ChoosePatch(cam, fPatch[idx]);
-
-        fPixelEnable->setChecked(fFtmStaticData.IsEnabled(idx));
-    }
 
 #ifdef HAVE_ROOT
@@ -1861,4 +1834,6 @@
                 const int idx = cam->GetIdx(xx, yy);
 
+                cout << "Select: " << idx << endl;
+
                 ChoosePixel(*cam, idx);
 
@@ -1878,5 +1853,5 @@
                 const int idx = cam->GetIdx(xx, yy);
 
-                //cam->Toggle(idx);
+                cout << "Toggle: " << idx << endl;
 
                 Dim::SendCommand("FTM_CONTROL/TOGGLE_PIXEL", uint16_t(idx));
@@ -1934,5 +1909,41 @@
     }
 
-    void on_fThresholdIdx_valueChanged(int idx)
+    void ChoosePatch(Camera &cam, int idx)
+    {
+        cam.Reset();
+
+        fThresholdIdx->setValue(idx);
+
+        const int patch = idx%4;
+        const int board = (idx/4)%10;
+        const int crate = (idx/4)/10;
+
+        fThresholdCrate->setValue(crate);
+        fThresholdBoard->setValue(board);
+        fThresholdPatch->setValue(patch);
+
+        //fThresholdVal->setEnabled(idx>=0);
+        //fThresholdVolt->setEnabled(idx>=0);
+        fPatchRate->setEnabled(idx>=0);
+        if (idx<0)
+            return;
+
+        fThresholdVal->setValue(fFtmStaticData.fThreshold[idx]);
+        fPatchRate->setValue(cam.GetData(idx));
+
+        for (unsigned int i=0; i<fPatch.size(); i++)
+            if (fPatch[i]==idx)
+                cam.SetBold(i);
+    }
+
+    void ChoosePixel(Camera &cam, int idx)
+    {
+        cam.SetWhite(idx);
+        ChoosePatch(cam, fPatch[idx]);
+
+        fPixelEnable->setChecked(fFtmStaticData.IsEnabled(idx));
+    }
+
+    void UpdatePatch(int idx)
     {
         Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera");
@@ -1940,8 +1951,40 @@
     }
 
+    void on_fThresholdIdx_valueChanged(int idx)
+    {
+        UpdatePatch(idx);
+    }
+
+    void UpdateThresholdIdx()
+    {
+        const int crate = fThresholdCrate->value();
+        const int board = fThresholdBoard->value();
+        const int patch = fThresholdPatch->value();
+
+        const int id = patch + board*4 + crate*40;
+
+        UpdatePatch(id);
+    }
+
+    void on_fThresholdPatch_valueChanged(int)
+    {
+        UpdateThresholdIdx();
+    }
+    void on_fThresholdBoard_valueChanged(int)
+    {
+        UpdateThresholdIdx();
+    }
+    void on_fThresholdCrate_valueChanged(int)
+    {
+        UpdateThresholdIdx();
+    }
+
     void on_fPixelIdx_valueChanged(int idx)
     {
         Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera");
         ChoosePixel(*cam, idx);
+
+        fRatesCanv->GetCanvas()->Modified();
+        fRatesCanv->GetCanvas()->Update();
     }
 #endif
Index: trunk/FACT++/gui/MainWindow.h
===================================================================
--- trunk/FACT++/gui/MainWindow.h	(revision 10947)
+++ trunk/FACT++/gui/MainWindow.h	(revision 10948)
@@ -88,4 +88,7 @@
     void on_fThresholdVal_valueChanged(int);
     virtual void on_fThresholdIdx_valueChanged(int) { }
+    virtual void on_fThresholdCrate_valueChanged(int) { }
+    virtual void on_fThresholdBoard_valueChanged(int) { }
+    virtual void on_fThresholdPatch_valueChanged(int) { }
     virtual void on_fPixelIdx_valueChanged(int) { }
 
Index: trunk/FACT++/gui/design.ui
===================================================================
--- trunk/FACT++/gui/design.ui	(revision 10947)
+++ trunk/FACT++/gui/design.ui	(revision 10948)
@@ -52,5 +52,5 @@
       </property>
       <property name="currentIndex">
-       <number>3</number>
+       <number>2</number>
       </property>
       <property name="documentMode">
@@ -2547,4 +2547,78 @@
                   <width>20</width>
                   <height>5</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <layout class="QGridLayout" name="gridLayout_40">
+                <property name="topMargin">
+                 <number>0</number>
+                </property>
+                <item row="1" column="0">
+                 <widget class="QSpinBox" name="fThresholdCrate">
+                  <property name="alignment">
+                   <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                  </property>
+                  <property name="maximum">
+                   <number>3</number>
+                  </property>
+                 </widget>
+                </item>
+                <item row="1" column="1">
+                 <widget class="QSpinBox" name="fThresholdBoard">
+                  <property name="alignment">
+                   <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                  </property>
+                  <property name="maximum">
+                   <number>9</number>
+                  </property>
+                 </widget>
+                </item>
+                <item row="1" column="3">
+                 <widget class="QSpinBox" name="fThresholdPatch">
+                  <property name="alignment">
+                   <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                  </property>
+                  <property name="maximum">
+                   <number>4</number>
+                  </property>
+                 </widget>
+                </item>
+                <item row="0" column="3">
+                 <widget class="QLabel" name="label_130">
+                  <property name="text">
+                   <string>Patch ID</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="0" column="1">
+                 <widget class="QLabel" name="label_131">
+                  <property name="text">
+                   <string>Board ID</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="0" column="0">
+                 <widget class="QLabel" name="label_132">
+                  <property name="text">
+                   <string>Crate ID</string>
+                  </property>
+                 </widget>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <spacer name="verticalSpacer_27">
+                <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>40</height>
                  </size>
                 </property>
