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_00_02/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 201 of file ParameterSetEditDialog.h.

Constructor & Destructor Documentation

ParameterSetEditDialog::ParameterSetEditDialog ( unsigned int  psetid)

Definition at line 802 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, kHeight, kWidth, string, TabName(), and top.

802  :
803  TGTransientFrame(gClient->GetRoot(), gClient->GetRoot(), 4, 4)
804 {
805  fTGTab = new TGTab(this);
806  this->AddFrame(fTGTab);
807 
808  fButtons = new TGHorizontalFrame(this);
809  this->AddFrame(fButtons);
810 
811  fApply = new TGTextButton(fButtons, " Apply ");
812  fCancel = new TGTextButton(fButtons, " Cancel ");
813  fDone = new TGTextButton(fButtons, " Done ");
814 
815  fButtons->AddFrame(fApply);
816  fButtons->AddFrame(fCancel);
817  fButtons->AddFrame(fDone);
818 
819  fApply-> Connect("Clicked()","evdb::ParameterSetEditDialog",this,"Apply()");
820  fCancel->Connect("Clicked()","evdb::ParameterSetEditDialog",this,"Cancel()");
821  fDone-> Connect("Clicked()","evdb::ParameterSetEditDialog",this,"Done()");
822 
823  //
824  // Loop over all the parameter sets and build tabs for them
825  //
826  const ServiceTable& st = ServiceTable::Instance();
827  assert(psetid < st.fServices.size());
828  int which = st.fServices[psetid].fCategory;
829 
830  unsigned int i;
831  unsigned int top=0, indx=0;
832  for (i=0; i<st.fServices.size(); ++i) {
833  if (st.fServices[i].fCategory==which) {
834  if (i==psetid) top = indx;
835  std::string tabnm = this->TabName(st.fServices[i].fName);
836  TGCompositeFrame* f = fTGTab->AddTab(tabnm.c_str());
837  fFrames.push_back(new ParameterSetEditFrame(f, i));
838  ++indx;
839  }
840  }
841  fTGTab->SetTab(top);
842 
843  switch (which) {
844  case kDRAWING_SERVICE:
845  this->SetWindowName("Drawing Services");
846  break;
847  case kEXPERIMENT_SERVICE:
848  this->SetWindowName("Experiment Services");
849  break;
850  default:
851  this->SetWindowName("Services Configuration");
852  }
853 
854  this->MapSubwindows();
855  this->Resize(kWidth,kHeight);
856  this->MapWindow();
857 }
static constexpr int kDRAWING_SERVICE
Definition: ServiceTable.h:19
static const unsigned int kHeight
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)
static const unsigned int kWidth
TGeoVolume * top
Definition: make_fe_box.C:9
std::string TabName(const std::string &s)
enum BeamMode string
ParameterSetEditDialog::~ParameterSetEditDialog ( )

Definition at line 861 of file ParameterSetEditDialog.cxx.

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

862 {
863  unsigned int i;
864  for (i=0; i<fFrames.size(); ++i) delete fFrames[i];
865  delete fDone;
866  delete fCancel;
867  delete fApply;
868  delete fButtons;
869  delete fTGTab;
870 }
std::vector< ParameterSetEditFrame * > fFrames

Member Function Documentation

void ParameterSetEditDialog::Apply ( )

Definition at line 874 of file ParameterSetEditDialog.cxx.

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

Referenced by Done().

875 {
876  //
877  // We're not in control of the event loop so what we can do is write
878  // the new configuration to the ServiceTable. The main driver will
879  // pick it up, apply it, and wipe it clean when a reload / next
880  // event is triggered.
881  //
882  unsigned int i;
884  for (i=0; i<fFrames.size(); ++i) {
885  if (fFrames[i]->fIsModified) {
886  unsigned int psetid = fFrames[i]->fParameterSetID;
887 
888  fFrames[i]->Finalize();
889  std::string p = fFrames[i]->AsFHICL();
890 
891  p += "service_type:";
892  p += st.fServices[psetid].fName;
893 
894  st.fServices[psetid].fParamSet = p;
895 
896  }
897  }
899 }
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 903 of file ParameterSetEditDialog.cxx.

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

Definition at line 915 of file ParameterSetEditDialog.cxx.

915 { delete this; }
void ParameterSetEditDialog::Done ( )

Definition at line 907 of file ParameterSetEditDialog.cxx.

References Apply().

908 {
909  this->Apply();
910  this->SendCloseMessage();
911 }
std::string ParameterSetEditDialog::TabName ( const std::string s)

Definition at line 921 of file ParameterSetEditDialog.cxx.

References getGoodRuns4SAM::n.

Referenced by ParameterSetEditDialog().

922 {
923  size_t n = 0;
924 
925  n = s.find("DrawingOptions");
926  if (n!=std::string::npos) return s.substr(0,n);
927 
928  return s;
929 }
const XML_Char * s
Definition: expat.h:262

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 221 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: