Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4CommandsAnalysis/TGo4ComGetPicture.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
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");  // this command needs client as receiver
00032                                        // override default receiver
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");  // this command needs client as receiver
00041                                        // override default receiver
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 //               TGo4Picture* copy = par->MakeCopy(true);
00067 //               cli->SendObject(copy);
00068 //               delete copy;
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 //               par->SetObjectsOwnership(kTRUE);
00082                // on gui side, we need ownership to histogram refs
00083 //               cli->SendObject(par);
00084                // to avoid memory leak
00085 //               par->SetObjectsOwnership(kFALSE);
00086 
00087                   // on analysis side (here), histos are owned
00088                   // by Histograms folder
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 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:50 2005 for Go4-v2.10-5 by doxygen1.2.15