GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4ComSetAnalysisStatus.cxx
Go to the documentation of this file.
1 // $Id$
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 fuer 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 "TGo4RemoteCommand.h"
21 
23  TGo4AnalysisCommand("ANSetStatus","Set Analysis to given Status ")
24 {
25  GO4TRACE((12,"TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus() ctor",__LINE__, __FILE__));
26  SetReceiverName("AnalysisClient"); // this command needs client as receiver
27  // override default receiver
28  fxAnalysisStatus = settings;
30 }
31 
33  TGo4AnalysisCommand("ANSetStatus","Set Analysis to given Status ")
34 {
35  GO4TRACE((12,"TGo4ComSetAnalysisStatus::TGo4ComSetAnalysisStatus() ctor",__LINE__, __FILE__));
36  SetReceiverName("AnalysisClient"); // this command needs client as receiver
37  // override default receiver
39 
40 }
41 
43 {
44  GO4TRACE((12,"TGo4ComSetAnalysisStatus::~TGo4ComSetAnalysisStatus() dtor",__LINE__, __FILE__));
45  delete fxAnalysisStatus;
46 }
47 
49 {
50  if(!remcom) return;
51  TGo4AnalysisStatus *stat = dynamic_cast<TGo4AnalysisStatus *>(remcom->GetAggregate());
52 
53  if(stat) {
54  delete fxAnalysisStatus;
55  fxAnalysisStatus = stat;
56  }
57 }
58 
60 {
61  GO4TRACE((12,"TGo4ComSetAnalysisStatus::ExeCom()",__LINE__, __FILE__));
62 
64  if (cli) {
65  GO4TRACE((11,"TGo4ComSetAnalysisStatus::ExeCom() - found valid receiver",__LINE__, __FILE__));
66  //TGo4Log::Debug(" Executing SetAnalysisStatus... ");
68  if(ana) {
69  if(cli->MainIsRunning()) ana->PostLoop(); // if submit is done on running analysis,
70  // execute postloop before closing previous objects
72  cli->SendStatusMessage(1, kFALSE,"New analysis status was set.");
73  } else {
74  cli->SendStatusMessage(3, kTRUE, TString::Format("%s ERROR no analysis", GetName()));
75  }
76  } else {
77  GO4TRACE((11,"TGo4ComSetAnalysisStatus::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
78  TGo4Log::Debug(" !!! ''%s'': NO RECEIVER ERROR!!!",GetName());
79  throw TGo4RuntimeException();
80  }
81 
82  return -1;
83 }
void Set(TGo4RemoteCommand *remcon) override
void SetReceiverName(const char *)
Definition: TGo4Command.cxx:93
TGo4CommandReceiver * fxReceiverBase
Definition: TGo4Command.h:116
TObject * GetAggregate(Bool_t chown=kTRUE)
TGo4AnalysisStatus * fxAnalysisStatus
void SendStatusMessage(Int_t level, Bool_t printout, const TString &text) override
static void Debug(const char *text,...) GO4_PRINTF_ARGS
Definition: TGo4Log.cxx:281
void SetProtection(Go4CommandMode_t m)
Definition: TGo4Command.h:104
#define GO4TRACE(X)
Definition: TGo4Log.h:25
Bool_t MainIsRunning() const
Definition: TGo4Slave.h:95
static TGo4Analysis * Instance()
void SetStatus(TGo4AnalysisStatus *state)