Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4CommandsAnalysis/TGo4ComSaveAnalysisStatus.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE 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 "TGo4ComSaveAnalysisStatus.h"
00017 
00018 #include "Go4Log/TGo4Log.h"
00019 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00020 #include "Go4Analysis/TGo4AnalysisImp.h"
00021 
00022 TGo4ComSaveAnalysisStatus::TGo4ComSaveAnalysisStatus(const char* filename)
00023 :TGo4AnalysisCommand("ANSave","Save settings to file")
00024 {
00025    TRACE((12,"TGo4ComSaveAnalysisStatus::TGo4ComSaveAnalysisStatus() ctor",__LINE__, __FILE__));
00026    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00027                                                  // override default receiver
00028    SetFileName(filename);
00029    SetProtection(kGo4ComModeController);
00030 }
00031 
00032 
00033 TGo4ComSaveAnalysisStatus::TGo4ComSaveAnalysisStatus()
00034 :TGo4AnalysisCommand("ANSave","Save settings to file")
00035 {
00036    TRACE((12,"TGo4ComSaveAnalysisStatus::TGo4ComSaveAnalysisStatus() ctor",__LINE__, __FILE__));
00037    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00038                                                  // override default receiver
00039    SetFileName(TGo4Analysis::fgcDEFAULTSTATUSFILENAME);
00040    SetProtection(kGo4ComModeController);
00041 }
00042 
00043 
00044 TGo4ComSaveAnalysisStatus::~TGo4ComSaveAnalysisStatus()
00045 {
00046    TRACE((12,"TGo4ComSaveAnalysisStatus::~TGo4ComSaveAnalysisStatus() dtor",__LINE__, __FILE__));
00047 }
00048 
00049 
00050 Int_t TGo4ComSaveAnalysisStatus::ExeCom()
00051 {
00052    TRACE((12,"TGo4ComSaveAnalysisStatus::ExeCom()",__LINE__, __FILE__));
00053 
00054    TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00055    if (cli!=0)
00056       {
00057       TRACE((11,"TGo4ComSaveAnalysisStatus::ExeCom() - found valid receiver",__LINE__, __FILE__));
00058 //         TGo4Log::Debug(" Executing ComSaveAnalysisStatus...  ");
00059          TGo4Analysis* ana=TGo4Analysis::Instance();
00060          if(ana)
00061             {
00062                Bool_t ok=ana->SaveStatus( GetFileName() );
00063                if(ok)
00064                   {
00065                    cli->SendStatusMessage(1, kFALSE,"Saved analysis status to file %s.",
00066                                                 GetFileName());
00067                   }
00068                else
00069                   {
00070                    cli->SendStatusMessage(3, kFALSE,"ERROR on Saving analysis status to file %s.",
00071                                                 GetFileName());
00072                   } // if(ok)
00073             }
00074          else
00075             {
00076                     cli->SendStatusMessage(3, kTRUE," %s ERROR no analysis ",
00077                                                  GetName());
00078             } // if(ana)
00079       }
00080    else
00081       {
00082       TRACE((11,"TGo4ComSaveAnalysisStatus::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00083          TGo4Log::Debug(" !!! ComSaveAnalysisStatus ''%s'': NO RECEIVER ERROR!!!",GetName());
00084          return 1;
00085       }
00086 
00087    return -1;
00088 }
00089 
00090 ClassImp(TGo4ComSaveAnalysisStatus)
00091 
00092 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:50 2005 for Go4-v2.10-5 by doxygen1.2.15