CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWGUIEventSelector Class Reference

#include <FWGUIEventSelector.h>

Inheritance diagram for FWGUIEventSelector:

Public Member Functions

void deleteCallback ()
 
void enableCallback (bool)
 
void expressionCallback (char *)
 
 FWGUIEventSelector (TGCompositeFrame *p, FWEventSelector *sel, std::vector< std::string > &triggerProcessList)
 
FWEventSelectorguiSelector ()
 
FWEventSelectororigSelector ()
 
void removeSelector (FWGUIEventSelector *)
 
void selectorChanged ()
 
void setOrigSelector (FWEventSelector *s)
 
void triggerProcessCallback (const char *)
 
void updateNEvents ()
 
 ~FWGUIEventSelector () override
 

Private Member Functions

 ClassDefOverride (FWGUIEventSelector, 0)
 
 FWGUIEventSelector (const FWGUIEventSelector &)
 
const FWGUIEventSelectoroperator= (const FWGUIEventSelector &)
 

Private Attributes

TGComboBox * m_combo
 
FWCustomIconsButtonm_deleteBtn
 
TGCheckButton * m_enableBtn
 
FWEventSelectorm_guiSelector
 
TGLabel * m_nEvents
 
FWEventSelectorm_origSelector
 
FWGUIValidatingTextEntrym_text1
 
FWGUIValidatingTextEntrym_text2
 
FWHLTValidatorm_validator
 

Detailed Description

Definition at line 15 of file FWGUIEventSelector.h.

Constructor & Destructor Documentation

◆ FWGUIEventSelector() [1/2]

FWGUIEventSelector::FWGUIEventSelector ( TGCompositeFrame *  p,
FWEventSelector sel,
std::vector< std::string > &  triggerProcessList 
)

Definition at line 11 of file FWGUIEventSelector.cc.

14  : TGHorizontalFrame(p),
15  m_guiSelector(nullptr),
16  m_origSelector(nullptr),
17  m_text1(nullptr),
18  m_text2(nullptr),
19  m_enableBtn(nullptr),
20  m_deleteBtn(nullptr),
21  m_nEvents(nullptr),
22  m_combo(nullptr),
23  m_validator(nullptr) {
26 
27  if (!m_guiSelector->m_triggerProcess.empty()) {
28  m_combo = new TGComboBox(this);
29  int cnt = 0;
30  int id = -1;
31  for (std::vector<std::string>::iterator i = triggerProcessList.begin(); i != triggerProcessList.end(); ++i) {
32  if (*i == sel->m_triggerProcess)
33  id = cnt;
34  m_combo->AddEntry((*i).c_str(), cnt++);
35  }
36 
37  if (id < 0) {
38  m_combo->AddEntry(sel->m_triggerProcess.c_str(), cnt);
39  id = cnt;
40  }
41  m_combo->Select(id, false);
42  m_combo->Resize(80, 21);
43  AddFrame(m_combo, new TGLayoutHints(kLHintsNormal, 2, 2, 0, 1));
44 
46  m_combo->Connect("Selected(const char*)", "FWGUIEventSelector", this, "triggerProcessCallback(const char*)");
47  }
48 
49  // -------------- expression
50 
52  m_text1->SetHeight(20);
54  m_text1->ChangeOptions(0);
55  m_text1->Connect("TextChanged(char*)", "FWGUIEventSelector", this, "expressionCallback(char*)");
56  AddFrame(m_text1, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 2, 2, 1, 1));
57 
58  // -------------- comment
59 
60  TGCompositeFrame* cfr = new TGHorizontalFrame(this, 120, 20, kFixedSize);
61  AddFrame(cfr, new TGLayoutHints(kLHintsNormal, 2, 2, 1, 3));
63  // m_text2->SetHeight(21);
65  m_text2->ChangeOptions(0);
66  m_text2->Connect("TextChanged(char*)", "string", &m_guiSelector->m_description, "assign(char*)");
67  cfr->AddFrame(m_text2, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 2, 2, 0, 0));
68 
69  // ---------------- selection info
70 
71  TGHorizontalFrame* labFrame = new TGHorizontalFrame(this, 60, 22, kFixedSize);
72  AddFrame(labFrame, new TGLayoutHints(kLHintsBottom, 2, 2, 2, 2));
73  m_nEvents = new TGLabel(labFrame, "");
74  m_nEvents->SetTextJustify(kTextLeft);
75  labFrame->AddFrame(m_nEvents, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX));
76  updateNEvents();
77 
78  // ---------------- enable
79 
80  m_enableBtn = new TGCheckButton(this, "");
81  m_enableBtn->SetToolTipText("Enable/disable the selection");
83  m_enableBtn->Connect("Toggled(bool)", "FWGUIEventSelector", this, "enableCallback(bool)");
84  AddFrame(m_enableBtn, new TGLayoutHints(kLHintsNormal | kLHintsCenterY, 2, 2, 0, 0));
85 
86  // ---------------- delete
88  fClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "delete.png"),
89  fClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "delete-over.png"),
90  fClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "delete-disabled.png"));
91  AddFrame(m_deleteBtn, new TGLayoutHints(kLHintsRight | kLHintsCenterY, 2, 2, 0, 0));
92  TQObject::Connect(m_deleteBtn, "Clicked()", "FWGUIEventSelector", this, "deleteCallback()");
93 }

References FWCheckBoxIcon::coreIcondir(), hcaldqm::fClient, mps_fire::i, m_combo, m_deleteBtn, FWEventSelector::m_description, m_enableBtn, FWEventSelector::m_enabled, FWEventSelector::m_expression, m_guiSelector, m_nEvents, m_origSelector, m_text1, m_text2, FWEventSelector::m_triggerProcess, m_validator, EgammaValidation_Wenu_cff::sel, FWGUIValidatingTextEntry::setValidator(), and updateNEvents().

◆ ~FWGUIEventSelector()

FWGUIEventSelector::~FWGUIEventSelector ( )
override

Definition at line 95 of file FWGUIEventSelector.cc.

95  {
96  delete m_guiSelector;
97  delete m_validator;
98 }

References m_guiSelector, and m_validator.

◆ FWGUIEventSelector() [2/2]

FWGUIEventSelector::FWGUIEventSelector ( const FWGUIEventSelector )
private

Member Function Documentation

◆ ClassDefOverride()

FWGUIEventSelector::ClassDefOverride ( FWGUIEventSelector  ,
 
)
private

◆ deleteCallback()

void FWGUIEventSelector::deleteCallback ( )

Definition at line 112 of file FWGUIEventSelector.cc.

112 { removeSelector(this); }

References removeSelector().

◆ enableCallback()

void FWGUIEventSelector::enableCallback ( bool  x)

Definition at line 101 of file FWGUIEventSelector.cc.

101  {
103  selectorChanged();
104 }

References FWEventSelector::m_enabled, m_guiSelector, selectorChanged(), and x.

◆ expressionCallback()

void FWGUIEventSelector::expressionCallback ( char *  txt)

Definition at line 122 of file FWGUIEventSelector.cc.

122  {
124  selectorChanged();
125 }

References FWEventSelector::m_expression, m_guiSelector, and selectorChanged().

◆ guiSelector()

FWEventSelector* FWGUIEventSelector::guiSelector ( )
inline

Definition at line 26 of file FWGUIEventSelector.h.

26 { return m_guiSelector; }

References m_guiSelector.

◆ operator=()

const FWGUIEventSelector& FWGUIEventSelector::operator= ( const FWGUIEventSelector )
private

◆ origSelector()

FWEventSelector* FWGUIEventSelector::origSelector ( )
inline

Definition at line 27 of file FWGUIEventSelector.h.

27 { return m_origSelector; }

References m_origSelector.

◆ removeSelector()

void FWGUIEventSelector::removeSelector ( FWGUIEventSelector s)

Definition at line 107 of file FWGUIEventSelector.cc.

107  {
108  Emit("removeSelector(FWGUIEventSelector*)", (Long_t)s);
109 }

References alignCSCRings::s.

Referenced by deleteCallback().

◆ selectorChanged()

void FWGUIEventSelector::selectorChanged ( )

Definition at line 128 of file FWGUIEventSelector.cc.

128  {
129  if (m_origSelector)
130  m_origSelector->m_updated = false;
131  Emit("selectorChanged()");
132 }

References m_origSelector, and FWEventSelector::m_updated.

Referenced by enableCallback(), expressionCallback(), and triggerProcessCallback().

◆ setOrigSelector()

void FWGUIEventSelector::setOrigSelector ( FWEventSelector s)
inline

Definition at line 28 of file FWGUIEventSelector.h.

28 { m_origSelector = s; }

References m_origSelector, and alignCSCRings::s.

◆ triggerProcessCallback()

void FWGUIEventSelector::triggerProcessCallback ( const char *  txt)

◆ updateNEvents()

void FWGUIEventSelector::updateNEvents ( )

Definition at line 135 of file FWGUIEventSelector.cc.

135  {
137  m_nEvents->Enable();
138  const char* txtInfo = Form("%3d", m_origSelector ? m_origSelector->m_selected : -1);
139  m_nEvents->SetText(txtInfo);
140  } else {
141  m_nEvents->Disable();
142  m_nEvents->SetText("no check");
143  }
144 }

References m_nEvents, m_origSelector, FWEventSelector::m_selected, and FWEventSelector::m_updated.

Referenced by FWGUIEventSelector().

Member Data Documentation

◆ m_combo

TGComboBox* FWGUIEventSelector::m_combo
private

Definition at line 46 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

◆ m_deleteBtn

FWCustomIconsButton* FWGUIEventSelector::m_deleteBtn
private

Definition at line 43 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

◆ m_enableBtn

TGCheckButton* FWGUIEventSelector::m_enableBtn
private

Definition at line 42 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

◆ m_guiSelector

FWEventSelector* FWGUIEventSelector::m_guiSelector
private

◆ m_nEvents

TGLabel* FWGUIEventSelector::m_nEvents
private

Definition at line 44 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector(), and updateNEvents().

◆ m_origSelector

FWEventSelector* FWGUIEventSelector::m_origSelector
private

◆ m_text1

FWGUIValidatingTextEntry* FWGUIEventSelector::m_text1
private

Definition at line 40 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

◆ m_text2

FWGUIValidatingTextEntry* FWGUIEventSelector::m_text2
private

Definition at line 41 of file FWGUIEventSelector.h.

Referenced by FWGUIEventSelector().

◆ m_validator

FWHLTValidator* FWGUIEventSelector::m_validator
private
FWGUIValidatingTextEntry::setValidator
void setValidator(FWValidatorBase *)
Definition: FWGUIValidatingTextEntry.cc:78
mps_fire.i
i
Definition: mps_fire.py:355
FWCheckBoxIcon::coreIcondir
static const TString & coreIcondir()
Definition: FWCheckBoxIcon.cc:76
FWHLTValidator
Definition: FWHLTValidator.h:15
FWGUIEventSelector::m_origSelector
FWEventSelector * m_origSelector
Definition: FWGUIEventSelector.h:38
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FWGUIEventSelector::m_combo
TGComboBox * m_combo
Definition: FWGUIEventSelector.h:46
FWGUIEventSelector::selectorChanged
void selectorChanged()
Definition: FWGUIEventSelector.cc:128
FWEventSelector::m_triggerProcess
std::string m_triggerProcess
Definition: FWEventSelector.h:19
DDAxes::x
FWGUIValidatingTextEntry
Definition: FWGUIValidatingTextEntry.h:35
FWEventSelector
Definition: FWEventSelector.h:12
alignCSCRings.s
s
Definition: alignCSCRings.py:92
FWGUIEventSelector::m_nEvents
TGLabel * m_nEvents
Definition: FWGUIEventSelector.h:44
FWGUIEventSelector::m_enableBtn
TGCheckButton * m_enableBtn
Definition: FWGUIEventSelector.h:42
FWEventSelector::m_expression
std::string m_expression
Definition: FWEventSelector.h:17
FWEventSelector::m_selected
int m_selected
Definition: FWEventSelector.h:21
FWGUIEventSelector::removeSelector
void removeSelector(FWGUIEventSelector *)
Definition: FWGUIEventSelector.cc:107
FWCustomIconsButton
Definition: FWCustomIconsButton.h:29
hcaldqm::fClient
Definition: DQModule.h:24
FWEventSelector::m_description
std::string m_description
Definition: FWEventSelector.h:18
FWGUIEventSelector::m_text2
FWGUIValidatingTextEntry * m_text2
Definition: FWGUIEventSelector.h:41
FWGUIEventSelector::m_guiSelector
FWEventSelector * m_guiSelector
Definition: FWGUIEventSelector.h:37
FWGUIEventSelector::m_text1
FWGUIValidatingTextEntry * m_text1
Definition: FWGUIEventSelector.h:40
FWEventSelector::m_updated
bool m_updated
Definition: FWEventSelector.h:22
FWEventSelector::m_enabled
bool m_enabled
Definition: FWEventSelector.h:20
FWGUIEventSelector::m_validator
FWHLTValidator * m_validator
Definition: FWGUIEventSelector.h:47
FWGUIEventSelector::updateNEvents
void updateNEvents()
Definition: FWGUIEventSelector.cc:135
EgammaValidation_Wenu_cff.sel
sel
Definition: EgammaValidation_Wenu_cff.py:33
FWHLTValidator::setProcess
void setProcess(const char *x)
Definition: FWHLTValidator.h:20
FWGUIEventSelector::m_deleteBtn
FWCustomIconsButton * m_deleteBtn
Definition: FWGUIEventSelector.h:43