Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4ComSetAnalysisStatus.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE 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 "TGo4Log.h"
00019 #include "TGo4AnalysisClientImp.h"
00020 #include "TGo4RuntimeException.h"
00021 #include "TGo4AnalysisImp.h"
00022 #include "TGo4AnalysisClientImp.h"
00023 #include "TGo4RemoteCommand.h"
00024 
00025 TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus(TGo4AnalysisStatus* settings)
00026 :TGo4AnalysisCommand("ANSetStatus","Set Analysis to given Status ")
00027 {
00028    TRACE((12,"TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus() ctor",__LINE__, __FILE__));
00029    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00030                                        // override default receiver
00031    fxAnalysisStatus=settings;
00032    SetProtection(kGo4ComModeController);
00033 
00034 }
00035 
00036 TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus()
00037 :TGo4AnalysisCommand("ANSetStatus","Set Analysis to given Status ")
00038 {
00039    TRACE((12,"TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus() ctor",__LINE__, __FILE__));
00040    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00041                                        // override default receiver
00042    fxAnalysisStatus=0;
00043    SetProtection(kGo4ComModeController);
00044 
00045 }
00046 
00047 TGo4ComSetAnalysisStatus::~TGo4ComSetAnalysisStatus()
00048 {
00049    TRACE((12,"TGo4ComSetAnalysisStatus::~TGo4ComSetAnalysisStatus() dtor",__LINE__, __FILE__));
00050    delete fxAnalysisStatus;
00051 }
00052 
00053 void TGo4ComSetAnalysisStatus::SetStatusObject(TGo4AnalysisStatus* settings)
00054 {
00055   fxAnalysisStatus=settings;
00056 }
00057 
00058 void TGo4ComSetAnalysisStatus::Set(TGo4RemoteCommand* remcom)
00059 {
00060 if(remcom==0) return;
00061 TGo4AnalysisStatus* stat=dynamic_cast<TGo4AnalysisStatus* >(remcom->GetAggregate());
00062 
00063 if(stat)
00064    {
00065       delete fxAnalysisStatus;
00066       fxAnalysisStatus=stat;
00067    }
00068 }
00069 
00070 
00071 Int_t TGo4ComSetAnalysisStatus::ExeCom()
00072 {
00073    TRACE((12,"TGo4ComSetAnalysisStatus::ExeCom()",__LINE__, __FILE__));
00074 
00075    TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00076    if (cli!=0)
00077       {
00078       TRACE((11,"TGo4ComSetAnalysisStatus::ExeCom() - found valid receiver",__LINE__, __FILE__));
00079          //TGo4Log::Debug(" Executing SetAnalysisStatus...  ");
00080          TGo4Analysis* ana= TGo4Analysis::Instance();
00081          if(ana)
00082             {
00083                if(cli->MainIsRunning()) ana->PostLoop(); // if submit is done on running analysis,
00084                                    // execute postloop before closing previous objects
00085                ana->SetStatus(fxAnalysisStatus);
00086                cli->SendStatusMessage(1, kFALSE,"New analysis status was set.");
00087             }
00088          else
00089             {
00090                cli->SendStatusMessage(3, kTRUE,"%s ERROR no analysis",
00091                                                  GetName());
00092             }
00093       }
00094    else
00095       {
00096       TRACE((11,"TGo4ComSetAnalysisStatus::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00097          TGo4Log::Debug(" !!! ''%s'': NO RECEIVER ERROR!!!",GetName());
00098          throw TGo4RuntimeException();
00099          return 1;
00100       }
00101 
00102    return -1;
00103 }
00104 
00105 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:05 2008 for Go4-v3.04-1 by  doxygen 1.4.2