GUI/TFndMonFrame.h

00001 // @(#)fROOT/GUI:$Name:  $:$Id: TFndMonFrame.h,v 1.7 2007/09/05 09:54:56 Diego_Faso Exp $
00002 // Revision Author: Diego Faso <mailto:faso@to.infn.it>, 2006/05/16
00003 // Original Author: Piergiorgio Cerello <mailto:cerello@to.infn.it>, 2002
00004 
00005 #ifndef FROOT_TFndMonFrame
00006 #define FROOT_TFndMonFrame
00007 
00009 //     GUI Monitor base class for the FINUDA online monitoring                //
00010 //      - Mouse actions are considered                                        //
00011 //      - Automatic update is available                                       //
00012 //        by means of the virtual method UpdateDaughters                      //
00013 //                                                                            //
00015 
00016 #include <Riostream.h>
00017 #include "TThread.h"
00018 #include "TObject.h"
00019 #include "TStyle.h"
00020 #include "TFile.h"
00021 #include "TH3F.h"
00022 #include "TRootCanvas.h"
00023 #include "TCanvas.h"
00024 #include "TPaveStats.h"
00025 
00026 class TH1F;
00027 class TH2F;
00028 //class TH3F;
00029 class TH1D;
00030 
00031 class TPad;
00032 class TTimer;
00033 
00034 class TFndMonFrame : public TObject {
00035 
00036 protected:
00037 
00038   TFile *fRF;  // If you open a HDT processed file
00039   TFile *fRF2;
00040   Bool_t fIsOnline; // some operations are needed in online mode only
00041 
00042   Bool_t fCanStartGUI;
00043   Bool_t fClosed;
00044 
00045   Int_t        fMainCanvCoord[4];  // default [Xstart,Ystart,Xstop,Ystop]
00046   TCanvas      *fMainCanvas[2]; // in some classes you could need 2 canvases
00047   TRootCanvas  *fMainRootCanvas[2]; // in some classes you could need 2 canvases
00048   TPad     *fDisplayPad[2]; // in some classes you could need 2 display pads
00049   Int_t fUpdateFlashCol;
00050 
00051   Int_t fHighlightCol[2]; // inner/outer highlight button color
00052 
00053   // Enlarged view data-members
00054   TCanvas     *fBigCanvas;
00055   TRootCanvas *fBigRootCanvas;
00056   TH1F *fBigHis1F;
00057   TH2F *fBigHis2F;
00058   TH3F *fBigHis3F;
00059 
00060   TH1D *fBigHis1D;
00061 
00062   // --- Update data-members (to be implemented)
00063   TTimer *fTimer;
00064   Int_t fUpdateInterval; // time interval for update (seconds): default is 15
00065   Bool_t fAutoUpdate; // true (default) if autoupdate is set
00066   Bool_t fWhichPop; // Change the Pop-MainCanvas
00067 
00068  public:
00069 
00070   TFndMonFrame(TString filename=0, TString filename2=0);
00071   ~TFndMonFrame();
00072 
00073   Bool_t IsClosed() { return fClosed; }
00074 
00075   void BuildConnections();
00076   void HandleMouseActions(Int_t event, Int_t x, Int_t y, TObject *selected);
00077   void CloseMainCanvas();
00078   void CloseBigCanvas();
00079   void FollowBigCanvas(Int_t event, Int_t x, Int_t y, TObject *selected);
00080 
00081   void FlashDisplayPad(Int_t padnum = 0);
00082   virtual void RefreshSingleMonView()=0; // implemented in each daughter
00083   void PopMainCanvas();
00084   Bool_t SwitchUpdateMethod(); // return new update method
00085   static Int_t CheckProducerMessages();
00086 
00087   static TPaveStats *GetPadStats(TVirtualPad *pad=0);  // default (pad=0) uses gPad
00088 
00089  protected:
00090   void SetStyle(Int_t style_id=0);
00091   void SetMonitorTitle(Int_t cnum,Char_t *detector_name); // cnum: MainCanvas array index [0-1]
00092   void InitAll();
00093 
00094   void EnlargeHisto(TObject *selected);
00095   void PrintPaveInfo(TObject *selected);
00096   
00097   ClassDef(TFndMonFrame,0)    // Base Class for GUI
00098 };
00099 #endif // FROOT_TFndMonFrame
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 
00109 
00110 
00111 
00112 
00113 
00114 
00115 
00116 
00117 
00118 
00119 
00120 

Generated on Tue Oct 16 15:40:46 2007 by  doxygen 1.5.2