Index: /trunk/FACT++/gui/FactGui.h
===================================================================
--- /trunk/FACT++/gui/FactGui.h	(revision 11966)
+++ /trunk/FACT++/gui/FactGui.h	(revision 11967)
@@ -23,4 +23,5 @@
 #include "src/tools.h"
 #include "src/FAD.h"
+#include "src/PixelMap.h"
 
 
@@ -355,72 +356,4 @@
 */
 // #########################################################################
-
-
-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 hw() const    { return pixel()+patch()*9+board()*36+crate()*360; }
-    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
@@ -509,4 +442,5 @@
         kLedWarnTriangleBorder,
         kLedWarnTriangle,
+        kLedInProgress,
     };
 
@@ -549,4 +483,8 @@
         case kLedWarnTriangleBorder:
             button->setIcon(QIcon(":/Resources/icons/warning 4.png"));
+            break;
+
+        case kLedInProgress:
+            button->setIcon(QIcon(":/Resources/icons/in progress.png"));
             break;
 
@@ -2665,5 +2603,5 @@
                 SetLedColor(fStatusBiasLed, kLedYellow, time);
             if (s.index==BIAS::kRamping) // Ramping
-                SetLedColor(fStatusBiasLed, kLedWarn, time);
+                SetLedColor(fStatusBiasLed, kLedInProgress, time);
             if (s.index==BIAS::kOverCurrent) // Over current
                 SetLedColor(fStatusBiasLed, kLedWarnBorder, time);
@@ -3615,4 +3553,11 @@
         // --------------------------------------------------------------------------
 
+        if (!fPixelMap.Read("FACTmapV5.txt"))
+        {
+            cerr << "ERROR - Problems reading FACTmapV5.txt" << endl;
+            exit(-1);
+        }
+
+/*
         ifstream fin0("FACTmapV5.txt");
 
@@ -3656,10 +3601,12 @@
             exit(-1);
         }
-
+ */
         // --------------------------------------------------------------------------
 
         ifstream fin1("Trigger-Patches.txt");
 
-        l = 0;
+        string buf;
+
+        int l = 0;
         while (getline(fin1, buf, '\n'))
         {
