Index: trunk/MagicSoft/Mars/mreport/MReportCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCamera.cc	(revision 6922)
+++ trunk/MagicSoft/Mars/mreport/MReportCamera.cc	(revision 6962)
@@ -17,4 +17,5 @@
 !
 !   Author(s): Thomas Bretz, 11/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Daniel Mazin, 04/2005 <mailto:mazin@mppmu.mpg.de>
 !
 !   Copyright: MAGIC Software Development, 2000-2003
@@ -45,4 +46,6 @@
 #include "MCameraLV.h"
 #include "MCameraAUX.h"
+#include "MCameraActiveLoad.h"
+#include "MCameraCentralPix.h"
 #include "MCameraLids.h"
 
@@ -50,4 +53,6 @@
 
 using namespace std;
+
+const Int_t  MReportCamera::gkActiveLoadControlVersNum = 200504130;
 
 // --------------------------------------------------------------------------
@@ -95,4 +100,12 @@
     fCalibration = (MCameraCalibration*)plist.FindCreateObj("MCameraCalibration");
     if (!fCalibration)
+        return kFALSE;
+
+    fActiveLoad = (MCameraActiveLoad*)plist.FindCreateObj("MCameraActiveLoad");
+    if (!fActiveLoad)
+        return kFALSE;
+
+    fCentralPix = (MCameraCentralPix*)plist.FindCreateObj("MCameraCentralPix");
+    if (!fCentralPix)
         return kFALSE;
 
@@ -406,16 +419,78 @@
 // --------------------------------------------------------------------------
 //
+// Interprete the Active Load REPORT part
+//
+Bool_t MReportCamera::InterpreteActiveLoad(TString &str)
+{
+    if (!CheckTag(str, "ACTLOAD "))
+        return kFALSE;
+
+    Int_t len;
+    Short_t v360a, i360a, v360b, i360b, v175a, i175a, v175b, i175b;
+    Int_t n=sscanf(str.Data(), " %hd %hd %hd %hd %hd %hd %hd %hd %n",
+                   &v360a, &i360a, &v360b, &i360b, &v175a, &i175a, &v175b, &i175b, &len);
+    if (n!=8)
+    {
+        *fLog << warn << "WARNING - Reading information of 'ACTLOAD' section." << endl;
+        return kFALSE;
+    }
+
+    fActiveLoad->fVoltage360A = (float)v360a*0.1;
+    fActiveLoad->fIntens360A  = (float)i360a*0.01;
+    fActiveLoad->fVoltage360B = (float)v360b*0.1;
+    fActiveLoad->fIntens360B  = (float)i360b*0.01;
+    fActiveLoad->fVoltage175A = (float)v175a*0.1;
+    fActiveLoad->fIntens175A  = (float)i175a*0.01;
+    fActiveLoad->fVoltage175B = (float)v175b*0.1;
+    fActiveLoad->fIntens175B  = (float)i175b*0.01;
+
+    str.Remove(0, len);
+    str=str.Strip(TString::kBoth);
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Interprete the Central Pixel part
+//
+Bool_t MReportCamera::InterpreteCentralPix(TString &str)
+{
+    if (!CheckTag(str, "CPIX "))
+        return kFALSE;
+
+    Int_t len;
+    Short_t status;
+    Int_t n=sscanf(str.Data(), " %hd %n",
+                   &status, &len);
+    if (n!=1)
+    {
+        *fLog << warn << "WARNING - Reading information of 'CPIX' section." << endl;
+        return kFALSE;
+    }
+
+    fCentralPix->fStatus = (Bool_t)status;
+
+    str.Remove(0, len);
+    str=str.Strip(TString::kBoth);
+
+    return kTRUE;
+}
+// --------------------------------------------------------------------------
+//
 // Interprete the CAMERA-REPORT part
 //
-Bool_t MReportCamera::InterpreteCamera(TString &str)
+Bool_t MReportCamera::InterpreteCamera(TString &str, Int_t ver)
 {
     //
     // I have tried to do it with pure pointer arithmentics, but most of the time is spent
     // to do the sscanf. So we gain less than 5% not using TString like it is done here.
-    Int_t len;
+    Int_t len1=0;
     Short_t cal, stat, hvps, lid, lv, cool, hv, dc, led, fan, can, io, clv;
-    Int_t n=sscanf(str.Data(), " %hd %hd %hd %hd %hd %hd %hd %hd %hd %hd %hd %hd %hd %n",
-                   &cal, &stat, &hvps, &lid, &lv, &cool, &hv,
-                   &dc, &led, &fan, &can, &io, &clv, &len);
+    Int_t n;
+
+    n=sscanf(str.Data(), " %hd %hd %hd %hd %hd %hd %hd %hd %hd %hd %hd %hd %hd %n",
+             &cal, &stat, &hvps, &lid, &lv, &cool, &hv,
+             &dc, &led, &fan, &can, &io, &clv, &len1);
     if (n!=13)
     {
@@ -423,6 +498,4 @@
         return kFALSE;
     }
-    str.Remove(0, len);
-    str=str.Strip(TString::kLeading);
 
     fHV->fStatus                   = (Byte_t)hvps;
@@ -439,4 +512,20 @@
     fStatus                        = (Byte_t)stat;
     fStatusDC                      = (Byte_t)dc;
+    fActiveLoad->fStatus           = 0xff;
+
+    Int_t len2=0;
+    if (ver > gkActiveLoadControlVersNum)
+    {
+        Short_t actl;
+        n=sscanf(str.Data()+len1, " %hd %n", &actl, &len2);
+        if (n!=1)
+        {
+            *fLog << warn << "WARNING - Cannot interprete status of active load." << endl;
+            return kFALSE;
+        }
+        fActiveLoad->fStatus = (Byte_t)actl;
+    }
+    str.Remove(0, len1+len2);
+    str=str.Strip(TString::kLeading);
 
     return kTRUE;
@@ -449,5 +538,5 @@
 Int_t MReportCamera::InterpreteBody(TString &str, Int_t ver)
 {
-    if (!InterpreteCamera(str))
+    if (!InterpreteCamera(str, ver))
         return kCONTINUE;
 
@@ -479,4 +568,12 @@
         return kCONTINUE;
 
+    if (ver > gkActiveLoadControlVersNum)
+    {
+         if (!InterpreteActiveLoad(str))
+            return kCONTINUE;
+         if (!InterpreteCentralPix(str))
+            return kCONTINUE;
+    }
+
     if (str!="OVER")
     {
