Index: trunk/FACT++/gui/FactGui.h
===================================================================
--- trunk/FACT++/gui/FactGui.h	(revision 11854)
+++ trunk/FACT++/gui/FactGui.h	(revision 11855)
@@ -356,4 +356,70 @@
 
 
+struct PixelMapEntry
+{
+    int index;
+    int cbpx;
+    int gapd;
+    int hv_board;
+    int hv_channel;
+
+    int crate() const { return cbpx/1000; }
+    int board() const { return (cbpx/100)%10; }
+    int patch() const { return (cbpx/10)%10; }
+    int pixel() const { return cbpx%10; }
+    int group() const { return pixel()>4; }
+    int hv() const    { return hv_channel+hv_board*32; }
+};
+
+class PixelMap : public vector<PixelMapEntry>
+{
+public:
+    static const PixelMapEntry empty;
+
+    PixelMap() : vector<PixelMapEntry>(1440)
+    {
+    }
+
+    const PixelMapEntry &index(int idx) const
+    {
+        for (vector<PixelMapEntry>::const_iterator it=begin(); it!=end(); it++)
+            if (it->index==idx)
+                return *it;
+        cerr << "PixelMap: index " << idx << " not found" << endl;
+        return empty;
+    }
+
+    const PixelMapEntry &cbpx(int c) const
+    {
+        for (vector<PixelMapEntry>::const_iterator it=begin(); it!=end(); it++)
+            if (it->cbpx==c)
+                return *it;
+        cerr << "PixelMap: cbpx " << c << " not found" << endl;
+        return empty;
+    }
+
+    const PixelMapEntry &cbpx(int c, int b, int p, int px) const
+    {
+        return cbpx(px + p*9 + b*36 + c*360);
+    }
+
+    const PixelMapEntry &hv(int board, int channel) const
+    {
+        for (vector<PixelMapEntry>::const_iterator it=begin(); it!=end(); it++)
+            if (it->hv_board==board && it->hv_channel==channel)
+                return *it;
+        cerr << "PixelMap: hv " << board << "/" << channel << " not found" << endl;
+        return empty;
+    }
+
+    const PixelMapEntry &hv(int idx) const
+    {
+        return hv(idx/32, idx%32);
+    }
+};
+
+const PixelMapEntry PixelMap::empty = { 0, 0, 0, 0, 0 };
+
+
 class FactGui : public MainWindow, public DimNetwork
 {
@@ -373,4 +439,6 @@
     valarray<int8_t> fFtuStatus;
 
+    PixelMap fPixelMap;
+
     vector<int>  fPixelMapHW; // Software -> Hardware
     vector<int>  fPatchMapHW; // Software -> Hardware
@@ -378,5 +446,6 @@
 
     bool fInChoosePatchTH;   // FIXME. Find a better solution
-    bool fInChoosePatchBias; // FIXME. Find a better solution
+    bool fInChooseBiasHv;    // FIXME. Find a better solution
+    bool fInChooseBiasCam;   // FIXME. Find a better solution
 
     DimStampedInfo fDimDNS;
@@ -420,5 +489,5 @@
     DimStampedInfo fDimFscHumidity;
 
-    //DimStampedInfo fDimBiasVolt;
+    DimStampedInfo fDimBiasVolt;
     DimStampedInfo fDimBiasCurrent;
 
@@ -652,5 +721,5 @@
         if (fServices.find(service)!=fServices.end())
         {
-            cout << "ERROR - We are already subscribed to " << service << endl;
+            cerr << "ERROR - We are already subscribed to " << service << endl;
             return;
         }
@@ -666,5 +735,5 @@
         {
             if (!allow_unsubscribed)
-                cout << "ERROR - We are not subscribed to " << service << endl;
+                cerr << "ERROR - We are not subscribed to " << service << endl;
             return;
         }
@@ -908,5 +977,5 @@
         {
             if (print)
-                cout << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected=" << sz << endl;
+                cerr << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected=" << sz << endl;
             return false;
         }
@@ -1010,5 +1079,5 @@
         if (d.size()<20)
         {
-            cout << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected>=20" << endl;
+            cerr << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected>=20" << endl;
             return;
         }
@@ -1493,5 +1562,5 @@
         if (d.size()<sizeof(EVENT))
         {
-            cout << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected>=" << sizeof(EVENT) << endl;
+            cerr << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected>=" << sizeof(EVENT) << endl;
             return;
         }
@@ -1499,5 +1568,5 @@
         if (d.size()!=sizeof(EVENT)+dat.Roi*4*1440)
         {
-            cout << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected=" << dat.Roi*4*1440+sizeof(EVENT) << " [roi=" << dat.Roi << "]" << endl;
+            cerr << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected=" << dat.Roi*4*1440+sizeof(EVENT) << " [roi=" << dat.Roi << "]" << endl;
             return;
         }
@@ -1939,5 +2008,4 @@
     void UpdateRatesCam(const FTM::DimTriggerRates &sdata)
     {
-#ifdef HAVE_ROOT
         if (fThresholdIdx->value()>=0)
         {
@@ -1960,12 +2028,5 @@
         }
 
-//        TCanvas *c = fRatesCanv->GetCanvas();
-//        Camera *cam = (Camera*)c->FindObject("Camera");
-
         fRatesCanv->SetData(dat);
-
-//        c->Modified();
-//        c->Update();
-#endif
     }
 
@@ -2114,24 +2175,4 @@
         }
 #endif
-    }
-
-    void on_fRatePatch1_valueChanged(int)
-    {
-        DisplayRates();
-    }
-
-    void on_fRatePatch2_valueChanged(int)
-    {
-        DisplayRates();
-    }
-
-    void on_fRateBoard1_valueChanged(int)
-    {
-        DisplayRates();
-    }
-
-    void on_fRateBoard2_valueChanged(int)
-    {
-        DisplayRates();
     }
 
@@ -2452,5 +2493,6 @@
     // ========================== FSC =======================================
 
-    vector<int16_t> fVecBias;
+    vector<int16_t> fVecBiasVolt;
+    vector<int16_t> fVecBiasCurrent;
 
     void handleBiasVolt(const DimData &d)
@@ -2461,6 +2503,7 @@
         const int16_t *ptr = d.ptr<int16_t>();
 
-        fVecBias.assign(ptr, ptr+416);
-        // FIXME: Update displayed value
+        fVecBiasVolt.assign(ptr, ptr+416);
+
+        UpdateBiasValues();
     }
 
@@ -2471,4 +2514,6 @@
 
         const int16_t *ptr = d.ptr<int16_t>();
+
+        fVecBiasCurrent.assign(ptr, ptr+416);
 
         valarray<double> dat(0., 1440);
@@ -2477,13 +2522,15 @@
         for (int i=0; i<1440; i++)
         {
-            const int ihw = fPatchHW[i];
+            const PixelMapEntry &entry = fPixelMap.index(i);
 
             // FIXME: Display Overcurrent
-            dat[i] = abs(ptr[ihw])*5000./4096;
-
-            fBiasCam->SetEnable(i, uint16_t(ptr[ihw])!=0x8000);
+            dat[i] = abs(ptr[entry.hv()])*5000./4096;
+
+            fBiasCam->SetEnable(i, uint16_t(ptr[entry.hv()])!=0x8000);
         }
 
         fBiasCam->SetData(dat);
+
+        UpdateBiasValues();
     }
 
@@ -2924,6 +2971,6 @@
             return PostInfoHandler(&FactGui::handleFscHumidity);
 
-//        if (getInfo()==&fDimBiasVolt)
-//            return PostInfoHandler(&FactGui::handleBiasVolt);
+        if (getInfo()==&fDimBiasVolt)
+            return PostInfoHandler(&FactGui::handleBiasVolt);
 
         if (getInfo()==&fDimBiasCurrent)
@@ -3095,9 +3142,10 @@
     }
 
+    /*
     void ChoosePatchBias(Camera &cam, int isw)
     {
         cam.Reset();
 
-        fBiasPixel->setValue(isw);
+        fBiasChannel->setValue(isw);
 
         const int ihw = isw<0 ? 0 : fPatchMapHW[isw];
@@ -3127,5 +3175,5 @@
             // FIXME: Mapping
             fBiasVoltDac->setValue(fVecBias[ihw]);
-            fBiasVolt->setValue(fVecBias[ihw]*90/4096);
+            fBiasVolt->setValue(fVecBias[ihw]*90./4096);
         }
 
@@ -3136,5 +3184,5 @@
             if (fPatchHW[i]==ihw)
                 cam.SetBold(i);
-    }
+    }*/
 
     void slot_ChoosePixelThreshold(int isw)
@@ -3144,12 +3192,4 @@
         const bool on = fFtmStaticData.IsEnabled(ihw);
         fPixelEnable->setChecked(on);
-    }
-
-    void slot_ChoosePixelBias(int isw)
-    {
-        fBiasPixel->setValue(isw);
-        //const uint16_t ihw = fPixelMapHW[isw];
-        //const bool on = fFtmStaticData.IsEnabled(ihw);
-        //fPixelEnable->setChecked(on);
     }
 
@@ -3207,23 +3247,4 @@
     }
 
-    void UpdateBiasIdx()
-    {
-        if (fInChoosePatchBias)
-            return;
-
-        const int crate = fBiasCrate->value();
-        const int board = fBiasBoard->value();
-        const int patch = fBiasPatch->value();
-
-        const int ihw = patch + board*4 + crate*40;
-
-        int isw = 0;
-        for (; isw<160; isw++)
-            if (ihw==fPatchMapHW[isw])
-                break;
-
-        on_fBiasPixel_valueChanged(isw);
-    }
-
     void on_fPixelIdx_valueChanged(int isw)
     {
@@ -3242,20 +3263,89 @@
     }
 
-    void on_fBiasPixel_valueChanged(int isw)
-    {
-        const int  ihw = fPixelMapHW[isw];
-
-        int ii = 0;
-        for (; ii<160; ii++)
-            if (fPatchHW[isw]==fPatchMapHW[ii])
-                break;
-
-        fBiasCam->SetWhite(isw);
-        ChoosePatchBias(*fRatesCanv, ii);
-
-        const bool on  = fFtmStaticData.IsEnabled(ihw);
-        fPixelEnable->setChecked(on);
-    }
-
+    // ------------------- Bias display ---------------------
+
+    void UpdateBiasValues()
+    {
+        const int b = fBiasHvBoard->value();
+        const int c = fBiasHvChannel->value();
+
+        const int ihw = b*32+c;
+
+        if (fVecBiasVolt.size()>0)
+        {
+            fBiasVoltDac->setValue(fVecBiasVolt[ihw]);
+            fBiasVolt->setValue(fVecBiasVolt[ihw]*90./4096);
+        }
+
+        if (fVecBiasCurrent.size()>0)
+            fBiasCurrent->setValue(fVecBiasCurrent[ihw]*5000./4096);
+    }
+
+    void UpdateBiasCam(const PixelMapEntry &entry)
+    {
+        fInChooseBiasCam = true;
+
+        fBiasCamCrate->setValue(entry.crate());
+        fBiasCamBoard->setValue(entry.board());
+        fBiasCamPatch->setValue(entry.patch());
+        fBiasCamPixel->setValue(entry.pixel());
+
+        fInChooseBiasCam = false;
+    }
+
+    void UpdateBiasHv(const PixelMapEntry &entry)
+    {
+        fInChooseBiasHv = true;
+
+        fBiasHvBoard->setValue(entry.hv_board);
+        fBiasHvChannel->setValue(entry.hv_channel);
+
+        fInChooseBiasHv = false;
+    }
+
+    void BiasHvChannelChanged()
+    {
+        if (fInChooseBiasHv)
+            return;
+
+        const int b  = fBiasHvBoard->value();
+        const int ch = fBiasHvChannel->value();
+
+        const PixelMapEntry &entry = fPixelMap.hv(b, ch);
+        fBiasCam->SetWhite(entry.index);
+        fBiasCam->updateGL();
+        // FIXME: mark patch in camera
+        UpdateBiasCam(entry);
+        UpdateBiasValues();
+    }
+
+    void BiasCamChannelChanged()
+    {
+        if (fInChooseBiasCam)
+            return;
+
+        const int crate = fBiasCamCrate->value();
+        const int board = fBiasCamBoard->value();
+        const int patch = fBiasCamPatch->value();
+        const int pixel = fBiasCamPixel->value();
+
+        const PixelMapEntry &entry = fPixelMap.cbpx(crate, board, patch, pixel);
+        fBiasCam->SetWhite(entry.index);
+        fBiasCam->updateGL();
+        // FIXME: mark patch in camera
+        UpdateBiasHv(entry);
+        UpdateBiasValues();
+    }
+
+    void slot_ChooseBiasChannel(int isw)
+    {
+        const PixelMapEntry &entry = fPixelMap.index(isw);
+
+        UpdateBiasHv(entry);
+        UpdateBiasCam(entry);
+        UpdateBiasValues();
+    }
+
+    // ------------------------------------------------------
 
     void on_fPixelEnable_stateChanged(int b)
@@ -3344,7 +3434,8 @@
 public:
     FactGui(Configuration &conf) :
-        fFtuStatus(40),
+        fFtuStatus(40), 
         fPixelMapHW(1440), fPatchMapHW(160), fPatchHW(1440),
-        fInChoosePatchTH(false), fInChoosePatchBias(false),
+        fInChoosePatchTH(false),
+        fInChooseBiasHv(false), fInChooseBiasCam(false),
         fDimDNS("DIS_DNS/VERSION_NUMBER", 1, int(0), this),
         //-
@@ -3387,10 +3478,9 @@
         fDimFscHumidity        ("FSC_CONTROL/HUMIDITY",           (void*)NULL, 0, this),
         //-
-        //fDimBiasVolt           ("BIAS_CONTROL/VOLTAGE",           (void*)NULL, 0, this),
+        fDimBiasVolt           ("BIAS_CONTROL/VOLTAGE",           (void*)NULL, 0, this),
         fDimBiasCurrent        ("BIAS_CONTROL/CURRENT",           (void*)NULL, 0, this),
         //-
         fEventData(0), fDrsCalibration(1440*1024*6),
 	fTimeStamp0(0)
-
     {
         fClockCondFreq->addItem("--- Hz",  QVariant(-1));
@@ -3448,9 +3538,51 @@
         // --------------------------------------------------------------------------
 
+        ifstream fin0("FACTmapV5.txt");
+
+        int l = 0;
+
+        string buf;
+        while (getline(fin0, buf, '\n'))
+        {
+            if (l>1439)
+                break;
+
+            buf = Tools::Trim(buf);
+            if (buf[0]=='#')
+                continue;
+
+            stringstream str(buf);
+
+            int   idummy;
+            float fdummy;
+
+            PixelMapEntry entry;
+
+            str >> entry.index;
+            str >> entry.cbpx;
+            str >> idummy;
+            str >> idummy;
+            str >> entry.gapd;
+            str >> fdummy;
+            str >> entry.hv_board;
+            str >> entry.hv_channel;
+            str >> fdummy;
+            str >> fdummy;
+            str >> fdummy;
+
+            fPixelMap[l++] = entry;
+        }
+
+        if (l!=1440)
+        {
+            cerr << "ERROR - Problems reading FACTmapV5.txt" << endl;
+            exit(-1);
+        }
+
+        // --------------------------------------------------------------------------
+
         ifstream fin1("Trigger-Patches.txt");
 
-        int l = 0;
-
-        string buf;
+        l = 0;
         while (getline(fin1, buf, '\n'))
         {
@@ -3608,4 +3740,10 @@
         // --------------------------------------------------------------------------
 
+        fBiasCam->SetMin(fBiasMin->value());
+        fBiasCam->SetMax(fBiasMax->value());
+        fBiasCam->updateGL();
+
+        // --------------------------------------------------------------------------
+
         fRatesCanv->SetMin(fRatesMin->value());
         fRatesCanv->SetMax(fRatesMax->value());
@@ -3657,5 +3795,5 @@
                 this, SLOT(slot_ChoosePixelThreshold(int)));
         connect(fBiasCam, SIGNAL(signalCurrentPixel(int)),
-                this, SLOT(slot_ChoosePixelBias(int)));
+                this, SLOT(slot_ChooseBiasChannel(int)));
         connect(fFtmRateCanv, SIGNAL(     RootEventProcessed(TObject*, unsigned int, TCanvas*)),
                 this,         SLOT  (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*)));
Index: trunk/FACT++/gui/design.ui
===================================================================
--- trunk/FACT++/gui/design.ui	(revision 11854)
+++ trunk/FACT++/gui/design.ui	(revision 11855)
@@ -3008,5 +3008,5 @@
                      </property>
                      <property name="maximum">
-                      <number>4</number>
+                      <number>3</number>
                      </property>
                     </widget>
@@ -3350,80 +3350,53 @@
                   <widget class="QLabel" name="label_202">
                    <property name="text">
-                    <string>Pixel</string>
+                    <string>Bias supply</string>
+                   </property>
+                   <property name="alignment">
+                    <set>Qt::AlignCenter</set>
                    </property>
                   </widget>
                  </item>
                  <item>
-                  <layout class="QHBoxLayout" name="horizontalLayout_43">
+                  <layout class="QGridLayout" name="gridLayout_87">
                    <property name="topMargin">
                     <number>0</number>
                    </property>
-                   <item>
-                    <widget class="QSpinBox" name="fBiasPixel">
+                   <item row="1" column="0">
+                    <widget class="QSpinBox" name="fBiasHvBoard">
                      <property name="alignment">
                       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
                      </property>
                      <property name="maximum">
-                      <number>1439</number>
+                      <number>9</number>
                      </property>
                     </widget>
                    </item>
-                   <item>
-                    <widget class="QCheckBox" name="fPixelEnable_2">
-                     <property name="enabled">
-                      <bool>false</bool>
-                     </property>
-                     <property name="maximumSize">
-                      <size>
-                       <width>20</width>
-                       <height>16777215</height>
-                      </size>
-                     </property>
+                   <item row="0" column="0">
+                    <widget class="QLabel" name="label_229">
                      <property name="text">
-                      <string/>
+                      <string>Board</string>
                      </property>
                     </widget>
                    </item>
-                  </layout>
-                 </item>
-                 <item>
-                  <layout class="QHBoxLayout" name="horizontalLayout_44">
-                   <property name="topMargin">
-                    <number>0</number>
-                   </property>
-                   <item>
-                    <widget class="QPushButton" name="fPixelEnableAll_2">
-                     <property name="enabled">
-                      <bool>false</bool>
-                     </property>
+                   <item row="0" column="1">
+                    <widget class="QLabel" name="label_230">
                      <property name="text">
-                      <string>Enable all</string>
+                      <string>Channel</string>
                      </property>
                     </widget>
                    </item>
-                   <item>
-                    <widget class="QPushButton" name="fPixelDisableAll_2">
-                     <property name="enabled">
+                   <item row="1" column="1">
+                    <widget class="QSpinBox" name="fBiasHvChannel">
+                     <property name="alignment">
+                      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                     </property>
+                     <property name="readOnly">
                       <bool>false</bool>
                      </property>
-                     <property name="text">
-                      <string>Disable all</string>
-                     </property>
-                    </widget>
-                   </item>
-                  </layout>
-                 </item>
-                 <item>
-                  <layout class="QHBoxLayout" name="horizontalLayout_45">
-                   <property name="topMargin">
-                    <number>0</number>
-                   </property>
-                   <item>
-                    <widget class="QPushButton" name="fPixelDisableOthers_2">
-                     <property name="enabled">
-                      <bool>false</bool>
-                     </property>
-                     <property name="text">
-                      <string>Disable others</string>
+                     <property name="buttonSymbols">
+                      <enum>QAbstractSpinBox::UpDownArrows</enum>
+                     </property>
+                     <property name="maximum">
+                      <number>31</number>
                      </property>
                     </widget>
@@ -3450,62 +3423,10 @@
                   <widget class="QLabel" name="label_206">
                    <property name="text">
-                    <string>Patch</string>
+                    <string>Camera</string>
+                   </property>
+                   <property name="alignment">
+                    <set>Qt::AlignCenter</set>
                    </property>
                   </widget>
-                 </item>
-                 <item>
-                  <widget class="QSpinBox" name="fBiasPatch">
-                   <property name="alignment">
-                    <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-                   </property>
-                   <property name="readOnly">
-                    <bool>false</bool>
-                   </property>
-                   <property name="specialValueText">
-                    <string>all</string>
-                   </property>
-                   <property name="minimum">
-                    <number>-1</number>
-                   </property>
-                   <property name="maximum">
-                    <number>159</number>
-                   </property>
-                   <property name="value">
-                    <number>0</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item>
-                  <layout class="QHBoxLayout" name="horizontalLayout_46">
-                   <property name="topMargin">
-                    <number>0</number>
-                   </property>
-                   <item>
-                    <widget class="QPushButton" name="fThresholdDisableOthers_2">
-                     <property name="enabled">
-                      <bool>false</bool>
-                     </property>
-                     <property name="text">
-                      <string>Disable others</string>
-                     </property>
-                    </widget>
-                   </item>
-                  </layout>
-                 </item>
-                 <item>
-                  <spacer name="verticalSpacer_62">
-                   <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>5</height>
-                    </size>
-                   </property>
-                  </spacer>
                  </item>
                  <item>
@@ -3515,5 +3436,5 @@
                    </property>
                    <item row="1" column="0">
-                    <widget class="QSpinBox" name="fBiasCrate">
+                    <widget class="QSpinBox" name="fBiasCamCrate">
                      <property name="alignment">
                       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -3525,5 +3446,5 @@
                    </item>
                    <item row="1" column="1">
-                    <widget class="QSpinBox" name="fBiasBoard">
+                    <widget class="QSpinBox" name="fBiasCamBoard">
                      <property name="alignment">
                       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -3531,21 +3452,4 @@
                      <property name="maximum">
                       <number>9</number>
-                     </property>
-                    </widget>
-                   </item>
-                   <item row="1" column="3">
-                    <widget class="QSpinBox" name="fBiasPatch_2">
-                     <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_222">
-                     <property name="text">
-                      <string>Patch</string>
                      </property>
                     </widget>
@@ -3562,4 +3466,47 @@
                      <property name="text">
                       <string>Board</string>
+                     </property>
+                    </widget>
+                   </item>
+                   <item row="2" column="0">
+                    <widget class="QLabel" name="label_222">
+                     <property name="text">
+                      <string>Patch</string>
+                     </property>
+                    </widget>
+                   </item>
+                   <item row="3" column="0">
+                    <widget class="QSpinBox" name="fBiasCamPatch">
+                     <property name="alignment">
+                      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                     </property>
+                     <property name="maximum">
+                      <number>3</number>
+                     </property>
+                    </widget>
+                   </item>
+                   <item row="2" column="1">
+                    <widget class="QLabel" name="label_231">
+                     <property name="text">
+                      <string>Pixel</string>
+                     </property>
+                    </widget>
+                   </item>
+                   <item row="3" column="1">
+                    <widget class="QSpinBox" name="fBiasCamPixel">
+                     <property name="alignment">
+                      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                     </property>
+                     <property name="readOnly">
+                      <bool>false</bool>
+                     </property>
+                     <property name="buttonSymbols">
+                      <enum>QAbstractSpinBox::UpDownArrows</enum>
+                     </property>
+                     <property name="maximum">
+                      <number>8</number>
+                     </property>
+                     <property name="singleStep">
+                      <number>1</number>
                      </property>
                     </widget>
@@ -3638,4 +3585,11 @@
                  </item>
                  <item>
+                  <widget class="QCheckBox" name="fBiasApplyGlobal">
+                   <property name="text">
+                    <string>Apply globally</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
                   <spacer name="verticalSpacer_64">
                    <property name="orientation">
@@ -3672,5 +3626,5 @@
                    </property>
                    <property name="suffix">
-                    <string> mA</string>
+                    <string> µA</string>
                    </property>
                    <property name="maximum">
@@ -3737,5 +3691,5 @@
                    </property>
                    <property name="suffix">
-                    <string> Hz</string>
+                    <string> µA</string>
                    </property>
                    <property name="minimum">
@@ -3743,5 +3697,8 @@
                    </property>
                    <property name="maximum">
-                    <number>2147483647</number>
+                    <number>5000</number>
+                   </property>
+                   <property name="value">
+                    <number>0</number>
                    </property>
                   </widget>
@@ -3775,5 +3732,5 @@
                    </property>
                    <property name="suffix">
-                    <string> Hz</string>
+                    <string> µA</string>
                    </property>
                    <property name="minimum">
@@ -3781,8 +3738,8 @@
                    </property>
                    <property name="maximum">
-                    <number>2147483647</number>
+                    <number>5000</number>
                    </property>
                    <property name="value">
-                    <number>1000</number>
+                    <number>5000</number>
                    </property>
                   </widget>
@@ -14930,6 +14887,6 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1141</x>
-     <y>772</y>
+     <x>1191</x>
+     <y>774</y>
     </hint>
     <hint type="destinationlabel">
@@ -14946,6 +14903,6 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1176</x>
-     <y>772</y>
+     <x>1226</x>
+     <y>774</y>
     </hint>
     <hint type="destinationlabel">
@@ -14962,5 +14919,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1130</x>
+     <x>1180</x>
      <y>109</y>
     </hint>
@@ -14978,5 +14935,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1165</x>
+     <x>1215</x>
      <y>109</y>
     </hint>
@@ -15026,5 +14983,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1130</x>
+     <x>1180</x>
      <y>105</y>
     </hint>
@@ -15042,5 +14999,5 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1165</x>
+     <x>1215</x>
      <y>105</y>
     </hint>
@@ -15218,6 +15175,6 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1130</x>
-     <y>442</y>
+     <x>1180</x>
+     <y>443</y>
     </hint>
     <hint type="destinationlabel">
@@ -15234,6 +15191,6 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1165</x>
-     <y>442</y>
+     <x>1215</x>
+     <y>443</y>
     </hint>
     <hint type="destinationlabel">
@@ -15250,6 +15207,6 @@
    <hints>
     <hint type="sourcelabel">
-     <x>1086</x>
-     <y>423</y>
+     <x>1215</x>
+     <y>438</y>
     </hint>
     <hint type="destinationlabel">
