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

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

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