LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ParameterSetEditDialog.h
Go to the documentation of this file.
1 #ifndef EVDB_PARAMETERSETEDITDIALOG_H
63 #define EVDB_PARAMETERSETEDITDIALOG_H
64 #include "RQ_OBJECT.h"
65 #include "TGFrame.h"
66 #include "TQObject.h"
67 class TGTab;
68 class TGCanvas;
69 class TGTableLayout;
70 class TGTableLayoutHints;
71 class TGListBox;
72 class TGDoubleSlider;
73 class TGTextEntry;
74 class TGRadioButton;
75 class TGCheckButton;
76 namespace fhicl {
77  class ParameterSet;
78 }
79 
80 namespace evdb {
81  class ParameterSetEditFrame;
87  RQ_OBJECT("evdb::ParameterSetEditRow")
88  public:
90  TGHorizontalFrame* lhs,
91  TGHorizontalFrame* rhs,
92  const fhicl::ParameterSet& ps,
93  const std::string& key);
95 
96  void Finalize();
97  std::string AsFHICL() const;
98 
99  void TextEntryReturnPressed();
100  void ListBoxSelectionChanged();
101  void ListBoxSelected(int id);
102  void RadioButtonClicked();
103  void CheckButtonClicked();
104  void SliderPositionChanged();
105 
106  private:
107  void SetupTextEntry(TGCompositeFrame* f,
108  unsigned int flags,
109  const std::vector<std::string>& value);
110 
111  void SetupListBox(TGCompositeFrame* f,
112  const std::vector<std::string>& choice,
113  const std::vector<std::string>& value,
114  bool ismulti);
115 
116  void SetupRadioButtons(TGCompositeFrame* f,
117  const std::vector<std::string>& choice,
118  const std::vector<std::string>& value);
119 
120  void SetupCheckButton(TGCompositeFrame* f,
121  const std::vector<std::string>& choice,
122  const std::vector<std::string>& value);
123 
124  void SetupSlider(TGCompositeFrame* f,
125  const std::vector<std::string>& choice,
126  const std::vector<std::string>& value);
127 
128  private:
129  static bool IsLegalGUItag(const std::string& s);
130  static void ParseGUItag(const std::string& guitag,
131  std::string& frame,
132  std::vector<std::string>& choice);
133  static void UnpackParameter(const fhicl::ParameterSet& ps,
134  const std::string& key,
135  unsigned int& flags,
136  std::string& tag,
137  std::vector<std::string>& choice,
138  std::vector<std::string>& value,
139  std::string& gui,
140  std::string& doc);
141 
142  public:
144  public:
145  TGHorizontalFrame* fMother;
146  TGLayoutHints* fRightLH{nullptr};
147  TGLayoutHints* fLeftLH{nullptr};
148  TGTextButton* fLabel{nullptr};
149  public:
150  TGTextEntry* fTextEntry{nullptr};
151  TGListBox* fListBox{nullptr};
152  TGDoubleSlider* fSlider{nullptr};
153  std::vector<TGRadioButton*> fRadioButton;
154  std::vector<TGCheckButton*> fCheckButton;
155 
156  public:
157  unsigned int fParamFlags;
158  std::string fKEY;
159  std::string fGUI;
160  std::string fDOC;
161  std::vector<std::string> fChoice;
162  std::string fValue;
163  };
164 
170  RQ_OBJECT("evdb:ParameterSetEditFrame")
171  public:
172  ParameterSetEditFrame(TGCompositeFrame* mother, unsigned int psetid);
174 
175  std::string AsFHICL() const;
176 
177  void HandleMouseWheel(Event_t* event);
178  void Modified();
179  void Finalize();
180 
181  public:
182  TGCompositeFrame* fTopFrame;
183  TGCanvas* fCanvas;
184  TGLayoutHints* fCanvasH;
185  TGCompositeFrame* fContainer;
186  TGTableLayout* fLayout;
187  std::vector<TGHorizontalFrame*> fLHS;
188  std::vector<TGHorizontalFrame*> fRHS;
189  std::vector<TGTableLayoutHints*> fLHSHints;
190  std::vector<TGTableLayoutHints*> fRHSHints;
191  std::vector<ParameterSetEditRow*> fRow;
192 
193  public:
194  unsigned int fParameterSetID;
196  };
197 
202  class ParameterSetEditDialog : public TGTransientFrame {
203  RQ_OBJECT("evdb::ParameterSetEditDialog")
204  public:
205  ParameterSetEditDialog(unsigned int psetid);
207 
208  void Apply();
209  void Cancel();
210  void Done();
211  void CloseWindow();
212  std::string TabName(const std::string& s);
213 
214  private:
215  TGTab* fTGTab;
216  TGHorizontalFrame* fButtons;
217  TGTextButton* fApply;
218  TGTextButton* fCancel;
219  TGTextButton* fDone;
220 
221  private:
222  unsigned int fParameterSetID;
223  std::vector<ParameterSetEditFrame*> fFrames;
224 
225  ClassDef(ParameterSetEditDialog, 0);
226  };
227 }
228 
229 #endif
230 
c1 Modified()
std::vector< TGRadioButton * > fRadioButton
std::vector< ParameterSetEditRow * > fRow
Manage all things related to colors for the event display.
ParameterSetEditFrame * fFrame
The parent frame.
TFile f
Definition: plotHisto.C:6
std::vector< std::string > fChoice
std::vector< TGTableLayoutHints * > fRHSHints
Top-level interface to all parameter sets.
std::vector< TGHorizontalFrame * > fLHS
parameter set interface
TGHorizontalFrame * fMother
Top level frame.
A frame for editing a single paramter set.
double value
Definition: spectrum.C:18
std::vector< TGTableLayoutHints * > fLHSHints
std::vector< TGHorizontalFrame * > fRHS
A single row for editing a single parameter in a set.
void Finalize()
Definition: errprop.cc:256
std::vector< ParameterSetEditFrame * > fFrames
std::vector< TGCheckButton * > fCheckButton
Event finding and building.