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 AliMonitorClient(const AliMonitorClient& client);
43 AliMonitorClient& operator = (const AliMonitorClient& client);
44 virtual ~AliMonitorClient();
50 void OnMenuActivated(Int_t id);
52 void OnEventNumberChanged();
53 void OnEventButtonPressed();
54 void OnSumButtonPressed();
55 void OnRunButtonPressed();
56 void OnLoopButtonClicked();
57 void OnPreviousButtonClicked();
58 void OnNextButtonClicked();
59 void OnCopyButtonClicked();
60 void OnSaveButtonClicked();
61 void OnPrintButtonClicked();
63 void OnTreeClicked(TGListTreeItem* item, Int_t btn);
64 void OnTreeReturnPressed(TGListTreeItem* item);
69 TFolder* CreateTopFolder() const;
70 AliMonitorHisto* GetHisto(const char* folderName, const char* histoName);
71 TGListTreeItem* GetItem(TGListTreeItem* base, const char* folderName,
72 const char* histoName, Bool_t create);
74 Bool_t ConnectToServer();
75 void DisconnectFromServer();
78 void ViewToolBar(Bool_t visible);
79 void ViewTree(Bool_t visible);
80 void ViewDescription(Bool_t visible);
81 void ViewReference(Bool_t visible);
82 void ViewStatistics(Bool_t visible);
85 Bool_t DeleteFavorite();
86 Bool_t LoadFavorites(Bool_t dialog = kTRUE);
87 Bool_t SaveFavorites();
88 Bool_t SaveFavoritesAs();
90 Bool_t LoadReference(Bool_t dialog = kTRUE);
92 Bool_t TakeCurrentReference();
93 void TakeReferenceHisto(const char* folderName,
94 AliMonitorHisto* histo);
95 void TakeReferenceFolder(TGListTreeItem* item);
96 Bool_t SaveReference();
97 Bool_t SaveReferenceAs();
103 Bool_t GetBaseItem();
104 Bool_t GoToNextItem();
105 Bool_t GoToPreviousItem();
106 void UpdateItem(Bool_t highlight);
108 Bool_t CheckForNewData();
109 void ClearItems(TGListTreeItem* base) const;
110 void CleanUpTree(TGListTreeItem* base);
112 void UpdateFavoritesTree();
113 void UpdateComparisonTree();
114 void UpdateDescription();
118 TGLayoutHints* fMenuBarLayout; // layout of the menu bar
119 TGLayoutHints* fMenuBarItemLayout; // layout of the menu items
120 TGLayoutHints* fMenuBarHelpLayout; // layout of the help menu
121 TGPopupMenu* fMenuFile; // the file menu
122 TGPopupMenu* fMenuView; // the view menu
123 TGPopupMenu* fMenuFavorites; // the favorites menu
124 TGPopupMenu* fMenuReference; // the reference menu
125 TGPopupMenu* fMenuOptions; // the options menu
126 TGPopupMenu* fMenuHelp; // the help menu
127 TGMenuBar* fMenuBar; // the menu bar
129 TGLayoutHints* fToolBarLayout; // layout of the tool bar
130 TGHorizontal3DLine* fToolBarSep; // separation of the tool bar
131 TGToolBar* fToolBar; // the tool bar
132 TGLayoutHints* fEventNumberLayout; // layout of the event number
133 TGNumberEntry* fEventNumber; // the event number
134 TGButton* fEventButton; // the button for one event
135 TGButton* fSumButton; // the button for the sum of events
136 TGButton* fRunButton; // the button for a run
137 TGButton* fLoopButton; // the botton for the loop
138 const TGPicture* fLoopOnPicture; // the picture for running loop
139 const TGPicture* fLoopOffPicture; // the picture for stoped loop
140 TGButton* fPreviousButton; // the button for previous histo
141 TGButton* fNextButton; // the button for next histo
142 TGButton* fCopyButton; // the button for copy histo
143 TGButton* fSaveButton; // the button for save histo
144 TGButton* fPrintButton; // the button for print histo
146 TGLayoutHints* fBottomLayout; // layout at bottom
147 TGLayoutHints* fLeftLayout; // layout at left
148 TGLayoutHints* fExpandLayout; // expanded layout
150 TGVerticalFrame* fVerticalFrame; // frame for tree/histo and description
151 TGHorizontalFrame* fHorizontalFrame; // frame for tree and histo
153 TGCompositeFrame* fTreeFrame; // frame for tree
154 TGCanvas* fTreeCanvas; // canvas for tree
155 TGListTree* fTree; // tree with histos
156 const TGPicture* fHistoPicture; // picture for histo item
157 TGListTreeItem* fAllItem; // top item for all histos
158 TGListTreeItem* fFavoritesItem; // top item for favorites
159 TGListTreeItem* fComparisonItem; // top item for comparison
161 TGVSplitter* fTreeSplitter; // splitter for tree and histo
163 TGCompositeFrame* fDrawFrame; // frame for histo
164 TRootEmbeddedCanvas* fDrawCanvas; // canvas for histo
166 TGHSplitter* fDescriptionSplitter; // splitter tree/histo and description
168 TGCompositeFrame* fDescriptionFrame; // frame for description
169 TGTextView* fDescription; // description text
171 TString fServerName; // name of the monitor server
172 TSocket* fSocket; // socket to the monitor server
173 TFileHandler* fSocketHandler; // handler for fSocket
175 TFolder* fFolder; // folder with histos
177 TGListTreeItem* fCurrentItem; // current tree item
178 TGListTreeItem* fBaseItem; // base item of current item
179 TTimer* fLoopTimer; // timer for loop over histos
180 Int_t fLoopInterval; // loop interval
182 TString fFavoritesFileName; // file name of favorites
184 TString fReferenceFileName; // file name with reference histos
185 TFolder* fReference; // folder with reference histos
187 TString fPrintCommand; // print command
189 static const char* fgSettingsFileName; // file name of settings
192 class AliMonitorStringDlg : public AliMonitorDialog {
195 AliMonitorStringDlg(TString& string, TGFrame* main, const char* title,
197 AliMonitorStringDlg(const AliMonitorStringDlg& dlg) :
198 AliMonitorDialog(dlg), fString(dlg.fString) {
199 Fatal("AliMonitorStringDlg", "copy constructor not implemented");
201 AliMonitorStringDlg& operator = (const AliMonitorStringDlg& /*dlg*/) {
202 Fatal("operator =", "assignment operator not implemented");
205 virtual ~AliMonitorStringDlg();
207 virtual void OnOkClicked();
210 TGLayoutHints* fStringLayout; // layout of the text entry
211 TGLabel* fStringLabel; // label for the text entry
212 TGTextEntry* fStringEntry; // the text enty
214 TString& fString; // result
218 class AliMonitorNumberDlg : public AliMonitorDialog {
221 AliMonitorNumberDlg(Float_t& value, TGFrame* main, const char* title,
222 const char* label, Float_t min);
223 AliMonitorNumberDlg(const AliMonitorNumberDlg& dlg) :
224 AliMonitorDialog(dlg), fNumber(dlg.fNumber) {
225 Fatal("AliMonitorNumberDlg", "copy constructor not implemented");
227 AliMonitorNumberDlg& operator = (const AliMonitorNumberDlg& /*dlg*/) {
228 Fatal("operator =", "assignment operator not implemented");
231 virtual ~AliMonitorNumberDlg();
233 virtual void OnOkClicked();
236 TGLayoutHints* fNumberLayout; // layout of the number entry
237 TGLabel* fNumberLabel; // label for the number entry
238 TGNumberEntry* fNumberEntry; // the number entry
240 Float_t& fNumber; // result
244 ClassDef(AliMonitorClient, 0) // class for receiving and displaying monitor histograms