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

/Go4CommandsAnalysis/TGo4ComSetProcessor.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 "TGo4ComSetProcessor.h"
00017 
00018 #include "Go4Log/TGo4Log.h"
00019 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00020 #include "Go4Analysis/TGo4AnalysisImp.h"
00021 
00022 TGo4ComSetProcessor::TGo4ComSetProcessor(const char* stepname, TGo4EventProcessorParameter* newproc)
00023 :TGo4AnalysisStepCommand("ANSetProcessor","Set eventprocessor of analysis step",stepname)
00024 {
00025    TRACE((12,"TGo4ComSetProcessor::TGo4ComSetProcessor(const Text_t*) ctor",__LINE__, __FILE__));
00026    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00027                                                  // to send back status message
00028    fxProcessorPar=newproc;
00029 
00030 }
00031 
00032 TGo4ComSetProcessor::TGo4ComSetProcessor()
00033 :TGo4AnalysisStepCommand("ANSetProcessor","Set eventprocessor of analysis step",0)
00034 {
00035    TRACE((12,"TGo4ComSetProcessor::TGo4ComSetProcessor() ctor",__LINE__, __FILE__));
00036    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00037                                                  // to send back status message
00038    fxProcessorPar=0;
00039 }
00040 
00041 TGo4ComSetProcessor::~TGo4ComSetProcessor()
00042 {
00043    TRACE((12,"TGo4ComSetProcessor::~TGo4ComSetProcessor() dtor",__LINE__, __FILE__));
00044 }
00045 
00046 
00047 Int_t TGo4ComSetProcessor::ExeCom()
00048 {
00049    TRACE((12,"TGo4ComSetProcessor::ExeCom()",__LINE__, __FILE__));
00050 
00051    if (fxReceiverBase!=0)
00052       {
00053       TRACE((11,"TGo4ComSetProcessor::ExeCom() - found valid receiver",__LINE__, __FILE__));
00054 //         TGo4Log::Debug(" Executing %s : Step %s resets event processor ",
00055 //            GetName(), GetStepName());
00056          TGo4Analysis* anna=0;
00057          TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00058          if(cli)
00059             {
00060                anna=TGo4Analysis::Instance();
00061                const char* parname="default";
00062                TGo4EventProcessorParameter* par = GetProcessorPar();
00063                if(par) parname =  par->GetName();
00064 
00065 
00066              // execute action and look for result
00067                if(anna && anna->NewStepProcessor( GetStepName() , par ) )
00068                   {
00069                      // true, command succeeds
00070                      cli->SendStatusMessage(1,kTRUE,"New processor  %s was set to step %s .",
00071                                                 parname, GetStepName());
00072                   }
00073                else
00074                   {
00075                     // result false, send error message through status
00076                       cli->SendStatusMessage(3,kTRUE,"%s - ERROR at setting processor %s  to step %s !!! ",
00077                                                 GetName(), parname, GetStepName());
00078                   }
00079 
00080             }
00081 
00082          else
00083             {
00084                TGo4Log::Debug(" !!! %s : WRONG RECEIVER ERROR, never come here!!!",GetName());
00085             }
00086       }
00087 
00088    else
00089 
00090        {
00091       TRACE((11,"TGo4ComSetProcessor::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00092          TGo4Log::Debug(" !!! %s : NO RECEIVER ERROR!!!",GetName());
00093          return 1;
00094       }
00095 
00096    return -1;
00097 }
00098 
00099 ClassImp(TGo4ComSetProcessor)
00100 
00101 //----------------------------END OF GO4 SOURCE FILE ---------------------

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