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

/Go4CommandsAnalysis/TGo4ComSetAnalysisStatus.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 "TGo4ComSetAnalysisStatus.h"
00017 
00018 #include "Go4Log/TGo4Log.h"
00019 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00020 #include "Go4Exceptions/TGo4RuntimeException.h"
00021 #include "Go4Analysis/TGo4AnalysisImp.h"
00022 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00023 
00024 TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus(TGo4AnalysisStatus* settings)
00025 :TGo4AnalysisCommand("ANSetStatus","Set Analysis to given Status ")
00026 {
00027    TRACE((12,"TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus() ctor",__LINE__, __FILE__));
00028    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00029                                        // override default receiver
00030    fxAnalysisStatus=settings;
00031    SetProtection(kGo4ComModeController);
00032 
00033 }
00034 
00035 TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus()
00036 :TGo4AnalysisCommand("ANSetStatus","Set Analysis to given Status ")
00037 {
00038    TRACE((12,"TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus() ctor",__LINE__, __FILE__));
00039    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00040                                        // override default receiver
00041    fxAnalysisStatus=0;
00042    SetProtection(kGo4ComModeController);
00043 
00044 }
00045 
00046 TGo4ComSetAnalysisStatus::~TGo4ComSetAnalysisStatus()
00047 {
00048    TRACE((12,"TGo4ComSetAnalysisStatus::~TGo4ComSetAnalysisStatus() dtor",__LINE__, __FILE__));
00049 }
00050 
00051 void TGo4ComSetAnalysisStatus::SetStatusObject(TGo4AnalysisStatus* settings)
00052 {
00053   fxAnalysisStatus=settings;
00054 }
00055 
00056 Int_t TGo4ComSetAnalysisStatus::ExeCom()
00057 {
00058    TRACE((12,"TGo4ComSetAnalysisStatus::ExeCom()",__LINE__, __FILE__));
00059 
00060    TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00061    if (cli!=0)
00062       {
00063       TRACE((11,"TGo4ComSetAnalysisStatus::ExeCom() - found valid receiver",__LINE__, __FILE__));
00064          //TGo4Log::Debug(" Executing SetAnalysisStatus...  ");
00065          TGo4Analysis* ana= TGo4Analysis::Instance();
00066          if(ana)
00067             {
00068                if(cli->MainIsRunning()) ana->PostLoop(); // if submit is done on running analysis,
00069                                    // execute postloop before closing previous objects 
00070                ana->SetStatus(fxAnalysisStatus);
00071                cli->SendStatusMessage(1, kFALSE,"New analysis status was set.");
00072             }
00073          else
00074             {
00075                cli->SendStatusMessage(3, kTRUE,"%s ERROR no analysis",
00076                                                  GetName());
00077             }
00078       }
00079    else
00080       {
00081       TRACE((11,"TGo4ComSetAnalysisStatus::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00082          TGo4Log::Debug(" !!! ''%s'': NO RECEIVER ERROR!!!",GetName());
00083          throw TGo4RuntimeException();
00084          return 1;
00085       }
00086 
00087    return -1;
00088 }
00089 
00090 ClassImp(TGo4ComSetAnalysisStatus)
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