GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ComSetAnalysisStatus.cxx
Go to the documentation of this file.
1 // $Id: TGo4ComSetAnalysisStatus.cxx 2745 2020-04-16 08:55:15Z 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 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
40 
41 }
42 
44 {
45  GO4TRACE((12,"TGo4ComSetAnalysisStatus::~TGo4ComSetAnalysisStatus() dtor",__LINE__, __FILE__));
46  delete fxAnalysisStatus;
47 }
48 
50 {
51  fxAnalysisStatus = settings;
52 }
53 
55 {
56  if(remcom==0) return;
57  TGo4AnalysisStatus* stat = dynamic_cast<TGo4AnalysisStatus* >(remcom->GetAggregate());
58 
59  if(stat) {
60  delete fxAnalysisStatus;
61  fxAnalysisStatus = stat;
62  }
63 }
64 
66 {
67  GO4TRACE((12,"TGo4ComSetAnalysisStatus::ExeCom()",__LINE__, __FILE__));
68 
70  if (cli!=0) {
71  GO4TRACE((11,"TGo4ComSetAnalysisStatus::ExeCom() - found valid receiver",__LINE__, __FILE__));
72  //TGo4Log::Debug(" Executing SetAnalysisStatus... ");
74  if(ana) {
75  if(cli->MainIsRunning()) ana->PostLoop(); // if submit is done on running analysis,
76  // execute postloop before closing previous objects
78  cli->SendStatusMessage(1, kFALSE,"New analysis status was set.");
79  } else {
80  cli->SendStatusMessage(3, kTRUE, TString::Format("%s ERROR no analysis", GetName()));
81  }
82  } else {
83  GO4TRACE((11,"TGo4ComSetAnalysisStatus::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
84  TGo4Log::Debug(" !!! ''%s'': NO RECEIVER ERROR!!!",GetName());
85  throw TGo4RuntimeException();
86  return 1;
87  }
88 
89  return -1;
90 }
void SetReceiverName(const char *)
Definition: TGo4Command.cxx:93
virtual void SendStatusMessage(Int_t level, Bool_t printout, const TString &text)
TGo4CommandReceiver * fxReceiverBase
Definition: TGo4Command.h:116
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:104
#define GO4TRACE(X)
Definition: TGo4Log.h:26
static TGo4Analysis * Instance()
static void Debug(const char *text,...)
Definition: TGo4Log.cxx:274
void SetStatus(TGo4AnalysisStatus *state)