00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4ComSetPrintEvent.h"
00017
00018 #include "Go4Log/TGo4Log.h"
00019 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00020 #include "Go4Analysis/TGo4AnalysisImp.h"
00021 #include "Go4EventServer/TGo4MbsEvent.h"
00022
00023 TGo4ComSetPrintEvent::TGo4ComSetPrintEvent(const char* obname)
00024 :TGo4AnalysisObjectCommand("ANSetPrintEvent","Set event printout for analysis",obname)
00025 {
00026 SetReceiverName("AnalysisClient");
00027
00028 }
00029 TGo4ComSetPrintEvent::TGo4ComSetPrintEvent()
00030 :TGo4AnalysisObjectCommand("ANSetPrintEvent","Set event printout for analysis","dummy")
00031 {
00032 SetReceiverName("AnalysisClient");
00033
00034 }
00035
00036 TGo4ComSetPrintEvent::~TGo4ComSetPrintEvent()
00037 {
00038 }
00039
00040
00041 Int_t TGo4ComSetPrintEvent::ExeCom()
00042 {
00043 TGo4Log::Debug(" Executing %s : Printou for %s requested for %d events of subid %d, long:%d, hex:%d, data:%d",
00044 GetObjectName(),
00045 fxPrintPar.fiNum,
00046 fxPrintPar.fiSid,
00047 fxPrintPar.fiLong,
00048 fxPrintPar.fiHex,
00049 fxPrintPar.fiData);
00050 TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00051 if (cli!=0)
00052 {
00053 TGo4Analysis* ana=TGo4Analysis::Instance();
00054 if(ana==0)
00055 {
00056
00057 cli->SendStatusMessage(3, kTRUE," %s ERROR no analysis ",GetName());
00058 return -2;
00059 } else {}
00060
00061 TGo4EventElement* eve=ana->GetEventStructure(GetObjectName());
00062 if(eve)
00063 {
00064
00065 if(eve->InheritsFrom("TGo4MbsEvent"))
00066 {
00067 TGo4MbsEvent* mbseve=dynamic_cast<TGo4MbsEvent*>(eve);
00068 mbseve->SetPrintEvent(fxPrintPar.fiNum,
00069 fxPrintPar.fiSid,
00070 fxPrintPar.fiLong,
00071 fxPrintPar.fiHex,
00072 fxPrintPar.fiData);
00073 }
00074 else
00075 {
00076
00077 cli->SendStatusMessage(2, kTRUE," Event %s of class %s is not yet supported for printevent mode!",GetObjectName(), eve->IsA()->GetName());
00078 }
00079 }
00080 else
00081 {
00082 cli->SendStatusMessage(2, kTRUE," Event %s was not found to set printout mode!",GetObjectName());
00083 }
00084 }
00085 else
00086 {
00087 TRACE((11,"TGo4ComSetPrintEvent::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00088 TGo4Log::Debug(" !!! %s : NO or WRONG RECEIVER ERROR!!!",GetName());
00089 return 1;
00090 }
00091 return -1;
00092 }
00093
00094 ClassImp(TGo4ComSetPrintEvent)
00095
00096