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

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-30/OnlineMonitoring/viewer/GUIModel.h"

Public Member Functions

const GUIModelDataData () const
 
void Subscribe (GUIModelSubscriber *s, unsigned int which)
 
void Unsubscribe (GUIModelSubscriber *s)
 
void HistogramBack ()
 
void HistogramForward ()
 
void SetDetector (const char *n)
 
void SetHistogramSource (const char *s)
 
void SetCurrentHistogram (const char *h)
 
void SetCSVFile (std::string v)
 
void SetHistogramInfoText (const char *t)
 
void SetPlotViewRefreshPaused (bool paused)
 
void DrawContentProjection ()
 
void SendUpdates () const
 
void SetCompareWhich (unsigned int i)
 
void SetReferenceFile (const char *RefFile)
 
void SetLookBack (int lb)
 
void SetCompareMethod (unsigned int i)
 
void SetCompareNorm (unsigned int i)
 
void SendWatchListUpdate ()
 
void SendPrint ()
 
void Publish (unsigned int which) const
 
void Init ()
 

Static Public Member Functions

static GUIModelInstance ()
 

Private Member Functions

 GUIModel ()
 

Private Attributes

GUIModelData fData
 
std::vector< GUIModelSubscriber * > fSubscriber
 
std::vector< unsigned intfWhich
 

Detailed Description

Definition at line 11 of file GUIModel.h.

Constructor & Destructor Documentation

GUIModel::GUIModel ( )
private

Definition at line 53 of file GUIModel.cxx.

Referenced by Data().

53 { }

Member Function Documentation

const GUIModelData& om::GUIModel::Data ( ) const
inline
void GUIModel::DrawContentProjection ( )

Definition at line 203 of file GUIModel.cxx.

References om::GUIModelData::fComparisonOpt, om::GUIModelData::fContentProjection, fData, om::ComparisonOptions::fWhich, om::kComparisonUpdateID, om::ComparisonOptions::kNone, om::kPlotViewRefreshID, and Publish().

Referenced by Data(), and om::ButtonBank::Histo().

204 {
206 
209  else
211 
213 }
unsigned int fWhich
Which histo. to compare to?
static const unsigned int kComparisonUpdateID
Definition: GUIModelData.h:24
ComparisonOptions fComparisonOpt
Definition: GUIModelData.h:41
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
GUIModelData fData
Definition: GUIModel.h:47
unsigned int fContentProjection
Definition: GUIModelData.h:42
static const unsigned int kPlotViewRefreshID
Definition: GUIModelData.h:17
void GUIModel::HistogramBack ( )

Definition at line 113 of file GUIModel.cxx.

References om::CurrentHistogram::Backward(), om::GUIModelData::fCurrentHistogram, fData, om::kCurrentHistogramID, and Publish().

Referenced by om::ButtonBank::Back(), and Data().

114 {
117 }
static const unsigned int kCurrentHistogramID
Definition: GUIModelData.h:15
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
GUIModelData fData
Definition: GUIModel.h:47
CurrentHistogram fCurrentHistogram
Definition: GUIModelData.h:37
void GUIModel::HistogramForward ( )

Definition at line 121 of file GUIModel.cxx.

References om::GUIModelData::fCurrentHistogram, fData, om::CurrentHistogram::Forward(), om::kCurrentHistogramID, and Publish().

Referenced by Data(), and om::ButtonBank::Forward().

122 {
125 }
static const unsigned int kCurrentHistogramID
Definition: GUIModelData.h:15
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
GUIModelData fData
Definition: GUIModel.h:47
CurrentHistogram fCurrentHistogram
Definition: GUIModelData.h:37
void GUIModel::Init ( )

Definition at line 19 of file GUIModel.cxx.

References om::kComparisonUpdateID, om::kCurrentHistogramID, om::kPlotViewRefreshID, om::kPrintID, om::kRefFileInitID, and Publish().

Referenced by Data().

20 {
21  unsigned int whichInit = 0xFFFF;
22 
23  // subtract off things that should NOT be initialized
24  whichInit -= kCurrentHistogramID;
25  whichInit -= kPlotViewRefreshID;
26  whichInit -= kComparisonUpdateID;
27  whichInit -= kPrintID;
28  whichInit -= kRefFileInitID;
29 
30  this->Publish(whichInit);
31 }
static const unsigned int kRefFileInitID
Definition: GUIModelData.h:28
static const unsigned int kCurrentHistogramID
Definition: GUIModelData.h:15
static const unsigned int kPrintID
Definition: GUIModelData.h:27
static const unsigned int kComparisonUpdateID
Definition: GUIModelData.h:24
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
static const unsigned int kPlotViewRefreshID
Definition: GUIModelData.h:17
GUIModel & GUIModel::Instance ( )
static

Definition at line 11 of file GUIModel.cxx.

Referenced by om::ButtonBank::Back(), om::ButtonBank::ButtonBank(), om::UTCLabel::DCMLabels(), om::PlotClickHandler::DCMutcInfo(), om::PlotClickHandler::DecodeClick(), om::PlotClickHandler::DefaultHistogramInfo(), om::HistogramBrowser::DoubleClicked(), om::UTCLabel::FEBLabels(), om::PlotClickHandler::FEButcInfo(), om::MenuBar::FilePrint(), om::ButtonBank::Forward(), om::ComparisonBox::GUIModelDataIssue(), om::GUIModelSubscriber::GUIModelSubscriber(), om::WatchListBox::HandleAddToList(), om::ComparisonBox::HandleApplyOptions(), om::ComparisonBox::HandleCompareHowButtons(), om::ComparisonBox::HandleCompareNormButtons(), om::ComparisonBox::HandleCompareWhichButtons(), om::ComparisonBox::HandleFileBrowse(), om::WatchListBox::HandleRemoveFromList(), om::HeaderBar::HandleTimer(), om::ButtonBank::HandleTimer(), om::ButtonBank::Histo(), om::PlotClickHandler::HwDCMHistogramInfo(), om::PlotClickHandler::HwDetDoubleClick(), om::PlotClickHandler::HwDetHistogramInfo(), om::PlotClickHandler::HwPCHistogramInfoX(), om::PlotClickHandler::HwPCHistogramInfoY(), om::WatchListBox::LayoutHardwareFrame(), om::HistogramBrowser::MakeCategories(), om::PlotOptions::MakeLabelText(), om::PlotOptions::MakeSpecialLabel(), om::ButtonBank::Pause(), om::PlotClickHandler::PlotClickHandler(), om::HistogramBrowser::Populate(), om::ButtonBank::PrintPlot(), om::MenuBar::ResetLocks(), om::ButtonBank::Resume(), om::ButtonBank::Update(), om::PlotViewer::Update(), om::PlotViewer::UpdateCompare(), om::WatchListBox::UpdateCurrentList(), om::WatchListBox::UpdateHWboxes(), and om::GUIModelSubscriber::~GUIModelSubscriber().

12 {
13  static GUIModel nico;
14  return nico;
15 }
void GUIModel::Publish ( unsigned int  which) const

Definition at line 227 of file GUIModel.cxx.

References fData, fSubscriber, fWhich, gsLocked, and MECModelEnuComparisons::i.

Referenced by Data(), DrawContentProjection(), om::ComparisonBox::HandleApplyOptions(), HistogramBack(), HistogramForward(), Init(), SendPrint(), SendUpdates(), SendWatchListUpdate(), SetCompareMethod(), SetCompareNorm(), SetCompareWhich(), SetCurrentHistogram(), SetDetector(), SetHistogramInfoText(), SetHistogramSource(), SetLookBack(), SetPlotViewRefreshPaused(), and SetReferenceFile().

228 {
229  if (gsLocked==true) return;
230 
231  gsLocked = true;
232 
233  unsigned int i;
234  for (i=0; i<fSubscriber.size(); ++i) {
235  if ((which&fWhich[i])!=0 && fSubscriber[i]!=0) {
236  fSubscriber[i]->GUIModelDataIssue(fData, which);
237  }
238  }
239 
240  gsLocked = false;
241 }
static bool gsLocked
Definition: GUIModel.cxx:7
GUIModelData fData
Definition: GUIModel.h:47
std::vector< GUIModelSubscriber * > fSubscriber
Definition: GUIModel.h:48
std::vector< unsigned int > fWhich
Definition: GUIModel.h:49
void GUIModel::SendPrint ( )

Definition at line 196 of file GUIModel.cxx.

References om::kPrintID, and Publish().

Referenced by Data(), om::MenuBar::FilePrint(), and om::ButtonBank::PrintPlot().

197 {
198  this->Publish(kPrintID);
199 }
static const unsigned int kPrintID
Definition: GUIModelData.h:27
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
void GUIModel::SendUpdates ( ) const

Definition at line 217 of file GUIModel.cxx.

References om::GUIModelData::fComparisonOpt, fData, om::ComparisonOptions::fWhich, om::kComparisonUpdateID, om::ComparisonOptions::kNone, om::kPlotViewRefreshID, and Publish().

Referenced by Data(), and om::ButtonBank::Update().

218 {
221  else
223 }
unsigned int fWhich
Which histo. to compare to?
static const unsigned int kComparisonUpdateID
Definition: GUIModelData.h:24
ComparisonOptions fComparisonOpt
Definition: GUIModelData.h:41
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
GUIModelData fData
Definition: GUIModel.h:47
static const unsigned int kPlotViewRefreshID
Definition: GUIModelData.h:17
void GUIModel::SendWatchListUpdate ( )

Definition at line 189 of file GUIModel.cxx.

References om::kWatchListUpdateID, and Publish().

Referenced by Data(), om::WatchListBox::HandleAddToList(), and om::WatchListBox::HandleRemoveFromList().

190 {
192 }
static const unsigned int kWatchListUpdateID
Definition: GUIModelData.h:26
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
void GUIModel::SetCompareMethod ( unsigned int  i)

Definition at line 173 of file GUIModel.cxx.

References om::GUIModelData::fComparisonOpt, fData, om::ComparisonOptions::fMethod, MECModelEnuComparisons::i, om::kComparisonOptionsID, and Publish().

Referenced by Data(), and om::ComparisonBox::HandleCompareHowButtons().

174 {
177 }
ComparisonOptions fComparisonOpt
Definition: GUIModelData.h:41
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
unsigned int fMethod
How to show the comparison?
static const unsigned int kComparisonOptionsID
Definition: GUIModelData.h:21
GUIModelData fData
Definition: GUIModel.h:47
void GUIModel::SetCompareNorm ( unsigned int  i)

Definition at line 181 of file GUIModel.cxx.

References om::GUIModelData::fComparisonOpt, fData, om::ComparisonOptions::fNormalize, MECModelEnuComparisons::i, om::kComparisonOptionsID, and Publish().

Referenced by Data(), and om::ComparisonBox::HandleCompareNormButtons().

182 {
185 }
ComparisonOptions fComparisonOpt
Definition: GUIModelData.h:41
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
static const unsigned int kComparisonOptionsID
Definition: GUIModelData.h:21
GUIModelData fData
Definition: GUIModel.h:47
unsigned int fNormalize
How to normalize the histos?
void GUIModel::SetCompareWhich ( unsigned int  i)

Definition at line 147 of file GUIModel.cxx.

References om::GUIModelData::fComparisonOpt, fData, om::ComparisonOptions::fWhich, MECModelEnuComparisons::i, om::kComparisonOptionsID, and Publish().

Referenced by Data(), om::ComparisonBox::HandleCompareWhichButtons(), and om::ComparisonBox::HandleFileBrowse().

148 {
151 }
unsigned int fWhich
Which histo. to compare to?
ComparisonOptions fComparisonOpt
Definition: GUIModelData.h:41
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
static const unsigned int kComparisonOptionsID
Definition: GUIModelData.h:21
GUIModelData fData
Definition: GUIModel.h:47
void GUIModel::SetCSVFile ( std::string  v)

Definition at line 78 of file GUIModel.cxx.

References fData, and om::GUIModelData::SetCSVFile().

Referenced by Data().

79 {
81 }
void SetCSVFile(std::string v)
GUIModelData fData
Definition: GUIModel.h:47
void GUIModel::SetCurrentHistogram ( const char *  h)
void GUIModel::SetDetector ( const char *  n)

Definition at line 57 of file GUIModel.cxx.

References om::cout, fData, om::GUIModelData::fDetector, om::kDetectorID, om::kFARDET, om::kNDOS, om::kNEARDET, om::kTESTBEAM, Munits::nm, Publish(), and string.

Referenced by Data().

58 {
59  std::string nm(n);
60  if (nm=="NDOS" || nm=="ndos")
62  else if (nm=="FD" || nm=="fd" || nm=="far" || nm=="FarDet" || nm=="fardet")
64  else if (nm=="ND" || nm=="nd" || nm=="near" || nm=="NearDet" || nm=="neardet" || nm=="NDUG")
66  else if (nm=="TB" || nm=="tb" || nm=="test" || nm=="TestBeam"|| nm=="testbeam")
68  else {
69  std::cout << "\nERROR: " << nm << " is not a valid detector type.\n\n";
70  abort();
71  }
72 
73  this->Publish(kDetectorID);
74 }
Detector_t fDetector
Definition: GUIModelData.h:34
static constexpr Double_t nm
Definition: Munits.h:133
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
OStream cout
Definition: OStream.cxx:6
GUIModelData fData
Definition: GUIModel.h:47
static const unsigned int kDetectorID
Definition: GUIModelData.h:25
enum BeamMode string
void GUIModel::SetHistogramInfoText ( const char *  t)
void GUIModel::SetHistogramSource ( const char *  s)

Definition at line 85 of file GUIModel.cxx.

References galleryMaker::ext, fData, om::GUIModelData::fHistogramSource, om::kHistogramSourceID, Publish(), SetPlotViewRefreshPaused(), ss, and string.

Referenced by Data().

86 {
87  //
88  // If the histogram source happens to be a .root file, automatically
89  // pause the automatic updates. If its .shm automatically unpause
90  //
91  std::string ss(s);
92  std::string ext(ss.substr(ss.find_last_of(".")+1));
93  if (ext=="root") { this->SetPlotViewRefreshPaused(true); }
94  if (ext=="shm") { this->SetPlotViewRefreshPaused(false); }
95 
98 }
Float_t ss
Definition: plot.C:24
const XML_Char * s
Definition: expat.h:262
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
static const unsigned int kHistogramSourceID
Definition: GUIModelData.h:22
std::string fHistogramSource
Definition: GUIModelData.h:35
GUIModelData fData
Definition: GUIModel.h:47
void SetPlotViewRefreshPaused(bool paused)
Definition: GUIModel.cxx:137
enum BeamMode string
void GUIModel::SetLookBack ( int  lb)

Definition at line 163 of file GUIModel.cxx.

References om::GUIModelData::fComparisonOpt, fData, om::ComparisonOptions::fLookBack, om::kComparisonOptionsID, and Publish().

Referenced by Data(), and om::ComparisonBox::HandleApplyOptions().

164 {
165  // The comparison box returns a number 0 through (n-1) but the look back
166  // number is defined from 1 to n, so we will add 1.
167  fData.fComparisonOpt.fLookBack = lb + 1;
169 }
unsigned int fLookBack
Which "look back" histogram to compare to?
ComparisonOptions fComparisonOpt
Definition: GUIModelData.h:41
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
static const unsigned int kComparisonOptionsID
Definition: GUIModelData.h:21
GUIModelData fData
Definition: GUIModel.h:47
void GUIModel::SetPlotViewRefreshPaused ( bool  paused)

Definition at line 137 of file GUIModel.cxx.

References fData, om::GUIModelData::fPlotViewRefreshPaused, om::kPlotViewRefreshPausedID, and Publish().

Referenced by Data(), om::ButtonBank::Pause(), om::ButtonBank::Resume(), and SetHistogramSource().

138 {
139  if (fData.fPlotViewRefreshPaused!=paused) {
140  fData.fPlotViewRefreshPaused = paused;
142  }
143 }
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
bool fPlotViewRefreshPaused
Definition: GUIModelData.h:39
static const unsigned int kPlotViewRefreshPausedID
Definition: GUIModelData.h:18
GUIModelData fData
Definition: GUIModel.h:47
void GUIModel::SetReferenceFile ( const char *  RefFile)

Definition at line 155 of file GUIModel.cxx.

References om::GUIModelData::fComparisonOpt, fData, om::ComparisonOptions::fReferenceFile, om::kComparisonOptionsID, and Publish().

Referenced by Data(), and om::ComparisonBox::HandleFileBrowse().

156 {
159 }
ComparisonOptions fComparisonOpt
Definition: GUIModelData.h:41
void Publish(unsigned int which) const
Definition: GUIModel.cxx:227
static const unsigned int kComparisonOptionsID
Definition: GUIModelData.h:21
GUIModelData fData
Definition: GUIModel.h:47
std::string fReferenceFile
Reference file for comparison histograms.
void GUIModel::Subscribe ( GUIModelSubscriber s,
unsigned int  which 
)

Definition at line 35 of file GUIModel.cxx.

References fSubscriber, fWhich, and push_back().

Referenced by Data(), and om::GUIModelSubscriber::GUIModelSubscriber().

36 {
37  fSubscriber.push_back(s);
38  fWhich. push_back(which);
39 }
base_types push_back(int_type())
std::vector< GUIModelSubscriber * > fSubscriber
Definition: GUIModel.h:48
std::vector< unsigned int > fWhich
Definition: GUIModel.h:49
void GUIModel::Unsubscribe ( GUIModelSubscriber s)

Definition at line 43 of file GUIModel.cxx.

References fSubscriber, and MECModelEnuComparisons::i.

Referenced by Data(), and om::GUIModelSubscriber::~GUIModelSubscriber().

44 {
45  unsigned int i;
46  for (i=0; i<fSubscriber.size(); ++i) {
47  if (fSubscriber[i]==s) fSubscriber[i]=0;
48  }
49 }
std::vector< GUIModelSubscriber * > fSubscriber
Definition: GUIModel.h:48

Member Data Documentation

GUIModelData om::GUIModel::fData
private
std::vector<GUIModelSubscriber*> om::GUIModel::fSubscriber
private

Definition at line 48 of file GUIModel.h.

Referenced by Publish(), Subscribe(), and Unsubscribe().

std::vector<unsigned int> om::GUIModel::fWhich
private

Definition at line 49 of file GUIModel.h.

Referenced by Publish(), and Subscribe().


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