GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ComSetAnalysisStatus.cxx
Go to the documentation of this file.
1 // $Id: TGo4ComSetAnalysisStatus.cxx 1271 2014-11-07 14:46:58Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
15 
16 #include "TGo4Log.h"
17 #include "TGo4AnalysisClientImp.h"
18 #include "TGo4RuntimeException.h"
19 #include "TGo4AnalysisImp.h"
20 #include "TGo4AnalysisClientImp.h"
21 #include "TGo4RemoteCommand.h"
22 
24  TGo4AnalysisCommand("ANSetStatus","Set Analysis to given Status ")
25 {
26  GO4TRACE((12,"TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus() ctor",__LINE__, __FILE__));
27  SetReceiverName("AnalysisClient"); // this command needs client as receiver
28  // override default receiver
29  fxAnalysisStatus=settings;
31 }
32 
34  TGo4AnalysisCommand("ANSetStatus","Set Analysis to given Status ")
35 {
36  GO4TRACE((12,"TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus() ctor",__LINE__, __FILE__));
37  SetReceiverName("AnalysisClient"); // this command needs client as receiver
38  // override default receiver
41 
42 }
43 
45 {
46  GO4TRACE((12,"TGo4ComSetAnalysisStatus::~TGo4ComSetAnalysisStatus() dtor",__LINE__, __FILE__));
47  delete fxAnalysisStatus;
48 }
49 
51 {
52  fxAnalysisStatus = settings;
53 }
54 
56 {
57  if(remcom==0) return;
58  TGo4AnalysisStatus* stat = dynamic_cast<TGo4AnalysisStatus* >(remcom->GetAggregate());
59 
60  if(stat) {
61  delete fxAnalysisStatus;
62  fxAnalysisStatus = stat;
63  }
64 }
65 
67 {
68  GO4TRACE((12,"TGo4ComSetAnalysisStatus::ExeCom()",__LINE__, __FILE__));
69 
71  if (cli!=0) {
72  GO4TRACE((11,"TGo4ComSetAnalysisStatus::ExeCom() - found valid receiver",__LINE__, __FILE__));
73  //TGo4Log::Debug(" Executing SetAnalysisStatus... ");
75  if(ana) {
76  if(cli->MainIsRunning()) ana->PostLoop(); // if submit is done on running analysis,
77  // execute postloop before closing previous objects
79  cli->SendStatusMessage(1, kFALSE,"New analysis status was set.");
80  } else {
81  cli->SendStatusMessage(3, kTRUE, TString::Format("%s ERROR no analysis", GetName()));
82  }
83  } else {
84  GO4TRACE((11,"TGo4ComSetAnalysisStatus::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
85  TGo4Log::Debug(" !!! ''%s'': NO RECEIVER ERROR!!!",GetName());
86  throw TGo4RuntimeException();
87  return 1;
88  }
89 
90  return -1;
91 }
void SetReceiverName(const char *)
Definition: TGo4Command.cxx:92
virtual void SendStatusMessage(Int_t level, Bool_t printout, const TString &text)
TGo4CommandReceiver * fxReceiverBase
Definition: TGo4Command.h:117
TObject * GetAggregate(Bool_t chown=kTRUE)
Bool_t MainIsRunning()
Definition: TGo4Slave.h:92
TGo4AnalysisStatus * fxAnalysisStatus
void SetStatusObject(TGo4AnalysisStatus *settings)
virtual void Set(TGo4RemoteCommand *remcon)
void SetProtection(Go4CommandMode_t m)
Definition: TGo4Command.h:105
#define GO4TRACE(X)
Definition: TGo4Log.h:26
static TGo4Analysis * Instance()
static void Debug(const char *text,...)
Definition: TGo4Log.cxx:270
void SetStatus(TGo4AnalysisStatus *state)