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

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

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