Index: trunk/FACT++/gui/FactGui.h
===================================================================
--- trunk/FACT++/gui/FactGui.h	(revision 13840)
+++ trunk/FACT++/gui/FactGui.h	(revision 13923)
@@ -19,10 +19,6 @@
 #include "src/Converter.h"
 #include "src/Configuration.h"
-#include "src/HeadersFTM.h"
-#include "src/HeadersFAD.h"
-#include "src/HeadersBIAS.h"
 #include "src/DimNetwork.h"
 #include "src/tools.h"
-#include "src/FAD.h"
 #include "src/PixelMap.h"
 #include "src/DimData.h"
@@ -41,4 +37,10 @@
 
 #include "QCameraWidget.h"
+
+#include "src/FAD.h"
+#include "src/HeadersFTM.h"
+#include "src/HeadersFAD.h"
+#include "src/HeadersBIAS.h"
+#include "src/HeadersDrive.h"
 
 using namespace std;
@@ -2596,31 +2598,31 @@
             bool enable = false;
             const bool configuring =
-                s.index==FTM::StateMachine::kConfiguring1 ||
-                s.index==FTM::StateMachine::kConfiguring2 ||
-                s.index==FTM::StateMachine::kConfigured;
-
-            if (s.index<FTM::StateMachine::kDisconnected) // No Dim connection
+                s.index==FTM::State::kConfiguring1 ||
+                s.index==FTM::State::kConfiguring2 ||
+                s.index==FTM::State::kConfigured;
+
+            if (s.index<FTM::State::kDisconnected) // No Dim connection
                 SetLedColor(fStatusFTMLed, kLedGray, time);
-            if (s.index==FTM::StateMachine::kDisconnected) // Dim connection / FTM disconnected
+            if (s.index==FTM::State::kDisconnected) // Dim connection / FTM disconnected
                 SetLedColor(fStatusFTMLed, kLedYellow, time);
-            if (s.index==FTM::StateMachine::kConnected    ||
-                s.index==FTM::StateMachine::kIdle         ||
+            if (s.index==FTM::State::kConnected    ||
+                s.index==FTM::State::kIdle         ||
                 configuring) // Dim connection / FTM connected
                 SetLedColor(fStatusFTMLed, kLedGreen, time);
-            if (s.index==FTM::StateMachine::kTriggerOn) // Dim connection / FTM connected
+            if (s.index==FTM::State::kTriggerOn) // Dim connection / FTM connected
                 SetLedColor(fStatusFTMLed, kLedGreenCheck, time);
-            if (s.index==FTM::StateMachine::kConnected ||
-                s.index==FTM::StateMachine::kIdle) // Dim connection / FTM connected
+            if (s.index==FTM::State::kConnected ||
+                s.index==FTM::State::kIdle) // Dim connection / FTM connected
                 enable = true;
 
             fFtmStartRun->setEnabled(!configuring && enable);
-            fFtmStopRun->setEnabled(!configuring && (enable || s.index==FTM::StateMachine::kTriggerOn));
+            fFtmStopRun->setEnabled(!configuring && (enable || s.index==FTM::State::kTriggerOn));
 
             fTriggerWidget->setEnabled(enable);
             fFtuGroupEnable->setEnabled(enable);
             fRatesControls->setEnabled(enable);
-            fFtuWidget->setEnabled(s.index>FTM::StateMachine::kDisconnected);
-
-            if (s.index>=FTM::StateMachine::kConnected)
+            fFtuWidget->setEnabled(s.index>FTM::State::kDisconnected);
+
+            if (s.index>=FTM::State::kConnected)
                 SetFtuStatusLed(time);
             else
@@ -2639,5 +2641,5 @@
             bool enable = false;
 
-            if (s.index<FAD::kOffline) // No Dim connection
+            if (s.index<FAD::State::kOffline) // No Dim connection
             {
                 SetLedColor(fStatusFADLed, kLedGray, time);
@@ -2655,9 +2657,9 @@
                  */
             }
-            if (s.index==FAD::kOffline) // Dim connection / FTM disconnected
+            if (s.index==FAD::State::kOffline) // Dim connection / FTM disconnected
                 SetLedColor(fStatusFADLed, kLedRed, time);
-            if (s.index==FAD::kDisconnected) // Dim connection / FTM disconnected
+            if (s.index==FAD::State::kDisconnected) // Dim connection / FTM disconnected
                 SetLedColor(fStatusFADLed, kLedOrange, time);
-	    if (s.index==FAD::kConnecting) // Dim connection / FTM disconnected
+	    if (s.index==FAD::State::kConnecting) // Dim connection / FTM disconnected
             {
 		SetLedColor(fStatusFADLed, kLedYellow, time);
@@ -2665,5 +2667,5 @@
                 enable = true;
             }
-            if (s.index>=FAD::kConnected) // Dim connection / FTM connected
+            if (s.index>=FAD::State::kConnected) // Dim connection / FTM connected
             {
                 SetLedColor(fStatusFADLed, kLedGreen, time);
@@ -2673,9 +2675,9 @@
             fFadWidget->setEnabled(enable);
 
-            fFadStart->setEnabled(s.index==FAD::kOffline);
-            fFadStop->setEnabled(s.index>FAD::kOffline);
-            fFadAbort->setEnabled(s.index>FAD::kOffline);
-            fFadSoftReset->setEnabled(s.index>FAD::kOffline);
-            fFadHardReset->setEnabled(s.index>FAD::kOffline);
+            fFadStart->setEnabled    (s.index==FAD::State::kOffline);
+            fFadStop->setEnabled     (s.index >FAD::State::kOffline);
+            fFadAbort->setEnabled    (s.index >FAD::State::kOffline);
+            fFadSoftReset->setEnabled(s.index >FAD::State::kOffline);
+            fFadHardReset->setEnabled(s.index >FAD::State::kOffline);
         }
 
@@ -2711,9 +2713,9 @@
             if (s.index==2 || s.index==3)  // Not Ready
                 SetLedColor(fStatusDriveLed, kLedGreenBar, time);
-            if (s.index==4 || s.index==5)  // Connected / Armed
+            if (s.index==Drive::State::kConnected || s.index==Drive::State::kArmed)  // Connected / Armed
                 SetLedColor(fStatusDriveLed, kLedGreen, time);
-            if (s.index==6)  // Moving
+            if (s.index==Drive::State::kMoving)  // Moving
                 SetLedColor(fStatusDriveLed, kLedInProgress, time);
-            if (s.index==7)  // Tracking
+            if (s.index==Drive::State::kTracking)  // Tracking
                 SetLedColor(fStatusDriveLed, kLedGreenCheck, time);
             if (s.index==99)  // Error
@@ -2728,19 +2730,19 @@
             if (s.index<1) // No Dim connection
                 SetLedColor(fStatusBiasLed, kLedGray, time);
-            if (s.index==BIAS::kDisconnected) // Dim connection / FTM disconnected
+            if (s.index==BIAS::State::kDisconnected) // Dim connection / FTM disconnected
                 SetLedColor(fStatusBiasLed, kLedRed, time);
-            if (s.index==BIAS::kConnecting || s.index==BIAS::kInitializing) // Connecting / Initializing
+            if (s.index==BIAS::State::kConnecting || s.index==BIAS::State::kInitializing) // Connecting / Initializing
                 SetLedColor(fStatusBiasLed, kLedOrange, time);
-            if (s.index==BIAS::kVoltageOff) // At reference
+            if (s.index==BIAS::State::kVoltageOff) // At reference
                 SetLedColor(fStatusBiasLed, kLedGreenBar, time);
-            if (s.index==BIAS::kNotReferenced) // At reference
+            if (s.index==BIAS::State::kNotReferenced) // At reference
                 SetLedColor(fStatusBiasLed, kLedGreenWarn, time);
-            if (s.index==BIAS::kRamping) // Ramping
+            if (s.index==BIAS::State::kRamping) // Ramping
                 SetLedColor(fStatusBiasLed, kLedInProgress, time);
-            if (s.index==BIAS::kVoltageOn) // At reference
+            if (s.index==BIAS::State::kVoltageOn) // At reference
                 SetLedColor(fStatusBiasLed, kLedGreenCheck, time);
-            if (s.index==BIAS::kOverCurrent) // Over current
+            if (s.index==BIAS::State::kOverCurrent) // Over current
                 SetLedColor(fStatusBiasLed, kLedWarnBorder, time);
-            if (s.index==BIAS::kExpertMode) // ExpertMode
+            if (s.index==BIAS::State::kExpertMode) // ExpertMode
                 SetLedColor(fStatusBiasLed, kLedWarnTriangleBorder, time);
 
