Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TProofProgressDialog.h
Go to the documentation of this file.
1 // @(#)root/sessionviewer:$Id$
2 // Author: Fons Rademakers 21/03/03
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2003, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TProofProgressDialog
13 #define ROOT_TProofProgressDialog
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TProofProgressDialog //
19 // //
20 // This class provides a query progress bar. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TTime.h"
25 #include "TString.h"
26 
27 class TGTransientFrame;
28 class TGProgressBar;
29 class TGTextButton;
30 class TGCheckButton;
31 class TGLabel;
32 class TGTextBuffer;
33 class TGTextEntry;
34 class TProof;
35 class TProofProgressLog;
36 class TProofProgressMemoryPlot;
37 class TNtuple;
38 class TGraph;
39 class TGSpeedo;
40 
41 class TProofProgressDialog {
42 
43  friend class TProofProgressLog;
44  friend class TProofProgressMemoryPlot;
45 
46 private:
47  enum EQueryStatus { kRunning = 0, kDone, kStopped, kAborted, kIncomplete };
48 
49  TGTransientFrame *fDialog; // transient frame, main dialog window
50  TGProgressBar *fBar; // progress bar
51  TGTextButton *fClose;
52  TGTextButton *fStop;
53  TGTextButton *fAbort;
54  TGTextButton *fAsyn;
55  TGTextButton *fLog;
56  TGTextButton *fRatePlot;
57  TGTextButton *fMemPlot;
58  TGTextButton *fUpdtSpeedo;
59  TGCheckButton *fKeepToggle;
60  TGCheckButton *fLogQueryToggle;
61  TGTextBuffer *fTextQuery;
62  TGTextEntry *fEntry;
63  TGLabel *fTitleLab;
64  TGLabel *fFilesEvents;
65  TGLabel *fTimeLab;
66  TGLabel *fProcessed;
67  TGLabel *fEstim;
68  TGLabel *fTotal;
69  TGLabel *fRate;
70  TGLabel *fInit;
71  TGLabel *fSelector;
72  Bool_t fSpeedoEnabled; // whether to enable the speedometer
73  TGSpeedo *fSpeedo; // speedometer
74  TGCheckButton *fSmoothSpeedo; // use smooth speedometer update
75  TProofProgressLog *fLogWindow; // transient frame for logs
76  TProofProgressMemoryPlot *fMemWindow; // transient frame for memory plots
77  TProof *fProof;
78  TTime fStartTime;
79  TTime fEndTime;
80  Long64_t fPrevProcessed;
81  Long64_t fPrevTotal;
82  Long64_t fFirst;
83  Long64_t fEntries;
84  Int_t fFiles;
85  EQueryStatus fStatus;
86  Bool_t fKeep;
87  Bool_t fLogQuery;
88  TNtuple *fRatePoints;
89  TGraph *fRateGraph;
90  TGraph *fMBRtGraph;
91  TGraph *fActWGraph;
92  TGraph *fTotSGraph;
93  TGraph *fEffSGraph;
94  Float_t fInitTime;
95  Float_t fProcTime;
96  Double_t fAvgRate;
97  Double_t fAvgMBRate;
98  Int_t fRightInfo;
99 
100  TString fSessionUrl;
101 
102  Float_t AdjustBytes(Float_t mbs, TString &sf);
103 
104  static Bool_t fgKeepDefault;
105  static Bool_t fgLogQueryDefault;
106  static TString fgTextQueryDefault;
107 
108 public:
109  TProofProgressDialog(TProof *proof, const char *selector,
110  Int_t files, Long64_t first, Long64_t entries);
111  virtual ~TProofProgressDialog();
112 
113  void ResetProgressDialog(const char *sel, Int_t sz, Long64_t fst, Long64_t ent);
114  void Progress(Long64_t total, Long64_t processed);
115  void Progress(Long64_t total, Long64_t processed, Long64_t bytesread,
116  Float_t initTime, Float_t procTime,
117  Float_t evtrti, Float_t mbrti) {
118  Progress(total, processed, bytesread, initTime, procTime,
119  evtrti, mbrti, -1, -1, -1.); }
120  void Progress(Long64_t total, Long64_t processed, Long64_t bytesread,
121  Float_t initTime, Float_t procTime,
122  Float_t evtrti, Float_t mbrti, Int_t actw, Int_t tses, Float_t eses);
123  void DisableAsyn();
124  void IndicateStop(Bool_t aborted);
125  void LogMessage(const char *msg, Bool_t all);
126 
127  void CloseWindow();
128  void DoClose();
129  void DoLog();
130  void DoKeep(Bool_t on);
131  void DoSetLogQuery(Bool_t on);
132  void DoStop();
133  void DoAbort();
134  void DoAsyn();
135  void DoPlotRateGraph();
136  void DoMemoryPlot();
137  void DoEnableSpeedo();
138  void ToggleOdometerInfos();
139  void ToggleThreshold();
140 
141  ClassDef(TProofProgressDialog,0) //PROOF progress dialog
142 };
143 
144 #endif