1 | // class EusoMainFrame |
---|
2 | // GUI interface for Euso simulation program |
---|
3 | // M. Pallavicini created 28-12-2001 |
---|
4 | // |
---|
5 | |
---|
6 | #ifndef __EUSOMAINFRAME_HH_ |
---|
7 | #define __EUSOMAINFRAME_HH_ |
---|
8 | |
---|
9 | #include "TGFrame.h" |
---|
10 | #include "TGMenu.h" |
---|
11 | #include "TApplication.h" |
---|
12 | #include "TGCanvas.h" |
---|
13 | #include "TBrowser.h" |
---|
14 | |
---|
15 | class SimuApplication; |
---|
16 | class TFile; |
---|
17 | class TTree; |
---|
18 | |
---|
19 | // constants used to send message to the system from the GUI |
---|
20 | // menu, buttons etc. |
---|
21 | |
---|
22 | enum EusoGUICommands { |
---|
23 | E_NOT_IMPLEMENTED, // not yet implemented command |
---|
24 | E_FILE_OPEN_INPUT, // open input file |
---|
25 | E_FILE_CLOSE_INPUT, // close input file |
---|
26 | E_FILE_RENAME_OUTPUT, // rename output file (not root file) |
---|
27 | E_FILE_OPEN_ROOT_INP, // open root file for reading |
---|
28 | E_FILE_CLOSE_ROOT_INP, // close root file for reading |
---|
29 | E_FILE_CLOSE_ROOT_OUT, // close root file for writing |
---|
30 | E_FILE_EXIT_PROGRAM, // end program |
---|
31 | E_CONFIG_SELECT_FILES, // select config files |
---|
32 | E_CONFIG_SHOWER_SLAST, // edit parameters for Slast |
---|
33 | E_CONFIG_SHOWER_CORSIKA, // edit parameters for Corsika |
---|
34 | E_CONFIG_SHOWER_APGIL, // simple GIL by A.Petrolini |
---|
35 | E_CONFIG_TESTLIGHTTOEUSO,// edit TestLightToEuso config file |
---|
36 | E_CONFIG_EUSO, // view and edit config parameters for Euso detector |
---|
37 | E_RUN_SINGLE, // simulate a single event |
---|
38 | E_RUN_ALL, // simulate all events in the input source |
---|
39 | E_RUN_REDO, // re-run last event |
---|
40 | E_RUN_REDOALL, // re-run all events from beginning |
---|
41 | E_RUN_SET, // set the number of events to be used |
---|
42 | E_DISPLAY_SHOW_DATA, // dialog window with simulation results of last event |
---|
43 | E_DISPLAY_DUMP_DATA, // dump a table with simulation results of last event |
---|
44 | E_DISPLAY_PRINT_DATA, // print a table with simulation results data of last event |
---|
45 | E_DISPLAY_3D_EVENT, // enable graphical 3D event display |
---|
46 | E_ROOT_HIST, // show and display root histograms |
---|
47 | E_ROOT_TREE, // show and display root tree |
---|
48 | E_ROOT_BROWSER, // open a root browser |
---|
49 | E_HELP_CONTENTS, // help |
---|
50 | E_HELP_ABOUT // about dialog and program version |
---|
51 | }; |
---|
52 | |
---|
53 | // main window of the GUI |
---|
54 | class EusoMainFrame : public TGMainFrame { |
---|
55 | public: |
---|
56 | EusoMainFrame( SimuApplication*, const TGWindow* , UInt_t, UInt_t ); |
---|
57 | virtual ~EusoMainFrame(); |
---|
58 | |
---|
59 | virtual void CloseWindow(); |
---|
60 | virtual Bool_t ProcessMessage( Long_t, Long_t, Long_t ); |
---|
61 | |
---|
62 | private: |
---|
63 | |
---|
64 | // enable display menu commands |
---|
65 | void EnableDisplay( Bool_t enable = kTRUE ); |
---|
66 | |
---|
67 | // enable compare menu commands |
---|
68 | void EnableCompare( Bool_t enable = kTRUE ); |
---|
69 | |
---|
70 | // menu objects |
---|
71 | TGMenuBar *fMenu; // menu bar of the main window |
---|
72 | TGPopupMenu *fMenuFile, *fMenuConfig, *fMenuRun; // menu items |
---|
73 | TGPopupMenu *fMenuDisplay, *fMenuRoot, *fMenuHelp; // menu items |
---|
74 | TGPopupMenu *fCascadeShowerMenu, *fCascadeLightMenu; // menu items |
---|
75 | TGPopupMenu *fCascadeAtmosphereMenu, *fCascadeDetectorMenu; |
---|
76 | TGLayoutHints *fMenuLayout, *fItemLayout, *fHelpLayout; |
---|
77 | TGCanvas *fWindow; // main window with scroll bars |
---|
78 | TGFrame *fWindowContainer; // main window background |
---|
79 | |
---|
80 | // pointer to unique application object |
---|
81 | SimuApplication *theApp; |
---|
82 | |
---|
83 | // execute one event |
---|
84 | void DoEvent(); |
---|
85 | |
---|
86 | // command handlers |
---|
87 | void HandleMenuCommand(Int_t); |
---|
88 | void GuiFileOpenInput(); |
---|
89 | void GuiFileCloseInput(); |
---|
90 | void GuiFileRenameOutput(); |
---|
91 | void GuiFileOpenRootInput(); |
---|
92 | void GuiFileCloseRootInput(); |
---|
93 | void GuiFileCloseRootOutput(); |
---|
94 | void GuiConfigSelectFiles(); |
---|
95 | void GuiConfigShowerBySlast(); |
---|
96 | void GuiConfigTestLightToEuso(); |
---|
97 | void GuiConfigEuso(); |
---|
98 | void GuiRunSingle(); |
---|
99 | void GuiRunAll(); |
---|
100 | void GuiRunRedo(); |
---|
101 | void GuiRunRedoAll(); |
---|
102 | void GuiRunSet(); |
---|
103 | void GuiDisplayDumpData(); |
---|
104 | void GuiRootHistos(); |
---|
105 | void GuiRootTree(); |
---|
106 | void GuiRootBrowser(); |
---|
107 | void GuiDisplayShowData(); |
---|
108 | void GuiDisplayToggle3DViewer(); |
---|
109 | |
---|
110 | // root input file (read only, histogram maker ) |
---|
111 | inline TFile* RootInputFile() { return fRootInputFile;} |
---|
112 | void OpenRootInputFile( const char* ); |
---|
113 | void CloseRootInputFile(); |
---|
114 | TTree* GetTree(); |
---|
115 | TFile *fRootInputFile; |
---|
116 | |
---|
117 | ClassDef(EusoMainFrame,0) |
---|
118 | }; |
---|
119 | |
---|
120 | #endif |
---|