Index: trunk/FACT++/src/smartfact.cc
===================================================================
--- trunk/FACT++/src/smartfact.cc	(revision 17520)
+++ trunk/FACT++/src/smartfact.cc	(revision 17672)
@@ -536,5 +536,7 @@
     DimDescribedState fDimFscControl;
     DimDescribedState fDimGpsControl;
-    DimDescribedState fDimAgilentControl;
+    DimDescribedState fDimAgilentControl24;
+    DimDescribedState fDimAgilentControl50;
+    DimDescribedState fDimAgilentControl80;
     DimDescribedState fDimPwrControl;
     DimDescribedState fDimLidControl;
@@ -1099,6 +1101,6 @@
                 double UdrpApd = (R5+2000)*Iout;  // Voltage seen by G-APD
 
-                const double pwrCam = Iapd * (fBiasControlVoltageVec[i]-UdrpCam);
-                const double pwrApd = Iapd * (fBiasControlVoltageVec[i]-UdrpApd);
+                const double pwrCam = Iout * (fBiasControlVoltageVec[i]-UdrpCam);
+                const double pwrApd = Iout * (fBiasControlVoltageVec[i]-UdrpApd);
 
                 // Total power participated in the camera at the G-APD
@@ -1875,7 +1877,7 @@
     }
 
-    int HandleAgilentData(const EventImp &d)
-    {
-        if (!CheckDataSize(d, "Agilent:Data", 4*sizeof(float)))
+    int HandleAgilentData(const EventImp &d, const string &ext)
+    {
+        if (!CheckDataSize(d, "Agilent"+ext+":Data", 4*sizeof(float)))
             return GetCurrentState();
 
@@ -1892,5 +1894,5 @@
         out << HTML::kWhite << '\t' << data[3] << '\n';
 
-        ofstream(fPath+"/agilent.data") << out.str();
+        ofstream(fPath+"/agilent"+ext+".data") << out.str();
 
         return GetCurrentState();
@@ -2034,5 +2036,7 @@
         Out() << fDimRateControl    << endl;
         Out() << fDimFscControl     << endl;
-        Out() << fDimAgilentControl << endl;
+        Out() << fDimAgilentControl24 << endl;
+        Out() << fDimAgilentControl50 << endl;
+        Out() << fDimAgilentControl80 << endl;
         Out() << fDimPwrControl     << endl;
         Out() << fDimLidControl     << endl;
@@ -2947,5 +2951,7 @@
             out << GetStateHtml(fDimFscControl,     FSC::State::kConnected);
             out << GetStateHtml(fDimGpsControl,     GPS::State::kConnected);
-            out << GetStateHtml(fDimAgilentControl, Agilent::State::kVoltageOff);
+            out << GetStateHtml(fDimAgilentControl24, Agilent::State::kVoltageOff);
+            out << GetStateHtml(fDimAgilentControl50, Agilent::State::kVoltageOff);
+            out << GetStateHtml(fDimAgilentControl80, Agilent::State::kVoltageOff);
             out << GetStateHtml(fDimPwrControl,     Power::State::kSystemOff);
             out << GetStateHtml(fDimLidControl,     Lid::State::kConnected);
@@ -3019,5 +3025,7 @@
         fDimFscControl    ("FSC_CONTROL"),
         fDimGpsControl    ("GPS_CONTROL"),
-        fDimAgilentControl("AGILENT_CONTROL"),
+        fDimAgilentControl24("AGILENT_CONTROL_24V"),
+        fDimAgilentControl50("AGILENT_CONTROL_50V"),
+        fDimAgilentControl80("AGILENT_CONTROL_80V"),
         fDimPwrControl    ("PWR_CONTROL"),
         fDimLidControl    ("LID_CONTROL"),
@@ -3043,5 +3051,7 @@
         fDimFscControl.Subscribe(*this);
         fDimGpsControl.Subscribe(*this);
-        fDimAgilentControl.Subscribe(*this);
+        fDimAgilentControl24.Subscribe(*this);
+        fDimAgilentControl50.Subscribe(*this);
+        fDimAgilentControl80.Subscribe(*this);
         fDimPwrControl.Subscribe(*this);
         fDimLidControl.Subscribe(*this);
@@ -3081,8 +3091,12 @@
 
         Subscribe("TEMPERATURE/DATA")
-            (bind(&StateMachineSmartFACT::HandleTemperatureData,    this, placeholders::_1));
-
-        Subscribe("AGILENT_CONTROL/DATA")
-            (bind(&StateMachineSmartFACT::HandleAgilentData,        this, placeholders::_1));
+            (bind(&StateMachineSmartFACT::HandleTemperatureData,     this, placeholders::_1));
+
+        Subscribe("AGILENT_CONTROL_24V/DATA")
+            (bind(&StateMachineSmartFACT::HandleAgilentData,         this, placeholders::_1, "24"));
+        Subscribe("AGILENT_CONTROL_50V/DATA")
+            (bind(&StateMachineSmartFACT::HandleAgilentData,         this, placeholders::_1, "50"));
+        Subscribe("AGILENT_CONTROL_80V/DATA")
+            (bind(&StateMachineSmartFACT::HandleAgilentData,         this, placeholders::_1, "80"));
 
         Subscribe("MAGIC_WEATHER/DATA")
