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

TGo4ComSetPrintEvent.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 "TGo4ComSetPrintEvent.h"
00017 
00018 #include "TGo4Log.h"
00019 #include "TGo4AnalysisClientImp.h"
00020 #include "TGo4AnalysisImp.h"
00021 #include "TGo4MbsEvent.h"
00022 #include "TGo4RemoteCommand.h"
00023 
00024 TGo4ComSetPrintEvent::TGo4ComSetPrintEvent(const char* obname)
00025 :TGo4AnalysisObjectCommand("ANSetPrintEvent","Set event printout for analysis",obname)
00026 {
00027    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00028                                                  // override default receiver
00029 }
00030 TGo4ComSetPrintEvent::TGo4ComSetPrintEvent()
00031 :TGo4AnalysisObjectCommand("ANSetPrintEvent","Set event printout for analysis","dummy")
00032  {
00033    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00034                                                  // override default receiver
00035 }
00036 
00037 TGo4ComSetPrintEvent::~TGo4ComSetPrintEvent()
00038 {
00039 }
00040 
00041 void TGo4ComSetPrintEvent::Set(TGo4RemoteCommand* remcom)
00042 {
00043    if(remcom==0) return;
00044    TGo4AnalysisObjectCommand::Set(remcom);
00045    fxPrintPar.fiNum  = remcom->GetValue(0);
00046    fxPrintPar.fiSid  = remcom->GetValue(1);
00047    fxPrintPar.fiLong = remcom->GetValue(2);
00048    fxPrintPar.fiHex  = remcom->GetValue(3);
00049    fxPrintPar.fiData = remcom->GetValue(4);
00050 }
00051 
00052 Int_t TGo4ComSetPrintEvent::ExeCom()
00053 {
00054    TGo4Log::Debug(" Executing %s : Printou for %s requested for %d events of subid %d, long:%d, hex:%d, data:%d",
00055          GetObjectName(),
00056          fxPrintPar.fiNum,
00057             fxPrintPar.fiSid,
00058             fxPrintPar.fiLong,
00059             fxPrintPar.fiHex,
00060             fxPrintPar.fiData);
00061    TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00062    if (cli!=0)
00063       {
00064          TGo4Analysis* ana=TGo4Analysis::Instance();
00065          if(ana==0)
00066              {
00067                     // never come here
00068                     cli->SendStatusMessage(3, kTRUE," %s ERROR no analysis ",GetName());
00069                     return -2;
00070              } else {}
00071          // request for event by name from folder
00072          TGo4EventElement* eve=ana->GetEventStructure(GetObjectName());
00073          if(eve)
00074             {
00075 
00076             if(eve->InheritsFrom(TGo4MbsEvent::Class()))
00077                {
00078                    TGo4MbsEvent* mbseve=dynamic_cast<TGo4MbsEvent*>(eve);
00079                    mbseve->SetPrintEvent(fxPrintPar.fiNum,
00080                                           fxPrintPar.fiSid,
00081                                           fxPrintPar.fiLong,
00082                                           fxPrintPar.fiHex,
00083                                           fxPrintPar.fiData);
00084                }
00085             else
00086                {
00087                   // later we might put printout functionality in baseclass, for now:
00088                   cli->SendStatusMessage(2, kTRUE," Event %s of class %s is not yet supported for printevent mode!",GetObjectName(), eve->ClassName());
00089                }
00090             }
00091          else
00092             {
00093                cli->SendStatusMessage(2, kTRUE," Event %s was not found to set printout mode!",GetObjectName());
00094             }
00095       }
00096    else
00097        {
00098       TRACE((11,"TGo4ComSetPrintEvent::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00099          TGo4Log::Debug(" !!! %s : NO or WRONG RECEIVER ERROR!!!",GetName());
00100          return 1;
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