Public Member Functions | Public Attributes | Private Attributes | List of all members
om::HeaderBar Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/OnlineMonitoring/viewer/HeaderBar.h"

Inheritance diagram for om::HeaderBar:

Public Member Functions

 HeaderBar (TGWindow *w)
 
 ~HeaderBar ()
 
Bool_t HandleTimer (TTimer *timer)
 

Public Attributes

TGLabel * fProdLabel
 
TGLabel * fDateLabel
 

Private Attributes

TTimer * fTimer
 

Detailed Description

Definition at line 9 of file HeaderBar.h.

Constructor & Destructor Documentation

HeaderBar::HeaderBar ( TGWindow *  w)

Definition at line 14 of file HeaderBar.cxx.

References fDateLabel, fProdLabel, fTimer, and kTick.

14  :
15  TGGroupFrame(w, "Monitoring Status", kHorizontalFrame)
16 {
17  fProdLabel = new TGLabel(this,
18  "Producer: ------ pid:------ s/utime=------/------ rsize=------k"
19  " Run/Subrun/Event=------/----/---------");
20  fProdLabel->SetTextJustify(kTextLeft);
21  this->AddFrame(fProdLabel, new TGLayoutHints(kLHintsLeft|kLHintsTop, 16, 16, 2, 2));
22 
23  fDateLabel = new TGLabel(this, "--------------------------");
24  fDateLabel->SetTextJustify(kTextRight);
25  this->AddFrame(fDateLabel, new TGLayoutHints(kLHintsRight|kLHintsTop, 16, 16, 2, 2));
26 
27  fTimer = new TTimer;
28  fTimer->SetObject(this);
29  fTimer->Start(kTick);
30 }
static unsigned int kTick
Definition: HeaderBar.cxx:12
TGLabel * fDateLabel
Definition: HeaderBar.h:18
TGLabel * fProdLabel
Definition: HeaderBar.h:17
Float_t w
Definition: plot.C:20
TTimer * fTimer
Definition: HeaderBar.h:21
HeaderBar::~HeaderBar ( )

Definition at line 34 of file HeaderBar.cxx.

References fDateLabel, fProdLabel, and fTimer.

35 {
36  if(fProdLabel) { delete fProdLabel; fProdLabel = 0; }
37  if(fDateLabel) { delete fDateLabel; fDateLabel = 0; }
38  if(fTimer) { delete fTimer; fTimer = 0; }
39 }
TGLabel * fDateLabel
Definition: HeaderBar.h:18
TGLabel * fProdLabel
Definition: HeaderBar.h:17
TTimer * fTimer
Definition: HeaderBar.h:21

Member Function Documentation

Bool_t HeaderBar::HandleTimer ( TTimer *  timer)

Definition at line 43 of file HeaderBar.cxx.

References om::GUIModel::Data(), e, MakeMiniprodValidationCuts::f, fDateLabel, om::GUIModelData::fHistogramSource, fProdLabel, fTimer, om::HistoSource::GetStatus(), MECModelEnuComparisons::i, om::GUIModel::Instance(), kTick, BlessedPlots::pid, r(), source, fetchNoiseMap::stime, submit_syst::str, string, and confusionMatrixTree::t.

44 {
45 
46  // Check to see that the histosource is SHM
47  // If the source is a root file, return.
48  const char* source = GUIModel::Instance().Data().fHistogramSource.c_str();
49  std::string str(source);
50  bool is_root = str.find(".root")<str.length();
51  bool is_shm = str.find(".shm")< str.length();
52 
53  if (is_root && is_shm) abort();
54  if (is_root) {
55  this->Layout();
56  fTimer->SetTime(kTick);
57  return true;
58  }
59 
60  HistoSource f(source);
61 
62  std::string snm;
63  unsigned int r, s, e;
64  pid_t pid;
65  long stime, utime, cpu, rsize;
66  time_t tp;
67  f.GetStatus(snm, &r, &s, &e, &pid, &stime, &utime, &cpu, &rsize, &tp);
68 
69  char evtext[1024];
70  sprintf(evtext,
71  "Producer: %6s pid:%6d s/utime=%lu/%lu rsize=%6.2fk"
72  " Run/Subrun/Event=%d/%d/%d",
73  snm.c_str(), pid, stime, utime, rsize/1024.0,
74  r, s, e);
75  fProdLabel->ChangeText(evtext);
76 
77  time_t t = time(NULL);
78  char datext[1024];
79  sprintf(datext, "UTC: %s", asctime(gmtime(&t)));
80  for (unsigned int i=0; i<1024; ++i) {
81  if (datext[i]=='\n') datext[i] = '\0';
82  }
83  fDateLabel->ChangeText(datext);
84 
85  //
86  // Documentation says we have to call a Layout when the text changes
87  //
88  this->Layout();
89 
90  fTimer->SetTime(kTick);
91 
92  return true;
93 }
static unsigned int kTick
Definition: HeaderBar.cxx:12
::xsd::cxx::tree::time< char, simple_type > time
Definition: Database.h:194
TGLabel * fDateLabel
Definition: HeaderBar.h:18
const XML_Char * s
Definition: expat.h:262
static GUIModel & Instance()
Definition: GUIModel.cxx:11
const char * source
Definition: lz4.h:436
std::string fHistogramSource
Definition: GUIModelData.h:35
TRandom3 r(0)
TGLabel * fProdLabel
Definition: HeaderBar.h:17
Float_t e
Definition: plot.C:35
const GUIModelData & Data() const
Definition: GUIModel.h:15
TTimer * fTimer
Definition: HeaderBar.h:21
enum BeamMode string

Member Data Documentation

TGLabel* om::HeaderBar::fDateLabel

Definition at line 18 of file HeaderBar.h.

Referenced by HandleTimer(), HeaderBar(), and ~HeaderBar().

TGLabel* om::HeaderBar::fProdLabel

Definition at line 17 of file HeaderBar.h.

Referenced by HandleTimer(), HeaderBar(), and ~HeaderBar().

TTimer* om::HeaderBar::fTimer
private

Definition at line 21 of file HeaderBar.h.

Referenced by HandleTimer(), HeaderBar(), and ~HeaderBar().


The documentation for this class was generated from the following files: