1#include "KVINDRARunSheetGUI.h"
12#include "KVINDRADBRun.h"
13#include "KVInputDialog.h"
18#include "KVDataSetManager.h"
19#include "KVDataRepositoryManager.h"
20#include "KVDBSystemDialog.h"
138#ifdef __WITHOUT_TGBUTTON_SETENABLED
139#define SetEnabled(flag) \
140 SetState( flag ? kButtonUp : kButtonDisabled )
163 tb->
SetToolTipText(
"Set path to directory containing run sheets");
164 tb->
Connect(
"Clicked()",
"KVINDRARunSheetGUI",
this,
177 tb->
Connect(
"Clicked()",
"KVINDRARunSheetGUI",
this,
"SetFileFormat()");
198 "SetMakeTree(Bool_t)");
200 (
"Check this to fill a TTree with all infos read from runsheet");
207 tb->
Connect(
"Clicked()",
"KVINDRARunSheetGUI",
this,
208 "StartTreeViewer()");
210#ifdef __WITHOUT_TGBUTTON_SETENABLED
211 cb->
Connect(
"Toggled(Bool_t)",
"KVINDRARunSheetGUI",
this,
"SetViewTreeEnabled(Bool_t)");
212 fViewTreeButton = tb;
214 cb->
Connect(
"Toggled(Bool_t)",
"TGTextButton", tb,
"SetEnabled(Bool_t)");
224 ULong_t red, cyan, green, yellow, magenta;
225 gClient->GetColorByName(
"#ff00ff", magenta);
226 gClient->GetColorByName(
"#ff0000", red);
227 gClient->GetColorByName(
"#00ff00", green);
228 gClient->GetColorByName(
"#00ffff", cyan);
229 gClient->GetColorByName(
"#ffff00", yellow);
250 SetToolTipText(
"Save all informations in database");
251 fSaveDB->
Connect(
"Clicked()",
"KVINDRARunSheetGUI",
this,
"SaveAll()");
256 SetToolTipText(
"Exit the application");
259 fQuit->
Connect(
"Clicked()",
"KVINDRARunSheetGUI",
this,
"CloseWindow()");
294 (
"Add a reference to the experiment logbook for selected run");
302 (
"Set the multiplicity trigger for the selected run(s)");
352 "SelectionChanged()");
372 if (!gDataRepositoryManager) {
374 gDataRepositoryManager->
Init();
517 cout <<
"directory = " << dir.
Data() << endl;
520 Form(
"KVDataBaseGUI.RunSheetDir.%s", gDataSet->
GetName()),
610 cout <<
"Read " << read <<
" runsheets" << endl;
612 gExpDB->
Save(
"Runlist");
671 gIndraDB->
Save(
"Systems");
672 gIndraDB->
Save(
"Runlist");
711 new KVInputDialog(
this,
"Enter log-book reference for run(s)",
735 new KVInputDialog(
this,
"Enter multiplicity trigger for run(s)",
737 "Enter minimum multiplicity, i.e. for M>=4 type '4'");
764 new KVInputDialog(
this,
"Enter format string for runsheet filenames",
766 "e.g. RUN_%04d.TXT for filenames such as RUN_0123.TXT");
845 gExpDB->
Save(
"Systems");
863 fMain->SetLayoutBroken(
kTRUE);
864 fMain->Connect(
"CloseWindow()",
"KVIRSGChooseDataSetDialog",
this,
866 fMain->DontCallClose();
870 fLabel =
new TGLabel(fMain,
"Choose dataset:");
871 fLabel->SetTextJustify(36);
872 fMain->AddFrame(fLabel,
875 fLabel->MoveResize(8, 8, 208, 24);
877 gClient->GetColorByName(
"#ffffff", ucolor);
883 if (gDataSetManager) {
884 for (
int i = 0; i < gDataSetManager->
GetNtotal(); i++) {
889 fComboBox->Connect(
"Selected(Int_t)",
"KVIRSGChooseDataSetDialog",
this,
890 "SetDataSet(Int_t)");
891 fComboBox->Resize(208, 22);
892 fComboBox->Select(0);
894 fMain->AddFrame(fComboBox,
897 fComboBox->MoveResize(8, 40, 208, 22);
901 fTextButton->
Resize(80, 24);
902 fMain->AddFrame(fTextButton,
907 fTextButton->
Connect(
"Clicked()",
"KVIRSGChooseDataSetDialog",
this,
910 fMain->MapSubwindows();
912 fMain->Resize(fMain->GetDefaultSize());
913 fMain->CenterOnParent();
914 fMain->SetWindowName(
"Choose dataset dialog box");
916 fMain->Resize(223, 110);
967#ifdef __WITHOUT_TGBUTTON_SETENABLED
R__EXTERN TApplication * gApplication
winID h TVirtualViewer3D TVirtualGLPainter p
char * Form(const char *fmt,...)
char * StrDup(const char *str)
virtual Int_t GetNumber() const
const Char_t * GetComments() const
void SetComments(const KVString &comments)
KVDBSystem * GetSystem() const
virtual void Print(Option_t *option="") const
void BlockSignals(Bool_t yes=kTRUE)
void SetTrigger(Int_t trig)
Dialog box for setting system parameters associated to runs.
Database class used to store information on different colliding systems studied during an experiment....
Manages access to one or more data repositories.
virtual Int_t GetNtotal() const
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
Manage an experimental dataset corresponding to a given experiment or campaign.
void UpdateAvailableRuns(const Char_t *type)
KVExpDB * GetDataBase(Option_t *opt="") const
virtual void Save(const Char_t *)
virtual KVSeqCollection * GetRuns() const
Database entry for each run of an INDRA experiment.
const Char_t * GetCahier() const
void SetCahier(const Char_t *log)
virtual void UnsetSystem()
_________________________________________________//
void ChangeDataSet()
open dialog to choose dataset
void DisableButtons()
Disable all buttons.
TGVButtonGroup * fButtonsFrame
TGTextButton * fSetSystem
KVINDRARunSheetReader fReader
used to read runsheets
TGTextButton * fAddComment
void SetSystem()
Open dialog box for setting system properties for runs.
virtual ~KVINDRARunSheetGUI()
close window
TGTextButton * fChangeDataSet
void ClearListOfRuns()
remove all entries from grid list box
KVINDRADBRun * fSelectedRun
Int_t GetNSelected()
returns current number of selected items in grid list
TGTextButton * fUnSetSystem
TGHorizontalFrame * fHframe
TGTextButton * fSetTrigger
void CloseWindow()
close viewer
TGTextButton * fAddCahier
KVListView * fRunList
TGListBox *fRunList;.
const Char_t * GetFileFormat()
const Char_t * GetRunSheetDir()
Int_t ReadAllRunSheets(Int_t first=1, Int_t last=9999)
void StartTreeViewer() const
Bool_t IsMakeTree() const
void SetFileFormat(const Char_t *fmt)
void SetRunSheetDir(const Char_t *dir)
_________________________________________________//
virtual ~KVIRSGChooseDataSetDialog()
Delete all widgets.
void YouPressedOK()
Called when OK button is pressed.
virtual void SetIsDateTime(KVDatime::EKVDateFormat fmt=KVDatime::kCTIME, Bool_t with_reference=kTRUE)
Enhanced version of ROOT TGListView widget.
virtual void ActivateSortButtons()
virtual void SetDataColumns(Int_t ncolumns)
virtual void Sort(Int_t column)
void AllowBrowse(Bool_t on=kTRUE)
virtual void Display(const TCollection *l)
TObject * GetLastInList() const
TObject * GetFirstInList() const
TObject * GetLastSelectedObject() const
void AllowContextMenu(Bool_t on=kTRUE)
TList * GetSelectedObjects() const
virtual void SetDataColumn(Int_t index, const Char_t *name, const Char_t *method="", Int_t mode=kTextCenterX)
virtual KVLVColumnData * GetDataColumn(Int_t index) const
Strings used to represent a set of ranges of values.
void Add(Int_t)
Add value 'n' to the list.
virtual Int_t GetSize() const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
virtual void Terminate(Int_t status=0)
virtual Int_t GetEntries() const
virtual Int_t GetSize() const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
virtual void SaveLevel(EEnvLevel level)
TGDimension GetDefaultSize() const override
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
UInt_t GetDefaultWidth() const override
void MapSubwindows() override
UInt_t GetDefaultHeight() const override
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
virtual void Resize(TGDimension size)
void MapWindow() override
virtual void ChangeBackground(Pixel_t back)
void UnmapWindow() override
void SetText(const char *newText)
void SetWMSize(UInt_t w, UInt_t h)
void SetWindowName(const char *name=nullptr) override
virtual void SetTextJustify(Int_t tmode)
void Add(TObject *obj) override
const char * GetName() const override
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
const char * Data() const
void Form(const char *fmt,...)
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)