Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 4799)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 4800)
@@ -19,24 +19,32 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2004/08/30: Thomas Bretz
+
+   * showlog.cc, showplot.cc:
+     - anhanced functionality
+
+
+
  2004/08/29: Markus Gaug
  
-  * mbadpixels/MBadPixelsPix.[h,cc] 
-  * mbadpixels/MBadPixelsCam.cc
-  * mjobs/MJCalibration.cc 
-    - introduced new calibration bits: kHiGainOverFlow 
-      and kLoGainOverFlow being filled when the calibration histograms 
-      overflow. Will cause an kUnsuitableRun afterwards. 
-    - added in datacheck-display of MJCalibration
-
-  * mcalib/MHCalibrationChargeHiGainPix.[h,cc]
-  * mcalib/MHCalibrationChargeLoGainPix.[h,cc]
-    - default lower histogram limit moved to -100.5
-
-  * mcalib/MHCalibrationCam.h
-  * mcalib/MHCalibrationChargeCam.cc
-    - make TArrayI out of fOverFlowHiGain and fOverFlowLoGain
-
-  * mjobs/MJCalibration.[h,cc]
-    - finished datacheck display with the arrival times.
+   * mbadpixels/MBadPixelsPix.[h,cc] 
+   * mbadpixels/MBadPixelsCam.cc
+   * mjobs/MJCalibration.cc 
+     - introduced new calibration bits: kHiGainOverFlow 
+       and kLoGainOverFlow being filled when the calibration histograms 
+       overflow. Will cause an kUnsuitableRun afterwards. 
+     - added in datacheck-display of MJCalibration
+
+   * mcalib/MHCalibrationChargeHiGainPix.[h,cc]
+   * mcalib/MHCalibrationChargeLoGainPix.[h,cc]
+     - default lower histogram limit moved to -100.5
+
+   * mcalib/MHCalibrationCam.h
+   * mcalib/MHCalibrationChargeCam.cc
+     - make TArrayI out of fOverFlowHiGain and fOverFlowLoGain
+
+   * mjobs/MJCalibration.[h,cc]
+     - finished datacheck display with the arrival times.
+
 
 
@@ -45,4 +53,6 @@
    * mpedestal/MPedestalPix.h
      - correct calculation of error of RMS
+
+
 
  2004/08/27: Hendrik Bartko
@@ -51,4 +61,6 @@
      - check that the pixel has a low gain before calculating the time 
        for the low gain in case of a saturated high gain.
+
+
 
  2004/08/27: Markus Gaug
Index: /trunk/MagicSoft/Mars/callisto.cc
===================================================================
--- /trunk/MagicSoft/Mars/callisto.cc	(revision 4799)
+++ /trunk/MagicSoft/Mars/callisto.cc	(revision 4800)
@@ -54,4 +54,5 @@
     gLog << "   --debug-env               Debug setting resources from file" << endl << endl;
     gLog << endl;
+    gLog << "   -q                        Quit when job is finished" << endl;
     gLog << "   -f                        Force overwrite of existing files" << endl;
     gLog << "   -ff                       Force execution if not all files found" << endl;
@@ -85,5 +86,6 @@
     gLog << " contants. These constants are stored in a so called calibration-file" << endl;
     gLog << " together with some datacheck plots  which can be viewed using either" << endl;
-    gLog << " showplot or MStatusDisplay in the interpreter." << endl << endl;
+    gLog << " showplot or MStatusDisplay in the interpreter.  A description  of  a" << endl;
+    gLog << " sequence-file can be found in the class reference of MSequence." << endl << endl;
     gLog << "Example:" << endl;
     gLog << " callisto -f --outc=mycal/ --outy=mysignal/ --log sequence02345.txt" << endl;
@@ -98,5 +100,5 @@
     // Evaluate arguments
     //
-    MArgs arg(argc, argv);
+    MArgs arg(argc, argv, kTRUE);
 
     if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
@@ -115,4 +117,6 @@
     const Bool_t  kDebugEnv   = arg.HasOnlyAndRemove("--debug-env");
 
+    const Bool_t  kQuit       = arg.HasOnlyAndRemove("-q");
+    const Bool_t  kBatch      = arg.HasOnlyAndRemove("-b");
     const Bool_t  kOverwrite  = arg.HasOnlyAndRemove("-f");
     const Bool_t  kForceExec  = arg.HasOnlyAndRemove("-ff");
@@ -380,4 +384,10 @@
     }
 
+    if (kBatch || kQuit)
+    {
+        delete d;
+        return 0;
+    }
+
     // From now on each 'Close' means: Terminate the application
     d->SetBit(MStatusDisplay::kExitLoopOnClose);
Index: /trunk/MagicSoft/Mars/showlog.cc
===================================================================
--- /trunk/MagicSoft/Mars/showlog.cc	(revision 4799)
+++ /trunk/MagicSoft/Mars/showlog.cc	(revision 4800)
@@ -1,4 +1,6 @@
 #include <errno.h>
 #include <fstream>
+
+#include <TRegexp.h>
 
 #include "MArgs.h"
@@ -16,4 +18,5 @@
     gLog << " or" << endl;
     gLog << "   showlog [options] < filename" << endl << endl;
+    gLog.Usage();
     gLog << "   -?, -h, --help            This help" << endl << endl;
     gLog << endl;
@@ -24,4 +27,21 @@
     gLog << " colored output with less use the option -R, eg." << endl;
     gLog << "   less -R logfile.log" << endl << endl;
+}
+
+void RemoveAnsi(TString &s)
+{
+    static const TRegexp regexp("[][[][0-9]+[m]");
+
+    int i=0;
+
+    while (1)
+    {
+        Ssiz_t len = 0;
+        Ssiz_t idx = s.Index(regexp, &len);
+        if (idx<0)
+            break;
+
+        s.Remove(idx, len);
+    }
 }
 
@@ -37,4 +57,8 @@
         return -1;
     }
+
+    const Bool_t kNoColors = arg.HasOnly("--no-colors") || arg.HasOnly("-a");
+
+    gLog.Setup(arg);
 
     if (arg.GetNumOptions()>0)
@@ -69,5 +93,8 @@
             break;
 
-        s.ReplaceAll("", "\033");
+        if (kNoColors)
+            RemoveAnsi(s);
+        else
+            s.ReplaceAll("", "\033");
         gLog << s << endl;
     }
Index: /trunk/MagicSoft/Mars/showplot.cc
===================================================================
--- /trunk/MagicSoft/Mars/showplot.cc	(revision 4799)
+++ /trunk/MagicSoft/Mars/showplot.cc	(revision 4800)
@@ -28,5 +28,18 @@
     gLog << all << endl;
     gLog << "Sorry the usage is:" << endl;
-    gLog << " showplot filename" << endl << endl;
+    gLog << " showplot [options] filename" << endl << endl;
+    gLog << " Arguments:" << endl;
+    gLog << "   filename                  Input file containing an MStatusArray" << endl << endl;
+    gLog << " Root Options:" << endl;
+    gLog << "   -b                        Batch mode (no graphical output to screen)" << endl<<endl;
+    gLog << " Options: "<< endl;
+    gLog.Usage();
+    gLog << "   -q                        Quit when job is finished" << endl;
+    gLog << endl;
+    gLog << " Output Options: "<< endl;
+    gLog << "   --save-as-ps[=filename]   Save plots as postscript" << endl;
+    gLog << "   --save-as-gif[=filename]  Save plots as gif files" << endl;
+    gLog << "   --save-as-C[=filename]    Save plots as root scripts" << endl;
+    gLog << "   --tab=num                 Save only tab number num" << endl << endl;
     gLog << "Description:" << endl;
     gLog << " Use showplot to display a MStatusArray in an MStatusDisplay." << endl;
@@ -51,4 +64,20 @@
     }
 
+    gLog.Setup(arg);
+
+    const Bool_t kQuit      = arg.HasOnlyAndRemove("-q");
+    const Bool_t kBatch     = arg.HasOnlyAndRemove("-b");
+
+    const Int_t  kTab       = arg.GetIntAndRemove("--tab=", -1);
+
+    const Bool_t kSaveAsPs  = arg.HasOnlyAndRemove("--save-as-ps") || arg.Has("--save-as-ps=");
+    const Bool_t kSaveAsGif = arg.HasOnlyAndRemove("--save-as-gif") || arg.Has("--save-as-gif=");
+    const Bool_t kSaveAsC   = arg.HasOnlyAndRemove("--save-as-C") || arg.Has("--save-as-C=");
+
+    TString kNamePs  = arg.GetStringAndRemove("--save-as-ps=");
+    TString kNameGif = arg.GetStringAndRemove("--save-as-gif=");
+    TString kNameC   = arg.GetStringAndRemove("--save-as-C=");
+
+
     //
     // check for the right usage of the program
@@ -60,6 +89,4 @@
     }
 
-    const TString kInput = arg.GetArgumentStr(0);
-
     TApplication app("Callisto", &argc, argv);
     if (gROOT->IsBatch() || !gClient)
@@ -68,4 +95,16 @@
         return 1;
     }
+
+    //
+    // Process filenames
+    //
+    const TString kInput = arg.GetArgumentStr(0);
+
+    if (kNamePs.IsNull() && kSaveAsPs)
+        kNamePs = kInput;
+    if (kNameGif.IsNull() && kSaveAsGif)
+        kNameGif = kInput;
+    if (kNameC.IsNull() && kSaveAsC)
+        kNameC = kInput;
 
     //
@@ -78,4 +117,17 @@
     d->Open(kInput);
 
+    if (kSaveAsPs)
+        d->SaveAsPS(kTab, kNamePs);
+    if (kSaveAsGif)
+        d->SaveAsGIF(kTab, kNameGif);
+    if (kSaveAsC)
+        d->SaveAsC(kTab, kNameC);
+
+    if (kBatch || kQuit)
+    {
+        delete d;
+        return 0;
+    }
+
     // From now on each 'Close' means: Terminate the application
     d->SetBit(MStatusDisplay::kExitLoopOnClose);
