GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4AnalysisClientStatus.cxx
Go to the documentation of this file.
1 // $Id: TGo4AnalysisClientStatus.cxx 999 2013-07-25 11:58:59Z 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 "TDatime.h"
17 #include "Riostream.h"
18 
19 #include "TGo4Log.h"
20 
23  fuCurrentCount(0),
24  fdRate(0),
25  fdAveRate(0),
26  fdTime(0),
27  fbAnalysisRunning(false)
28 {
29 }
30 
32  TGo4ClientStatus(name),
33  fuCurrentCount(0),
34  fdRate(0),
35  fdAveRate(0),
36  fdTime(0),
37  fbAnalysisRunning(false)
38 {
39  GO4TRACE((12,"TGo4AnalysisClientStatus::TGo4AnalysisClientStatus(const char*)",__LINE__, __FILE__));
40 }
41 
43 {
44 }
45 
46 Int_t TGo4AnalysisClientStatus::PrintStatus(Text_t* buffer, Int_t buflen)
47 {
48  GO4TRACE((12,"TGo4AnalysisClientStatus::PrintStatus()",__LINE__, __FILE__));
49  //
50  Int_t locallen=4096;
51  Text_t localbuf[4096];
52  if(buflen<=0 && buffer!=0) return 0;
53  Text_t* current=localbuf;
54  Int_t size=0;
55  Int_t restlen=locallen;
56  current=PrintBuffer(current,restlen,"G-OOOO-> Analysis Client Status Class %s Printout: <-OOOO-G\n",GetName());
57  current=PrintBuffer(current,restlen,"G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
58  current=PrintBuffer(current,restlen,"G-OOOO-> Analysis Running State: %d\n",IsAnalysisRunning());
59  current=PrintBuffer(current,restlen,"G-OOOO-> Current event rate: %f\n",GetRate());
60  current=PrintBuffer(current,restlen,"G-OOOO-> Average event rate: %f\n",GetAvRate());
61  current=PrintBuffer(current,restlen,"G-OOOO-> Total event counts: %d\n",GetCurrentCount());
62  current=PrintBuffer(current,restlen,"G-OOOO-> Total time: %f\n",GetTime());
63  current=PrintBuffer(current,restlen,"G-OOOO-> Current Event source: %s\n",GetCurrentSource());
64  current=PrintBuffer(current,restlen,"G-OOOO-> Creation date: %s\n",GetDateTime());
65  current=PrintBuffer(current,restlen,"G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
66  Int_t delta=TGo4ClientStatus::PrintStatus(current,restlen);
67  restlen-=delta;
68  current+=delta;
69  current=PrintBuffer(current,restlen,"G-OOOO-> END Analysis Client Status Class Printout END <-OOOO-G\n");
70  if(buffer==0)
71  {
72  std::cout << localbuf << std::endl;
73  }
74  else
75  {
76  if(size>buflen-1)
77  size=buflen-1;
78  strncpy(buffer,localbuf,size);
79  }
80  return size;
81 }
82 
83 void TGo4AnalysisClientStatus::SetRates(Double_t rate, Double_t average, ULong64_t counts, Double_t time)
84 {
85  GO4TRACE((12,"TGo4AnalysisClientStatus::SetRates(...)",__LINE__, __FILE__));
86  fdRate=rate;
87  fdAveRate=average;
88  fuCurrentCount=counts;
89  fdTime=time;
90  TDatime now;
91  fxDateString=now.AsSQLString();
92 }
void SetRates(Double_t rate, Double_t average, ULong64_t counts, Double_t time)
virtual Int_t PrintStatus(Text_t *buffer=0, Int_t buflen=0)
const char * GetDateTime() const
#define GO4TRACE(X)
Definition: TGo4Log.h:26
static Text_t * PrintBuffer(char *buffer, Int_t &buflen, const char *text,...)
Definition: TGo4Status.cxx:85
virtual Int_t PrintStatus(Text_t *buffer=0, Int_t buflen=0)
const char * GetCurrentSource() const