Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 9004)
+++ trunk/MagicSoft/Mars/Changelog	(revision 9005)
@@ -31,4 +31,44 @@
      - use File-Id to order files
      - added telescope number to all constructors
+
+   * automatic-exclusions.rc:
+     - moved as exclusions.rc to resources and updated contents
+       to new doeclusion.C
+
+   * ganymed.cc:
+     - updated Usage output
+     - added new option to change meximum file size
+
+   * merpp.cc:
+     - merpp also MCameraDC from cc-report
+
+   * datacenter/macros/fillsignal.C:
+     - replaces WARNING by ERROR if an error is returned
+
+   * datacenter/macros/writesequencefile.C:
+     - completely redone using new MSequenceSQL
+
+   * mcamera/MCameraDC.[h,cc]:
+     - added the Interprete member function
+     - made MReportCamera and MReportCurrents friends clases
+     - added fStatus
+     - increased class version accordingly
+
+   * mjobs/MJCalibration.cc, mjobs/MJPedestal.cc:
+     - tiny changes to output
+
+   * mreport/MReportCamera.[h,cc]:
+     - removed fStatusDC
+     - removed gkActiveLoadControlVersNum
+     - added interpretation of DC
+     - increased class version by one
+
+   * mreport/MReportCurrents.cc:
+     - moved interpretation of DCs to MCameraDC
+
+   * resources/sequences.rc:
+     - changed some comments
+     - added telescope number to rules
+
 
 
Index: trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C	(revision 9004)
+++ trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C	(revision 9005)
@@ -114,5 +114,5 @@
     if (!cam)
     {
-        cout << "WARNING - Reading of PedRMS;avg failed." << endl;
+        cout << "ERROR - Reading of PedRMS;avg failed." << endl;
         return 2;
     }
@@ -122,5 +122,5 @@
     if (!pul)
     {
-        cout << "WARNING - Reading of PulsePos;avg failed." << endl;
+        cout << "ERROR - Reading of PulsePos;avg failed." << endl;
         return 2;
     }
@@ -129,5 +129,5 @@
     if (!difflo)
     {
-        cout << "WARNING - Reading of DiffLo;avg failed." << endl;
+        cout << "ERROR - Reading of DiffLo;avg failed." << endl;
         return 2;
     }
@@ -135,5 +135,5 @@
     if (!diffhi)
     {
-        cout << "WARNING - Reading of DiffHi;avg failed." << endl;
+        cout << "ERROR - Reading of DiffHi;avg failed." << endl;
         return 2;
     }
@@ -144,5 +144,5 @@
     if (sequence.IsNull())
     {
-        cout << "WARNING - Sequ# empty" << endl;
+        cout << "ERROR - Sequ# empty" << endl;
         cout << "Sequ# " << sequence << endl;
         return 2;
@@ -161,5 +161,5 @@
         if (!hilooff)
         {
-            cout << "WARNING - Reading of HiLoOff failed." << endl;
+            cout << "ERROR - Reading of HiLoOff failed." << endl;
             return 2;
         }
@@ -168,5 +168,5 @@
         if (!hilocal)
         {
-            cout << "WARNING - Reading of HiLoCal failed." << endl;
+            cout << "ERROR - Reading of HiLoCal failed." << endl;
             return 2;
         }
@@ -191,5 +191,5 @@
     if (meanrmsi<0 || meanrmso<0)
     {
-        cout << "WARNING - MeanPedRMS inner or outer < 0 " << endl;
+        cout << "ERROR - MeanPedRMS inner or outer < 0 " << endl;
         cout << "MeanPedRMS inner " << meanrmsi << endl;
         cout << "MeanPedRMS outer " << meanrmso << endl;
@@ -203,5 +203,5 @@
     if (!cam)
     {
-        cout << "WARNING - Reading of Interp'd;avg failed." << endl;
+        cout << "ERROR - Reading of Interp'd;avg failed." << endl;
         return 2;
     }
@@ -212,5 +212,5 @@
     if (meansigi<0 || meansigo<0)
     {
-        cout << "WARNING - MeanInterp'd inner or outer < 0 " << endl;
+        cout << "ERRROR - MeanInterp'd inner or outer < 0 " << endl;
         cout << "MeanInterp'd inner " << meansigi << endl;
         cout << "MeanInterp'd outer " << meansigo << endl;
@@ -225,5 +225,5 @@
     if (pul->GetMean()<0 || pul->GetRMS()<0)
     {
-        cout << "WARNING - PulsePos'd mean or rms < 0 " << endl;
+        cout << "ERROR - PulsePos'd mean or rms < 0 " << endl;
         cout << "PulsePos'd mean " << pul->GetMean() << endl;
         cout << "PulsePos'd rms  " << pul->GetRMS() << endl;
@@ -258,5 +258,5 @@
     if (!cam)
     {
-        cout << "WARNING - Reading of Unsuitable;avg failed." << endl;
+        cout << "ERROR - Reading of Unsuitable;avg failed." << endl;
         return 2;
     }
@@ -375,5 +375,5 @@
 
 
-    return serv.Update("Calibration", vars, Form("fSequenceFirst=%d", seq));
+    return serv.Update("Calibration", vars, Form("fSequenceFirst=%d", seq)) ? 1 : 2;
 }
 
Index: trunk/MagicSoft/Mars/datacenter/macros/writesequencefile.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/writesequencefile.C	(revision 9004)
+++ trunk/MagicSoft/Mars/datacenter/macros/writesequencefile.C	(revision 9005)
@@ -41,186 +41,17 @@
 // to the database is not working.
 //
+//
+// This tool will work from Period017 (2004_05_17) on...
+//
+// For more details see MSequence and MSequenceSQL
+//
 /////////////////////////////////////////////////////////////////////////////
-#include <iostream>
-#include <iomanip>
-#include <fstream>
-
-#include <TSQLRow.h>
-#include <TSQLResult.h>
-
-#include <TEnv.h>
-#include <TMath.h>
-#include <TRegexp.h>
-
-#include "MAstro.h"
-#include "MTime.h"
-#include "MDirIter.h"
-
-#include "MSQLMagic.h"
+#include "MSequence.h"
 
 using namespace std;
 
-Bool_t GetRuns(MSQLServer &serv, ofstream &fout, TString query, TString name, UInt_t nevts=(UInt_t)-1)
+int writeseq(Int_t sequno, Int_t tel, TString sequpath="")
 {
-    TSQLResult *res = serv.Query(query);
-    if (!res)
-        return kFALSE;
-
-    UInt_t cnt=0;
-    UInt_t evts=0;
-
-    fout << name << ":";
-    TSQLRow *row=0;
-    while ((row = res->Next()) && evts<nevts)
-    {
-        fout << " " << (*row)[0];
-        evts += atoi((*row)[1]);
-        cnt++;
-    }
-    fout << endl;
-
-    delete res;
-
-    if (cnt==0)
-    {
-        cout << "ERROR - No " << name << " belonging to this sequence found." << endl;
-        return kFALSE;
-    }
-
-    return kTRUE;
-}
-
-TString GetTime(const char *type)
-{
-    return Form("if(TIME_TO_SEC(fRun%s)<12*60*60,"
-                " TIME_TO_SEC(fRun%s)+24*60*60,"
-                " TIME_TO_SEC(fRun%s))", type, type, type);
-}
-
-Int_t GetTimeC(MSQLServer &serv, const TString &str)
-{
-    TSQLResult *res = serv.Query(str);
-    if (!res)
-        return -1;
-
-    TSQLRow *row=res->Next();
-    if (!row)
-    {
-        delete res;
-        return -1;
-    }
-
-    Int_t rc = (*row)[0] ? atoi((*row)[0]) : -1;
-    delete res;
-    return rc;
-}
-
-Bool_t GetSequence(MSQLMagic &serv, TSQLRow &data, TString sequpath)
-{
-    UShort_t y;
-    Byte_t m, d;
-
-    MTime time;
-    time.SetSqlDateTime(data[8]);
-    time.GetDateOfSunrise(y, m, d);
-
-    TString date = Form("%04d-%02d-%02d", y, (int)m, (int)d);
-
-    Int_t period = MAstro::GetMagicPeriod(time.GetMjd());
-
-    TString str[6];
-    str[0] = serv.QueryNameOfKey("Project",         data[2]);
-    str[1] = serv.QueryNameOfKey("Source",          data[3]);
-    str[2] = serv.QueryNameOfKey("L1TriggerTable",  data[4]);
-    str[3] = serv.QueryNameOfKey("L2TriggerTable",  data[5]);
-    str[4] = serv.QueryNameOfKey("HvSettings",      data[6]);
-    str[5] = serv.QueryNameOfKey("LightConditions", data[7]);
-
-    if (str[0].IsNull() || str[1].IsNull() || str[2].IsNull() || str[3].IsNull() || str[4].IsNull() || str[5].IsNull())
-        return kFALSE;
-
-    //create sequence file
-    TString fname(Form("%s/%04d/sequence%08d.txt", sequpath.Data(), atoi(data[0])/10000, atoi(data[0])));
-    cout << "Creating " << fname << "..." << flush;
-
-    ofstream fout(fname);
-    if (!fout)
-    {
-        cout << "ERROR - Cannot open file." << endl;
-        return kFALSE;
-    }
-
-    //write information into file
-    fout << "Sequence:        " << data[0]  << endl;
-    fout << "Period:          " << period   << endl;
-    fout << "Night:           " << date     << endl;
-    fout << "LightConditions: " << str[5]   << endl;
-    fout << endl;
-    fout << "Start:           " << data[8]  << endl;
-    fout << "LastRun:         " << data[1]  << endl;
-    fout << "Project:         " << str[0]   << endl;
-    fout << "Source:          " << str[1]   << endl;
-    fout << "ZdMin:           " << data[10] << endl;
-    fout << "ZdMax:           " << data[11] << endl;
-    fout << "L1TriggerTable:  " << str[2]   << endl;
-    fout << "L2TriggerTable:  " << str[3]   << endl;
-    fout << "HvSettings:      " << str[4]   << endl;
-    fout << "NumEvents:       " << data[9]  << endl;
-    fout << endl;
-
-    TString where(Form(" FROM RunData WHERE fSequenceFirst=%s AND fExcludedFDAKEY=1"
-                       " AND fRunTypeKEY%%s", data[0]));
-
-    TString query1(Form("SELECT fRunNumber, fNumEvents %s", where.Data()));
-    TString query2(Form("SELECT %s %s", GetTime("Start").Data(), where.Data()));
-    TString query3(Form("SELECT %s %s", GetTime("Stop").Data(),  where.Data()));
-
-    TString queryA(Form(query1.Data(), " BETWEEN 2 AND 4 ORDER BY fRunNumber"));
-    TString queryC(Form(query1.Data(), "=4 ORDER BY fRunNumber"));
-    TString queryD(Form(query1.Data(), "=2 ORDER BY fRunNumber"));
-    TString queryT(Form(query2.Data(), "=4 ORDER BY fRunNumber LIMIT 1"));
-
-    Int_t timec = GetTimeC(serv, queryT);
-    if (timec<0)
-    {
-        cout << "WARNING - Requesting start time of first calibration run failed." << endl;
-        queryT = Form(query3.Data(), "=4 ORDER BY fRunNumber LIMIT 1");
-        timec = GetTimeC(serv, queryT);
-        if (timec<0)
-        {
-            cout << "ERROR - Neither start nor stop time of first calibration could be requested." << endl;
-            return kFALSE;
-        }
-    }
-
-    TString query4(Form("=3 ORDER BY ABS(%s-%d) ASC", GetTime("Stop").Data(), timec));
-    TString queryP(Form(query1.Data(), query4.Data()));
-
-    //write runs into sequence file
-    if (!GetRuns(serv, fout, queryA, "Runs"))
-        return kFALSE;
-
-    fout << endl;
-
-    if (!GetRuns(serv, fout, queryC, "CalRuns"))
-        return kFALSE;
-    if (!GetRuns(serv, fout, queryP, "PedRuns", 1000))
-        return kFALSE;
-    if (!GetRuns(serv, fout, queryD, "DatRuns"))
-        return kFALSE;
-
-    fout << endl;
-
-    cout << " done <Nevts=" << data[9] << ">" << endl;
-
-    return kTRUE;
-}
-
-// This tool will work from Period017 (2004_05_17) on...
-int writesequencefile(Int_t sequno, TString sequpath)
-{
-    TEnv env("sql.rc");
-
-    MSQLMagic serv(env);
+    MSQLMagic serv("sql.rc");
     if (!serv.IsConnected())
     {
@@ -233,23 +64,22 @@
     cout << endl;
     cout << "Connected to " << serv.GetName() << endl;
+    cout << "Sequence:  " << sequno << endl;
+    cout << "Telescope: " << tel << endl;
     cout << endl;
 
-    //get sequence information from database
-    TString query(Form("SELECT fSequenceFirst, fSequenceLast, fProjectKEY, fSourceKEY,"
-                       " fL1TriggerTableKEY, fL2TriggerTableKEY, fHvSettingsKEY, "
-                       " fLightConditionsKEY, fRunStart, fNumEvents, "
-                       " fZenithDistanceMin, fZenithDistanceMax "
-                       " FROM Sequences WHERE fSequenceFirst=%d", sequno));
-    TSQLResult *res = serv.Query(query);
+    const MSequenceSQL s(serv, sequno, tel);
+    if (!s.IsValid())
+        return 2;
 
-    TSQLRow *row = 0;
-    while ((row = res->Next()))
-        if (!GetSequence(serv, *row, sequpath))
-            return 2;
+    if (sequpath.IsNull())
+    {
+        s.Print();
+        return 1;
+    }
 
-    delete res;
+    const TString fname(Form("%s/%04d/sequence%08d.txt", sequpath.Data(), sequno/10000, sequno));
 
-    cout << endl;
+    cout << "File:     " << fname << endl;
 
-    return 1;
+    return s.WriteFile(fname) ? 1 : 2;
 }
Index: trunk/MagicSoft/Mars/ganymed.cc
===================================================================
--- trunk/MagicSoft/Mars/ganymed.cc	(revision 9004)
+++ trunk/MagicSoft/Mars/ganymed.cc	(revision 9005)
@@ -1,3 +1,3 @@
-#include <TROOT.h>
+#include <TTree.h>
 #include <TClass.h>
 #include <TSystem.h>
@@ -43,43 +43,53 @@
     gLog << " ganymed [options] dataset.txt|number" << endl << endl;
     gLog << " Arguments:" << endl;
-    gLog << "   dataset.txt:              ASCII file defining a collection of datasets/sequences" << endl;
-    gLog << "                             (for more details see MSequence/MDataSet)" << endl;
-    gLog << "   number:                   The dataset number (using file in the datacenter)" << endl;
-    gLog << "                             For more details see MDataSet." << endl;
+    gLog << "   dataset.txt:              File defining a collection of datasets/sequences"   << endl;
+    gLog << "                             (for more details see MSequence/MDataSet)"          << endl;
+    gLog << "   number:                   The dataset number (using file in the datacenter)"  << endl;
+    gLog << "                             For more details see MDataSet."                     << endl;
     gLog << " Root Options:" << endl;
-    gLog << "   -b                        Batch mode (no graphical output to screen)" << endl<<endl;
+    gLog << "   -b                        Batch mode (no graphical output to screen)"         << endl;
+    gLog << endl;
     gLog << " Operation Mode:" << endl;
-    gLog << "   -mc                       Monte Carlo dataset (no times)" << endl;
-    gLog << "   --wobble                  Force wobble mode (overwrites dataset)" << endl;
-    gLog << "   --no-wobble               Force normal mode (overwrites dataset)" << endl << endl;
+    gLog << "   -mc                       Monte Carlo dataset (no times)"                     << endl;
+    gLog << "   --wobble                  Force wobble mode (overwrites dataset)"             << endl;
+    gLog << "   --no-wobble               Force normal mode (overwrites dataset)"             << endl;
+    gLog << endl;
     gLog << " Options:" << endl;
     gLog.Usage();
-    gLog << "   --debug-env=0             Disable debugging setting resources <default>" << endl;
-    gLog << "   --debug-env[=1]           Display untouched resources after program execution" << endl;
-    gLog << "   --debug-env=2             Display untouched resources after eventloop setup" << endl;
-    gLog << "   --debug-env=3             Debug setting resources from resource file and command line" << endl;
+    gLog << "   --debug-env=0             Disable debugging setting resources <default>"      << endl;
+    gLog << "   --debug-env[=1]           Display untouched resources after execution"        << endl;
+    gLog << "   --debug-env=2             Display untouched resources after eventloop setup"  << endl;
+    gLog << "   --debug-env=3             Debug setting resources from resource file and"     << endl;
+    gLog << "                             command line" << endl;
     gLog << "   --debug-mem               Debug memory usage" << endl << endl;
-    gLog << "   --rc=Name:option          Set or overwrite a resource of the resource file." << endl;
-    gLog << "                             (Note, that this option can be used multiple times." << endl;
+    gLog << "   --rc=Name:option          Set or overwrite a resource of the resource file."  << endl;
+    gLog << "                             (Note, this option can be used multiple times)"     << endl;
     gLog << endl;
     gLog << "   -q                        Quit when job is finished" << endl;
     gLog << "   -f                        Force overwrite of existing files" << endl;
-    gLog << "   --n=number                Analysis number (required if not in dataset file)" << endl;
-    gLog << "   --dataset=number          Choose a dataset from a collection of datasets in your file" << endl;
-    gLog << "                             (for more details see MDataSet)" << endl;
-    gLog << "   --out=path                Path to write all output to [def=local path]" << endl;
-    gLog << "   --ind=path                Path to data/star files [default=datacenter path]" << endl;
-    gLog << "   --ins=path                Path to sequence files [default=datacenter path]" << endl;
-    gLog << "   --outf=filename           Filename for output file (eg. status display)" << endl;
+    gLog << "   --n=number                Analysis number (required if not in dataset file)"  << endl;
+    gLog << "   --dataset=number          Choose a dataset from a collection of datasets"     << endl;
+    gLog << "                             in your file (for more details see MDataSet)"       << endl;
+    gLog << "   --out=path                Path to write all output to [def=local path]"       << endl;
+    gLog << "   --ind=path                Path to data/star files [default=datacenter path]"  << endl;
+    gLog << "   --ins=path                Path to sequence files [default=datacenter path]"   << endl;
+    gLog << "   --outf=filename           Filename for output file (eg. status display)"      << endl;
     gLog << "   --sum[=filename]          Enable writing of summary file (events after cut0)" << endl;
 //    gLog << "   --res[=filename]          Enable writing of result file (surviving events)" << endl;
-    gLog << "   --skip-res                Disable writing of result events" << endl;
-    gLog << "   --write-only              Only write output files. No histograms filled." << endl;
-    gLog << "   --print-ds                Print the information interpreted from the dataset file" << endl;
-    gLog << "   --print-files             Print files taken from sequences ('+' found, '-' missing)" << endl;
+    gLog << "   --skip-res                Disable writing of result events"                   << endl;
+    gLog << "   --write-only              Only write output files. No histograms filled."     << endl;
+    gLog << "   --print-ds                Print dataset as interpreted from the dataset file" << endl;
+    gLog << "   --print-files             Print files from sequences, '+' found, '-' missing" << endl;
 //    gLog << "   --full-display            Show as many plots as possible" << endl;
-    gLog << "   --config=ganymed.rc       Resource file [default=ganymed.rc]" << endl;
-    gLog << endl;
-    gLog << "   --version, -V             Show startup message with version number" << endl;
+    gLog << "   --config=ganymed.rc       Resource file [default=ganymed.rc]"                 << endl;
+    gLog << endl;
+    gLog << "   --max-file-size=number    Sets the maximum size before root opens a new file" << endl;
+    gLog << "                             automatically. The number is given in kB (1000b)."  << endl;
+    gLog << "                             Use this option with caution it can result in"      << endl;
+    gLog << "                             extremely large files (especially summary files),"  << endl;
+    gLog << "                             use (e.g. lower size) cuts instead to decrease"     << endl;
+    gLog << "                             the file size. Root's default is 1.9GB."            << endl;
+    gLog << endl;
+    gLog << "   --version, -V             Show startup message with version number"           << endl;
     gLog << "   -?, -h, --help            This help" << endl << endl;
     gLog << "Background:" << endl;
@@ -89,5 +99,5 @@
     gLog << " 1,070,000km.  It has a magnetic field  and probably has a molten iron" << endl;
     gLog << " core.  It takes  Ganymed  7.15 days to  orbit  Jupiter.  Its mass  is" << endl;
-    gLog << " 1.5e23kg. It was independently discovered by  Galileo and S.Marius in"<< endl;
+    gLog << " 1.5e23kg. It was independently discovered by  Galileo and S.Marius in" << endl;
     gLog << " 1610.  Ganymed is  the largest moon  in the solar system;  it is also" << endl;
     gLog << " larger than the planets Mercury and Pluto." << endl << endl;
@@ -98,4 +108,6 @@
     if (!MARS::CheckRootVer())
         return 0xff;
+
+    // FIXME: Record command line to file!!!
 
     MLog::RedirectErrorHandler(MLog::kColor);
@@ -146,6 +158,9 @@
     const TString kNameSummary   = arg.GetStringAndRemove("--sum=");
     const Bool_t  kSkipResult    = arg.HasOnlyAndRemove("--skip-res");
+
 //    const Bool_t  kWriteResult   = arg.HasOnlyAndRemove("--res");
 //    const TString kNameResult    = arg.GetStringAndRemove("--res=");
+
+    TTree::SetMaxTreeSize((Long64_t)arg.GetIntAndRemove("--max-file-size=", TTree::GetMaxTreeSize()/1000)*1000);
 
     if (kWobbleModeOn && kWobbleModeOff)
Index: trunk/MagicSoft/Mars/mcamera/MCameraDC.h
===================================================================
--- trunk/MagicSoft/Mars/mcamera/MCameraDC.h	(revision 9004)
+++ trunk/MagicSoft/Mars/mcamera/MCameraDC.h	(revision 9005)
@@ -15,9 +15,17 @@
 class MCameraDC : public MParContainer, public MCamEvent
 {
+    friend class MReportCamera;
+    friend class MReportCurrents;
 private:
-    TArrayF fArray; // [nA] Unsigned Int!
+    Byte_t  fStatus; // CaCo monitored status of the High Voltage [0-9], Cam.HV.PS_state
+
+    TArrayF fArray;  // [nA] Unsigned Int!
+
+    Int_t Interprete(TString &str, Int_t len=0);
 
 public:
     MCameraDC(Int_t size=577, const char *name=NULL, const char *title=NULL);
+
+    Byte_t GetStatus() const { return  fStatus; }
 
     void SetCurrent(Int_t i, Float_t val) { fArray[i] = (Int_t)val; }
@@ -43,5 +51,5 @@
     }
 
-    ClassDef(MCameraDC, 1) // Storage Container for the Currents (PRELIMINARY)
+    ClassDef(MCameraDC, 2) // Storage Container for the Currents (PRELIMINARY)
 };
 
Index: trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- trunk/MagicSoft/Mars/merpp.cc	(revision 9004)
+++ trunk/MagicSoft/Mars/merpp.cc	(revision 9005)
@@ -359,4 +359,5 @@
             write->AddContainer("MCameraActiveLoad",  "Camera",     required);
             write->AddContainer("MCameraHV",          "Camera",     required);
+            write->AddContainer("MCameraDC",          "Camera",     required);
             write->AddContainer("MCameraLV",          "Camera",     required);
             write->AddContainer("MCameraLids",        "Camera",     required);
Index: trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 9004)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 9005)
@@ -1762,5 +1762,5 @@
     }
 
-    *fLog << all << GetDescriptor() << ": Done." << endl;
+    *fLog << all << GetDescriptor() << ": Done." << endl << endl << endl;
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 9004)
+++ trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 9005)
@@ -1210,6 +1210,5 @@
         return rc;
 
-    *fLog << all << GetDescriptor() << ": Done." << endl;
-    *fLog << endl << endl;
+    *fLog << all << GetDescriptor() << ": Done." << endl << endl << endl;
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/mreport/MReportCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCamera.cc	(revision 9004)
+++ trunk/MagicSoft/Mars/mreport/MReportCamera.cc	(revision 9005)
@@ -33,4 +33,8 @@
 // there.
 //
+// Version 2:
+// ----------
+//   - fStstusDC
+//
 //////////////////////////////////////////////////////////////////////////////
 #include "MReportCamera.h"
@@ -43,4 +47,5 @@
 #include "MCameraCalibration.h"
 #include "MCameraCooling.h"
+#include "MCameraDC.h"
 #include "MCameraHV.h"
 #include "MCameraLV.h"
@@ -53,6 +58,4 @@
 
 using namespace std;
-
-const Int_t  MReportCamera::gkActiveLoadControlVersNum = 200504130;
 
 // --------------------------------------------------------------------------
@@ -94,4 +97,8 @@
         return kFALSE;
 
+    fDC = (MCameraDC*)plist.FindCreateObj("MCameraDC");
+    if (!fDC)
+        return kFALSE;
+
     fLV = (MCameraLV*)plist.FindCreateObj("MCameraLV");
     if (!fLV)
@@ -122,7 +129,5 @@
         return kFALSE;
 
-    str.Remove(0, 577*4); // Remove DC currents
-    str=str.Strip(TString::kLeading);
-    return kTRUE;
+    return fDC->Interprete(str);
 }
 
@@ -548,9 +553,9 @@
     fCalibration->fStatusLoVoltage = (Bool_t)clv;
     fStatus                        = (Byte_t)stat;
-    fStatusDC                      = (Byte_t)dc;
+    fDC->fStatus                   = (Byte_t)dc;
     fActiveLoad->fStatus           = 0xff;
 
     Int_t len2=0;
-    if (ver > gkActiveLoadControlVersNum)
+    if (ver > 200504130)
     {
         Short_t actl;
@@ -608,5 +613,5 @@
     }
 
-    if (ver > gkActiveLoadControlVersNum)
+    if (ver > 200504130)
     {
          if (!InterpreteActiveLoad(str))
Index: trunk/MagicSoft/Mars/mreport/MReportCamera.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCamera.h	(revision 9004)
+++ trunk/MagicSoft/Mars/mreport/MReportCamera.h	(revision 9005)
@@ -9,4 +9,5 @@
 class MCameraLids;
 class MCameraHV;
+class MCameraDC;
 class MCameraLV;
 class MCameraAUX;
@@ -18,9 +19,5 @@
 {
 private:
-    
-    static const Int_t gkActiveLoadControlVersNum; //!
-
     Byte_t fStatus;   // CaCo monitored status of the sentinel (0-9), Sentinel_state
-    Byte_t fStatusDC; // CaCo monitored status of the DC currents (0-9), Cam.DC_state
 
     MCameraCooling     *fCooling;     //!
@@ -28,4 +25,5 @@
     MCameraAUX         *fAUX;         //!
     MCameraHV          *fHV;          //!
+    MCameraDC          *fDC;          //!
     MCameraLV          *fLV;          //!
     MCameraActiveLoad  *fActiveLoad;  //!
@@ -56,7 +54,6 @@
 
     Byte_t GetStatus() const { return  fStatus; }
-    Byte_t GetStatusDC() const { return fStatusDC; }
 
-    ClassDef(MReportCamera, 1) // Class for CAMERA-REPORT information
+    ClassDef(MReportCamera, 2) // Class for CAMERA-REPORT information
 };
 
Index: trunk/MagicSoft/Mars/mreport/MReportCurrents.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCurrents.cc	(revision 9004)
+++ trunk/MagicSoft/Mars/mreport/MReportCurrents.cc	(revision 9005)
@@ -84,27 +84,6 @@
     fStatus2 = (Byte_t)err2;
 
-    const char *pos = str.Data()+len;
-    const char *end = pos+577*4;
+    // FIXME: Set fDC->fStatus ???
 
-    Int_t i=0;
-    while (pos<end)
-    {
-        Int_t c;
-        const Char_t hex[5] = { pos[0], pos[1], pos[2], pos[3], 0 };
-        pos += 4;
-
-        const Int_t nn=sscanf(hex, "%4x", &c);
-        if (nn!=1)
-        {
-            *fLog << warn << "WARNING - Reading hexadecimal DC information." << endl;
-            return kCONTINUE;
-        }
-
-        (*fDC)[i++] = 0.001*c;
-    }
-
-    str.Remove(0, pos-str.Data()); // Remove DC currents
-    str=str.Strip(TString::kLeading);
-
-    return str.IsNull() ? kTRUE : kCONTINUE;
+    return fDC->Interprete(str, len);
 }
Index: trunk/MagicSoft/Mars/resources/sequences.rc
===================================================================
--- trunk/MagicSoft/Mars/resources/sequences.rc	(revision 9004)
+++ trunk/MagicSoft/Mars/resources/sequences.rc	(revision 9005)
@@ -1,9 +1,37 @@
+#/////////////////////////////////////////////////////////////////////////
+#
+# This file is compiled from two sections. One defines which transitions
+# are allowed to build a sequence (for example changing L1 Trigger
+# Tables between Calibration and Pedestal runs). The other section 
+# defines a regular expression to define the allowed ordering
+# of the P-, C- and D-runs.
+#
+# The sections a introduced by [Transition] and [Regexp]. For further
+# details see below.
+#
+# If a section should be valid only for one telescope use:
+#   [Transition]         # Valid for all telescope numbers
+#   [Transition 5]       # Valid for telescope 5
+#   [Transition: 5]      # Valid for telescope 5
+#   [Transition: 5 6]    # Valid for telescopes 5 and 6
+#
+#
+# File-Id:
+#   A file is uniquely identified by run-number and file-number.
+#   If you give just a number it is identical to run-number with
+#   file-number 0. To give a dedicated file-number you can use:
+#     run.file
+#
+#/////////////////////////////////////////////////////////////////////////
+
 ##########################################################################
 #
+# Explanation [Transition]
+#
 # Rules to build blocks which will later be broken into sequences
 #
 # Syntax:
 #
-# [keyname]
+# [Transition]
 # rule1
 # rule2
@@ -12,12 +40,13 @@
 #
 # Colums of rule:
-# 1 2 3 4 [5 [6]]
+# 0 [1 2 3 4 [5 [6]]]
 # 
+# 0: Table/Column to which the transition is applied
 # 1: Run type of previous run
 # 2: Run type of run to be accepted
 # 3: Key for previous run
 # 4: key for run to be accepted
-# 5: first run to apply this rule <default=0>
-# 6: last run to apply this rule <default=max>
+# 5: first file-id to apply this rule <default=0>
+# 6: last  file-id to apply this rule <default=max>
 #
 # Run Types:
@@ -31,19 +60,21 @@
 # A single "*" is an abbreviation for the regexp ".*" .
 #
-# A "-" is an abbreviation for "to be ignored". For example:
-#     [Test]
-#     - 4 * 1200 1300
+# As soon as any transition (column 0) is specified this transisiton 
+# is checked not to change within a sequence.
+#
+# A "-" is an abbreviation for transitions "to be ignored". For example:
+#     [Transition]
+#     Test - 4 * 1200 1300
 # would mean:
-#     ignore all keys (*) of column test for all current runs
-#     with run-type 4 if its run-number is between 1200 and 1300.
+#     ignore all keys (*) of column test for all current files
+#     with run-type 4 if its file-id is between 1200.0 and 1300.0
 #     The (former) third column in this case is obsolete.
 #
-# Ignore project name for calibration runs between 20100 and 45100
-#
 # Each Transition which appears at least once is checked.
 #
 
-[Transition]
-
+[Transition: 1]
+
+# Ignore project name for calibration files between 20100 and 45100
 Project           - 4 *    20100 45100
 HvSettings        - 2 *    86094 86094
@@ -76,5 +107,5 @@
 
 # The Discriminator Thresholds do not influence the pedestal- and
-# calibration-trigger and nedd therefore not to be chacked for these runs.
+# calibration-trigger and need therefore not to be checked for these runs.
 # This allows all kind of transitions from P/C to P/C and from C to D.
 DiscriminatorThresholdTable  [34]  [34]   *   *
@@ -166,10 +197,6 @@
 
 #########################################################################
-# The regexp section MUST be the last section. This allows
-# regular expressions to start with a [
-
-[Regexp]
-
-# Explanation:
+#
+# Explanation [Regexp]
 #
 # To build sequences a string with the run-types is evaluated.
@@ -185,6 +212,8 @@
 #
 # The syntax is
+#   [Regexp]
 #   regexp [firstrun [lastrun]]
 #
+[Regexp: 1]
 
 # Allow almost everything but require at least one run of each run-type
