Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4ComLoadAnalysisStatus.h"
00015
00016 #include "TGo4Log.h"
00017 #include "TGo4AnalysisClientImp.h"
00018 #include "TGo4RuntimeException.h"
00019 #include "TGo4AnalysisImp.h"
00020 #include "TGo4RemoteCommand.h"
00021
00022 TGo4ComLoadAnalysisStatus::TGo4ComLoadAnalysisStatus(const char* filename) :
00023 TGo4AnalysisCommand("ANLoad","Load Analysis Settings from file")
00024 {
00025 GO4TRACE((12,"TGo4ComLoadAnalysisStatus::TGo4ComLoadAnalysisStatus() ctor",__LINE__, __FILE__));
00026 SetReceiverName("AnalysisClient");
00027
00028 SetProtection(kGo4ComModeController);
00029 SetFileName(filename);
00030 }
00031
00032 TGo4ComLoadAnalysisStatus::TGo4ComLoadAnalysisStatus() :
00033 TGo4AnalysisCommand("ANLoad","Load Analysis Settings from file")
00034 {
00035 GO4TRACE((12,"TGo4ComLoadAnalysisStatus::TGo4ComLoadAnalysisStatus() ctor",__LINE__, __FILE__));
00036 SetReceiverName("AnalysisClient");
00037
00038 SetFileName(TGo4Analysis::fgcDEFAULTSTATUSFILENAME);
00039 SetProtection(kGo4ComModeController);
00040 }
00041
00042 TGo4ComLoadAnalysisStatus::~TGo4ComLoadAnalysisStatus()
00043 {
00044 GO4TRACE((12,"TGo4ComLoadAnalysisStatus::~TGo4ComLoadAnalysisStatus() dtor",__LINE__, __FILE__));
00045 }
00046
00047 void TGo4ComLoadAnalysisStatus::Set(TGo4RemoteCommand* remcom)
00048 {
00049 if(remcom==0) return;
00050 SetFileName(remcom->GetString(0));
00051 }
00052
00053 Int_t TGo4ComLoadAnalysisStatus::ExeCom()
00054 {
00055 GO4TRACE((12,"TGo4ComLoadAnalysisStatus::ExeCom()",__LINE__, __FILE__));
00056
00057 TGo4AnalysisClient* cli = dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00058 if (cli==0) {
00059 GO4TRACE((11,"TGo4ComLoadAnalysisStatus::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00060 TGo4Log::Debug(" !!! ComLoadAnalysisStatus ''%s'': NO RECEIVER ERROR!!!",GetName());
00061 throw TGo4RuntimeException();
00062 return 1;
00063 }
00064
00065 GO4TRACE((11,"TGo4ComLoadAnalysisStatus::ExeCom() - found valid receiver",__LINE__, __FILE__));
00066
00067 TGo4Analysis* ana = TGo4Analysis::Instance();
00068 if(ana) {
00069 Bool_t ok=ana->LoadStatus( GetFileName() );
00070 if(ok)
00071 {
00072 cli->SendStatusMessage(1, kFALSE, TString::Format(
00073 "Loaded analysis status from file %s.", GetFileName()));
00074 }
00075 else
00076 {
00077 cli->SendStatusMessage(3, kFALSE,TString::Format(
00078 "ERROR on Loading analysis status from file %s", GetFileName()));
00079 }
00080
00081 }
00082 else
00083 {
00084 cli->SendStatusMessage(3, kTRUE, TString::Format(
00085 " %s ERROR no analysis", GetName()));
00086 }
00087
00088
00089 return -1;
00090 }
00091