00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4ComClearObject.h"
00017
00018 #include "Go4Log/TGo4Log.h"
00019 #include "Go4Analysis/TGo4AnalysisImp.h"
00020 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00021
00022 TGo4ComClearObject::TGo4ComClearObject()
00023 :TGo4AnalysisObjectCommand("ANClearObject",
00024 "clears object by name",
00025 "his")
00026 {
00027 TRACE((12,"TGo4ComClearObject::TGo4ComClearObject() ctor",__LINE__, __FILE__));
00028 SetReceiverName("AnalysisClient");
00029
00030 SetProtection(kGo4ComModeController);
00031 }
00032
00033 TGo4ComClearObject::TGo4ComClearObject(const char* name)
00034 :TGo4AnalysisObjectCommand("ANClearObject",
00035 "clears object by name",
00036 name)
00037 {
00038 TRACE((12,"TGo4ComClearObject::TGo4ComClearObject(Text_t*) ctor",__LINE__, __FILE__));
00039 SetReceiverName("AnalysisClient");
00040
00041 SetProtection(kGo4ComModeController);
00042 }
00043
00044
00045 TGo4ComClearObject::~TGo4ComClearObject()
00046 {
00047 TRACE((12,"TGo4ComClearObject::~TGo4ComClearObject() dtor",__LINE__, __FILE__));
00048 }
00049
00050
00051
00052 Int_t TGo4ComClearObject::ExeCom()
00053 {
00054 TRACE((12,"TGo4ComClearObject::ExeCom()",__LINE__, __FILE__));
00055
00056 TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00057 if(cli)
00058 {
00059 TGo4Analysis* ana=TGo4Analysis::Instance();
00060 if(ana)
00061 {
00062 const Text_t* obname = GetObjectName();
00063 Bool_t ok=ana->ClearObjects(obname);
00064 if(ok)
00065 {
00066 cli->SendStatusMessage(1,kTRUE,"Object %s was cleared.", obname);
00067 }
00068 else
00069 {
00070 cli->SendStatusMessage(2,kTRUE,"Could not clear object %s", obname);
00071 }
00072 }
00073 else
00074 {
00075 cli->SendStatusMessage(3, kTRUE," %s ERROR no analysis ", GetName());
00076 }
00077 }
00078 else
00079 {
00080 TRACE((11,"TGo4ComClearObject::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00081 TGo4Log::Debug(" !!! %s: NO RECEIVER ERROR!!!",GetName());
00082 return 1;
00083 }
00084
00085 return -1;
00086 }
00087
00088 ClassImp(TGo4ComClearObject)
00089
00090