GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4AnalysisClientImp.h
Go to the documentation of this file.
1 // $Id: TGo4AnalysisClientImp.h 2627 2019-10-01 08:02:45Z 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 
14 #ifndef TGO4ANALYSISCLIENTIMP_H
15 #define TGO4ANALYSISCLIENTIMP_H
16 
17 #include "TGo4Slave.h"
18 
19 #include "TString.h"
20 
21 class TTimer;
22 class TGo4Analysis;
23 class TGo4ClientStatus;
24 class TGo4Ratemeter;
26 class TGo4TaskStatus;
28 
34 class TGo4AnalysisClient : public TGo4Slave {
35 
36  public:
37  TGo4AnalysisClient(const char* name,
38  TGo4Analysis* analysis,
39  const char* host="localhost",
40  UInt_t negport=0,
41  Bool_t histoserver=kFALSE,
42  const char* basename="Go4",
43  const char* passwd="abcd",
44  Bool_t servermode=kFALSE,
45  Bool_t autorun=kFALSE,
46  Bool_t cintmode = kFALSE,
47  Bool_t loadprefs = kTRUE,
48  Bool_t showrate = kFALSE);
49 
50  TGo4AnalysisClient(int argc, char** argv,
51  TGo4Analysis* analysis,
52  Bool_t histoserver=kFALSE,
53  const char* basename="Go4",
54  const char* passwd="abcd",
55  Bool_t servermode=kFALSE,
56  Bool_t autorun=kFALSE);
57 
58  virtual ~TGo4AnalysisClient();
59 
60  TGo4Analysis* GetAnalysis() const { return fxAnalysis; }
61 
62  virtual void Start();
63 
64  virtual void Stop();
65 
66  virtual void Quit();
67 
70  virtual void KillMain();
71 
74  virtual void RestartMain();
75 
80  virtual TGo4TaskStatus* CreateStatus();
81 
84  virtual Int_t Initialization();
85 
89  void SendAnalysisObject(const char* name);
90 
93  void SendAnalysisStatus();
94 
98 
100  void SendNamesList();
101 
103  void UpdateRate(Int_t counts=1);
104 
106  UInt_t GetCurrentCount();
107 
109  Bool_t TestRatemeter();
110 
113 
116  void StartObjectServer(const char* basename, const char* passwd);
117 
119  void StopObjectServer();
120 
121 
125  virtual Int_t StartWorkThreads();
126 
130  virtual Int_t StopWorkThreads();
131 
133  virtual void Terminate (Bool_t termapp=kTRUE);
134 
136  virtual void TerminateFast ();
137 
138  /* submit a analysis server shutdown into local command queue.
139  * used by ctrl-c handler of analysis server*/
140  void SubmitShutdown();
141 
143  virtual void SendStatusMessage(Int_t level, Bool_t printout, const TString& text);
144 
147  virtual void ExecuteString(const char* command);
148 
149  void SetCintMode(Bool_t on=kTRUE);
150 
151  Bool_t IsCintMode() const { return fbCintMode; }
152 
154  static const char* fgcMAINTHREAD;
155 
157  static const char* fgcWATCHTHREAD;
158 
160  static const UInt_t fguSTATUSUPDATE;
161 
163  static const Double_t fgdSTATUSTIMEOUT;
164 
166  static const UInt_t fguCINTTIMERPERIOD;
167 
168  private:
169 
170  void Constructor(Bool_t starthistserv=kFALSE, const char* basename="Go4", const char* passwd="abcd");
171 
174  void UpdateStatus(TGo4TaskStatus * state);
175 
176 
177 
178 private:
179 
185 
187  TString fcMainName;
188 
190  TString fcWatchName;
191 
194 
198 
203 
206  Bool_t fbAutoStart;
207 
210  Bool_t fbCintMode;
211 
213  Bool_t fbLoadPrefs;
214 
216  Bool_t fbShowRate;
217 
218 
219 
221 
222  ClassDef(TGo4AnalysisClient,1)
223 
224 };
225 
226 #endif //TGO4ANALYSISCLIENT_H
TGo4HistogramServer * fxHistoServer
virtual void SendStatusMessage(Int_t level, Bool_t printout, const TString &text)
virtual Int_t Initialization()
void Constructor(Bool_t starthistserv=kFALSE, const char *basename="Go4", const char *passwd="abcd")
void SetCintMode(Bool_t on=kTRUE)
virtual Int_t StartWorkThreads()
virtual void Terminate(Bool_t termapp=kTRUE)
static const Double_t fgdSTATUSTIMEOUT
static const char * fgcMAINTHREAD
void SendAnalysisObject(const char *name)
TGo4Analysis * GetAnalysis() const
static const char * fgcWATCHTHREAD
virtual TGo4TaskStatus * CreateStatus()
virtual Int_t StopWorkThreads()
Bool_t IsCintMode() const
TGo4Ratemeter * fxRatemeter
static const UInt_t fguCINTTIMERPERIOD
void UpdateRate(Int_t counts=1)
void UpdateStatus(TGo4TaskStatus *state)
virtual void ExecuteString(const char *command)
static const UInt_t fguSTATUSUPDATE
void StartObjectServer(const char *basename, const char *passwd)