Index: /trunk/FACT++/gui/FactGui.h
===================================================================
--- /trunk/FACT++/gui/FactGui.h	(revision 17018)
+++ /trunk/FACT++/gui/FactGui.h	(revision 17019)
@@ -121,7 +121,6 @@
     DimStampedInfo fDimFscHumidity;
 
-    DimStampedInfo fDimFeedbackDeviation;
-    DimStampedInfo fDimFeedbackReference;
     DimStampedInfo fDimFeedbackCalibration;
+    DimStampedInfo fDimFeedbackCalibrated;
 
     DimStampedInfo fDimBiasNominal;
@@ -2262,75 +2261,65 @@
 #endif
 
-    void handleFeedbackDeviation(const DimData &d)
-    {
-        if (!CheckSize(d, (2*416+2)*sizeof(float)))
-            return;
-
-        if (d.qos==0)
+    vector <float> fVecFeedbackCurrents;
+
+    void handleFeedbackCalibratedCurrents(const DimData &d)
+    {
+        if (!CheckSize(d, (416+1+1+1+1+1+416+1+1)*sizeof(float)+sizeof(uint32_t)))
             return;
 
         const float *ptr = d.ptr<float>();
-
-        valarray<float> dev(1440);
-        valarray<float> cmd(1440);
-
-        double avgdev = 0;
-        double avgcmd = 0;
-
-        double rmsdev = 0;
-        double rmscmd = 0;
-
+        const float *Uov = ptr+416+6;
+
+        fVecFeedbackCurrents.assign(ptr, ptr+416);
+
+        valarray<double> datc(0., 1440);
+        valarray<double> datu(0., 1440);
+
+        // fPatch converts from software id to software patch id
         for (int i=0; i<1440; i++)
         {
             const PixelMapEntry &entry = fPixelMap.index(i);
 
-            dev[i] = /*1000*/ptr[entry.hv()];
-            cmd[i] = 1000*ptr[entry.hv()+416];
-
-            avgdev += dev[i];
-            avgcmd += cmd[i];
-
-            rmsdev += dev[i]*dev[i];
-            rmscmd += cmd[i]*cmd[i];
-        }
-
-        avgdev /= 1440;
-        avgcmd /= 1440;
-
-        rmsdev = sqrt(rmsdev/1440 - avgdev*avgdev);
-        rmscmd = sqrt(rmscmd/1440 - avgcmd*avgcmd);
-
-        fFeedbackDevCam->SetData(dev);
-        fFeedbackCmdCam->SetData(cmd);
+            datc[i] = fVecFeedbackCurrents[entry.hv()];
+            datu[i] = Uov[entry.hv()];
+
+            if (fVecBiasCurrent.size()>0)
+            {
+                fBiasCamA->SetEnable(i, uint16_t(fVecBiasCurrent[entry.hv()])!=0x8000);
+                fBiasCamA->highlightPixel(i, fVecBiasCurrent[entry.hv()]<0);
+            }
+        }
+
+        fBiasCamA->SetData(datc);
+        fBiasCamA->updateCamera();
+
+        UpdateBiasValues();
+
+        // --------------------------------------------------------
+
+        double avg = 0;
+        double rms = 0;
+
+        for (int i=0; i<320; i++)
+        {
+            avg += Uov[i];
+            rms += Uov[i]*Uov[i];
+        }
+
+        avg /= 320;
+        rms /= 320;
+        rms = sqrt(rms-avg*avg);
+
+
+        fFeedbackDevCam->SetData(datu);
+        //fFeedbackCmdCam->SetData(cmd);
 
         fFeedbackDevCam->updateCamera();
-        fFeedbackCmdCam->updateCamera();
+        //fFeedbackCmdCam->updateCamera();
 
 #ifdef HAVE_ROOT
-        UpdateFeedback(*fFeedbackDev, d.time, fGraphFeedbackDev, avgdev, rmsdev);
-        UpdateFeedback(*fFeedbackCmd, d.time, fGraphFeedbackCmd, avgcmd, rmscmd);
+        UpdateFeedback(*fFeedbackDev, d.time, fGraphFeedbackDev, avg, rms);
+        //UpdateFeedback(*fFeedbackCmd, d.time, fGraphFeedbackCmd, avgcmd, rmscmd);
 #endif
-    }
-
-    void handleFeedbackReference(const DimData &d)
-    {
-        if (!CheckSize(d, 416*sizeof(float)))
-            return;
-
-        const float *ptr = d.ptr<float>();
-
-//        fFeedbackRefCam->SetData(valarray<float>(ptr, 416));
-//        fFeedbackRefCam->updateCamera();
-    }
-
-    vector<float> fBiasOffsets;
-
-    void handleFeedbackCalibration(const DimData &d)
-    {
-        if (!CheckSize(d, 3*416*sizeof(float)))
-            return;
-
-        const float *ptr = d.ptr<float>();
-        fBiasOffsets.assign(ptr+2*416, ptr+3*416);
     }
 
@@ -2461,14 +2450,23 @@
     vector<int16_t> fVecBiasDac;
     vector<int16_t> fVecBiasCurrent;
-    vector<float>   fVecBiasCalibOffset;
-
-    void handleBiasNominal(const DimData &d)
-    {
-        if (!CheckSize(d, 3*416*sizeof(float)))
+
+    void handleBiasVolt(const DimData &d)
+    {
+        if (!CheckSize(d, 416*sizeof(float)))
             return;
 
         const float *ptr = d.ptr<float>();
-
-        fVecBiasCalibOffset.assign(ptr+2*416, ptr+3*416);
+        fVecBiasVolt.assign(ptr, ptr+416);
+
+        on_fBiasDispRefVolt_stateChanged();
+    }
+
+    void handleBiasDac(const DimData &d)
+    {
+        if (!CheckSize(d, 2*416*sizeof(int16_t)))
+            return;
+
+        const int16_t *ptr = d.ptr<int16_t>();
+        fVecBiasDac.assign(ptr, ptr+2*416);
 
         on_fBiasDispRefVolt_stateChanged();
@@ -2476,24 +2474,5 @@
     }
 
-    void handleBiasVolt(const DimData &d)
-    {
-        if (!CheckSize(d, 416*sizeof(float)))
-            return;
-
-        const float *ptr = d.ptr<float>();
-        fVecBiasVolt.assign(ptr, ptr+416);
-    }
-
-    void handleBiasDac(const DimData &d)
-    {
-        if (!CheckSize(d, 2*416*sizeof(int16_t)))
-            return;
-
-        const int16_t *ptr = d.ptr<int16_t>();
-        fVecBiasDac.assign(ptr, ptr+2*416);
-
-        on_fBiasDispRefVolt_stateChanged();
-        UpdateBiasValues();
-    }
+    int fStateFeedback;
 
     void handleBiasCurrent(const DimData &d)
@@ -2513,21 +2492,5 @@
             const PixelMapEntry &entry = fPixelMap.index(i);
 
-            // FIXME: Display Overcurrent
-            /*
-            dat[i] = fVecBiasVolt[entry.hv()]*90./4096;
-            double amp = abs(ptr[entry.hv()]);
-            if (fBiasOffsets.size()>0)
-                amp -= fBiasOffsets[entry.hv()];
-            amp *= 5000./4096;
-            amp *= 5200 *1e-6;
-            dat[i] -= amp;
-            */
-
             dat[i] = abs(ptr[entry.hv()]) * 5000./4096;
-
-            if (fBiasOffsets.size()>0 && fVecBiasVolt.size()>0)
-                dat[i] -= fVecBiasVolt[entry.hv()]/fBiasOffsets[entry.hv()]*1e6;
-
-            dat[i] *= 4.5 / (entry.group() ? 5 : 4);
 
             fBiasCamA->SetEnable(i, uint16_t(ptr[entry.hv()])!=0x8000);
@@ -2535,5 +2498,7 @@
         }
 
-        fBiasCamA->SetData(dat);
+        if (fStateFeedback<Feedback::State::kCalibrated)
+            fBiasCamA->SetData(dat);
+
         fBiasCamA->updateCamera();
 
@@ -2593,5 +2558,4 @@
             if (s.index==FTM::State::kConnected    ||
                 s.index==FTM::State::kIdle         ||
-                s.index==FTM::State::kValid        ||
                 configuring) // Dim connection / FTM connected
                 SetLedColor(fStatusFTMLed, kLedGreen, time);
@@ -2599,6 +2563,5 @@
                 SetLedColor(fStatusFTMLed, kLedGreenCheck, time);
             if (s.index==FTM::State::kConnected ||
-                s.index==FTM::State::kIdle      ||
-                s.index==FTM::State::kValid) // Dim connection / FTM connected
+                s.index==FTM::State::kIdle) // Dim connection / FTM connected
                 enable = true;
             if (s.index>=FTM::State::kConfigError1) // Dim connection / FTM connected
@@ -2745,7 +2708,5 @@
 
             const bool connected = s.index> Feedback::State::kConnecting;
-            const bool idle      = s.index>=Feedback::State::kTempCtrlIdle    && s.index<=Feedback::State::kCurrentCtrlIdle;
-            const bool running   = s.index>=Feedback::State::kTempCtrlRunning && s.index<=Feedback::State::kCurrentCtrlRunning;
-            const bool calib     = s.index==Feedback::State::kCalibrating;
+            const bool idle      = s.index==Feedback::State::kCalibrated || s.index==Feedback::State::kWaitingForData;
 
             if (s.index<=Feedback::State::kConnecting) // NoDim / Disconnected
@@ -2757,30 +2718,24 @@
             if (connected) // Connected
                 SetLedColor(fStatusFeedbackLed, kLedYellow, time);
-             if (idle)
+            if (idle)
                 SetLedColor(fStatusFeedbackLed, kLedGreen, time);
-             if (running)
-                 SetLedColor(fStatusFeedbackLed, kLedGreenCheck, time);
-             if (calib)
+            if (s.index==Feedback::State::kInProgress)
+                SetLedColor(fStatusFeedbackLed, kLedGreenCheck, time);
+            if (s.index==Feedback::State::kCalibrating)
                 SetLedColor(fStatusFeedbackLed, kLedInProgress, time);
 
             fFeedbackWidget->setEnabled(connected);
 
-            fFeedbackCalibrate->setEnabled(s.index==Feedback::State::kConnectedFSC || s.index==Feedback::State::kConnected);
-            fFeedbackTempStart->setEnabled(s.index==Feedback::State::kConnectedFSC || s.index==Feedback::State::kConnected);
-
-            fFeedbackStop->setEnabled(s.index>Feedback::State::kConnected);
-
-            fFeedbackTempOffset->setEnabled(s.index<=Feedback::State::kConnected);
-            fFeedbackOutputEnable->setEnabled(s.index<Feedback::State::kTempCtrlRunning);
-            fFeedbackOutputDisable->setEnabled(running);
-
-            const bool enable =
-                s.index!=Feedback::State::kTempCtrlIdle       ||
-                s.index!=Feedback::State::kCurrentCtrlIdle    ||
-                s.index!=Feedback::State::kTempCtrlRunning    ||
-                s.index!=Feedback::State::kCurrentCtrlRunning;
+            fFeedbackCalibrate->setEnabled(s.index==Feedback::State::kConnected || s.index==Feedback::State::kCalibrated);
+            fFeedbackStart->setEnabled(s.index==Feedback::State::kCalibrated);
+            fFeedbackStop->setEnabled(s.index>Feedback::State::kCalibrated);
+            fFeedbackOvervoltage->setEnabled(connected);
+
+            const bool enable = s.index>=Feedback::State::kCalibrated;
 
             fFeedbackFrameLeft->setEnabled(enable);
             fFeedbackCanvLeft->setEnabled(enable);
+
+            fStateFeedback = s.index;
         }
 
@@ -3155,6 +3110,6 @@
             return PostInfoHandler(&FactGui::handleFscHumidity);
 
-        if (getInfo()==&fDimBiasNominal)
-            return PostInfoHandler(&FactGui::handleBiasNominal);
+        //if (getInfo()==&fDimBiasNominal)
+        //    return PostInfoHandler(&FactGui::handleBiasNominal);
 
         if (getInfo()==&fDimBiasVolt)
@@ -3167,12 +3122,6 @@
             return PostInfoHandler(&FactGui::handleBiasCurrent);
 
-        if (getInfo()==&fDimFeedbackReference)
-            return PostInfoHandler(&FactGui::handleFeedbackReference);
-
-        if (getInfo()==&fDimFeedbackDeviation)
-            return PostInfoHandler(&FactGui::handleFeedbackDeviation);
-
-        if (getInfo()==&fDimFeedbackCalibration)
-            return PostInfoHandler(&FactGui::handleFeedbackCalibration);
+        if (getInfo()==&fDimFeedbackCalibrated)
+            return PostInfoHandler(&FactGui::handleFeedbackCalibratedCurrents);
 
         if (getInfo()==&fDimRateScan)
@@ -3348,48 +3297,4 @@
     }
 
-    /*
-    void ChoosePatchBias(Camera &cam, int isw)
-    {
-        cam.Reset();
-
-        fBiasChannel->setValue(isw);
-
-        const int ihw = isw<0 ? 0 : fPatchMapHW[isw];
-
-        fBiasCurrent->setEnabled(isw>=0);
-        fBiasCrate->setEnabled(isw>=0);
-        fBiasBoard->setEnabled(isw>=0);
-        fBiasPatch->setEnabled(isw>=0);
-
-        if (isw<0)
-            return;
-
-        const int patch = ihw%4;
-        const int board = (ihw/4)%10;
-        const int crate = (ihw/4)/10;
-
-        fInChoosePatchBias = true;
-
-        fBiasCrate->setValue(crate);
-        fBiasBoard->setValue(board);
-        fBiasPatch->setValue(patch);
-
-        fInChoosePatchBias = false;
-
-        if (fVecBias.size()>0)
-        {
-            // FIXME: Mapping
-            fBiasVoltDac->setValue(fVecBias[ihw]);
-            fBiasVolt->setValue(fVecBias[ihw]*90./4096);
-        }
-
-        fBiasCurrent->setValue(cam.GetData(isw));
-
-        // Loop over the software idx of all pixels
-        for (unsigned int i=0; i<1440; i++)
-            if (fPatchHW[i]==ihw)
-                cam.SetBold(i);
-    }*/
-
     void slot_ChoosePixelThreshold(int isw)
     {
@@ -3425,31 +3330,4 @@
     }
 
-    /*
-    void on_fThresholdIdx_valueChanged(int isw)
-    {
-        // fRatesCanv->SetBold(isw);
-        // fRatesCanv->updateGL();
-    }*/
-
-    /*
-    void UpdateThresholdIdx()
-    {
-        if (fInChoosePatchTH)
-            return;
-
-        const int crate = fThresholdCrate->value();
-        const int board = fThresholdBoard->value();
-        const int patch = fThresholdPatch->value();
-
-        const int ihw = patch + board*4 + crate*40;
-
-        int isw = 0;
-        for (; isw<160; isw++)
-            if (ihw==fPatchMapHW[isw])
-                break;
-
-        on_fThresholdIdx_valueChanged(isw);
-    }*/
-
     void on_fPixelIdx_valueChanged(int isw)
     {
@@ -3475,12 +3353,7 @@
         const int ihw = b*32+c;
 
-        const double offset = fVecBiasCalibOffset.size()>0 ? fVecBiasCalibOffset[ihw] : 0;
-
-
-        if (fVecBiasDac.size()>0)
-        {
-            fBiasVoltCur->setValue(fVecBiasDac[ihw]*90./4096-offset);
-            fBiasVoltRef->setValue(fVecBiasDac[ihw+416]*90./4096-offset);
-
+        if (fVecBiasVolt.size()>0)
+        {
+            fBiasVoltCur->setValue(fVecBiasVolt[ihw]);
             SetLedColor(fBiasNominalLed,
                         fVecBiasDac[ihw]==fVecBiasDac[ihw+416]?kLedGreen:kLedRed, Time());
@@ -3489,8 +3362,5 @@
         if (fVecBiasCurrent.size()>0)
         {
-            double val = abs(fVecBiasCurrent[ihw]) * 5000./4096;
-            if (fBiasOffsets.size()>0 && fVecBiasVolt.size()>0)
-                val -= fVecBiasVolt[ihw]/fBiasOffsets[ihw]*1e6;
-
+            const double val = abs(fVecBiasCurrent[ihw]) * 5000./4096;
             fBiasCurrent->setValue(val);
             SetLedColor(fBiasOverCurrentLed,
@@ -3498,8 +3368,9 @@
         }
 
-        if (fBiasOffsets.size()>0 && fVecBiasVolt.size()>0)
-            fBiasOffset->setValue(fVecBiasVolt[ihw]/fBiasOffsets[ihw]*1e6);
-
-        fBiasOffset->setEnabled(fBiasOffsets.size()>0 && fVecBiasVolt.size()>0);
+        const bool calibrated = fStateFeedback>=Feedback::State::kCalibrated &&
+            fVecFeedbackCurrents.size()>0;
+
+        fBiasCalibrated->setValue(calibrated ? fVecFeedbackCurrents[ihw] : 0);
+        fBiasCalibrated->setEnabled(calibrated);
     }
 
@@ -3580,24 +3451,13 @@
 
         valarray<double> dat(0., 1440);
-
-        int offset = 0;
-        if (!fBiasDispRefVolt->isChecked())
-            fBiasCamV->setTitle("Applied BIAS voltage");
-        else
-        {
-            fBiasCamV->setTitle("Reference BIAS voltage");
-            offset = 416;
-        }
-
-        if (fVecBiasDac.size()>0)
+        fBiasCamV->setTitle("Applied BIAS voltage");
+
+        if (fVecBiasVolt.size()>0 && fVecBiasDac.size()>0)
         {
             for (int i=0; i<1440; i++)
             {
                 const PixelMapEntry &entry = fPixelMap.index(i);
-                dat[i] = fVecBiasDac[entry.hv()+offset]*90./4096;
-
-                if (fVecBiasCalibOffset.size()>0)
-                    dat[i] -= fVecBiasCalibOffset[entry.hv()];
-
+
+                dat[i] = fVecBiasVolt[entry.hv()];
                 fBiasCamV->highlightPixel(i, fVecBiasDac[entry.hv()]!=fVecBiasDac[entry.hv()+416]);
             }
@@ -3758,7 +3618,5 @@
         fDimFscHumidity        ("FSC_CONTROL/HUMIDITY",           (void*)NULL, 0, this),
         //-
-        fDimFeedbackDeviation  ("FEEDBACK/DEVIATION",             (void*)NULL, 0, this),
-        fDimFeedbackReference  ("FEEDBACK/REFERENCE",             (void*)NULL, 0, this),
-        fDimFeedbackCalibration("FEEDBACK/CALIBRATION",           (void*)NULL, 0, this),
+        fDimFeedbackCalibrated ("FEEDBACK/CALIBRATED_CURRENTS",   (void*)NULL, 0, this),
         //-
         fDimBiasNominal        ("BIAS_CONTROL/NOMINAL",           (void*)NULL, 0, this),
@@ -3954,5 +3812,5 @@
         c->SetGrid();
 
-	TH1 *hf = DrawTimeFrame("Control deviation [mV]   ");
+	TH1 *hf = DrawTimeFrame("Overvoltage [V]   ");
         hf->GetXaxis()->SetLabelSize(0.07);
         hf->GetYaxis()->SetLabelSize(0.07);
@@ -3960,5 +3818,5 @@
         hf->GetYaxis()->SetTitleOffset(0.55);
         hf->GetXaxis()->SetTitle("");
-        hf->GetYaxis()->SetRangeUser(-99, 99);
+        hf->GetYaxis()->SetRangeUser(0, 1.5);
 
         c->GetListOfPrimitives()->Add(hf, "");
@@ -3973,5 +3831,5 @@
         c->SetGrid();
 
-        hf = DrawTimeFrame("Command delta value [mV]   ");
+        hf = DrawTimeFrame("Command temp delta [V]   ");
         hf->GetXaxis()->SetLabelSize(0.07);
         hf->GetYaxis()->SetLabelSize(0.07);
@@ -3979,5 +3837,5 @@
         hf->GetYaxis()->SetTitleOffset(0.55);
         hf->GetXaxis()->SetTitle("");
-        hf->GetYaxis()->SetRangeUser(-99*10, 99*10);
+        hf->GetYaxis()->SetRangeUser(-2, 2);
 
         c->GetListOfPrimitives()->Add(hf, "");
Index: /trunk/FACT++/gui/MainWindow.cc
===================================================================
--- /trunk/FACT++/gui/MainWindow.cc	(revision 17018)
+++ /trunk/FACT++/gui/MainWindow.cc	(revision 17019)
@@ -626,18 +626,8 @@
 }
 
-void MainWindow::on_fFeedbackTempStart_clicked()
-{
-    Dim::SendCommand("FEEDBACK/START_TEMP_CONTROL",
-                     (float)fFeedbackTempOffset->value());
-}
-
-void MainWindow::on_fFeedbackOutputEnable_clicked()
-{
-    Dim::SendCommand("FEEDBACK/ENABLE_OUTPUT", uint8_t(1));
-}
-
-void MainWindow::on_fFeedbackOutputDisable_clicked()
-{
-    Dim::SendCommand("FEEDBACK/ENABLE_OUTPUT", uint8_t(0));
+void MainWindow::on_fFeedbackStart_clicked()
+{
+    Dim::SendCommand("FEEDBACK/START",
+                     (float)fFeedbackOvervoltage->value());
 }
 
@@ -649,5 +639,5 @@
 void MainWindow::on_fFeedbackCalibrate_clicked()
 {
-    Dim::SendCommand("FEEDBACK/CALIBRATE_CURRENTS");
+    Dim::SendCommand("FEEDBACK/CALIBRATE");
 }
 
@@ -655,9 +645,4 @@
 {
     fBiasVoltDacVolt->setValue(val*90./4096);
-}
-
-void MainWindow::on_fBiasOffsetDac_valueChanged(int val)
-{
-    fBiasOffsetDacVolt->setValue(val*90./4096);
 }
 
@@ -669,10 +654,4 @@
 }
 */
-
-void MainWindow::on_fBiasApplyReference_clicked()
-{
-    if (!fInHandler)
-        Dim::SendCommand("BIAS_CONTROL/SET_GLOBAL_OFFSET_TO_ZERO");
-}
 
 void MainWindow::on_fBiasSetToZero_clicked()
@@ -728,58 +707,4 @@
 }
 
-void MainWindow::on_fBiasAddOffsetChVolt_clicked()
-{
-    if (fInHandler)
-        return;
-
-    const struct Data { uint16_t ch; float val; } __attribute__((__packed__)) val = {
-        uint16_t(fBiasHvBoard->value()*32+fBiasHvChannel->value()),
-        float(fBiasOffsetVolt->value())
-    };
-
-    Dim::SendCommand("BIAS_CONTROL/INCREASE_CHANNEL_VOLTAGE", &val, sizeof(Data));
-}
-
-void MainWindow::on_fBiasAddOffsetGlobalVolt_clicked()
-{ 
-    if (!fInHandler)
-        Dim::SendCommand("BIAS_CONTROL/INCREASE_GLOBAL_VOLTAGE", float(fBiasOffsetVolt->value()));
-}
-
-void MainWindow::on_fBiasAddOffsetChDac_clicked()
-{
-}
-
-void MainWindow::on_fBiasAddOffsetGlobalDac_clicked()
-{
-}
-
-void MainWindow::on_fBiasApplyOffsetChVolt_clicked()
-{
-    if (fInHandler)
-        return;
-
-    const struct Data { uint16_t ch; float val; } __attribute__((__packed__)) val = {
-        uint16_t(fBiasHvBoard->value()*32+fBiasHvChannel->value()),
-        float(fBiasOffsetVolt->value())
-    };
-
-    Dim::SendCommand("BIAS_CONTROL/SET_CHANNEL_OFFSET", &val, sizeof(Data));
-}
-
-void MainWindow::on_fBiasApplyOffsetGlobalVolt_clicked()
-{
-    if (!fInHandler)
-        Dim::SendCommand("BIAS_CONTROL/SET_GLOBAL_OFFSET", float(fBiasOffsetVolt->value()));
-}
-
-/*
-void MainWindow::on_fBiasApplyReferenceCh_clicked()
-{
-    if (!fInHandler)
-        Dim::SendCommand("BIAS_CONTROL/SET_CHANNEL_OFFSET_TO_ZERO",
-                         uint16_t(fBiasHvBoard->value()*32+fBiasHvChannel->value()));
-}*/
-
 void MainWindow::on_fBiasVoltMin_valueChanged(int min)
 {
Index: /trunk/FACT++/gui/design.ui
===================================================================
--- /trunk/FACT++/gui/design.ui	(revision 17018)
+++ /trunk/FACT++/gui/design.ui	(revision 17019)
@@ -3816,5 +3816,5 @@
                <string>Controls</string>
               </property>
-              <layout class="QHBoxLayout" name="horizontalLayout_46" stretch="0,0,0,0,0,0,0,0,0,0">
+              <layout class="QHBoxLayout" name="horizontalLayout_46" stretch="0,0,0,0,0,0,0,0,0">
                <item>
                 <layout class="QGridLayout" name="gridLayout_84">
@@ -4048,4 +4048,39 @@
                   <number>0</number>
                  </property>
+                 <item row="2" column="1">
+                  <widget class="QDoubleSpinBox" name="fBiasVoltRef">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                   <property name="alignment">
+                    <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                   </property>
+                   <property name="readOnly">
+                    <bool>true</bool>
+                   </property>
+                   <property name="buttonSymbols">
+                    <enum>QAbstractSpinBox::NoButtons</enum>
+                   </property>
+                   <property name="suffix">
+                    <string> V</string>
+                   </property>
+                   <property name="decimals">
+                    <number>3</number>
+                   </property>
+                   <property name="maximum">
+                    <double>90.000000000000000</double>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="1" column="0" colspan="3">
+                  <widget class="Line" name="line_50">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                  </widget>
+                 </item>
                  <item row="2" column="2">
                   <widget class="QLabel" name="label_233">
@@ -4113,39 +4148,4 @@
                   </widget>
                  </item>
-                 <item row="2" column="1">
-                  <widget class="QDoubleSpinBox" name="fBiasVoltRef">
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                   <property name="alignment">
-                    <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-                   </property>
-                   <property name="readOnly">
-                    <bool>true</bool>
-                   </property>
-                   <property name="buttonSymbols">
-                    <enum>QAbstractSpinBox::NoButtons</enum>
-                   </property>
-                   <property name="suffix">
-                    <string> V</string>
-                   </property>
-                   <property name="decimals">
-                    <number>3</number>
-                   </property>
-                   <property name="maximum">
-                    <double>90.000000000000000</double>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="1" column="0" colspan="3">
-                  <widget class="Line" name="line_50">
-                   <property name="orientation">
-                    <enum>Qt::Horizontal</enum>
-                   </property>
-                  </widget>
-                 </item>
                  <item row="4" column="1">
                   <widget class="QDoubleSpinBox" name="fBiasCurrent">
@@ -4176,5 +4176,5 @@
                   <widget class="QLabel" name="label_239">
                    <property name="text">
-                    <string>feedback</string>
+                    <string>total</string>
                    </property>
                   </widget>
@@ -4219,5 +4219,5 @@
                  </item>
                  <item row="5" column="1">
-                  <widget class="QDoubleSpinBox" name="fBiasOffset">
+                  <widget class="QDoubleSpinBox" name="fBiasCalibrated">
                    <property name="sizePolicy">
                     <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -4246,5 +4246,5 @@
                   <widget class="QLabel" name="label_261">
                    <property name="text">
-                    <string>offset</string>
+                    <string>calibrated</string>
                    </property>
                   </widget>
@@ -4275,11 +4275,4 @@
                    <property name="maximum">
                     <double>90.000000000000000</double>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="6" column="1" colspan="2">
-                  <widget class="QPushButton" name="fBiasApplyReferenceCh">
-                   <property name="text">
-                    <string>Set channel to Vgapd</string>
                    </property>
                   </widget>
@@ -4462,192 +4455,4 @@
                </item>
                <item>
-                <layout class="QVBoxLayout" name="verticalLayout_18">
-                 <item>
-                  <widget class="QLabel" name="label_237">
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                   <property name="text">
-                    <string>Voltage offset</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item>
-                  <widget class="Line" name="line_49">
-                   <property name="orientation">
-                    <enum>Qt::Horizontal</enum>
-                   </property>
-                  </widget>
-                 </item>
-                 <item>
-                  <layout class="QGridLayout" name="gridLayout_113">
-                   <item row="1" column="2">
-                    <widget class="QSpinBox" name="fBiasOffsetDac">
-                     <property name="enabled">
-                      <bool>false</bool>
-                     </property>
-                     <property name="sizePolicy">
-                      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-                       <horstretch>0</horstretch>
-                       <verstretch>0</verstretch>
-                      </sizepolicy>
-                     </property>
-                     <property name="alignment">
-                      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-                     </property>
-                     <property name="suffix">
-                      <string> DAC</string>
-                     </property>
-                     <property name="minimum">
-                      <number>-4095</number>
-                     </property>
-                     <property name="maximum">
-                      <number>4095</number>
-                     </property>
-                    </widget>
-                   </item>
-                   <item row="3" column="2">
-                    <widget class="QPushButton" name="fBiasAddOffsetGlobalDac">
-                     <property name="enabled">
-                      <bool>false</bool>
-                     </property>
-                     <property name="text">
-                      <string>Add global</string>
-                     </property>
-                    </widget>
-                   </item>
-                   <item row="0" column="2">
-                    <widget class="QDoubleSpinBox" name="fBiasOffsetDacVolt">
-                     <property name="enabled">
-                      <bool>false</bool>
-                     </property>
-                     <property name="sizePolicy">
-                      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-                       <horstretch>0</horstretch>
-                       <verstretch>0</verstretch>
-                      </sizepolicy>
-                     </property>
-                     <property name="alignment">
-                      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-                     </property>
-                     <property name="readOnly">
-                      <bool>true</bool>
-                     </property>
-                     <property name="buttonSymbols">
-                      <enum>QAbstractSpinBox::NoButtons</enum>
-                     </property>
-                     <property name="prefix">
-                      <string>~</string>
-                     </property>
-                     <property name="suffix">
-                      <string> V</string>
-                     </property>
-                     <property name="decimals">
-                      <number>3</number>
-                     </property>
-                     <property name="minimum">
-                      <double>-90.000000000000000</double>
-                     </property>
-                     <property name="maximum">
-                      <double>99.000000000000000</double>
-                     </property>
-                    </widget>
-                   </item>
-                   <item row="0" column="0">
-                    <widget class="QDoubleSpinBox" name="fBiasOffsetVolt">
-                     <property name="sizePolicy">
-                      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-                       <horstretch>0</horstretch>
-                       <verstretch>0</verstretch>
-                      </sizepolicy>
-                     </property>
-                     <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="prefix">
-                      <string/>
-                     </property>
-                     <property name="suffix">
-                      <string> V</string>
-                     </property>
-                     <property name="decimals">
-                      <number>3</number>
-                     </property>
-                     <property name="minimum">
-                      <double>-90.000000000000000</double>
-                     </property>
-                     <property name="maximum">
-                      <double>99.000000000000000</double>
-                     </property>
-                    </widget>
-                   </item>
-                   <item row="2" column="2">
-                    <widget class="QPushButton" name="fBiasAddOffsetChDac">
-                     <property name="enabled">
-                      <bool>false</bool>
-                     </property>
-                     <property name="text">
-                      <string>Add Ch</string>
-                     </property>
-                    </widget>
-                   </item>
-                   <item row="0" column="1" rowspan="6">
-                    <widget class="Line" name="line_63">
-                     <property name="orientation">
-                      <enum>Qt::Vertical</enum>
-                     </property>
-                    </widget>
-                   </item>
-                   <item row="1" column="0">
-                    <widget class="QPushButton" name="fBiasAddOffsetChVolt">
-                     <property name="enabled">
-                      <bool>true</bool>
-                     </property>
-                     <property name="text">
-                      <string>Add Ch</string>
-                     </property>
-                    </widget>
-                   </item>
-                   <item row="2" column="0">
-                    <widget class="QPushButton" name="fBiasAddOffsetGlobalVolt">
-                     <property name="enabled">
-                      <bool>true</bool>
-                     </property>
-                     <property name="text">
-                      <string>Add global</string>
-                     </property>
-                    </widget>
-                   </item>
-                   <item row="3" column="0">
-                    <widget class="QPushButton" name="fBiasApplyOffsetChVolt">
-                     <property name="enabled">
-                      <bool>true</bool>
-                     </property>
-                     <property name="text">
-                      <string>Set Ch</string>
-                     </property>
-                    </widget>
-                   </item>
-                   <item row="4" column="0">
-                    <widget class="QPushButton" name="fBiasApplyOffsetGlobalVolt">
-                     <property name="text">
-                      <string>Set global</string>
-                     </property>
-                    </widget>
-                   </item>
-                  </layout>
-                 </item>
-                </layout>
-               </item>
-               <item>
                 <widget class="Line" name="line_44">
                  <property name="orientation">
@@ -4665,11 +4470,4 @@
                    <property name="text">
                     <string>Set all to 0</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item>
-                  <widget class="QPushButton" name="fBiasApplyReference">
-                   <property name="text">
-                    <string>Set all to Vgapd</string>
                    </property>
                   </widget>
@@ -4840,5 +4638,5 @@
                    </property>
                    <property name="value">
-                    <number>2000</number>
+                    <number>110</number>
                    </property>
                   </widget>
@@ -4920,24 +4718,4 @@
                    <property name="value">
                     <number>0</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item>
-                  <spacer name="horizontalSpacer_56">
-                   <property name="orientation">
-                    <enum>Qt::Horizontal</enum>
-                   </property>
-                   <property name="sizeHint" stdset="0">
-                    <size>
-                     <width>40</width>
-                     <height>20</height>
-                    </size>
-                   </property>
-                  </spacer>
-                 </item>
-                 <item>
-                  <widget class="QCheckBox" name="fBiasDispRefVolt">
-                   <property name="text">
-                    <string>Display Reference Voltage</string>
                    </property>
                   </widget>
@@ -5342,5 +5120,5 @@
                <widget class="QGroupBox" name="groupBox_23">
                 <property name="title">
-                 <string>Temp feedback</string>
+                 <string>Feedback</string>
                 </property>
                 <layout class="QGridLayout" name="gridLayout_99">
@@ -5356,5 +5134,5 @@
                  </item>
                  <item row="3" column="0">
-                  <widget class="QDoubleSpinBox" name="fFeedbackTempOffset">
+                  <widget class="QDoubleSpinBox" name="fFeedbackOvervoltage">
                    <property name="alignment">
                     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -5372,27 +5150,11 @@
                     <double>0.100000000000000</double>
                    </property>
+                   <property name="value">
+                    <double>1.100000000000000</double>
+                   </property>
                   </widget>
                  </item>
                  <item row="4" column="0">
-                  <widget class="QPushButton" name="fFeedbackTempStart">
-                   <property name="text">
-                    <string>Start</string>
-                   </property>
-                  </widget>
-                 </item>
-                </layout>
-               </widget>
-              </item>
-              <item>
-               <widget class="QGroupBox" name="groupBox_24">
-                <property name="title">
-                 <string>Gain feedback</string>
-                </property>
-                <layout class="QGridLayout" name="gridLayout_100">
-                 <item row="0" column="0">
-                  <widget class="QPushButton" name="pushButton_5">
-                   <property name="enabled">
-                    <bool>false</bool>
-                   </property>
+                  <widget class="QPushButton" name="fFeedbackStart">
                    <property name="text">
                     <string>Start</string>
@@ -5409,20 +5171,6 @@
                 </property>
                 <layout class="QGridLayout" name="gridLayout_101">
-                 <item row="1" column="0">
-                  <widget class="QPushButton" name="fFeedbackOutputDisable">
-                   <property name="text">
-                    <string>Disable output</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="0" column="0">
-                  <widget class="QPushButton" name="fFeedbackOutputEnable">
-                   <property name="text">
-                    <string>Enable output</string>
-                   </property>
-                  </widget>
-                 </item>
                  <item row="2" column="0">
-                  <spacer name="verticalSpacer_78">
+                  <spacer name="verticalSpacer_85">
                    <property name="orientation">
                     <enum>Qt::Vertical</enum>
@@ -5439,13 +5187,6 @@
                   </spacer>
                  </item>
-                 <item row="3" column="0">
-                  <widget class="QPushButton" name="fFeedbackStop">
-                   <property name="text">
-                    <string>Stop</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="4" column="0">
-                  <spacer name="verticalSpacer_85">
+                 <item row="0" column="0">
+                  <spacer name="verticalSpacer_78">
                    <property name="orientation">
                     <enum>Qt::Vertical</enum>
@@ -5462,5 +5203,12 @@
                   </spacer>
                  </item>
-                 <item row="5" column="0">
+                 <item row="1" column="0">
+                  <widget class="QPushButton" name="fFeedbackStop">
+                   <property name="text">
+                    <string>Stop</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="3" column="0">
                   <widget class="QPushButton" name="fFeedbackCalibrate">
                    <property name="text">
