Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 2677)
+++ trunk/MagicSoft/Mars/Changelog	(revision 2678)
@@ -18,4 +18,24 @@
    * mfilter/MFAntiFilter.[h,cc]:
      - removed. This function is implemented in MFilterList
+
+   * merpp.cc:
+     - enhanced to support start/stop time
+
+   * manalysis/MEventRateCalc.cc:
+     - removed some stuff which was commented out
+     
+   * mbase/MTime.cc:
+     - small change to GetString
+     
+   * mhist/MHCamera.cc:
+     - made the inverse deep blue dea palette the default
+       (FIXME: Make this a resource)
+     
+   * mreport/MReport.[h,cc]:
+     - added MTime arguments to Interprete
+     
+   * mreport/MReportFileRead.[h,cc]:
+     - added MTime arguments to Interprete
+     - added fStart/fStop data member
 
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 2677)
+++ trunk/MagicSoft/Mars/NEWS	(revision 2678)
@@ -12,4 +12,6 @@
 
    - added support for DC current files from the camera control
+
+   - added support for start- and stop-time when merpping report files
 
 
Index: trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc	(revision 2677)
+++ trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc	(revision 2678)
@@ -59,5 +59,5 @@
 //
 MEventRateCalc::MEventRateCalc(const char *name, const char *title)
-    : /*fNumEvents(10000),*/ fTimes(1000)
+    : fTimes(1000)
 {
     fName  = name  ? name  : "MEventRateCalc";
@@ -82,6 +82,4 @@
     if (!fRate)
         return kFALSE;
-
-    //fEvtNumber = 0;
 
     memset(fTimes.GetArray(), 0, sizeof(Double_t)*fTimes.GetSize());
Index: trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 2677)
+++ trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 2678)
@@ -229,5 +229,5 @@
 //
 // Return contents as a TString of the form:
-//   "[yy]yy/mm/dd [h]h:mm:ss.fff"
+//   "yyyy/mm/dd hh:mm:ss.fff"
 //
 TString MTime::GetString() const
@@ -239,5 +239,5 @@
     GetTime(h, m, s, ms);
 
-    return TString(Form("%2d/%02d/%02d %02d:%02d:%02d.%03d", y, mon, d, h, m, s, ms));
+    return TString(Form("%4d/%02d/%02d %02d:%02d:%02d.%03d", y, mon, d, h, m, s, ms));
 }
 
Index: trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- trunk/MagicSoft/Mars/merpp.cc	(revision 2677)
+++ trunk/MagicSoft/Mars/merpp.cc	(revision 2678)
@@ -68,8 +68,23 @@
     gLog << "     -cn: Compression level n=1..9 [default=2]" << endl;
     gLog << "     -vn: Verbosity level n [default=2]" << endl;
+    gLog << "     --start=yyyy-mm-dd/hh:mm:ss.mmm: Start event time for merpping report files" << endl;
+    gLog << "     --stop=yyyy-mm-dd/hh:mm:ss.mmm:  Stop  event time for merpping report files" << endl;
     gLog << "     -?/-h: This help" << endl << endl;
     gLog << "   REMARK: At the moment you can process a .raw _or_ a .rep file, only!" << endl << endl;
 }
 
+// FIXME: Move to MTime (maybe 'InterpreteCmdline'
+MTime AnalyseTime(TString str)
+{
+    Int_t y=0, ms=0, mon=0, d=0, h=0, m=0, s=0;
+
+    if (7!=sscanf(str.Data(), "%d-%d-%d/%d:%d:%d.%d", &y, &mon, &d, &h, &m, &s, &ms))
+        return MTime();
+
+    MTime t;
+    t.Set(y, mon, d, h, m, s, ms);
+    return t;
+}
+
 int main(const int argc, char **argv)
 {
@@ -95,4 +110,14 @@
     gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);
 
+    MTime kTimeStart(AnalyseTime(arg.GetStringAndRemove("--start=")));
+    MTime kTimeStop(AnalyseTime(arg.GetStringAndRemove("--stop=")));
+    kTimeStart.SetName("MTimeStart");
+    kTimeStop.SetName("MTimeStop");
+
+    if (!kTimeStart)
+        cout << "No start time!" << endl;
+    if (!kTimeStop)
+        cout << "No stop time!" << endl;
+
     //
     // check for the right usage of the program
@@ -172,5 +197,5 @@
     //
     // ---- The following is only necessary to supress some output ----
-    //
+    /*
     MRawRunHeader runheader;
     plist.AddToList(&runheader);
@@ -187,4 +212,5 @@
     MTime evttime;
     plist.AddToList(&evttime);
+    */
 
     //
@@ -200,4 +226,6 @@
     {
         MReportFileRead *r = new MReportFileRead(kNamein);
+        r->SetTimeStart(kTimeStart);
+        r->SetTimeStop(kTimeStop);
         if (isdc)
         {
@@ -215,10 +243,4 @@
 
         MWriteRootFile *w = new MWriteRootFile(kNameout, option, "Magic root-file", kComprlvl);
-        /*
-         w->AddContainer("MReportDAQ",         "DAQ");
-         w->AddContainer("MTimeDAQ",           "DAQ");
-         w->AddContainer("MReportDrive",       "Drive");
-         w->AddContainer("MTimeDrive",         "Drive");
-         */
         if (isdc)
         {
@@ -241,4 +263,6 @@
             w->AddContainer("MReportDrive",       "Drive");
             w->AddContainer("MTimeDrive",         "Drive");
+            // w->AddContainer("MReportDAQ",         "DAQ");
+            // w->AddContainer("MTimeDAQ",           "DAQ");
         }
         write = w;
@@ -249,4 +273,5 @@
         write = new MRawFileWrite(kNameout, option, "Magic root-file", kComprlvl);
     }
+
     tasks.AddToList(read);
     tasks.AddToList(write);
Index: trunk/MagicSoft/Mars/mhist/MHCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 2677)
+++ trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 2678)
@@ -93,5 +93,5 @@
     SetPalette(1, 0);
 #else
-    SetPalette(51, 0);
+    SetInvDeepBlueSeaPalette();
 #endif
 }
Index: trunk/MagicSoft/Mars/mreport/MReport.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReport.cc	(revision 2677)
+++ trunk/MagicSoft/Mars/mreport/MReport.cc	(revision 2678)
@@ -53,4 +53,6 @@
 // While skip are numbers which won't enter the analysis
 //
+// SetupReading must be called successfully before.
+//
 Bool_t MReport::InterpreteHeader(TString &str)
 {
@@ -70,12 +72,11 @@
 
     fState=state;
-    if (fTime)
-        if (!fTime->Set(yea, mon, day, hor, min, sec, ms))
-        {
-            *fLog << err << "ERROR - Event has invalid time: ";
-            *fLog << Form("%d.%d.%d %02s:%02d:%02d.%03d", day, mon, yea, hor, min, sec, ms);
-            *fLog << "... abort." << endl;
-            return kFALSE;
-        }
+    if (!fTime->Set(yea, mon, day, hor, min, sec, ms))
+    {
+        *fLog << err << "ERROR - Event has invalid time: ";
+        *fLog << Form("%d.%d.%d %02s:%02d:%02d.%03d", day, mon, yea, hor, min, sec, ms);
+        *fLog << "... abort." << endl;
+        return kFALSE;
+    }
 
     str.Remove(0, len);
@@ -102,8 +103,15 @@
 // when a corresponding time container exists.
 //
-Bool_t MReport::Interprete(TString &str)
+// SetupReading must be called successfully before.
+//
+Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop)
 {
     if (!InterpreteHeader(str))
         return kFALSE;
+
+    if (start && *fTime<start)
+        return kCONTINUE;
+    if (stop  && *fTime>stop)
+        return kCONTINUE;
 
     if (!InterpreteBody(str))
@@ -111,6 +119,5 @@
 
     SetReadyToSave();
-    if (fTime)
-        fTime->SetReadyToSave();
+    fTime->SetReadyToSave();
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/mreport/MReport.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReport.h	(revision 2677)
+++ trunk/MagicSoft/Mars/mreport/MReport.h	(revision 2678)
@@ -27,5 +27,5 @@
     virtual Bool_t InterpreteBody(TString &str);
 
-    Bool_t Interprete(TString &str);
+    Int_t  Interprete(TString &str, const MTime &start, const MTime &stop);
     Bool_t CheckIdentifier(TString &str) const
     {
Index: trunk/MagicSoft/Mars/mreport/MReportFileRead.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportFileRead.cc	(revision 2677)
+++ trunk/MagicSoft/Mars/mreport/MReportFileRead.cc	(revision 2678)
@@ -119,11 +119,13 @@
     MReport *GetReport() { return fReport; }
     //void SetTime(MTime *t) { fReport->SetTime(t); }
-    Bool_t Interprete(TString &str)
-    {
-        if (!fReport->Interprete(str))
+    Int_t Interprete(TString &str, const MTime &start, const MTime &stop)
+    {
+        const Int_t rc = fReport->Interprete(str, start, stop);
+
+        if (rc==kFALSE)
             return kFALSE;
 
         fNumReports++;
-        return kTRUE;
+        return rc;
     }
     Bool_t SetupReading(MParList &plist) { return fReport->SetupReading(plist); }
@@ -289,7 +291,5 @@
     while (!GetReport(rep))
     {
-        // Don't know the reason, but ReadLine and ReadString don't work
-        // for the (at least: converted) DC files.
-        str.ReadToDelim(*fIn);
+        str.ReadLine(*fIn);
         if (!*fIn)
         {
@@ -307,5 +307,6 @@
     }
 
-    if (!rep->Interprete(str))
+    const Int_t rc = rep->Interprete(str, fStart, fStop);
+    if (rc==kFALSE)
     {
         *fLog << err << "ERROR - Interpretation of '" << rep->GetName() << "' failed." << endl;
@@ -313,5 +314,5 @@
     }
 
-    return kTRUE;
+    return rc;
 }
 
Index: trunk/MagicSoft/Mars/mreport/MReportFileRead.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportFileRead.h	(revision 2677)
+++ trunk/MagicSoft/Mars/mreport/MReportFileRead.h	(revision 2678)
@@ -5,8 +5,12 @@
 #include "MTask.h"
 #endif
+#ifndef MARS_MTime
+#include "MTime.h"
+#endif
 
-// gcc 3.2
+/*// gcc 3.2
 //class ifstream;
 #include <iosfwd>
+*/
 
 class THashTable;
@@ -27,4 +31,7 @@
     THashTable *fList;
 
+    MTime fStart;            // Time range which should be read from file
+    MTime fStop;             // Time range which should be read from file
+
     enum { kHasNoHeader = BIT(14) };
 
@@ -43,4 +50,6 @@
 
     void SetHasNoHeader() { SetBit(kHasNoHeader); }
+    void SetTimeStart(const MTime &tm) { fStart = tm; }
+    void SetTimeStop(const MTime &tm)  { fStop = tm; }
 
     Bool_t AddToList(const char *name) const;
