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

TGo4ComSaveAnalysisStatus.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 "TGo4ComSaveAnalysisStatus.h"
00017 
00018 #include "TGo4Log.h"
00019 #include "TGo4AnalysisClientImp.h"
00020 #include "TGo4AnalysisImp.h"
00021 #include "TGo4RemoteCommand.h"
00022 
00023 TGo4ComSaveAnalysisStatus::TGo4ComSaveAnalysisStatus(const char* filename)
00024 :TGo4AnalysisCommand("ANSave","Save settings to file")
00025 {
00026    TRACE((12,"TGo4ComSaveAnalysisStatus::TGo4ComSaveAnalysisStatus() ctor",__LINE__, __FILE__));
00027    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00028                                                  // override default receiver
00029    SetFileName(filename);
00030    SetProtection(kGo4ComModeController);
00031 }
00032 
00033 
00034 TGo4ComSaveAnalysisStatus::TGo4ComSaveAnalysisStatus()
00035 :TGo4AnalysisCommand("ANSave","Save settings to file")
00036 {
00037    TRACE((12,"TGo4ComSaveAnalysisStatus::TGo4ComSaveAnalysisStatus() ctor",__LINE__, __FILE__));
00038    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00039                                                  // override default receiver
00040    SetFileName(TGo4Analysis::fgcDEFAULTSTATUSFILENAME);
00041    SetProtection(kGo4ComModeController);
00042 }
00043 
00044 
00045 TGo4ComSaveAnalysisStatus::~TGo4ComSaveAnalysisStatus()
00046 {
00047    TRACE((12,"TGo4ComSaveAnalysisStatus::~TGo4ComSaveAnalysisStatus() dtor",__LINE__, __FILE__));
00048 }
00049 
00050 void TGo4ComSaveAnalysisStatus::Set(TGo4RemoteCommand* remcom)
00051 {
00052 if(remcom==0) return;
00053 SetFileName(remcom->GetString(0));
00054 }
00055 
00056 
00057 
00058 Int_t TGo4ComSaveAnalysisStatus::ExeCom()
00059 {
00060    TRACE((12,"TGo4ComSaveAnalysisStatus::ExeCom()",__LINE__, __FILE__));
00061 
00062    TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00063    if (cli!=0)
00064       {
00065       TRACE((11,"TGo4ComSaveAnalysisStatus::ExeCom() - found valid receiver",__LINE__, __FILE__));
00066 //         TGo4Log::Debug(" Executing ComSaveAnalysisStatus...  ");
00067          TGo4Analysis* ana=TGo4Analysis::Instance();
00068          if(ana)
00069             {
00070                Bool_t ok=ana->SaveStatus( GetFileName() );
00071                if(ok)
00072                   {
00073                    cli->SendStatusMessage(1, kFALSE,"Saved analysis status to file %s.",
00074                                                 GetFileName());
00075                   }
00076                else
00077                   {
00078                    cli->SendStatusMessage(3, kFALSE,"ERROR on Saving analysis status to file %s.",
00079                                                 GetFileName());
00080                   } // if(ok)
00081             }
00082          else
00083             {
00084                     cli->SendStatusMessage(3, kTRUE," %s ERROR no analysis ",
00085                                                  GetName());
00086             } // if(ana)
00087       }
00088    else
00089       {
00090       TRACE((11,"TGo4ComSaveAnalysisStatus::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00091          TGo4Log::Debug(" !!! ComSaveAnalysisStatus ''%s'': NO RECEIVER ERROR!!!",GetName());
00092          return 1;
00093       }
00094 
00095    return -1;
00096 }
00097 
00098 //----------------------------END OF GO4 SOURCE FILE ---------------------

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