00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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");
00027
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");
00038
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
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 }
00073 }
00074 else
00075 {
00076 cli->SendStatusMessage(3, kTRUE," %s ERROR no analysis ",
00077 GetName());
00078 }
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