GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4AnalysisClientImp.h
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 
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  void Start() override;
63 
64  void Stop() override;
65 
66  void Quit() override;
67 
70  void KillMain() override;
71 
74  void RestartMain() override;
75 
80  TGo4TaskStatus *CreateStatus() override;
81 
84  Int_t Initialization() override;
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() const;
107 
109  Bool_t TestRatemeter();
110 
113 
116  void StartObjectServer(const char *basename, const char *passwd);
117 
119  void StopObjectServer();
120 
121 
125  Int_t StartWorkThreads() override;
126 
130  Int_t StopWorkThreads() override;
131 
133  void Terminate (Bool_t termapp=kTRUE) override;
134 
136  void TerminateFast() override;
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  void SendStatusMessage(Int_t level, Bool_t printout, const TString &text) override;
144 
147  void ExecuteString(const char *command) override;
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) override;
175 
176 private:
177 
183 
185  TString fcMainName;
186 
188  TString fcWatchName;
189 
191  Double_t fdBufferUpdateTime{0};
192 
196 
201 
204  Bool_t fbAutoStart{kFALSE};
205 
208  Bool_t fbCintMode{kFALSE};
209 
211  Bool_t fbLoadPrefs{kFALSE};
212 
214  Bool_t fbShowRate{kFALSE};
215 
217 
218  ClassDef(TGo4AnalysisClient,1)
219 
220 };
221 
222 #endif //TGO4ANALYSISCLIENT_H
TGo4HistogramServer * fxHistoServer
void Constructor(Bool_t starthistserv=kFALSE, const char *basename="Go4", const char *passwd="abcd")
void SetCintMode(Bool_t on=kTRUE)
void ExecuteString(const char *command) override
void Terminate(Bool_t termapp=kTRUE) override
void SendStatusMessage(Int_t level, Bool_t printout, const TString &text) override
void UpdateStatus(TGo4TaskStatus *state) override
static const Double_t fgdSTATUSTIMEOUT
static const char * fgcMAINTHREAD
void SendAnalysisObject(const char *name)
static const char * fgcWATCHTHREAD
TGo4Analysis * GetAnalysis() const
Int_t StopWorkThreads() override
TGo4TaskStatus * CreateStatus() override
Int_t StartWorkThreads() override
TGo4Ratemeter * fxRatemeter
static const UInt_t fguCINTTIMERPERIOD
void UpdateRate(Int_t counts=1)
Int_t Initialization() override
static const UInt_t fguSTATUSUPDATE
void StartObjectServer(const char *basename, const char *passwd)