HYDRA_development_version
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hsuprogress.h
Go to the documentation of this file.
1 #ifndef HSUPROGRESS_H
2 #define HSUPROGRESS_H
3 #pragma interface
4 
5 // -----------------------------------------------------------------------------
6 
7 #include "TStopwatch.h"
8 #include "TString.h"
9 
10 // -----------------------------------------------------------------------------
11 
13 {
14 public:
15  HSUProgress(Int_t iMax = 100);
16  virtual ~HSUProgress();
17 
18  // -------------------------------------------------------------------------
19 
20  void SetMaxValue(Int_t i) { m_iMax = i; }
21  Int_t GetMaxValue(void) { return m_iMax; }
22 
23  void Reset(void);
24  void Restart(void);
25  Int_t GetLast(void) { return m_iLast; }
26  void Next(Int_t iSteps = 1);
27  void Final(void);
28 
29  void SetSpinOn(Bool_t b) { m_bSpin = b; }
30  Bool_t GetSpinOn(void) { return m_bSpin; }
31  void SetSpinPer(Float_t f);
32  void SetSpinEvents(Int_t i);
33  const Char_t* GetSpinChars(void) { return m_psSpinChars.Data(); }
34  void SetSpinChars(const Char_t *pStr);
35  void SetSpinChars(Int_t iType);
36  Float_t GetSpinReal(void);
37 
38  void SetProgressOn(Bool_t b) { m_bProgress = b; }
39  Bool_t GetProgressOn(void) { return m_bProgress; }
40  void SetProgressPer(Float_t f);
41  void SetProgressEvents(Int_t i);
42  Char_t GetProgressChar(void) { return m_cProgressChar; }
43  void SetProgressChar(Char_t c) { m_cProgressChar = c; }
44  Float_t GetProgressReal(void);
45 
46  void SetTimerOn(Bool_t b) { m_bTimer = b; }
47  Bool_t GetTimerOn(void) { return m_bTimer; }
48  void SetTimerPer(Float_t f);
49  void SetTimerEvents(Int_t i);
50  Float_t GetTimerReal(void);
51 
52  void SetFullTimerOn(Bool_t b) { m_bFullTimer = b; }
53  Bool_t GetFullTimerOn(void) { return m_bFullTimer; }
54 
55  // -------------------------------------------------------------------------
56 
57 private:
58 
59  Int_t m_iMax; // max numer of envents
60  Int_t m_iLast; // current number
61 
62  Bool_t m_bSpin; // spin option
63  Bool_t m_bSpinInPer; // m_fSpinSet in percents or events
64  Float_t m_fSpinSet; // how often spin
65  Float_t m_fSpinReal; // how often spin in events
66  TString m_psSpinChars; // list of spin's characters
67  Int_t m_iSpinLen; // length of the m_psSpinChars
68 
69  Bool_t m_bProgress; // print progress bar
70  Bool_t m_bProgressInPer; // m_fProgressSet in percents
71  Float_t m_fProgressSet; // how often print progress
72  Float_t m_fProgressReal; // how often print progress / events
73  Char_t m_cProgressChar; // a character for the progress bar
74 
75  Bool_t m_bTimer; // print timer value
76  Bool_t m_bTimerInPer; // m_fTimerSet in percents
77  Float_t m_fTimerSet; // how often print timer info
78  Float_t m_fTimerReal; // how often print timer info in events
79 
80  Bool_t m_bFullTimer; // print full time info at the end
81 
82  TStopwatch tTimer; // timer for time info
83 
84  Bool_t m_bWasOutOfRange; // flag if the progress was out of range
85 
86  // -------------------------------------------------------------------------
87 
88  ClassDef(HSUProgress, 1) //! Progress bar class
89 };
90 
91 // -----------------------------------------------------------------------------
92 
93 #endif //!HSUPROGRESS_H
Char_t GetProgressChar(void)
Definition: hsuprogress.h:42
Char_t m_cProgressChar
Definition: hsuprogress.h:73
HSUProgress(Int_t iMax=100)
Definition: hsuprogress.cc:74
Bool_t m_bProgress
Definition: hsuprogress.h:69
void SetTimerEvents(Int_t i)
Definition: hsuprogress.cc:221
Bool_t GetTimerOn(void)
Definition: hsuprogress.h:47
Bool_t m_bSpinInPer
Definition: hsuprogress.h:63
void SetSpinChars(const Char_t *pStr)
Definition: hsuprogress.cc:150
void SetFullTimerOn(Bool_t b)
Definition: hsuprogress.h:52
void SetTimerOn(Bool_t b)
Definition: hsuprogress.h:46
void SetProgressChar(Char_t c)
Definition: hsuprogress.h:43
Bool_t m_bTimer
Definition: hsuprogress.h:75
Bool_t m_bTimerInPer
Definition: hsuprogress.h:76
Float_t GetSpinReal(void)
Definition: hsuprogress.cc:172
void SetMaxValue(Int_t i)
Definition: hsuprogress.h:20
void Final(void)
Definition: hsuprogress.cc:373
Float_t m_fTimerSet
Definition: hsuprogress.h:77
Int_t GetLast(void)
Definition: hsuprogress.h:25
virtual ~HSUProgress()
Definition: hsuprogress.cc:117
void SetProgressPer(Float_t f)
Definition: hsuprogress.cc:183
Float_t GetTimerReal(void)
Definition: hsuprogress.cc:230
void SetSpinOn(Bool_t b)
Definition: hsuprogress.h:29
Bool_t m_bSpin
Definition: hsuprogress.h:62
Int_t m_iSpinLen
Definition: hsuprogress.h:67
Int_t GetMaxValue(void)
Definition: hsuprogress.h:21
void SetProgressOn(Bool_t b)
Definition: hsuprogress.h:38
const Char_t * GetSpinChars(void)
Definition: hsuprogress.h:33
Float_t m_fProgressSet
Definition: hsuprogress.h:71
Bool_t GetProgressOn(void)
Definition: hsuprogress.h:39
Float_t m_fSpinReal
Definition: hsuprogress.h:65
Float_t GetProgressReal(void)
Definition: hsuprogress.cc:201
void Restart(void)
Definition: hsuprogress.cc:124
Bool_t GetSpinOn(void)
Definition: hsuprogress.h:30
Float_t m_fSpinSet
Definition: hsuprogress.h:64
Bool_t m_bFullTimer
Definition: hsuprogress.h:80
Bool_t GetFullTimerOn(void)
Definition: hsuprogress.h:53
Float_t m_fTimerReal
Definition: hsuprogress.h:78
void Next(Int_t iSteps=1)
Definition: hsuprogress.cc:241
Int_t m_iMax
Definition: hsuprogress.h:59
Float_t m_fProgressReal
Definition: hsuprogress.h:72
void SetSpinEvents(Int_t i)
Definition: hsuprogress.cc:141
Bool_t m_bWasOutOfRange
Definition: hsuprogress.h:84
TStopwatch tTimer
Definition: hsuprogress.h:82
void SetTimerPer(Float_t f)
Definition: hsuprogress.cc:212
TString m_psSpinChars
Definition: hsuprogress.h:66
void SetSpinPer(Float_t f)
Definition: hsuprogress.cc:132
Int_t m_iLast
Definition: hsuprogress.h:60
void Reset(void)
Definition: hsuprogress.cc:84
Bool_t m_bProgressInPer
Definition: hsuprogress.h:70
void SetProgressEvents(Int_t i)
Definition: hsuprogress.cc:192