00001
00002
00003
00004 #ifndef FROOT_TFndSCCshowGUI
00005 #define FROOT_TFndSCCshowGUI
00006
00007
00008
00009 #include "TGFileDialog.h"
00010 #include "TObjString.h"
00011
00012 #include "TFndBaseMonGUI.h"
00013
00014 #include "TRandom.h"
00015 #include "TH1.h"
00016
00017 #include "TFndSCCshowHistos.h"
00018
00019 #include "Scc.h"
00020
00021 class TFndSCCshowGUI: public TFndBaseMonGUI {
00022
00023 public:
00024
00025 enum E_MasterMenuMode{
00026 E_MasMenu_TOFI = 0,
00027 E_MasMenu_TOFO = 1,
00028 E_MasMenu_ISIM = 2,
00029 E_MasMenu_OSIM = 3,
00030 E_MasMenu_LMDINN = 4,
00031 E_MasMenu_LMDOUT = 5,
00032 E_MasMenu_STB = 6,
00033 E_MasMenu_GAS = 7,
00034 E_MasMenu_End = 8,
00035 };
00036
00037 enum E_SlaveMenuMode{
00038 E_SlMenu_Gen_Avail = 0,
00039 E_SlMenu_Gen_Ch = 1,
00040 E_SlMenu_Gen_Pw = 2,
00041 E_SlMenu_Gen_Trip = 3,
00042 E_SlMenu_Gen_Summ = 4,
00043 E_SlMenu_Gen_End = 5,
00044
00045 E_SlMenu_Gas_Avail = 0,
00046 E_SlMenu_Gas_End = 1,
00047
00048 };
00049
00050 enum E_SettingMenuMode{
00051 E_SetMenu_ZoomV = 0,
00052 E_SetMenu_ZoomI = 1,
00053 E_SetMenu_End = 2
00054 };
00055
00056 TString GetSettingName(Int_t set_id){
00057 switch(set_id){
00058 case (E_SettingMenuMode)E_SetMenu_ZoomV: return "zoom on (V)";
00059 case (E_SettingMenuMode)E_SetMenu_ZoomI: return "zoom on (I)";
00060 default: return 0;
00061 }
00062 return 0;
00063 }
00064
00065
00066 enum E_savemode {
00067 Esave_pdf = 0,
00068 Esave_root = 1,
00069 };
00070
00071 TString GetExtFromMode(E_savemode mode) {
00072 switch(mode){
00073 case Esave_pdf : return ".pdf";
00074 case Esave_root : return ".root";
00075 default: return 0;
00076 }
00077 return 0;
00078 }
00079
00080
00081 protected:
00082 void ResetMultiGraphs(Bool_t recreate=kFALSE);
00083
00084 enum E_SCCshowGUIBckColors{
00085 E_SCCshowBckCol_default = 33,
00086 E_SCCshowBckCol_save = 0
00087 };
00088
00089 enum NmaxMulGraph { NMaxMultiGraphs = 30 };
00090 TFndMultiGraph *fFndMultiGraph[NMaxMultiGraphs];
00091
00092
00093 TDatime fStartDatime;
00094 TDatime fStopDatime;
00095
00096 TGNumberEntry *fSteer_Num1_time;
00097 TGNumberEntry *fSteer_Num2_time;
00098
00099 TGCheckButton *fChkBox_Autoreset;
00100 TGCheckButton *fChkBox_Overwrite;
00101
00102 TGLabel *fSetting_Combo_Lbl;
00103 TGComboBox *fSetting_Combo;
00104
00105 TGCheckButton *fChkBox_DisplayLine;
00106
00107 TFndSCCshowHistos *fSCCHistosRef;
00108 E_MasterMenuMode fCurMasterMode;
00109
00110 TGLabel *fWarningMsg_Lbl;
00111
00112 TGTextButton *fTxtBut_SaveRootFile;
00113 TGTextButton *fTxtBut_LoadRootFile;
00114
00115 TGLabel *fLab_ChannelSelect;
00116 TGNumberEntry *fNum_ChannelSelect;
00117 Int_t fDetChan;
00118
00119
00120 TFndGTransientProgress *fTransientProgress;
00121
00122
00123 TGTransientFrame *fTrsnFrm_SaveName;
00124 TGLabel *fSaveFnam_Trsn_Lbl;
00125 TGTextEntry *fSaveFnam_Trsn_Txt;
00126 TGTextButton *fSaveFnam_Trsn_ButOk;
00127 TGTextButton *fSaveFnam_Trsn_ButCancel;
00128
00129 TString fStrSaveFilename;
00130
00131 TString fTh1DrawOpt;
00132
00133 TGCheckButton *fChkBox_FillDet[K_N_SLOWS];
00134
00135 private:
00136
00137 void GetDatimesFromGUI(UInt_t &start_time,UInt_t &stop_time);
00138 void SetGuiDatime(const Int_t &whichone,const UInt_t &conv_time);
00139
00140 void DisplayInfo_Tofino(E_SlaveMenuMode mode);
00141 void DisplayInfo_Tofone(E_SlaveMenuMode mode);
00142 void DisplayInfo_Sil(E_SlaveMenuMode mode,E_Fnd_Layer layer);
00143 void DisplayInfo_Lmd(E_SlaveMenuMode mode,E_Fnd_Layer layer);
00144 void DisplayInfo_Stb(E_SlaveMenuMode mode);
00145 void DisplayInfo_Gas(E_SlaveMenuMode mode);
00146
00147 Bool_t Do_CheckCanWriteFile();
00148 void SetYaxis(TFndGraph *prof, Float_t min=0,Float_t max=0);
00149 void SetYaxis(TProfile *prof, Float_t min=0,Float_t max=0);
00150
00151
00152 void DrawFndGraph(Int_t pad_id,TFndGraph *graph1,TFndGraph *graph2=0,Bool_t time_x=kTRUE);
00153
00154 public:
00155
00156 TFndSCCshowGUI();
00157 ~TFndSCCshowGUI();
00158
00159 void BuildGUI();
00160 void CloseGUI();
00161
00162 void CustomizeGUI();
00163 void ResetDaughter();
00164
00165 Bool_t MakeConnections(Bool_t Connect = kTRUE);
00166
00167 void FillCombos()
00168 {
00169 FillCombo_Steer();
00170 FillCombo_Sel1();
00171 FillCombo_Sel2(-1);
00172 FillCombo_Setting();
00173 }
00174
00175 void FillCombo_Steer();
00176 void FillCombo_Sel1();
00177 void FillCombo_Sel2(Int_t mode);
00178 void FillCombo_Setting();
00179
00180 void Exe_SettingCombo(Int_t sel);
00181 void Exe_SteerCombo(Int_t id);
00182 void Exe_SelCombo1(Int_t id);
00183 void Exe_SelCombo2(Int_t id);
00184
00185 void UpdateDisplayPad(Bool_t every_pad=kFALSE);
00186
00187 void SetStartDatime(Long_t);
00188 void SetStopDatime(Long_t);
00189 void SetDetChan(Long_t);
00190
00191
00192
00193 void FillHistos_GUI();
00194
00195 void DisplayTofino(E_SlaveMenuMode mode);
00196 void DisplayTofone(E_SlaveMenuMode mode);
00197 void DisplaySil(E_SlaveMenuMode mode,E_Fnd_Layer layer);
00198 void DisplayLmd(E_SlaveMenuMode mode,E_Fnd_Layer layer);
00199 void DisplayStb(E_SlaveMenuMode mode);
00200 void DisplayGas(E_SlaveMenuMode mode);
00201
00202 void ToggleLineDraw(Bool_t line);
00203
00204 void SavePage();
00205 void SaveHistos();
00206 TString BrowseCurDir();
00207 void LoadHistos();
00208 void StartGUI_SaveFilename(E_savemode mode);
00209 void CloseGUI_SaveFilename();
00210 void Do_SaveDisplay();
00211 void Do_SaveHistos();
00212
00213 void HandleMouseActionsDaughter(Int_t event, Int_t x, Int_t y, TObject *selected);
00214 void EnlargeHisto(TObject *selected);
00215 void PrintPaveInfo(TObject *selected);
00216
00217
00218 ClassDef(TFndSCCshowGUI,0)
00219 };
00220
00221 #endif // FROOT_TFndSCCshowGUI