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

TGo4ComLoadAnalysisStatus.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 "TGo4ComLoadAnalysisStatus.h"
00017 
00018 #include "TGo4Log.h"
00019 #include "TGo4AnalysisClientImp.h"
00020 #include "TGo4RuntimeException.h"
00021 #include "TGo4AnalysisImp.h"
00022 #include "TGo4RemoteCommand.h"
00023 
00024 TGo4ComLoadAnalysisStatus::TGo4ComLoadAnalysisStatus(const char* filename)
00025 :TGo4AnalysisCommand("ANLoad","Load Analysis Settings from file")
00026 {
00027    TRACE((12,"TGo4ComLoadAnalysisStatus::TGo4ComLoadAnalysisStatus() ctor",__LINE__, __FILE__));
00028    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00029                                        // override default receiver
00030    SetProtection(kGo4ComModeController);
00031    SetFileName(filename);
00032 }
00033 
00034 TGo4ComLoadAnalysisStatus::TGo4ComLoadAnalysisStatus()
00035 :TGo4AnalysisCommand("ANLoad","Load Analysis Settings from file")
00036 {
00037    TRACE((12,"TGo4ComLoadAnalysisStatus::TGo4ComLoadAnalysisStatus() ctor",__LINE__, __FILE__));
00038    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00039                                        // override default receiver
00040    SetFileName(TGo4Analysis::fgcDEFAULTSTATUSFILENAME);
00041    SetProtection(kGo4ComModeController);
00042 }
00043 
00044 TGo4ComLoadAnalysisStatus::~TGo4ComLoadAnalysisStatus()
00045 {
00046    TRACE((12,"TGo4ComLoadAnalysisStatus::~TGo4ComLoadAnalysisStatus() dtor",__LINE__, __FILE__));
00047 }
00048 
00049 void TGo4ComLoadAnalysisStatus::Set(TGo4RemoteCommand* remcom)
00050 {
00051 if(remcom==0) return;
00052 SetFileName(remcom->GetString(0));
00053 }
00054 
00055 Int_t TGo4ComLoadAnalysisStatus::ExeCom()
00056 {
00057    TRACE((12,"TGo4ComLoadAnalysisStatus::ExeCom()",__LINE__, __FILE__));
00058 
00059    TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00060    if (cli!=0)
00061       {
00062       TRACE((11,"TGo4ComLoadAnalysisStatus::ExeCom() - found valid receiver",__LINE__, __FILE__));
00063 //         TGo4Log::Debug(" Executing ComLoadAnalysisStatus...  ");
00064          TGo4Analysis* ana= TGo4Analysis::Instance();
00065          if(ana)
00066             {
00067                Bool_t ok=ana->LoadStatus( GetFileName() );
00068                if(ok)
00069                   {
00070                     cli->SendStatusMessage(1, kFALSE,"Loaded analysis status from file %s.",
00071                                                 GetFileName());
00072                   }
00073                else
00074                   {
00075                      cli->SendStatusMessage(3, kFALSE,"ERROR on Loading analysis status from file %s",
00076                                                  GetFileName());
00077                   } // if(ok)
00078 
00079             }
00080          else
00081             {
00082                      cli->SendStatusMessage(3, kTRUE," %s ERROR no analysis",
00083                                                  GetName());
00084             } // if(ana)
00085 
00086       }
00087    else
00088       {
00089       TRACE((11,"TGo4ComLoadAnalysisStatus::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00090          TGo4Log::Debug(" !!! ComLoadAnalysisStatus ''%s'': NO RECEIVER ERROR!!!",GetName());
00091          throw TGo4RuntimeException(); // never come here!
00092          return 1;
00093       }
00094 
00095    return -1;
00096 }
00097 
00098 
00099 //----------------------------END OF GO4 SOURCE FILE ---------------------

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