00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4ComGetPicture.h"
00017
00018 #include <iostream.h>
00019
00020 #include "Go4Log/TGo4Log.h"
00021 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00022 #include "Go4Analysis/TGo4AnalysisImp.h"
00023 #include "Go4StatusBase/TGo4Picture.h"
00024 #include "Go4ConditionsBase/TGo4Condition.h"
00025
00026
00027 TGo4ComGetPicture::TGo4ComGetPicture(const char* obname)
00028 :TGo4AnalysisObjectCommand("ANGetPict","Get a picture from analysis",obname)
00029 {
00030 TRACE((12,"TGo4ComGetPicture::TGo4ComGetPicture(const Text_t*) ctor",__LINE__, __FILE__));
00031 SetReceiverName("AnalysisClient");
00032
00033 }
00034
00035 TGo4ComGetPicture::TGo4ComGetPicture()
00036 :TGo4AnalysisObjectCommand("ANGetPict","Get a picture from analysis","his")
00037
00038 {
00039 TRACE((12,"TGo4ComGetPicture::TGo4ComGetPicture() ctor",__LINE__, __FILE__));
00040 SetReceiverName("AnalysisClient");
00041
00042 }
00043
00044 TGo4ComGetPicture::~TGo4ComGetPicture()
00045 {
00046 TRACE((12,"TGo4ComGetPicture::~TGo4ComGetPicture() dtor",__LINE__, __FILE__));
00047 }
00048
00049
00050
00051 Int_t TGo4ComGetPicture::ExeCom()
00052 {
00053 TRACE((12,"TGo4ComGetPicture::ExeCom()",__LINE__, __FILE__));
00054
00055 if (fxReceiverBase!=0)
00056 {
00057 TRACE((11,"TGo4ComGetPicture::ExeCom() - found valid receiver",__LINE__, __FILE__));
00058 TGo4Log::Debug(" Executing %s : Picture %s requested ",
00059 GetName(), GetObjectName());
00060 TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00061 TGo4Analysis* ana=TGo4Analysis::Instance();
00062 TGo4Picture* par= ana->GetPicture(GetObjectName());
00063 if(par)
00064 {
00065
00066
00067
00068
00069 TGo4Picture* copy = new TGo4Picture;
00070
00071 copy->UpdateFrom(par, TGo4Condition::Class());
00072
00073 copy->SetObjectsOwnership(kTRUE);
00074
00075 cli->SendObject(copy, GetTaskName());
00076
00077 copy->SetObjectsOwnership(kFALSE);
00078
00079 delete copy;
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 }
00090 else
00091 {
00092 cli->SendStatusMessage(3, kTRUE,"GetPicture - ERROR: no such picture %s",
00093 GetObjectName());
00094 }
00095
00096 }
00097
00098 else
00099
00100 {
00101 cout <<"No receiver in comgetpicture!!!!!!!!!!!" << endl;
00102 TRACE((11,"TGo4ComGetObject::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00103 TGo4Log::Debug(" !!! %s : NO RECEIVER ERROR!!!",GetName());
00104 return 1;
00105 }
00106
00107 return -1;
00108 }
00109
00110 ClassImp(TGo4ComGetPicture)
00111
00112