Public Member Functions | Private Member Functions | Private Attributes | List of all members
evdb::ParameterSetEditDialog Class Reference

Top-level interface to all parameter sets. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/nuevdb/v1_02_05_01/source/nuevdb/EventDisplayBase/ParameterSetEditDialog.h"

Inheritance diagram for evdb::ParameterSetEditDialog:

Public Member Functions

 ParameterSetEditDialog (unsigned int psetid)
 
 ~ParameterSetEditDialog ()
 
void Apply ()
 
void Cancel ()
 
void Done ()
 
void CloseWindow ()
 
std::string TabName (const std::string &s)
 

Private Member Functions

 ClassDef (ParameterSetEditDialog, 0)
 

Private Attributes

TGTab * fTGTab
 
TGHorizontalFrame * fButtons
 
TGTextButton * fApply
 
TGTextButton * fCancel
 
TGTextButton * fDone
 
unsigned int fParameterSetID
 
std::vector< ParameterSetEditFrame * > fFrames
 

Detailed Description

Top-level interface to all parameter sets.

===================================================================

Definition at line 202 of file ParameterSetEditDialog.h.

Constructor & Destructor Documentation

ParameterSetEditDialog::ParameterSetEditDialog ( unsigned int  psetid)

Definition at line 822 of file ParameterSetEditDialog.cxx.

References ana::assert(), MakeMiniprodValidationCuts::f, fApply, fButtons, fCancel, fDone, fFrames, evdb::ServiceTable::fServices, fTGTab, MECModelEnuComparisons::i, evdb::ServiceTable::Instance(), evdb::kDRAWING_SERVICE, evdb::kEXPERIMENT_SERVICE, string, TabName(), and top.

823  : TGTransientFrame(gClient->GetRoot(), gClient->GetRoot(), 4, 4)
824 {
825  fTGTab = new TGTab(this);
826  this->AddFrame(fTGTab);
827 
828  fButtons = new TGHorizontalFrame(this);
829  this->AddFrame(fButtons);
830 
831  fApply = new TGTextButton(fButtons, " Apply ");
832  fCancel = new TGTextButton(fButtons, " Cancel ");
833  fDone = new TGTextButton(fButtons, " Done ");
834 
835  fButtons->AddFrame(fApply);
836  fButtons->AddFrame(fCancel);
837  fButtons->AddFrame(fDone);
838 
839  fApply->Connect("Clicked()", "evdb::ParameterSetEditDialog", this, "Apply()");
840  fCancel->Connect(
841  "Clicked()", "evdb::ParameterSetEditDialog", this, "Cancel()");
842  fDone->Connect("Clicked()", "evdb::ParameterSetEditDialog", this, "Done()");
843 
844  // Loop over all the parameter sets and build tabs for them
845  const ServiceTable& st = ServiceTable::Instance();
846  assert(psetid < st.fServices.size());
847  int which = st.fServices[psetid].fCategory;
848 
849  unsigned int i;
850  unsigned int top = 0, indx = 0;
851  for (i = 0; i < st.fServices.size(); ++i) {
852  if (st.fServices[i].fCategory == which) {
853  if (i == psetid)
854  top = indx;
855  std::string tabnm = this->TabName(st.fServices[i].fName);
856  TGCompositeFrame* f = fTGTab->AddTab(tabnm.c_str());
857  fFrames.push_back(new ParameterSetEditFrame(f, i));
858  ++indx;
859  }
860  }
861  fTGTab->SetTab(top);
862 
863  switch (which) {
864  case kDRAWING_SERVICE:
865  this->SetWindowName("Drawing Services");
866  break;
867  case kEXPERIMENT_SERVICE:
868  this->SetWindowName("Experiment Services");
869  break;
870  default:
871  this->SetWindowName("Services Configuration");
872  }
873 
874  this->MapSubwindows();
875  this->Resize(kWidth, kHeight);
876  this->MapWindow();
877 }
static constexpr int kDRAWING_SERVICE
Definition: ServiceTable.h:19
static ServiceTable & Instance()
Collection of Services used in the event display.
Definition: ServiceTable.h:36
static constexpr int kEXPERIMENT_SERVICE
Definition: ServiceTable.h:20
A frame for editing a single paramter set.
std::vector< ServiceTableEntry > fServices
Definition: ServiceTable.h:50
std::vector< ParameterSetEditFrame * > fFrames
assert(nhit_max >=nhit_nbins)
TGeoVolume * top
Definition: make_fe_box.C:9
std::string TabName(const std::string &s)
enum BeamMode string
ParameterSetEditDialog::~ParameterSetEditDialog ( )

Definition at line 881 of file ParameterSetEditDialog.cxx.

References fApply, fButtons, fCancel, fDone, fFrames, fTGTab, and MECModelEnuComparisons::i.

882 {
883  unsigned int i;
884  for (i = 0; i < fFrames.size(); ++i)
885  delete fFrames[i];
886  delete fDone;
887  delete fCancel;
888  delete fApply;
889  delete fButtons;
890  delete fTGTab;
891 }
std::vector< ParameterSetEditFrame * > fFrames

Member Function Documentation

void ParameterSetEditDialog::Apply ( )

Definition at line 896 of file ParameterSetEditDialog.cxx.

References fFrames, evdb::ServiceTable::fServices, evdb::ServiceTable::Instance(), evdb::kRELOAD_EVENT, evdb::NavState::Set(), and string.

Referenced by Done().

897 {
898  // We're not in control of the event loop so what we can do is write
899  // the new configuration to the ServiceTable. The main driver will
900  // pick it up, apply it, and wipe it clean when a reload / next
901  // event is triggered.
902 
904  for (auto frame : fFrames) {
905  if (frame->fIsModified) {
906  unsigned int psetid = frame->fParameterSetID;
907 
908  frame->Finalize();
909  std::string p = frame->AsFHICL();
910 
911  p += "service_type:";
912  p += st.fServices[psetid].fName;
913 
914  st.fServices[psetid].fParamSet = p;
915  }
916  }
918 }
static void Set(int which)
Definition: NavState.cxx:24
static ServiceTable & Instance()
Collection of Services used in the event display.
Definition: ServiceTable.h:36
const char * p
Definition: xmltok.h:285
std::vector< ServiceTableEntry > fServices
Definition: ServiceTable.h:50
std::vector< ParameterSetEditFrame * > fFrames
enum BeamMode string
void ParameterSetEditDialog::Cancel ( )

Definition at line 923 of file ParameterSetEditDialog.cxx.

924 {
925  this->SendCloseMessage();
926 }
evdb::ParameterSetEditDialog::ClassDef ( ParameterSetEditDialog  ,
 
)
private
void ParameterSetEditDialog::CloseWindow ( )

Definition at line 940 of file ParameterSetEditDialog.cxx.

References string.

941 {
942  delete this;
943 }
void ParameterSetEditDialog::Done ( )

Definition at line 931 of file ParameterSetEditDialog.cxx.

References Apply().

932 {
933  this->Apply();
934  this->SendCloseMessage();
935 }
std::string ParameterSetEditDialog::TabName ( const std::string s)

Definition at line 950 of file ParameterSetEditDialog.cxx.

Referenced by ParameterSetEditDialog().

951 {
952  std::size_t const n = s.find("DrawingOptions");
953  return s.substr(0, n);
954 }
const XML_Char * s
Definition: expat.h:262
std::void_t< T > n

Member Data Documentation

TGTextButton* evdb::ParameterSetEditDialog::fApply
private

Definition at line 217 of file ParameterSetEditDialog.h.

Referenced by ParameterSetEditDialog(), and ~ParameterSetEditDialog().

TGHorizontalFrame* evdb::ParameterSetEditDialog::fButtons
private

Definition at line 216 of file ParameterSetEditDialog.h.

Referenced by ParameterSetEditDialog(), and ~ParameterSetEditDialog().

TGTextButton* evdb::ParameterSetEditDialog::fCancel
private

Definition at line 218 of file ParameterSetEditDialog.h.

Referenced by ParameterSetEditDialog(), and ~ParameterSetEditDialog().

TGTextButton* evdb::ParameterSetEditDialog::fDone
private

Definition at line 219 of file ParameterSetEditDialog.h.

Referenced by ParameterSetEditDialog(), and ~ParameterSetEditDialog().

std::vector<ParameterSetEditFrame*> evdb::ParameterSetEditDialog::fFrames
private
unsigned int evdb::ParameterSetEditDialog::fParameterSetID
private

Definition at line 222 of file ParameterSetEditDialog.h.

TGTab* evdb::ParameterSetEditDialog::fTGTab
private

Definition at line 215 of file ParameterSetEditDialog.h.

Referenced by ParameterSetEditDialog(), and ~ParameterSetEditDialog().


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