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

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

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