1 #ifndef ALIMONITORCLIENT_H
2 #define ALIMONITORCLIENT_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
10 #include "AliMonitorDialog.h"
16 class TGHorizontal3DLine;
25 class TRootEmbeddedCanvas;
33 class AliMonitorHisto;
36 class AliMonitorClient : public TGMainFrame {
38 RQ_OBJECT("AliMonitorClient")
42 virtual ~AliMonitorClient();
48 void OnMenuActivated(Int_t id);
50 void OnEventNumberChanged();
51 void OnEventButtonPressed();
52 void OnSumButtonPressed();
53 void OnRunButtonPressed();
54 void OnLoopButtonClicked();
55 void OnPreviousButtonClicked();
56 void OnNextButtonClicked();
57 void OnCopyButtonClicked();
58 void OnSaveButtonClicked();
59 void OnPrintButtonClicked();
61 void OnTreeClicked(TGListTreeItem* item, Int_t btn);
62 void OnTreeReturnPressed(TGListTreeItem* item);
67 AliMonitorClient(const AliMonitorClient& client); // Not implemented
68 AliMonitorClient& operator = (const AliMonitorClient& client); // Not implemented
70 TFolder* CreateTopFolder() const;
71 AliMonitorHisto* GetHisto(const char* folderName, const char* histoName);
72 TGListTreeItem* GetItem(TGListTreeItem* base, const char* folderName,
73 const char* histoName, Bool_t create);
75 Bool_t ConnectToServer();
76 void DisconnectFromServer();
79 void ViewToolBar(Bool_t visible);
80 void ViewTree(Bool_t visible);
81 void ViewDescription(Bool_t visible);
82 void ViewReference(Bool_t visible);
83 void ViewStatistics(Bool_t visible);
86 Bool_t DeleteFavorite();
87 Bool_t LoadFavorites(Bool_t dialog = kTRUE);
88 Bool_t SaveFavorites();
89 Bool_t SaveFavoritesAs();
91 Bool_t LoadReference(Bool_t dialog = kTRUE);
93 Bool_t TakeCurrentReference();
94 void TakeReferenceHisto(const char* folderName,
95 AliMonitorHisto* histo);
96 void TakeReferenceFolder(TGListTreeItem* item);
97 Bool_t SaveReference();
98 Bool_t SaveReferenceAs();
104 Bool_t GetBaseItem();
105 Bool_t GoToNextItem();
106 Bool_t GoToPreviousItem();
107 void UpdateItem(Bool_t highlight);
109 Bool_t CheckForNewData();
110 void ClearItems(TGListTreeItem* base) const;
111 void CleanUpTree(TGListTreeItem* base);
113 void UpdateFavoritesTree();
114 void UpdateComparisonTree();
115 void UpdateDescription();
119 TGLayoutHints* fMenuBarLayout; // layout of the menu bar
120 TGLayoutHints* fMenuBarItemLayout; // layout of the menu items
121 TGLayoutHints* fMenuBarHelpLayout; // layout of the help menu
122 TGPopupMenu* fMenuFile; // the file menu
123 TGPopupMenu* fMenuView; // the view menu
124 TGPopupMenu* fMenuFavorites; // the favorites menu
125 TGPopupMenu* fMenuReference; // the reference menu
126 TGPopupMenu* fMenuOptions; // the options menu
127 TGPopupMenu* fMenuHelp; // the help menu
128 TGMenuBar* fMenuBar; // the menu bar
130 TGLayoutHints* fToolBarLayout; // layout of the tool bar
131 TGHorizontal3DLine* fToolBarSep; // separation of the tool bar
132 TGToolBar* fToolBar; // the tool bar
133 TGLayoutHints* fEventNumberLayout; // layout of the event number
134 TGNumberEntry* fEventNumber; // the event number
135 TGButton* fEventButton; // the button for one event
136 TGButton* fSumButton; // the button for the sum of events
137 TGButton* fRunButton; // the button for a run
138 TGButton* fLoopButton; // the botton for the loop
139 const TGPicture* fLoopOnPicture; // the picture for running loop
140 const TGPicture* fLoopOffPicture; // the picture for stoped loop
141 TGButton* fPreviousButton; // the button for previous histo
142 TGButton* fNextButton; // the button for next histo
143 TGButton* fCopyButton; // the button for copy histo
144 TGButton* fSaveButton; // the button for save histo
145 TGButton* fPrintButton; // the button for print histo
147 TGLayoutHints* fBottomLayout; // layout at bottom
148 TGLayoutHints* fLeftLayout; // layout at left
149 TGLayoutHints* fExpandLayout; // expanded layout
151 TGVerticalFrame* fVerticalFrame; // frame for tree/histo and description
152 TGHorizontalFrame* fHorizontalFrame; // frame for tree and histo
154 TGCompositeFrame* fTreeFrame; // frame for tree
155 TGCanvas* fTreeCanvas; // canvas for tree
156 TGListTree* fTree; // tree with histos
157 const TGPicture* fHistoPicture; // picture for histo item
158 TGListTreeItem* fAllItem; // top item for all histos
159 TGListTreeItem* fFavoritesItem; // top item for favorites
160 TGListTreeItem* fComparisonItem; // top item for comparison
162 TGVSplitter* fTreeSplitter; // splitter for tree and histo
164 TGCompositeFrame* fDrawFrame; // frame for histo
165 TRootEmbeddedCanvas* fDrawCanvas; // canvas for histo
167 TGHSplitter* fDescriptionSplitter; // splitter tree/histo and description
169 TGCompositeFrame* fDescriptionFrame; // frame for description
170 TGTextView* fDescription; // description text
172 TString fServerName; // name of the monitor server
173 TSocket* fSocket; // socket to the monitor server
174 TFileHandler* fSocketHandler; // handler for fSocket
176 TFolder* fFolder; // folder with histos
178 TGListTreeItem* fCurrentItem; // current tree item
179 TGListTreeItem* fBaseItem; // base item of current item
180 TTimer* fLoopTimer; // timer for loop over histos
181 Int_t fLoopInterval; // loop interval
183 TString fFavoritesFileName; // file name of favorites
185 TString fReferenceFileName; // file name with reference histos
186 TFolder* fReference; // folder with reference histos
188 TString fPrintCommand; // print command
190 static const char* fgSettingsFileName; // file name of settings
193 class AliMonitorStringDlg : public AliMonitorDialog {
196 AliMonitorStringDlg(TString& string, TGFrame* main, const char* title,
198 virtual ~AliMonitorStringDlg();
200 virtual void OnOkClicked();
203 AliMonitorStringDlg(const AliMonitorStringDlg& dlg);
204 AliMonitorStringDlg& operator = (const AliMonitorStringDlg& /*dlg*/);
206 TGLayoutHints* fStringLayout; // layout of the text entry
207 TGLabel* fStringLabel; // label for the text entry
208 TGTextEntry* fStringEntry; // the text enty
210 TString& fString; // result
214 class AliMonitorNumberDlg : public AliMonitorDialog {
217 AliMonitorNumberDlg(Float_t& value, TGFrame* main, const char* title,
218 const char* label, Float_t min);
219 virtual ~AliMonitorNumberDlg();
221 virtual void OnOkClicked();
224 AliMonitorNumberDlg(const AliMonitorNumberDlg& dlg);
225 AliMonitorNumberDlg& operator = (const AliMonitorNumberDlg& /*dlg*/);
227 TGLayoutHints* fNumberLayout; // layout of the number entry
228 TGLabel* fNumberLabel; // label for the number entry
229 TGNumberEntry* fNumberEntry; // the number entry
231 Float_t& fNumber; // result
235 ClassDef(AliMonitorClient, 0) // class for receiving and displaying monitor histograms