Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4ComAutosave.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4ComAutosave.h"
00017 
00018 #include "TGo4Log.h"
00019 #include "TGo4AnalysisClientImp.h"
00020 #include "TGo4AnalysisImp.h"
00021 #include "TGo4RemoteCommand.h"
00022 
00023 TGo4ComAutosave::TGo4ComAutosave() :
00024    TGo4AnalysisCommand("ANAutosave","Do immediate autosave"),
00025    fiAutoSaveCompression(5), fbAutoSaveOverwrite(1)
00026 {
00027    TRACE((12,"TGo4ComAutosave::TGo4ComAutosave() ctor",__LINE__, __FILE__));
00028    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00029                                        // override default receiver
00030    SetProtection(kGo4ComModeController);
00031 }
00032 
00033 TGo4ComAutosave::~TGo4ComAutosave()
00034 {
00035    TRACE((12,"TGo4ComAutosave::~TGo4ComAutosave() dtor",__LINE__, __FILE__));
00036 }
00037 
00038 void TGo4ComAutosave::Set(TGo4RemoteCommand* remcom)
00039 {
00040 if(remcom==0) return;
00041 SetAutoSaveCompression(remcom->GetValue(0));
00042 SetAutoSaveOverwrite(remcom->GetValue(1));
00043 SetAutoFileName(remcom->GetString(0));
00044 }
00045 
00046 Int_t TGo4ComAutosave::ExeCom()
00047 {
00048    TRACE((12,"TGo4ComAutosave::ExeCom()",__LINE__, __FILE__));
00049 
00050    TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00051    if (cli!=0)
00052       {
00053          TGo4Analysis* ana = TGo4Analysis::Instance();
00054          if(ana)
00055             {
00056                Bool_t autoenab=ana->IsAutoSaveOn();
00057                cli->SendStatusMessage(1, kTRUE,"Autosaving now...");
00058                ana->SetAutoSave(kTRUE);
00059                ana->SetAutoSaveFile(GetAutoFileName(),
00060                                     fbAutoSaveOverwrite,
00061                                     fiAutoSaveCompression);
00062                ana->AutoSave();
00063                ana->SetAutoSave(autoenab); // recover old autosave state
00064             }
00065 
00066       }
00067    else
00068       {
00069       TRACE((11,"TGo4ComAutosave::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00070          TGo4Log::Debug(" !!! ComAutosave ''%s'': NO RECEIVER ERROR!!!",GetName());
00071          return 1;
00072       }
00073 
00074    return -1;
00075 }
00076 
00077 
00078 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:05 2008 for Go4-v3.04-1 by  doxygen 1.4.2